/* ==========================================================================
   David Valencia — Personal site
   Design system: clean, minimal, subtle tech. Light default + optional dark.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

    /* Light theme (default) */
    --bg: #fafbfc;
    --bg-elev: #ffffff;
    --bg-subtle: #f1f3f7;
    --text: #14161c;
    --text-muted: #5b6472;
    --border: #e6e9ef;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.10);
    --accent-2: #0d9488;
    --shadow-sm: 0 1px 3px rgba(20, 22, 28, 0.06), 0 1px 2px rgba(20, 22, 28, 0.04);
    --shadow-md: 0 4px 16px rgba(20, 22, 28, 0.07);
    --shadow-lg: 0 12px 32px rgba(20, 22, 28, 0.10);

    --radius: 14px;
    --radius-sm: 9px;
    --maxw: 1080px;
    --nav-h: 68px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
    --bg: #0e1015;
    --bg-elev: #161922;
    --bg-subtle: #1c2029;
    --text: #eef1f6;
    --text-muted: #99a2b2;
    --border: #262b36;
    --accent: #5b9dff;
    --accent-soft: rgba(91, 157, 255, 0.14);
    --accent-2: #2dd4bf;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { color: var(--text-muted); }

.gradient-text {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
    white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Navbar ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: var(--maxw);
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; }
.nav-logo .logo-mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
}
.nav-logo-img { height: 24px; width: auto; display: block; }
[data-theme="dark"] .nav-logo-img { filter: invert(1); }
.nav-right { display: flex; align-items: center; gap: 6px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-subtle); }
.nav-links a.active { color: var(--accent); }

.icon-btn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.lang-btn { width: auto; padding: 0 12px; font-family: var(--font-mono); letter-spacing: 0.03em; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.3s;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 7vw, 80px);
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -160px; right: -120px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, var(--accent-soft), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
    align-items: center;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 22px;
}
.dot-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
    70% { box-shadow: 0 0 0 9px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.hero h1 { margin-bottom: 18px; }
.hero-lead { font-size: 1.12rem; max-width: 52ch; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-social { display: flex; gap: 12px; margin-top: 28px; }
.hero-social a {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text-muted);
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.hero-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.hero-social svg { width: 19px; height: 19px; }

/* Portrait */
.hero-portrait { position: relative; justify-self: center; }
.hero-portrait .frame {
    width: clamp(320px, 44vw, 470px);
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-subtle));
}
.hero-portrait .frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 32% center;
}
.hero-portrait .frame .placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 20px;
}
.float-chip {
    position: absolute;
    bottom: -14px; left: -18px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: var(--shadow-md);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: clamp(48px, 8vw, 88px) 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.section-head p { margin-top: 12px; font-size: 1.05rem; }
.alt-bg { background: var(--bg-subtle); }

/* ---------- About strip ---------- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.fact-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.fact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.fact-card .ico { font-size: 1.4rem; margin-bottom: 10px; }
.fact-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.fact-card p { font-size: 0.92rem; }

/* ---------- Cards grid (projects) ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card-media {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-subtle));
    display: grid; place-items: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-contain { padding: 16px; }
.card-media-contain img { object-fit: contain; }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: 10px; }
.card-body p { font-size: 0.93rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}
.card-links { display: flex; gap: 16px; margin-top: auto; padding-top: 6px; }
.card-links a {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.card-links a:hover { text-decoration: underline; }
.repo-stars {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted) !important;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    transition: color 0.2s, border-color 0.2s;
}
.repo-stars::before { content: "★"; color: #f5a623; font-size: 0.85rem; }
.repo-stars:hover { color: var(--text) !important; border-color: var(--accent); text-decoration: none !important; }
.badge-wip {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-top: auto;
}

/* ---------- Publications ---------- */
.pub-group { margin-bottom: 44px; }
.pub-group > h3 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.pub {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}
.pub:last-child { border-bottom: none; }
.pub .year {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
    font-size: 0.95rem;
    padding-top: 2px;
}
.pub .pub-title { font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.45; }
.pub .venue { font-size: 0.9rem; color: var(--text-muted); }
.pub .pub-links { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.pub .pub-links a { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.pub .pub-links a:hover { text-decoration: underline; }

/* ---------- CV ---------- */
.timeline { border-left: 2px solid var(--border); margin-left: 8px; padding-left: 28px; }
.tl-item { position: relative; padding-bottom: 30px; }
.tl-item::before {
    content: "";
    position: absolute;
    left: -35px; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
}
.tl-item .tl-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.tl-item h3 { font-size: 1.1rem; margin: 4px 0 2px; }
.tl-item .tl-org { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 8px; }
.tl-item p { font-size: 0.93rem; }

.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.skill-col h4 { font-size: 0.95rem; margin-bottom: 12px; }
.skill-col ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-col li {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 5px 11px;
    border-radius: 7px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* Languages */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.lang-item {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lang-name { font-weight: 600; color: var(--text); }
.lang-level { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- About figures ---------- */
.about-figure {
    margin: 36px 0 0;
}
.about-figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: block;
}
.about-figure-square {
    max-width: 420px;
}
.about-figure figcaption {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* About gallery */
.about-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 28px;
}
.about-gallery figure { margin: 0; }
.about-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: block;
}
.about-gallery figcaption {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}
@media (max-width: 720px) {
    .about-gallery { grid-template-columns: 1fr; gap: 22px; }
    .about-gallery img { aspect-ratio: 16 / 10; }
}

/* ---------- Tutorial / article ---------- */
.tutorial-back {
    display: inline-block;
    margin-bottom: 28px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}
.tutorial-back:hover { text-decoration: underline; }
.tutorial h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 18px; }
.tutorial h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.tutorial h3 { font-size: 1.2rem; margin: 28px 0 10px; }
.tutorial p { margin-bottom: 16px; line-height: 1.75; }
.tutorial ul, .tutorial ol { margin: 0 0 16px 1.3em; color: var(--text-muted); }
.tutorial li { margin-bottom: 8px; }
.tutorial a { color: var(--accent); text-decoration: underline; }
.tutorial img { border-radius: var(--radius); border: 1px solid var(--border); margin: 8px 0; }
.tutorial figure { margin: 24px 0; }
.tutorial figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--text-muted); font-style: italic; text-align: center; }
.tutorial pre {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 18px;
}
.tutorial code {
    font-family: var(--font-mono);
    font-size: 0.88rem;
}
.tutorial p > code, .tutorial li > code {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
}
.tutorial pre code { background: none; border: none; padding: 0; }

/* Lead paragraph */
.tutorial .tut-lead {
    font-size: 1.18rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 28px;
}
.tutorial h1 + .tut-lead { margin-top: 6px; }

/* English-only notice — shown only when the site is in Spanish */
.tut-en-note {
    display: none;
    margin: 0 0 22px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.tut-en-note::before { content: "🌐 "; }
html[lang="es"] .tut-en-note { display: block; }

/* Callouts / notes */
.tutorial blockquote {
    margin: 0 0 22px;
    padding: 14px 20px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.tutorial blockquote p { margin: 0 0 8px; color: var(--text); font-size: 0.95rem; }
.tutorial blockquote p:last-child { margin-bottom: 0; }

/* Tables */
.tutorial table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 22px;
    font-size: 0.92rem;
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.tutorial th, .tutorial td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.tutorial th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text);
}
.tutorial td { color: var(--text-muted); }
.tutorial tr:last-child td { border-bottom: none; }
.tutorial td code, .tutorial th code { white-space: nowrap; }

/* Anchor offset for sticky navbar */
.tutorial h2[id], .tutorial h3[id], .tutorial-main h2 { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* Center diagram figures, cap width */
.tutorial figure img { margin-inline: auto; max-width: 100%; }

/* Docs-style two-column layout with sticky TOC */
.tutorial-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 56px;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}
.tutorial-main { min-width: 0; }
.tutorial-back { margin-top: 4px; }

/* Section rhythm — divider above each H2 so it doesn't read like a wall of text */
.tutorial-main h2 {
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.tutorial-main > .section-label + h1,
.tutorial-main h1 { border: none; padding-top: 0; }

/* Sticky table of contents */
.tutorial-toc { position: sticky; top: calc(var(--nav-h) + 28px); }
.toc-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}
#tocNav { display: flex; flex-direction: column; border-left: 1px solid var(--border); }
#tocNav a {
    font-size: 0.84rem;
    color: var(--text-muted);
    padding: 6px 0 6px 14px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    line-height: 1.35;
    transition: color 0.2s, border-color 0.2s;
}
#tocNav a:hover { color: var(--text); }
#tocNav a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }

@media (max-width: 900px) {
    .tutorial-layout { grid-template-columns: 1fr; gap: 0; }
    .tutorial-toc { display: none; }
}
.tutorial blockquote {
    margin: 0 0 18px;
    padding: 14px 18px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text);
}
.tutorial blockquote p { margin: 0; color: var(--text); }
.tutorial blockquote p + p { margin-top: 8px; }
.tutorial .tut-lead { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 28px; }
.tutorial table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 18px;
    font-size: 0.92rem;
}
.tutorial th, .tutorial td {
    border: 1px solid var(--border);
    padding: 9px 12px;
    text-align: left;
    vertical-align: top;
}
.tutorial th { background: var(--bg-subtle); color: var(--text); font-weight: 600; }
.tutorial td { color: var(--text-muted); }

/* ---------- CTA ---------- */
.cta-box {
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: var(--radius);
    padding: clamp(40px, 7vw, 64px);
    color: #fff;
    box-shadow: var(--shadow-lg);
}
.cta-box h2 { color: #fff; margin-bottom: 12px; }
.cta-box p { color: rgba(255, 255, 255, 0.9); margin-bottom: 26px; max-width: 50ch; margin-inline: auto; }
.cta-box .btn-primary { background: #fff; color: var(--accent); }
.cta-box .btn-primary:hover { background: #fff; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 44px 0; background: var(--bg-elev); }
.footer-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}
.footer-logo { margin: 0; }
.footer-connect {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 26px;
}
.footer-connect a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.footer-connect a:hover { color: var(--accent); }
.footer-copy { font-size: 0.83rem; color: var(--text-muted); margin: 0; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .dot-pulse { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero-portrait { order: -1; }
    .nav-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: var(--nav-h); left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-elev);
        border-bottom: 1px solid var(--border);
        padding: 12px 24px 20px;
        transform: translateY(-130%);
        transition: transform 0.35s var(--ease);
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links a { padding: 12px 8px; border-radius: 8px; }
    .nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
