/* ==========================================================
   matheusrayol.com
   ========================================================== */

:root {
    --bg: #0b0d12;
    --bg-alt: #10131a;
    --surface: #151922;
    --surface-2: #1b2030;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #eef0f5;
    --muted: #9aa2b4;
    --accent: #8b7bff;
    --accent-2: #f4a340;
    --accent-3: #3dd6c6;
    --accent-ink: #0b0d12;
    --ok: #3dd68c;
    --warn: #f4a340;
    --grad: linear-gradient(110deg, #8b7bff 0%, #3dd6c6 55%, #f4a340 100%);
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
    --radius: 18px;
    --radius-sm: 10px;
    --header-h: 68px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", var(--font);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f7f6f2;
    --bg-alt: #efede6;
    --surface: #ffffff;
    --surface-2: #f3f1ea;
    --border: rgba(20, 22, 30, 0.09);
    --border-strong: rgba(20, 22, 30, 0.18);
    --text: #14161e;
    --muted: #5b6172;
    --accent: #5b47e0;
    --accent-2: #c46f0f;
    --accent-3: #0f9488;
    --accent-ink: #ffffff;
    --ok: #13894f;
    --warn: #b0640d;
    --grad: linear-gradient(110deg, #5b47e0 0%, #0f9488 55%, #c46f0f 100%);
    --shadow: 0 20px 50px -24px rgba(20, 22, 30, 0.25);
    color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); margin-bottom: 0.6em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
ul, ol, dl { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.ico { width: 1.15em; height: 1.15em; flex: none; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }

.skip-link {
    position: absolute; left: 16px; top: -48px; z-index: 100;
    background: var(--accent); color: var(--accent-ink);
    padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); }
.kicker {
    font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.8em;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 0.5em;
    padding: 0.8em 1.35em; border-radius: 999px;
    font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer;
    border: 1px solid transparent; transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { box-shadow: 0 10px 30px -10px var(--accent); }
.btn-ghost { border-color: var(--border-strong); background: transparent; color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-small { padding: 0.55em 1em; font-size: 0.875rem; }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    cursor: pointer; transition: border-color .2s ease, transform .2s ease;
}
.icon-btn:hover { border-color: var(--accent); }
.lang-btn { width: auto; min-width: 40px; padding: 0 10px; font-family: var(--font-display); font-weight: 600; font-size: 0.82rem; letter-spacing: .04em; }

/* ---------- Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
    transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
    border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom-color: var(--border);
}
.nav-wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; }
.brand-mark {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: var(--grad); color: #0b0d12; font-size: 0.85rem; letter-spacing: 0;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
    text-decoration: none; color: var(--muted); font-size: 0.93rem; font-weight: 500;
    padding: 8px 14px; border-radius: 999px; transition: color .2s ease, background .2s ease;
}
.nav a:hover, .nav a.is-active { color: var(--text); background: var(--surface); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }

[data-theme="dark"] .ico-sun { display: block; }
[data-theme="dark"] .ico-moon { display: none; }
[data-theme="light"] .ico-sun { display: none; }
[data-theme="light"] .ico-moon { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: calc(var(--header-h) + 72px) 0 64px; overflow: hidden; }
.hero-glow {
    position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
    background:
        radial-gradient(closest-side, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
        radial-gradient(closest-side at 30% 70%, color-mix(in srgb, var(--accent-3) 25%, transparent), transparent 70%);
    filter: blur(40px); opacity: .7; pointer-events: none;
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 60% 30%, #000 10%, transparent 65%);
    -webkit-mask-image: radial-gradient(ellipse at 60% 30%, #000 10%, transparent 65%);
    opacity: .5;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 500;
    padding: 6px 14px 6px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
    margin-bottom: 28px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 0%, transparent); } }

.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 24px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 40ch; }
.lead a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.roles { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-family: var(--font-display); margin: 4px 0 32px; }
.roles-label { color: var(--muted); }
.role-rotator { font-weight: 600; color: var(--text); border-bottom: 2px solid var(--accent); transition: opacity .3s ease, transform .3s ease; display: inline-block; }
.role-rotator.is-out { opacity: 0; transform: translateY(6px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }

.social { display: flex; gap: 8px; list-style: none; }
.social a {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.social a:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

.hero-visual { position: relative; justify-self: center; width: min(420px, 100%); }
.portrait {
    position: relative; aspect-ratio: 1; border-radius: 32px; overflow: hidden;
    border: 1px solid var(--border-strong); box-shadow: var(--shadow);
    background: var(--surface);
}
.portrait::before {
    content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; z-index: 2;
    background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.float-chip {
    position: absolute; display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 12px; font-size: 0.85rem; font-weight: 600; font-family: var(--font-display);
    background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow);
    animation: float 6s ease-in-out infinite;
}
.float-chip span { color: var(--ok); }
.chip-a { left: -28px; top: 14%; }
.chip-b { right: -24px; top: 42%; animation-delay: -2s; }
.chip-c { left: 8%; bottom: -18px; animation-delay: -4s; color: var(--muted); }
@keyframes float { 50% { transform: translateY(-8px); } }

.stats {
    position: relative; z-index: 1; margin-top: 72px;
    display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.stats > div { padding: 24px; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats dt { font-family: var(--font-display); font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -0.03em; }
.stats dd { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 48px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.about-grid p { color: var(--muted); }
.about-grid strong { color: var(--text); font-weight: 600; }
.facts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.facts li { font-weight: 500; font-size: 0.95rem; overflow-wrap: anywhere; }
.facts span { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.facts a { text-decoration: none; }
.facts a:hover { color: var(--accent); }

.skills { display: grid; gap: 16px; }
.skill-card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.skill-card h3 { margin-bottom: 14px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
    font-size: 0.82rem; padding: 5px 11px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.tags-inline { margin: 4px 0 24px; }

/* ---------- Featured projects ---------- */
.feature {
    display: grid; grid-template-columns: 1.05fr 1fr; gap: 0; margin-bottom: 28px;
    border: 1px solid var(--border); border-radius: 24px; background: var(--surface); overflow: hidden;
    box-shadow: var(--shadow);
}
.feature-flip .feature-media { order: 2; }
.feature-body { padding: clamp(28px, 4vw, 48px); }
.feature-body h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 14px; }
.feature-body > p { color: var(--muted); }
.feature-meta { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.pill {
    font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
    color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.pill-amber { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 16%, transparent); }
.checklist { list-style: none; display: grid; gap: 10px; margin: 20px 0 24px; }
.checklist li { position: relative; padding-left: 28px; font-size: 0.95rem; }
.checklist li::before {
    content: ""; position: absolute; left: 0; top: 0.35em; width: 16px; height: 16px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent-3) 20%, transparent);
    box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--accent-3) 0%, transparent);
}
.checklist li::after {
    content: ""; position: absolute; left: 5px; top: calc(0.35em + 4px); width: 6px; height: 4px;
    border-left: 2px solid var(--accent-3); border-bottom: 2px solid var(--accent-3); transform: rotate(-45deg);
}

.feature-media { position: relative; min-height: 360px; display: grid; place-items: center; padding: 40px 32px; overflow: hidden; }

/* MRF visual */
.media-mrf {
    background:
        radial-gradient(circle at 20% 15%, rgba(139, 123, 255, .35), transparent 50%),
        radial-gradient(circle at 85% 90%, rgba(61, 214, 198, .28), transparent 50%),
        #0f1220;
    color: #eef0f5;
}
.mrf-board {
    width: min(420px, 100%); border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12); background: rgba(10, 12, 20, .7);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.8rem;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
}
.mrf-row { display: grid; grid-template-columns: 1.1fr 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; }
.mrf-row + .mrf-row { border-top: 1px solid rgba(255, 255, 255, .07); }
.mrf-row .k { color: #8f97ab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrf-row .v { color: #eef0f5; }
.badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; font-family: var(--font); }
.badge.ok { color: #3dd68c; background: rgba(61, 214, 140, .14); }
.badge.warn { color: #f4a340; background: rgba(244, 163, 64, .16); }
.mrf-logo {
    position: absolute; left: 32px; bottom: 22px; font-family: var(--font-display); font-weight: 700;
    font-size: 1.4rem; letter-spacing: -0.02em;
}
.mrf-logo span { color: #8f97ab; font-weight: 500; }

/* Sideboardy visual */
.media-sideboardy {
    background:
        radial-gradient(circle at 80% 10%, rgba(244, 163, 64, .35), transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(244, 163, 64, .12), transparent 50%),
        #141a2e;
    gap: 28px; align-content: center; color: #f7f5f0;
}
.sb-logo { width: min(260px, 70%); height: auto; }
.sb-ui {
    width: min(360px, 100%); padding: 14px; border-radius: 16px; display: grid; gap: 8px;
    background: rgba(247, 245, 240, .05); border: 1px solid rgba(247, 245, 240, .12);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
}
.sb-card {
    display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
    padding: 10px 12px; border-radius: 10px; background: rgba(247, 245, 240, .06); font-size: 0.88rem;
}
.sb-card.foil { background: linear-gradient(100deg, rgba(139, 123, 255, .18), rgba(61, 214, 198, .14), rgba(244, 163, 64, .18)); }
.sb-name { font-weight: 600; }
.sb-set { font-size: 0.72rem; color: rgba(247, 245, 240, .6); text-transform: uppercase; letter-spacing: .06em; }
.sb-price { font-family: var(--font-display); font-weight: 700; color: #f4a340; }
.sb-total { display: flex; justify-content: space-between; padding: 8px 12px 2px; font-size: 0.82rem; color: rgba(247, 245, 240, .65); }
.sb-total strong { color: #f7f5f0; font-family: var(--font-display); }

.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mini {
    display: flex; flex-direction: column; text-decoration: none; padding: 26px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface); transition: transform .25s ease, border-color .25s ease;
}
.mini:hover { transform: translateY(-4px); border-color: var(--accent); }
.mini h3 { margin-bottom: 8px; }
.mini p:not(.feature-meta) { color: var(--muted); font-size: 0.93rem; }
.mini-link { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9rem; color: var(--accent); }

/* ---------- Experience ---------- */
.exp-grid { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: 64px; align-items: start; }
.sticky-head { position: sticky; top: calc(var(--header-h) + 32px); margin-bottom: 0; }
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); border-radius: 2px; }
.timeline > li { position: relative; padding: 0 0 36px 40px; }
.timeline > li::before {
    content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--accent);
}
.timeline > li:first-child::before { background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.when { display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.timeline h3 { font-size: 1.2rem; }
.where { color: var(--muted); font-weight: 500; margin: 4px 0 10px; }
.timeline ul { list-style: none; display: grid; gap: 6px; }
.timeline ul li { position: relative; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }
.timeline ul li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background: var(--border-strong); }

.edu { margin-top: 40px; padding: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.edu h3 { margin-bottom: 20px; }
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.edu-grid > div { display: flex; flex-direction: column; gap: 4px; }
.edu-grid span:last-child { color: var(--muted); font-size: 0.92rem; }

/* ---------- Archive ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
    padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    font-size: 0.9rem; font-weight: 500; cursor: pointer; color: var(--muted); transition: all .2s ease;
}
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tile {
    display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden;
    transition: transform .25s ease, border-color .25s ease;
}
.tile:hover { transform: translateY(-4px); border-color: var(--accent); }
.tile[hidden] { display: none; }
.tile-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s ease; }
.tile:hover .tile-img img { transform: scale(1.04); }
.tile-body { padding: 16px 18px 18px; }
.tile-body h3 { font-size: 1.05rem; margin-bottom: 4px; }
.tile-body p { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.contact-mail {
    display: inline-flex; align-items: center; gap: 10px; margin: 8px 0 24px;
    font-family: var(--font-display); font-weight: 600; font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 4px; overflow-wrap: anywhere;
}
.contact-form { display: grid; gap: 16px; padding: clamp(22px, 4vw, 36px); border-radius: 24px; border: 1px solid var(--border); background: var(--surface); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.contact-form input,
.contact-form textarea {
    width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.contact-form .btn { justify-self: start; }
.form-status { margin: 0; font-size: 0.9rem; min-height: 1.4em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: #ff6b6b; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 0.88rem; color: var(--muted); }
.footer-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-wrap p { margin: 0; }
.footer-wrap a { text-decoration: none; }
.footer-wrap a:hover { color: var(--text); }

/* ---------- Modal ---------- */
.modal {
    width: min(1000px, 100% - 32px); max-height: calc(100% - 32px); padding: 0; border: 1px solid var(--border-strong);
    border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: auto;
}
.modal::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-inner { position: relative; display: grid; grid-template-columns: 1.5fr 1fr; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.gallery { position: relative; background: var(--bg); display: grid; place-items: center; min-height: 320px; }
.gallery img { width: 100%; max-height: 72vh; object-fit: contain; }
.gal-prev, .gal-next { position: absolute; top: 50%; transform: translateY(-50%); }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gal-count { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.modal-body { padding: 56px 28px 28px; }
.modal-body h3 { font-size: 1.5rem; margin-bottom: 12px; }
.modal-body > p { color: var(--muted); }
.modal-body dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.9rem; margin: 20px 0; }
.modal-body dt { color: var(--muted); }
.modal-body dd { margin: 0; font-weight: 500; }
.modal-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero-visual { width: min(340px, 82%); order: -1; }
    .about-grid, .exp-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .sticky-head { position: static; }
    .feature, .feature-flip { grid-template-columns: 1fr; }
    .feature-flip .feature-media { order: 0; }
    .feature-media { min-height: 300px; }
    .mini-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats > div:nth-child(3) { border-left: 0; }
    .stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
    .edu-grid { grid-template-columns: 1fr; }
    .modal-inner { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .menu-btn { display: inline-grid; }
    .nav {
        position: fixed; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 2px;
        padding: 12px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--border);
        transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .25s ease;
    }
    .nav.is-open { transform: none; opacity: 1; visibility: visible; }
    .nav a { padding: 12px 14px; font-size: 1rem; }
    .nav-actions { margin-left: auto; }
    .site-header.menu-open { background: var(--bg); border-bottom-color: var(--border); }
}

@media (max-width: 560px) {
    .hide-sm { display: none; }
    .hero { padding-top: calc(var(--header-h) + 40px); }
    .chip-a { left: -10px; }
    .chip-b { right: -10px; }
    .stats > div { padding: 18px; }
    .facts { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .mrf-row { grid-template-columns: 1fr auto; }
    .mrf-row .k { display: none; }
    .feature-media { padding: 32px 20px 64px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}
