/* ==========================================================================
   Folio — memory-inspector themed portfolio
   ========================================================================== */

:root {
    --bg: #100f0d;
    --bg-2: #161410;
    --surface: #1c1a15;
    --surface-2: #24211a;
    --line: rgba(255, 236, 200, 0.09);
    --line-strong: rgba(255, 236, 200, 0.18);
    --text: #ece6d8;
    --muted: #9b937f;
    --accent: #ffb224;
    --accent-2: #ff6a3d;
    --accent-ink: #1a1206;
    --accent-soft: rgba(255, 178, 36, 0.12);
    --glow: rgba(255, 178, 36, 0.35);
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
    --field: 255, 178, 36;
    --field-alpha: 0.10;

    --font-display: "Bricolage Grotesque", ui-sans-serif, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
    --radius: 14px;
    --gutter: clamp(16px, 4vw, 40px);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f2ede2;
        --bg-2: #e9e2d2;
        --surface: #fbf8f1;
        --surface-2: #f4efe4;
        --line: rgba(40, 30, 10, 0.12);
        --line-strong: rgba(40, 30, 10, 0.24);
        --text: #1b1810;
        --muted: #6a624f;
        --accent: #b85700;
        --accent-2: #d1401a;
        --accent-ink: #fff8ec;
        --accent-soft: rgba(184, 87, 0, 0.1);
        --glow: rgba(184, 87, 0, 0.25);
        --shadow: 0 30px 60px -35px rgba(60, 40, 10, 0.35);
        --field: 150, 80, 0;
        --field-alpha: 0.09;
        color-scheme: light;
    }
}

:root[data-theme="light"] {
    --bg: #f2ede2;
    --bg-2: #e9e2d2;
    --surface: #fbf8f1;
    --surface-2: #f4efe4;
    --line: rgba(40, 30, 10, 0.12);
    --line-strong: rgba(40, 30, 10, 0.24);
    --text: #1b1810;
    --muted: #6a624f;
    --accent: #b85700;
    --accent-2: #d1401a;
    --accent-ink: #fff8ec;
    --accent-soft: rgba(184, 87, 0, 0.1);
    --glow: rgba(184, 87, 0, 0.25);
    --shadow: 0 30px 60px -35px rgba(60, 40, 10, 0.35);
    --field: 150, 80, 0;
    --field-alpha: 0.09;
    color-scheme: light;
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.6;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color .4s var(--ease), color .4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
ul, ol { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); font-size: 0.82em; letter-spacing: 0; }
.dim { color: var(--muted); }
.accent { color: var(--accent); }

.caret {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    margin-left: 4px;
    vertical-align: -0.12em;
    background: var(--accent);
    animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.grain {
    position: fixed; inset: -50%;
    pointer-events: none;
    z-index: 100;
    opacity: .05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress span {
    display: block; height: 100%; width: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform-origin: 0 50%;
    transform: scaleX(var(--p, 0));
}

/* ---------- nav ---------- */

.nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex; align-items: center; gap: 24px;
    padding: 14px var(--gutter);
    transition: background-color .3s, border-color .3s, backdrop-filter .3s;
    border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border-color: var(--line);
}
.nav__brand { font-family: var(--font-mono); font-weight: 600; font-size: 18px; display: flex; align-items: center; }
.nav__addr { color: var(--accent); }
.nav__brand .caret { height: .9em; width: .45em; }
.nav__links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav__links a {
    position: relative;
    padding: 8px 12px;
    font-size: 15px;
    color: var(--muted);
    border-radius: 8px;
    transition: color .2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
    background: var(--accent); border-radius: 2px;
}
.nav__links .nav__cta {
    margin-left: 8px; color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.nav__links .nav__cta:hover { background: var(--accent-soft); }
.nav__tools { display: flex; gap: 6px; }
.icon-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    color: var(--muted);
    transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--line-strong); }
.i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .i-sun { display: block; }
    :root:not([data-theme]) .i-moon { display: none; }
}
.nav__burger { display: none; flex-direction: column; gap: 5px; }
.nav__burger span { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .3s var(--ease); }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- buttons ---------- */

.btn {
    --bx: 50%; --by: 50%;
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 22px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-weight: 600; font-size: 15px;
    overflow: hidden;
    isolation: isolate;
    transition: border-color .25s, color .25s, transform .25s var(--ease);
}
.btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(160px circle at var(--bx) var(--by), var(--accent-soft), transparent 70%);
    opacity: 0; transition: opacity .25s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:hover::before { opacity: 1; }
.btn--solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--solid::before { background: radial-gradient(160px circle at var(--bx) var(--by), rgba(255,255,255,.35), transparent 70%); }
.btn--block { width: 100%; }

/* ---------- hero ---------- */

.hero {
    position: relative;
    min-height: 100vh; min-height: 100svh;
    display: flex; align-items: center;
    padding: 110px 0 80px;
    overflow: hidden;
}
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(60% 50% at 20% 40%, transparent, var(--bg) 85%),
        linear-gradient(to bottom, transparent 70%, var(--bg));
}
.hero__inner {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--font-mono); font-size: 13px;
    color: var(--muted);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(6px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot--live { background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

.hero__name {
    margin: 22px 0 18px;
    font-size: clamp(56px, 10vw, 136px);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: .88;
}
.hero__name > span { display: block; }
.hero__last { padding-left: clamp(0px, 6vw, 90px); color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero__last .accent { -webkit-text-stroke: 0; color: var(--accent); }
.hero__role { font-family: var(--font-mono); font-size: clamp(17px, 2vw, 22px); margin-bottom: 18px; min-height: 1.6em; }
.rotator { color: var(--accent); }
.hero__tagline { max-width: 34em; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__scroll {
    position: absolute; left: 50%; bottom: 26px; z-index: 1;
    transform: translateX(-50%);
    color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hero__scroll span { animation: bob 2s var(--ease) infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* staggered load-in */
.reveal { opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms + 150ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- terminal ---------- */

.term {
    position: relative;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 0 1px var(--line) inset, 0 0 80px -40px var(--glow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 13.5px;
}
.term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term__bar > span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.term__bar > span:first-child { background: var(--accent-2); }
.term__bar > span:nth-child(2) { background: var(--accent); }
.term__bar p { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }
.term__body { height: 250px; overflow-y: auto; padding: 16px 16px 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.term__line, .term__out { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.term__out { color: var(--muted); }
.term__out b, .term__out a { color: var(--accent); font-weight: 500; }
.term__out a { text-decoration: underline; text-underline-offset: 3px; }
.term__prompt { color: var(--accent); margin-right: 8px; }
.term__input { display: flex; align-items: center; padding: 8px 16px 14px; }
.term__input input {
    flex: 1; min-width: 0;
    background: none; border: 0; outline: 0;
    color: var(--text); font: inherit; caret-color: var(--accent);
}
.term__input input::placeholder { color: var(--muted); opacity: .5; }
.term__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.term__chips button {
    padding: 4px 10px; border-radius: 6px;
    font-size: 12px; color: var(--muted);
    border: 1px solid var(--line);
    transition: color .2s, border-color .2s, background .2s;
}
.term__chips button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- stats ---------- */

.stats { border-block: 1px solid var(--line); background: var(--bg-2); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 34px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat__value { font-size: clamp(40px, 5vw, 60px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; margin-bottom: 8px; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat__label { margin: 0; color: var(--muted); font-size: 15px; max-width: 14em; }

/* ---------- sections ---------- */

.section { padding: clamp(80px, 12vw, 140px) 0; position: relative; }
.section--alt { background: var(--bg-2); }
.section__head { margin-bottom: clamp(40px, 6vw, 64px); }
.section__addr { color: var(--accent); margin-bottom: 10px; letter-spacing: .04em; }
.section__head h2 { font-size: clamp(44px, 7vw, 88px); font-weight: 800; }
.section__sub { margin: 14px 0 0; color: var(--muted); max-width: 34em; }

.reveal-on-scroll { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--stagger, 0ms); }
.reveal-on-scroll.is-in { opacity: 1; transform: none; }

/* ---------- about ---------- */

.about { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }

.viewfinder { position: relative; margin: 0; padding: 18px; }
.viewfinder img {
    width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%;
    border-radius: 6px;
    filter: grayscale(.85) contrast(1.05);
    transition: filter .7s var(--ease);
}
.viewfinder:hover img { filter: none; }
.viewfinder__c { position: absolute; width: 26px; height: 26px; border: 2px solid var(--accent); transition: all .5s var(--ease); }
.viewfinder__c--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.viewfinder__c--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.viewfinder__c--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.viewfinder__c--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.viewfinder:hover .viewfinder__c--tl { top: 10px; left: 10px; }
.viewfinder:hover .viewfinder__c--tr { top: 10px; right: 10px; }
.viewfinder:hover .viewfinder__c--bl { bottom: 10px; left: 10px; }
.viewfinder:hover .viewfinder__c--br { bottom: 10px; right: 10px; }
.viewfinder figcaption {
    position: absolute; left: 34px; right: 34px; bottom: 32px;
    display: flex; gap: 14px; flex-wrap: wrap;
    color: #fff; font-size: 12px;
    text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.viewfinder .rec { margin-left: auto; color: #ff4d4d; animation: blink 1.6s steps(1) infinite; }

.about__lead { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 500; margin-bottom: 1.1em; }
.about__text > p:not(.about__lead) { color: var(--muted); }
.quote {
    margin: 32px 0; padding: 24px 26px;
    background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.quote p { font-size: 18px; font-style: italic; margin-bottom: 12px; }
.quote cite { font-style: normal; color: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 32px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts div { background: var(--bg); padding: 16px 18px; }
.facts dt { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- skills ---------- */

.skills { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.skills__tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.skills__tabs::-webkit-scrollbar { display: none; }
.skills__tab {
    flex: 1 0 auto;
    padding: 18px 22px;
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; color: var(--muted);
    border-right: 1px solid var(--line);
    position: relative;
    transition: color .2s, background .2s;
}
.skills__tab:last-child { border-right: 0; }
.skills__tab:hover { color: var(--text); }
.skills__tab.is-active { color: var(--text); background: var(--bg-2); }
.skills__tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.skills__count { font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.skills__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 380px; }
.skills__list { padding: 12px; border-right: 1px solid var(--line); }
.skill {
    width: 100%; text-align: left;
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    padding: 16px 16px; border-radius: 10px;
    transition: background .2s, color .2s;
    animation: rise .5s var(--ease) both;
    animation-delay: calc(var(--i) * 50ms);
    opacity: 0; transform: translateY(8px);
}
.skill:hover { background: var(--surface-2); }
.skill.is-active { background: var(--accent-soft); }
.skill__idx { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.skill__name { font-weight: 600; font-size: 18px; }
.skill.is-active .skill__name { color: var(--accent); }
.skill__arrow { color: var(--muted); transition: transform .3s var(--ease), color .2s; }
.skill.is-active .skill__arrow { transform: translateX(4px); color: var(--accent); }

.skills__detail { padding: clamp(24px, 3vw, 40px); position: relative; }
.skills__detail > * { animation: rise .5s var(--ease) both; opacity: 0; transform: translateY(8px); }
.skills__detail > :nth-child(2) { animation-delay: 60ms; }
.skills__detail > :nth-child(3) { animation-delay: 120ms; }
.skills__detail > :nth-child(4) { animation-delay: 180ms; }
.detail__name { font-size: clamp(28px, 3vw, 40px); font-weight: 800; letter-spacing: -0.04em; margin-bottom: 8px; }
.detail__note { color: var(--muted); font-size: 17px; margin-bottom: 28px; }
.detail__label { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.detail__group { margin-bottom: 24px; }
.detail__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.detail__pills a, .detail__pills span {
    padding: 7px 12px; border-radius: 8px; font-size: 14px;
    border: 1px solid var(--line-strong);
    transition: border-color .2s, color .2s, background .2s;
}
.detail__pills a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.detail__pills .is-empty { color: var(--muted); border-style: dashed; }

/* highlight experience entries tied to the active skill */
.job.is-linked .job__company { color: var(--accent); }
.job.is-linked::before { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }

/* ---------- experience ---------- */

.career { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.timeline { position: relative; border-left: 1px solid var(--line-strong); margin-left: 6px; }
.job { position: relative; padding: 0 0 8px 32px; }
.job::before {
    content: ""; position: absolute; left: -6px; top: 26px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--accent);
    transition: background .3s, box-shadow .3s;
}
.job__head {
    width: 100%; text-align: left;
    display: grid; grid-template-columns: 1fr auto; gap: 4px 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.job__dates { grid-column: 1; color: var(--muted); }
.job__company { grid-column: 1; font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; transition: color .25s; }
.job__title { grid-column: 1; color: var(--muted); }
.job__toggle { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); position: relative; transition: transform .4s var(--ease), border-color .2s; }
.job__toggle::before, .job__toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.job__toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .4s var(--ease); }
.job__head[aria-expanded="true"] .job__toggle { transform: rotate(180deg); border-color: var(--accent); color: var(--accent); }
.job__head[aria-expanded="true"] .job__toggle::after { transform: translate(-50%, -50%) rotate(0); }
.job__head:hover .job__company { color: var(--accent); }
.job__body { padding: 20px 0 16px; }
.role { position: relative; padding-left: 18px; margin-bottom: 18px; }
.role::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 1px; background: var(--accent); }
.role__title { font-weight: 600; margin-bottom: 4px; }
.role__title .mono { margin-left: 6px; font-weight: 400; }
.role__desc { color: var(--muted); margin: 0; }

.side__title { color: var(--accent); margin: 0 0 18px; font-weight: 500; font-size: 14px; }
.side__title:not(:first-child) { margin-top: 48px; }
.edu li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.edu li:first-child { padding-top: 0; }
.edu__degree { font-weight: 700; font-size: 18px; margin-bottom: 2px; }
.edu__school { margin-bottom: 6px; }
.edu__school .mono { margin-left: 6px; }
.edu__desc { color: var(--muted); font-size: 15px; margin: 0; }
.award { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .3s, transform .3s var(--ease); }
.award:hover { border-color: var(--accent); transform: translateX(4px); }
.award__place { font-size: 30px; font-weight: 800; letter-spacing: -0.05em; color: var(--accent); line-height: 1; min-width: 2ch; }
.award__title { font-weight: 700; margin: 0; }
.award__title a:hover { color: var(--accent); }
.award__event { margin: 2px 0 8px; }
.award__summary { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- projects ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
    padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 14px; font-weight: 500; color: var(--muted);
    transition: all .25s var(--ease);
}
.chip span { font-family: var(--font-mono); font-size: 12px; margin-left: 4px; opacity: .7; }
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
    --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
    perspective: 900px;
    transition: opacity .45s var(--ease), transform .45s var(--ease), filter .45s;
}
.card.is-hidden { display: none; }
.card.is-entering { animation: rise .5s var(--ease) both; }
.card__link {
    position: relative;
    display: flex; flex-direction: column; height: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    transform-style: preserve-3d;
    transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
}
.card__link::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(380px circle at var(--mx) var(--my), var(--accent-soft), transparent 60%);
    opacity: 0; transition: opacity .3s;
}
.card:hover .card__link { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: var(--shadow); }
.card:hover .card__link::after { opacity: 1; }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .6s; filter: saturate(.7); }
.card:hover .card__media img { transform: scale(1.06); filter: saturate(1); }
.card__addr { position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 6px; background: rgba(16,15,13,.75); color: #ffb224; backdrop-filter: blur(4px); }
.card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 21px; letter-spacing: -0.025em; margin-bottom: 8px; line-height: 1.2; }
.card__text { color: var(--muted); font-size: 15px; flex: 1; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card__tags li { font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }

/* ---------- contact ---------- */

.contact { border-top: 1px solid var(--line); overflow: hidden; }
.contact::before {
    content: ""; position: absolute; width: 700px; height: 700px; right: -250px; top: -200px;
    background: radial-gradient(circle, var(--glow), transparent 65%);
    opacity: .4; pointer-events: none; filter: blur(20px);
}
.contact__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
.contact__title { font-size: clamp(48px, 7vw, 96px); font-weight: 800; letter-spacing: -0.055em; line-height: .92; margin-bottom: 24px; }
.contact__copy > p { color: var(--muted); max-width: 28em; }
.contact__email {
    display: inline-block; margin: 8px 0 24px;
    font-size: clamp(15px, 1.8vw, 19px);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 2px;
    word-break: break-all;
    transition: color .2s;
}
.contact__email:hover { color: var(--accent); }
.contact__socials { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.contact__socials a { color: var(--muted); transition: color .2s; }
.contact__socials a:hover { color: var(--accent); }

.form { display: grid; gap: 14px; align-content: start; }
.field { position: relative; }
.field input, .field textarea {
    width: 100%;
    padding: 24px 16px 10px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--text);
    font: inherit; font-size: 16px;
    resize: vertical;
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field label {
    position: absolute; left: 17px; top: 17px;
    color: var(--muted); pointer-events: none;
    transform-origin: 0 0;
    transition: transform .2s var(--ease), color .2s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
    transform: translateY(-10px) scale(.75);
    color: var(--accent);
}
.form__error { color: var(--accent-2); margin: 0; font-size: 15px; }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer__inner p { margin: 0; color: var(--muted); }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer__links a { color: var(--muted); font-size: 15px; }
.footer__links a:hover { color: var(--accent); }
.footer__top { margin-left: auto; color: var(--accent); }

/* ---------- project page ---------- */

.page-project main, .page-thanks main { padding-top: 110px; }
.project { padding-bottom: 100px; }
.project__back { display: inline-block; color: var(--muted); margin-bottom: 40px; transition: color .2s, transform .2s; }
.project__back:hover { color: var(--accent); transform: translateX(-4px); }
.project__title { font-size: clamp(40px, 7vw, 84px); font-weight: 800; margin-bottom: 18px; }
.project__lede { font-size: clamp(18px, 2vw, 22px); color: var(--muted); max-width: 36em; }
.project__head { margin-bottom: 48px; }
.project__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.project__media { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.prose { font-size: 18px; margin-bottom: 28px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 10px; }
.project__pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--line); }
.project__pager a { display: flex; flex-direction: column; gap: 4px; font-size: clamp(18px, 2.4vw, 26px); font-weight: 700; letter-spacing: -0.03em; transition: color .2s; }
.project__pager a:hover { color: var(--accent); }
.project__pager .is-next { text-align: right; margin-left: auto; }

.thanks { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; padding-bottom: 80px; }
.thanks > p:not(.section__addr) { color: var(--muted); font-size: 19px; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
    .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats__grid { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(3) { border-left: 0; padding-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
    .nav__burger { display: flex; align-items: center; justify-content: center; }
    .nav__tools { margin-left: auto; }
    .nav__links {
        position: fixed; inset: 0 0 auto 0; top: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 80px var(--gutter) 24px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        transform: translateY(-100%);
        transition: transform .45s var(--ease);
        z-index: -1;
    }
    .nav__links.is-open { transform: none; }
    .nav__links a { padding: 14px 4px; font-size: 22px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line); border-radius: 0; }
    .nav__links a.is-active::after { display: none; }
    .nav__links .nav__cta { margin: 16px 0 0; border-radius: 999px; text-align: center; font-size: 17px; }

    .hero { padding-top: 96px; }
    .hero__inner, .about, .career, .contact__inner, .project__grid { grid-template-columns: minmax(0, 1fr); }
    .hero__last { padding-left: 0; }
    .term__body { height: 200px; }
    .hero__scroll { display: none; }
    .viewfinder { max-width: 440px; }
    .skills__body { grid-template-columns: minmax(0, 1fr); }
    .skills__list { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .projects { grid-template-columns: minmax(0, 1fr); }
    .stat { padding: 24px 12px 24px 0; }
    .stat:nth-child(even) { padding-left: 16px; }
    .facts { grid-template-columns: 1fr; }
    .hero__actions .btn { flex: 1 1 auto; }
    .skills__tab { padding: 14px 16px; }
    .footer__top { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
    .reveal, .reveal-on-scroll, .skill, .skills__detail > * { opacity: 1; transform: none; }
}
