/* ==========================================
   IceXcris — site.css v5
   Premium Dark Editorial Tech Theme
   Handcrafted. No framework.
   ========================================== */

:root {
    --bg: #020408;
    --bg-sec: #04060c;
    --bg-card: rgba(255, 255, 255, 0.015);
    --bg-card-hover: rgba(255, 255, 255, 0.025);
    
    /* Borders */
    --border: rgba(148, 163, 184, 0.05);
    --border-hover: rgba(56, 189, 248, 0.15);
    
    /* Typography Colors */
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    /* Accent Palette */
    --accent: #2f7df6;
    --cyan: #38bdf8;
    --green: #22c55e;
    --accent-dim: rgba(47, 125, 246, 0.08);
    --cyan-dim: rgba(56, 189, 248, 0.08);
    
    /* Font Stacks (System only, no external fonts) */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    --max-width: 1160px;
    --radius: 4px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base resets */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    /* Subtle dawn radial ambient background glow */
    background-image: radial-gradient(circle at 50% -20%, rgba(56, 189, 248, 0.02) 0%, rgba(2, 4, 8, 0) 65%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: rgba(56, 189, 248, 0.15);
    color: var(--text);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Global Elements */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.page-wrap {
    padding: 60px 0 80px;
}

h1, h2, h3, h4, .mono {
    font-family: var(--font-mono);
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

p {
    color: var(--text-muted);
}

/* Common Layout Elements */
.mono-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
    border: 1px solid var(--accent);
}
.btn-primary:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.btn-ghost {
    background-color: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.02);
}

/* ==================== HEADER ==================== */
.header-wrap {
    width: 100%;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(2, 4, 8, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text);
    text-transform: uppercase;
}

.nav-logo svg {
    width: 16px;
    height: 16px;
    stroke: var(--cyan);
}

.nav-logo:hover {
    color: var(--cyan);
}

.nav-links {
    display: flex;
    gap: 36px;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-links a:hover {
    color: var(--cyan);
}

.nav-icons {
    display: flex;
    gap: 20px;
    align-items: center;
    color: var(--text-dim);
}

.nav-icons svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    cursor: pointer;
    transition: var(--transition);
}

.nav-icons svg:hover {
    color: var(--text);
}

/* ==================== HERO ==================== */
.hero {
    display: grid;
    grid-template-columns: 46% 54%;
    align-items: center;
    gap: 60px;
    padding: 90px 0 110px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 80px;
}

.hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-label {
    color: var(--cyan);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-label::before {
    content: "";
    width: 14px;
    height: 1px;
    background-color: var(--cyan);
}

.hero h1 {
    font-family: var(--font-sans);
    font-size: clamp(2.3rem, 5.2vw, 3.5rem);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 24px;
}

.hero-underline {
    width: 32px;
    height: 2px;
    background-color: var(--cyan);
    margin-bottom: 28px;
}

.hero-sub {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 460px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-right {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 480px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-workspace-visual {
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: #020408;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    overflow: hidden;
}

/* ==================== HOMEPAGE MAIN SECTION ==================== */
.main-section-grid {
    display: grid;
    grid-template-columns: 56% 44%;
    gap: 80px;
}

.section-title {
    color: var(--cyan);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Left side (Latest Articles) */
.article-list {
    display: flex;
    flex-direction: column;
}

.article-row {
    display: flex;
    gap: 24px;
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.article-row:first-child {
    padding-top: 0;
}

.article-row:last-child {
    border-bottom: none;
}

.article-thumbnail {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.article-content {
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.article-category {
    color: var(--cyan);
    font-weight: 600;
}

.article-row h3 {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text);
}

.article-row h3 a:hover {
    color: var(--cyan);
}

.article-row p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    margin-top: 24px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--cyan);
    text-transform: uppercase;
    transition: var(--transition);
}

.view-all-link:hover {
    gap: 6px;
}

/* Right side (Selected Projects) */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-card-link {
    display: block;
}

.project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    gap: 24px;
    transition: var(--transition);
}

.project-card:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.project-icon {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.5;
    fill: none;
}

/* Project specific icon colors */
.project-icon.icebrain svg { stroke: var(--cyan); }
.project-icon.smartcuriosity svg { stroke: var(--accent); }
.project-icon.smokeless svg { stroke: var(--green); }

.project-info {
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-info p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.project-view-action {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--cyan);
    text-transform: uppercase;
    margin-top: auto;
}

/* ==================== FOOTER ==================== */
.footer-wrap {
    width: 100%;
    border-top: 1px solid var(--border);
    margin-top: 100px;
    padding: 60px 0 50px;
    background-color: var(--bg-sec);
}

.footer-columns {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col h4 {
    margin-bottom: 24px;
    color: var(--cyan);
}

.footer-brand-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text);
    margin-bottom: 14px;
}

.footer-brand-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 280px;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-list a {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-links-list a:hover {
    color: var(--cyan);
}

.footer-socials {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-socials a {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-socials a:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background-color: rgba(56, 189, 248, 0.05);
}

.footer-socials svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

/* ==================== INNER PAGES STYLING ==================== */

/* Page Headers */
.inner-header {
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 30px;
}

.inner-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 12px;
}

.inner-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}

.inner-lead {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 700px;
}

/* Rich text body */
.rich-text {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #cbd5e1;
    max-width: 660px;
}

.rich-text p {
    margin-bottom: 30px;
    color: #cbd5e1;
}

.rich-text h2 {
    font-family: var(--font-sans);
    font-size: 1.45rem;
    font-weight: 500;
    margin: 50px 0 20px;
    color: var(--text);
}

.rich-text blockquote {
    border-left: 3px solid var(--cyan);
    padding-left: 20px;
    margin: 36px 0;
    font-style: italic;
    color: var(--text-muted);
}

.rich-text ul, .rich-text ol {
    margin: 0 0 30px 20px;
    color: #cbd5e1;
}

.rich-text li {
    margin-bottom: 10px;
}

.rich-text a {
    color: var(--cyan);
    text-decoration: underline;
    text-decoration-color: rgba(56, 189, 248, 0.3);
}

.rich-text a:hover {
    text-decoration-color: var(--cyan);
}

.back-btn-wrap {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    max-width: 660px;
}

.back-btn {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.back-btn:hover {
    color: var(--cyan);
}

/* Card Badge */
.badge {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.badge-production {
    border-color: rgba(56, 189, 248, 0.3);
    color: var(--cyan);
    background-color: rgba(56, 189, 248, 0.04);
}

.badge-beta {
    border-color: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.04);
}

.badge-incubating {
    border-color: var(--border);
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.02);
}

/* ==================== RESPONSIVE MEDIA QUERIES ==================== */

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 50% 50%;
        gap: 24px;
        padding: 50px 0 70px;
    }
    
    .main-section-grid {
        grid-template-columns: 100%;
        gap: 60px;
    }
    
    .footer-columns {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }
    
    .nav-links {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        grid-template-columns: 100%;
        gap: 40px;
        padding: 40px 0 50px;
        margin-bottom: 50px;
    }
    
    .hero-right {
        max-height: 380px;
    }
    
    .article-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .article-thumbnail {
        width: 100%;
        height: 160px;
    }
    
    .footer-columns {
        grid-template-columns: 100%;
        gap: 30px;
    }
    
    .footer-col h4 {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
}

/* ==================== SELECTOR COMPATIBILITY RULES ==================== */

/* Page Headers & Page Leads mapping */
.page-header {
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 30px;
}
.page-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 12px;
}
.page-lead {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 700px;
}

/* Article List index page compatibility */
.article-item {
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
}
.article-item:first-child {
    padding-top: 0;
}
.article-item:last-child {
    border-bottom: none;
}
.article-item h2 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
}
.article-item h2 a:hover {
    color: var(--cyan);
}
.article-item p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.article-read-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--cyan);
    text-transform: uppercase;
}
.article-read-link:hover {
    padding-left: 4px;
}

/* Single post view compatibility mapping */
.article-header {
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 32px;
    max-width: 660px;
}
.article-header h1 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 16px;
}
.article-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
    letter-spacing: 0.05em;
}
.article-lede {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 660px;
}
.article-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #cbd5e1;
    max-width: 660px;
}
.article-body p {
    margin-bottom: 30px;
}
.article-back {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    max-width: 660px;
}
.back-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.back-link:hover {
    color: var(--cyan);
}

/* Project Index view grid & cards compatibility */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.project-card-name {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}
.project-card-name:hover {
    color: var(--cyan);
}

/* Contact page compatibility styling */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin-top: 30px;
}
.contact-row {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.contact-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
}
.contact-value {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--cyan);
}

/* 404 Error page compatibility styling */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
}
.error-code {
    font-family: var(--font-mono);
    font-size: 6rem;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(56, 189, 248, 0.15);
}
.error-signal {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 20px;
}
.error-message {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 480px;
}

