/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
    color-scheme: light;
    --bg: #F3F1EC;
    --surface: #FBFAF7;
    --ink: #121212;
    --muted: #64625C;
    --line: #DCD8CE;
    --accent: #3D5AFE;
    --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
    --success: #17944B;
    --warning: #B86E00;
    --inv-bg: #121212;
    --inv-text: #F3F1EC;
    --inv-muted: #A5A39C;
    --inv-line: #2E2D2A;

    --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --header-h: 72px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --section-y: clamp(64px, 9vw, 120px);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0E0E0D;
    --surface: #161615;
    --ink: #EDEBE6;
    --muted: #9C9A93;
    --line: #2A2926;
    --accent: #8C9EFF;
    --success: #4ADE80;
    --warning: #F5B545;
    --inv-bg: #191918;
    --inv-text: #EDEBE6;
    --inv-muted: #9C9A93;
    --inv-line: #33322F;
}

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

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

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color .3s ease, color .3s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; letter-spacing: -0.03em; font-weight: 600; }
strong { font-weight: 600; color: var(--ink); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

::selection { background: var(--accent); color: #fff; }

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

.icon {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    transform: translateY(-160%);
    transition: transform .2s;
}
.skip-link:focus { transform: none; }

.scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 2px;
    z-index: 200;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(0);
}

/* ==========================================================================
   Buttons, badges, tags
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55em;
    min-height: 50px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 500;
    font-size: .95rem;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform .25s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: .88rem; }
.btn--block { width: 100%; }
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }

.btn--accent { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn--accent { color: #0E0E0D; }
.btn--accent:hover { transform: translateY(-2px); }

.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover { background: var(--accent); color: #fff; }

.btn--line { border-color: var(--line); color: var(--ink); }
.btn--line:hover { border-color: var(--ink); }

.btn--inv-line { border-color: var(--inv-line); color: var(--inv-text); }
.btn--inv-line:hover { border-color: var(--inv-text); }
.btn--inv-line:hover .icon { transform: none; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--muted);
    white-space: nowrap;
}
.badge--live { border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); }
.badge--progress { border-color: color-mix(in srgb, var(--warning) 40%, transparent); color: var(--warning); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: .8rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition: background-color .3s, border-color .3s;
}
.header.is-scrolled,
.header.is-open {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom-color: var(--line);
}
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand__mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--ink);
    color: var(--bg);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: 0;
}
.brand__mark::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.nav__list {
    display: flex;
    gap: 2px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.nav__link {
    display: block;
    padding: 7px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 500;
    transition: color .2s, background-color .2s;
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--bg); background: var(--ink); }

.header__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--ink);
    border: 1px solid var(--line);
    transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn .icon { position: absolute; width: 18px; height: 18px; transition: transform .35s var(--ease), opacity .25s; }

.icon--moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme="dark"] .icon--sun { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-theme="dark"] .icon--moon { opacity: 1; transform: none; }

.menu-btn { display: none; }
.icon--close { opacity: 0; transform: rotate(-90deg); }
.header.is-open .icon--open { opacity: 0; transform: rotate(90deg); }
.header.is-open .icon--close { opacity: 1; transform: none; }

.mobile-nav { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative;
    padding-top: calc(var(--header-h) + clamp(32px, 6vw, 72px));
    padding-bottom: clamp(48px, 6vw, 80px);
}
.hero__grid {
    display: grid;
    grid-template-columns: 1.35fr .85fr;
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: .78rem;
    letter-spacing: .02em;
    color: var(--muted);
}
.status__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.status__dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--success);
    animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.hero__title { margin-top: 20px; font-weight: 600; }
.hero__name {
    display: block;
    font-size: clamp(3.2rem, 9vw, 7.25rem);
    line-height: .92;
    letter-spacing: -0.05em;
    font-variation-settings: "opsz" 96;
}
.hero__role {
    display: block;
    margin-top: 18px;
    font-size: clamp(1.6rem, 3.4vw, 2.6rem);
    line-height: 1.1;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: -0.035em;
}
.hero__role em { color: var(--accent); font-size: 1.12em; }

.hero__lead { margin-top: 24px; max-width: 32rem; font-size: 1.05rem; color: var(--muted); }
.hero__cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Phone mockup ---------- */
.hero__visual {
    position: relative;
    justify-self: center;
    width: min(100%, 320px);
    padding: 24px 0;
}
.halo {
    position: absolute;
    inset: 8% -18% 2%;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
    filter: blur(10px);
    z-index: -1;
}
.phone {
    position: relative;
    aspect-ratio: 9 / 19;
    padding: 10px;
    border-radius: 48px;
    background: #111;
    box-shadow:
        inset 0 0 0 1.5px #3a3a3a,
        0 0 0 1px rgba(0,0,0,.08),
        0 40px 80px -30px rgba(18, 18, 18, .45),
        0 20px 40px -20px color-mix(in srgb, var(--accent) 40%, transparent);
    transform: rotate(-3deg);
    transition: transform .8s var(--ease);
}
.hero__visual:hover .phone { transform: rotate(0deg) translateY(-6px); }
.phone__screen {
    position: relative;
    height: 100%;
    border-radius: 38px;
    overflow: hidden;
    background: #FBFAF7;
    color: #121212;
    display: flex;
    flex-direction: column;
}
.phone__status {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px 0 26px;
    font-family: var(--font);
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
}
.phone__island { width: 84px; height: 24px; border-radius: 999px; background: #000; }
.phone__sys { display: flex; gap: 3px; align-items: flex-end; }
.phone__sys i { display: block; width: 3px; background: #fff; border-radius: 1px; }
.phone__sys i:nth-child(1) { height: 5px; }
.phone__sys i:nth-child(2) { height: 7px; }
.phone__sys i:nth-child(3) { height: 9px; }
.phone__photo { position: relative; flex: 0 0 56%; overflow: hidden; background: #2A6FD6; }
.phone__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.phone__photo::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(transparent, #FBFAF7);
}
.phone__body { position: relative; flex: 1; padding: 0 20px 20px; margin-top: -26px; display: flex; flex-direction: column; }
.phone__name { font-family: var(--display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.phone__title { font-size: .78rem; color: #64625C; }
.phone__stats {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #E6E2D8;
    border-radius: 14px;
    background: #fff;
}
.phone__stats div { padding: 8px 4px; text-align: center; line-height: 1.2; }
.phone__stats div + div { border-left: 1px solid #E6E2D8; }
.phone__stats b { display: block; font-family: var(--display); font-size: 1rem; }
.phone__stats span { font-size: .62rem; color: #64625C; }
.phone__btn {
    margin-top: auto;
    padding: 11px;
    border-radius: 999px;
    background: #121212;
    color: #fff;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
}

.notif {
    position: absolute;
    left: -64px;
    bottom: 18%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 10px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    box-shadow: 0 20px 40px -20px rgba(0,0,0,.35);
    font-size: .82rem;
    line-height: 1.3;
    animation: float 6s ease-in-out infinite;
}
.notif b { display: block; font-weight: 600; }
.notif small { color: var(--muted); font-size: .75rem; }
.notif__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; }
[data-theme="dark"] .notif__icon { color: #0E0E0D; }
.notif__icon .icon { width: 16px; height: 16px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee {
    overflow: hidden;
    border-block: 1px solid var(--line);
    padding-block: 18px;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee ul { display: flex; flex-shrink: 0; }
.marquee li {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-right: 40px;
    font-family: var(--display);
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    white-space: nowrap;
}
.marquee li::after { content: "✦"; font-size: .6em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--line); }

.split {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: clamp(24px, 4vw, 56px);
}

.label {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--mono);
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 10px;
}
.label span { color: var(--accent); }
.split > .label { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.label--inv { color: var(--inv-muted); }

.section__title {
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    margin-bottom: clamp(28px, 4vw, 48px);
}

/* ---------- About ---------- */
.statement {
    font-size: clamp(1.6rem, 3.3vw, 2.6rem);
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.035em;
}
.statement em { color: var(--accent); font-size: 1.08em; }
.about__cols {
    margin-top: clamp(32px, 5vw, 56px);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(28px, 4vw, 56px);
}
.prose { color: var(--muted); font-size: 1.02rem; }
.prose p + p { margin-top: 14px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.stats div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.stats div:nth-child(odd) { padding-right: 16px; }
.stats div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.stats dt { font-size: .78rem; color: var(--muted); }
.stats dd {
    margin: 2px 0 0;
    font-family: var(--display);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.1;
}
.stats dd.stats__sm { font-size: 1.15rem; letter-spacing: -0.02em; padding-top: 8px; }

/* ---------- Rows (experience / education) ---------- */
.rows { border-top: 1px solid var(--line); }
.row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    padding-block: clamp(24px, 3vw, 36px);
    border-bottom: 1px solid var(--line);
}
.row__date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--muted);
    padding-top: 6px;
}
.row__title { font-size: clamp(1.3rem, 2.2vw, 1.65rem); }
.row__sub { margin-top: 4px; color: var(--muted); }
.job .row__sub { color: var(--accent); font-weight: 500; }

.rows--compact .row { padding-block: 22px; }
.rows--compact .row__title { font-size: clamp(1.1rem, 1.8vw, 1.3rem); }
.rows--compact .row__date { padding-top: 3px; }

.job__list { margin: 18px 0 20px; display: grid; gap: 8px; color: var(--muted); }
.job__list li { position: relative; padding-left: 22px; }
.job__list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .72em;
    width: 10px;
    height: 1.5px;
    background: var(--accent);
}

/* ---------- Work list ---------- */
.work { border-top: 1px solid var(--line); }
.work__item {
    position: relative;
    display: grid;
    grid-template-columns: 40px 56px 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 22px 16px;
    margin-inline: -16px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    transition: background-color .3s var(--ease);
}
.work__item:hover { background: var(--surface); }
.work__num { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.work__text h3 {
    font-size: clamp(1.3rem, 2.4vw, 1.85rem);
    transition: transform .4s var(--ease), color .2s;
}
.work__item:hover .work__text h3 { transform: translateX(6px); color: var(--accent); }
.work__text p { margin-top: 4px; color: var(--muted); font-size: .95rem; }
.work__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-size: .82rem;
    color: var(--muted);
    text-align: right;
}

.app-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 15px;
    color: #fff;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -10px rgba(0,0,0,.5);
    transition: transform .4s var(--ease);
}
.work__item:hover .app-icon { transform: rotate(-6deg) scale(1.05); }
.app-icon .icon { width: 24px; height: 24px; }
.app-icon--gold { background: linear-gradient(145deg, #F4C443, #C98500); }
.app-icon--blue { background: linear-gradient(145deg, #5C7CFF, #2F45D8); }
.app-icon--teal { background: linear-gradient(145deg, #34C8B0, #0E7A72); }
.app-icon--violet { background: linear-gradient(145deg, #A98BF7, #6A34D6); font-size: .82rem; }
.app-icon--rose { background: linear-gradient(145deg, #FB7F8F, #C2264A); }
.app-icon--ink { background: linear-gradient(145deg, #3A3A38, #121212); }
[data-theme="dark"] .app-icon--ink { background: linear-gradient(145deg, #F3F1EC, #BDB9AF); color: #121212; }

/* ---------- Skills ---------- */
.skills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}
.skill {
    padding: 24px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background-color .3s;
}
.skill:hover { background: var(--surface); }
.skill h3 { font-size: 1.15rem; letter-spacing: -0.02em; }
.skill ul { margin-top: 12px; display: grid; gap: 4px; }
.skill li { color: var(--muted); font-size: .95rem; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
    padding-block: clamp(72px, 10vw, 136px);
    background: var(--inv-bg);
    color: var(--inv-text);
}
[data-theme="dark"] .contact { border-top: 1px solid var(--line); }
.contact__title {
    margin-top: 24px;
    font-size: clamp(2.6rem, 8vw, 6.5rem);
    line-height: .98;
    letter-spacing: -0.05em;
}
.contact__title em { color: var(--accent); font-size: 1.05em; }
:root:not([data-theme="dark"]) .contact__title em { color: #8C9EFF; }

.contact__mail {
    margin-top: clamp(36px, 5vw, 56px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--inv-line);
}
.contact__email {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--display);
    font-size: clamp(1.35rem, 3.6vw, 2.5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
    transition: background-size .5s var(--ease);
}
.contact__email:hover { background-size: 100% 1.5px; }
.contact__email .icon { width: .8em; height: .8em; transition: transform .3s var(--ease); }
.contact__email:hover .icon { transform: translate(3px, -3px); }

.contact__list { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.contact__list a, .contact__list span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--inv-muted);
    transition: color .2s;
}
.contact__list a:hover { color: var(--inv-text); }

/* ---------- Footer ---------- */
.footer { background: var(--inv-bg); color: var(--inv-muted); font-size: .85rem; }
.footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-block: 24px 32px;
    border-top: 1px solid var(--inv-line);
}
.footer__top { display: inline-flex; align-items: center; gap: 6px; color: var(--inv-text); }
.footer__top:hover { color: var(--accent); }
.footer__top .icon { transform: rotate(-45deg); }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 300;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: .9rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity .25s, transform .35s var(--ease);
}
[data-theme="dark"] .toast { color: #0E0E0D; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.js .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .9s var(--ease), transform .9s var(--ease);
    transition-delay: var(--delay, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
    .skills { grid-template-columns: repeat(2, 1fr); }
    .split { grid-template-columns: 1fr; gap: 16px; }
    .split > .label { position: static; padding-top: 0; }
    .notif { left: -32px; }
}

@media (max-width: 900px) {
    .nav, .header__cta { display: none; }
    .menu-btn { display: grid; }

    .mobile-nav {
        display: block;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        padding: 8px var(--gutter) 24px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .25s, transform .3s var(--ease), visibility .25s;
    }
    .header.is-open .mobile-nav { opacity: 1; visibility: visible; transform: none; }
    .mobile-nav ul { display: grid; }
    .mobile-nav a:not(.btn) {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
        font-family: var(--display);
        font-size: 1.5rem;
        font-weight: 500;
        letter-spacing: -0.03em;
    }
    .mobile-nav a.is-active { color: var(--accent); }
    .mobile-nav li:last-child { margin-top: 20px; }

    .hero__grid { grid-template-columns: 1fr; }
    .hero__visual { width: min(66%, 260px); }
    .br-lg { display: none; }

    .about__cols { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    :root { --header-h: 64px; }
    .hero__cta .btn { flex: 1 1 auto; }
    .notif { left: -40px; bottom: 16%; padding: 8px 12px 8px 8px; }
    .notif small { display: none; }

    .row { grid-template-columns: 1fr; gap: 8px; }
    .row__date { flex-direction: row; align-items: center; flex-wrap: wrap; padding-top: 0; }

    .work__item { grid-template-columns: 48px 1fr; gap: 14px 16px; align-items: start; padding-block: 20px; }
    .work__num { display: none; }
    .app-icon { width: 48px; height: 48px; border-radius: 13px; }
    .work__meta { grid-column: 2; flex-direction: row; align-items: center; text-align: left; }

    .skills { grid-template-columns: 1fr 1fr; }
    .skill { padding: 18px 16px; }

    .footer__inner { flex-direction: column; }
}

@media (max-width: 380px) {
    .skills { grid-template-columns: 1fr; }
}

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