/* =================================================================
   SGCX Design System — Split Personality

   Light mode: Corporate pages (home, about, contact, SGC-Bio)
   Dark mode:  Developer pages (technology, pystatistics, pystatsbio, research)

   Unified by: SGCX green, DM Sans + JetBrains Mono, spacing scale
   ================================================================= */

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

/* ── CSS Custom Properties ────────────────────────────────────────── */
:root {
    /* Brand */
    --green-500: #27ae60;
    --green-400: #2ecc71;
    --green-600: #1e8449;
    --green-700: #196f3d;
    --green-900: #0d3b1f;
    --green-glow: rgba(46, 204, 113, 0.15);
    --green-glow-strong: rgba(46, 204, 113, 0.25);

    /* Light mode (default) */
    --bg-primary: #fafaf9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f0;
    --bg-elevated: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #737373;
    --text-muted: #a3a3a3;
    --border-primary: #e5e5e0;
    --border-secondary: #d4d4cf;
    --surface-hover: rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.1);

    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    --space-4xl: 128px;

    /* Typography */
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* ── Dark mode overrides ──────────────────────────────────────────── */
body.mode-dark {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #171717;
    --bg-elevated: #1a1a1a;
    --text-primary: #fafafa;
    --text-secondary: #d4d4d4;
    --text-tertiary: #a3a3a3;
    --text-muted: #636363;
    --border-primary: #262626;
    --border-secondary: #333333;
    --surface-hover: rgba(255, 255, 255, 0.04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* ── Global Base ──────────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

::selection {
    background: var(--green-500);
    color: white;
}

body.mode-dark ::selection {
    background: var(--green-400);
    color: #0a0a0a;
}

a {
    color: var(--green-500);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--green-600);
}

body.mode-dark a:hover {
    color: var(--green-400);
}

/* ── Container ────────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ── Header / Nav ─────────────────────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-md) 0;
    transition: background var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out);
}

body.mode-dark header {
    background: rgba(10, 10, 10, 0.85);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-nav {
    height: 36px;
    width: auto;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.logo:hover .logo-nav {
    opacity: 0.8;
}

/* Show dark logo on light bg, white logo on dark bg */
.logo-nav-dark { display: none; }
.logo-nav-light { display: block; }

body.mode-dark .logo-nav-dark { display: block; }
body.mode-dark .logo-nav-light { display: none; }

/* Nav links */
.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: var(--space-sm) 0;
    position: relative;
    transition: color var(--duration-fast) var(--ease-out);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green-500);
    transition: width var(--duration-normal) var(--ease-out);
}

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

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-out);
    line-height: 1;
}

.mobile-menu-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}


/* ══════════════════════════════════════════════════════════════════════
   LIGHT MODE — Corporate Pages (Home, About, Contact, SGC-Bio)
   ══════════════════════════════════════════════════════════════════════ */

/* ── Hero (Light) ─────────────────────────────────────────────────── */
.hero-light {
    position: relative;
    padding: var(--space-4xl) 0 var(--space-3xl) 0;
    text-align: center;
    overflow: hidden;
    background: var(--bg-secondary);
}

.hero-light::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 50%, var(--green-glow) 0%, transparent 70%),
        radial-gradient(ellipse 500px 300px at 80% 30%, rgba(39, 174, 96, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-light > * {
    position: relative;
    z-index: 1;
}

/* SGCX hero logo treatment */
.hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.hero-wordmark {
    width: min(420px, 85%);
    height: auto;
}

.hero-light h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.hero-light p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-manifesto {
    font-size: 1.35rem;
    line-height: 2;
    letter-spacing: 0.01em;
}

.hero-manifesto strong {
    color: var(--green-500);
    font-weight: 700;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    border: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--green-500);
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

.btn-primary:hover {
    background: var(--green-600);
    color: white;
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

body.mode-dark .btn-secondary {
    border-color: var(--border-secondary);
    color: var(--text-secondary);
}

body.mode-dark .btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--green-500);
    color: var(--green-400);
}

.btn-ghost {
    background: transparent;
    color: var(--green-500);
    padding: 12px 16px;
}

.btn-ghost:hover {
    color: var(--green-600);
}

body.mode-dark .btn-ghost:hover {
    color: var(--green-400);
}

/* ── Cards (Light) ────────────────────────────────────────────────── */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
    border-color: var(--border-secondary);
}

/* Clickable card (entire card is an <a> tag) */
a.card-link-block {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.card-link-block:hover {
    color: inherit;
    border-color: var(--green-500);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

a.card-link-block .card-link-hint {
    display: block;
    margin-top: var(--space-md);
    color: var(--green-500);
    font-weight: 600;
    font-size: 0.925rem;
    transition: gap var(--duration-fast) var(--ease-out);
}

a.card-link-block:hover .card-link-hint {
    color: var(--green-600);
}

body.mode-dark a.card-link-block:hover .card-link-hint {
    color: var(--green-400);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.925rem;
    color: var(--green-500);
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.975rem;
}

/* ── Section Blocks ───────────────────────────────────────────────── */
.section {
    padding: var(--space-3xl) 0;
}

.section-tight {
    padding: var(--space-2xl) 0;
}

.section-bg {
    background: var(--bg-tertiary);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-md);
}

.section-desc {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-tertiary);
    max-width: 600px;
    margin: 0 auto var(--space-2xl) auto;
    line-height: 1.7;
}

/* ── Feature Grid ─────────────────────────────────────────────────── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

/* SGC-Bio pricing bands: wider than .prose so four tiers fit in a row */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--space-md);
    max-width: 880px;
    margin: var(--space-lg) auto var(--space-xl) auto;
}
.pricing-tier {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}
.pricing-tier-name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--green-500);
    margin-bottom: var(--space-sm);
}
.pricing-tier-price {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-sm);
}
.pricing-tier-price span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.pricing-tier p {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.5;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-open-source {
    background: var(--green-glow-strong);
    color: var(--green-600);
}

body.mode-dark .badge-open-source {
    background: var(--green-glow);
    color: var(--green-400);
}

.badge-commercial {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

body.mode-dark .badge-commercial {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
}

.badge-status {
    background: var(--surface-hover);
    color: var(--text-tertiary);
}

/* ── Callout / Highlight ──────────────────────────────────────────── */
.callout {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--green-500);
    padding: var(--space-lg) var(--space-xl);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: var(--space-xl) 0;
}

body.mode-dark .callout {
    background: rgba(39, 174, 96, 0.06);
    border-left-color: var(--green-400);
}

.callout p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ── CTA Banner ───────────────────────────────────────────────────── */
.cta-banner {
    background: var(--green-900);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--green-glow-strong) 0%, transparent 70%);
    pointer-events: none;
}

.cta-banner > * {
    position: relative;
    z-index: 1;
}

.cta-banner h3 {
    color: white;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: var(--space-lg);
    font-size: 1.05rem;
}

.cta-banner .btn-primary {
    background: white;
    color: var(--green-900);
}

.cta-banner .btn-primary:hover {
    background: #f0f0f0;
    color: var(--green-900);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.cta-banner .btn-ghost {
    color: rgba(255, 255, 255, 0.8);
}

.cta-banner .btn-ghost:hover {
    color: white;
}


/* ══════════════════════════════════════════════════════════════════════
   DARK MODE — Developer Pages (Technology, PyStatistics, PyStatsBio)
   ══════════════════════════════════════════════════════════════════════ */

/* ── Hero (Dark) ──────────────────────────────────────────────────── */
.hero-dark {
    position: relative;
    padding: var(--space-3xl) 0 var(--space-2xl) 0;
    text-align: center;
    overflow: hidden;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
}

.hero-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 800px 500px at 30% 20%, rgba(39, 174, 96, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 600px 400px at 70% 80%, rgba(39, 174, 96, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

/* Subtle grid pattern for developer pages */
.hero-dark::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(39, 174, 96, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(39, 174, 96, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
}

.hero-dark > * {
    position: relative;
    z-index: 1;
}

.hero-dark h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.hero-dark p {
    font-size: 1.15rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-dark .badge {
    margin-bottom: var(--space-lg);
}

/* ── Code Blocks ──────────────────────────────────────────────────── */
.code-block {
    background: #0d0d0d;
    border: 1px solid #1e1e1e;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.75;
    margin: var(--space-lg) 0;
    color: #e4e4e7;
    position: relative;
}

/* Light mode code blocks */
body:not(.mode-dark) .code-block {
    background: #1a1a2e;
    border-color: #2a2a4a;
}

.code-block pre {
    margin: 0;
    white-space: pre;
}

.code-block code {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
}

/* Inline code */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-tertiary);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    color: var(--green-500);
    border: 1px solid var(--border-primary);
}

body.mode-dark code {
    background: rgba(39, 174, 96, 0.08);
    border-color: rgba(39, 174, 96, 0.15);
    color: var(--green-400);
}


/* ── Developer Cards (Dark) ───────────────────────────────────────── */
.dev-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
}

.dev-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--green-500);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.dev-card:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-md);
}

.dev-card:hover::before {
    opacity: 1;
}

.dev-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.dev-card p {
    color: var(--text-tertiary);
    font-size: 0.925rem;
    line-height: 1.65;
}

.dev-card .card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-md);
    color: var(--green-400);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    transition: gap var(--duration-fast) var(--ease-out);
}

.dev-card .card-link:hover {
    gap: 10px;
    color: var(--green-400);
}

.dev-card .card-validates {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: var(--space-sm);
    font-style: italic;
}


/* ══════════════════════════════════════════════════════════════════════
   SHARED COMPONENTS — Work in both modes
   ══════════════════════════════════════════════════════════════════════ */

/* ── Prose Content ────────────────────────────────────────────────── */
.prose {
    max-width: 680px;
    margin: 0 auto;
}

.prose h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
}

.prose h2:first-child {
    margin-top: 0;
}

.prose h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.prose p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.75;
    font-size: 1.05rem;
}

.prose ul, .prose ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
    color: var(--text-secondary);
    line-height: 1.85;
}

.prose li {
    margin-bottom: var(--space-sm);
}

.prose strong {
    color: var(--text-primary);
    font-weight: 600;
}

.prose a {
    color: var(--green-500);
    text-decoration: underline;
    text-decoration-color: rgba(39, 174, 96, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--duration-fast) var(--ease-out);
}

.prose a:hover {
    text-decoration-color: var(--green-500);
}

/* ── Featured Card (for SGC-Bio showcase) ─────────────────────────── */
.featured-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-500), var(--green-400));
}

body.mode-dark .featured-card {
    background: rgba(39, 174, 96, 0.04);
    border-color: rgba(39, 174, 96, 0.12);
}

.featured-card h3 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.featured-card .featured-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: var(--space-xl);
}

/* ── Philosophy / Accent Block ────────────────────────────────────── */
.accent-block {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.accent-block p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.accent-block .accent-tagline {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: var(--space-lg);
    letter-spacing: -0.015em;
}

.accent-block .accent-tagline em {
    color: var(--green-500);
    font-style: normal;
}


/* ── Footer ───────────────────────────────────────────────────────── */
footer {
    background: #111111;
    color: #a3a3a3;
    padding: var(--space-2xl) 0 var(--space-xl) 0;
    border-top: 1px solid #1e1e1e;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-xl);
}

.footer-content h3 {
    color: #fafafa;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.footer-content > div > p {
    color: #737373;
    font-size: 0.925rem;
    line-height: 1.65;
    max-width: 360px;
}

.footer-links {
    display: flex;
    gap: var(--space-xl);
    list-style: none;
}

.footer-links a {
    color: #737373;
    text-decoration: none;
    font-size: 0.925rem;
    transition: color var(--duration-fast) var(--ease-out);
}

.footer-links a:hover {
    color: #fafafa;
}

.footer-bottom {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid #1e1e1e;
    text-align: center;
}

.footer-bottom p {
    color: #525252;
    font-size: 0.85rem;
}
.footer-bottom .footer-legal {
    margin-top: var(--space-sm);
}
.footer-bottom a {
    color: #737373;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
.footer-bottom a:hover {
    color: #fafafa;
}


/* ══════════════════════════════════════════════════════════════════════
   PAGE-SPECIFIC STYLES
   ══════════════════════════════════════════════════════════════════════ */

/* ── Home: SGCX name breakdown ────────────────────────────────────── */
.sgcx-breakdown {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 500px;
    margin: var(--space-xl) auto;
}

.sgcx-breakdown p {
    font-size: 1.1rem;
    line-height: 2;
    color: var(--text-secondary);
}

.sgcx-breakdown strong {
    color: var(--green-500);
    font-family: var(--font-mono);
    font-size: 1.2em;
}

/* ── Research cards ───────────────────────────────────────────────── */
.research-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--duration-normal) var(--ease-out);
}

.research-card:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-md);
}

.research-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.research-card p {
    color: var(--text-tertiary);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* Publication card */
.pub-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.pub-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-style: italic;
}

.pub-card p {
    color: var(--text-tertiary);
    font-size: 0.925rem;
    margin-bottom: var(--space-xs);
}

/* ── Contact grid cards ───────────────────────────────────────────── */
.contact-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--duration-normal) var(--ease-out);
}

.contact-card:hover {
    border-color: var(--green-500);
    box-shadow: var(--shadow-md);
}

.contact-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.975rem;
    line-height: 1.7;
}


/* ══════════════════════════════════════════════════════════════════════
   LEGACY CLASS COMPAT — Keep old class names working during migration
   ══════════════════════════════════════════════════════════════════════ */

.project-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 22px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-out);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.project-link:hover {
    border-color: var(--green-500);
    color: var(--green-500);
    box-shadow: var(--shadow-sm);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-out);
    background: var(--green-500);
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

.cta-button:hover {
    background: var(--green-600);
    color: white;
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.35);
    transform: translateY(-1px);
}

.project-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.content-section {
    background: var(--bg-primary);
    padding: var(--space-3xl) 0;
    min-height: 60vh;
}

.content-section h1 {
    text-align: center;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}


/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero-light {
        padding: var(--space-2xl) 0;
    }

    .hero-dark {
        padding: var(--space-2xl) 0 var(--space-xl) 0;
    }

    .hero-logo {
        margin-bottom: var(--space-lg);
    }

    .hero-wordmark {
        width: min(340px, 85%);
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    .section-tight {
        padding: var(--space-xl) 0;
    }

    /* Show mobile menu button, hide desktop nav */
    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
    }

    nav {
        position: relative;
    }

    .nav-links.mobile-open {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: calc(-1 * var(--space-lg));
        right: calc(-1 * var(--space-lg));
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-primary);
        box-shadow: var(--shadow-lg);
        z-index: 9999;
        padding: var(--space-md) 0;
        gap: 0;
    }

    body.mode-dark .nav-links.mobile-open {
        background: #111111;
    }

    .nav-links.mobile-open li {
        margin: 0;
        text-align: center;
    }

    .nav-links.mobile-open a {
        display: block;
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
        border-bottom: 1px solid var(--border-primary);
    }

    .nav-links.mobile-open a::after {
        display: none;
    }

    .nav-links.mobile-open a:hover {
        background: var(--surface-hover);
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .footer-content > div > p {
        max-width: 100%;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-lg);
    }

    .logo-nav {
        height: 32px;
    }

    .btn {
        padding: 10px 22px;
        font-size: 0.9rem;
    }

    .featured-card {
        padding: var(--space-xl);
    }

    .cta-banner {
        padding: var(--space-xl);
    }

    .prose h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-wordmark {
        width: min(280px, 85%);
    }

    .container {
        padding: 0 var(--space-md);
    }
}


/* ══════════════════════════════════════════════════════════════════════
   ANIMATION — Subtle entrance animations
   ══════════════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-in {
    animation: fadeUp 0.6s var(--ease-out) both;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }
