/* ==========================================================================
   ET.dev — Editorial / Swiss redesign
   Bone · Ink · Signal Orange. Condensed display (Anton) · Manrope body · Space Mono labels.
   Motion only animates transform / opacity / clip-path.
   ========================================================================== */
:root {
    --paper: #ece9e2;
    --paper-2: #e2ded5;
    --ink: #0f0f0e;
    --ink-2: #1a1a18;
    --orange: #ff4a1c;
    --orange-2: #ff6a3f;

    --display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
    --body: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --ease: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
    --gutter: clamp(16px, 3.2vw, 44px);

    /* theme (light by default) */
    --bg: var(--paper);
    --fg: var(--ink);
    --mid: rgba(15, 15, 14, 0.58);
    --line: rgba(15, 15, 14, 0.16);
    --card: var(--paper-2);
    --hi: var(--orange);
    --hi-ink: var(--ink);
}

body[data-theme="dark"] {
    --bg: var(--ink);
    --fg: var(--paper);
    --mid: rgba(236, 233, 226, 0.56);
    --line: rgba(236, 233, 226, 0.15);
    --card: var(--ink-2);
    --hi: var(--orange);
    --hi-ink: var(--ink);
}

body[data-theme="accent"] {
    --bg: var(--orange);
    --fg: var(--ink);
    --mid: rgba(15, 15, 14, 0.66);
    --line: rgba(15, 15, 14, 0.25);
    --card: var(--orange-2);
    --hi: var(--ink);
    --hi-ink: var(--paper);
}

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

html {
    font-family: var(--body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--paper);
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    overflow-x: hidden;
    overflow-x: clip;
    transition: background-color 0.55s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--orange); color: var(--ink); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }

.mono {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-style: normal;
    font-size: 0.7rem;
}

.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}
section { position: relative; }

/* ==========================================================================
   CHARACTER ROLL — each letter flips up with a stagger (text-shadow copy)
   ========================================================================== */
[data-roll] { display: inline-flex; overflow: hidden; line-height: 1.2; height: 1.2em; vertical-align: top; }
[data-roll] .ch {
    display: inline-block;
    white-space: pre;
    text-shadow: 0 1.2em currentColor;
    transition: transform 0.6s var(--ease);
    transition-delay: calc(var(--i) * 22ms);
}
a:hover [data-roll] .ch,
button:hover [data-roll] .ch,
a:focus-visible [data-roll] .ch { transform: translateY(-1.2em); }

/* ==========================================================================
   PRELOADER — shutters
   ========================================================================== */
.loader { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.shutter {
    position: absolute;
    left: 0;
    right: 0;
    height: 50.5%;
    background: var(--ink);
    will-change: transform;
}
.shutter-top { top: 0; }
.shutter-bottom { bottom: 0; }
.loader-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--paper);
}
.loader-word {
    display: flex;
    overflow: hidden;
    font-size: clamp(3.5rem, 12vw, 10rem);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 0.9;
}
.loader-word span { display: inline-block; will-change: transform; }
.loader-word .o { color: var(--orange); }
.loader-meta {
    display: flex;
    gap: 32px;
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: rgba(236, 233, 226, 0.6);
}
.loader-meta b { color: var(--orange); font-weight: 500; }
@keyframes loaderFailsafe { to { visibility: hidden; } }
html.js .loader { animation: loaderFailsafe 0.1s 4.5s forwards; }
html.js.loaded .loader { animation: none; }
html:not(.js) .loader { display: none; }

/* ==========================================================================
   CURSOR — precise dot + trailing ring that morphs per context
   Native cursor is only hidden once the custom one is active & visible.
   ========================================================================== */
.c-dot,
.c-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 300;
    opacity: 0;
    will-change: transform;
    transition: opacity 0.25s;
}
.c-dot {
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 2px var(--bg);
}
body[data-theme="accent"] .c-dot { background: var(--ink); }
.c-ring {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    display: grid;
    place-items: center;
}
.c-shape {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--fg);
    opacity: 0.45;
    transition: transform 0.5s var(--ease), background-color 0.35s, border-color 0.35s, opacity 0.35s;
}
.c-label {
    position: relative;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.25s, transform 0.45s var(--ease);
}

/* states */
html.c-on .c-dot,
html.c-on .c-ring { opacity: 1; }
html.c-link .c-shape { transform: scale(1.4); border-color: var(--fg); border-width: 1.5px; opacity: 1; }
html.c-link .c-dot { background: var(--fg); }
html.c-down .c-shape { transform: scale(0.75); }
html.c-link.c-down .c-shape { transform: scale(1.15); }
html.c-view .c-shape { transform: scale(2.1); background: var(--orange); border-color: var(--orange); opacity: 1; }
html.c-view .c-label { opacity: 1; transform: scale(1); }
html.c-view .c-dot { opacity: 0; }
html.c-text .c-ring,
html.c-text .c-dot { opacity: 0; }

@media (hover: hover) and (pointer: fine) {
    html.c-on body,
    html.c-on a,
    html.c-on button,
    html.c-on [tabindex] { cursor: none; }
    html.c-on input,
    html.c-on textarea { cursor: text; }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px var(--gutter);
    color: var(--fg);
    transition: transform 0.7s var(--ease), color 0.6s;
}
.main-header.hidden { transform: translateY(-120%); }
.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 28px;
}
.logo {
    font-size: 1.3rem;
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
}
.logo span { color: var(--hi); transition: color 0.6s; }
.nav-clock { display: inline-flex; align-items: center; gap: 8px; opacity: 0.85; }
.nav-clock b { font-weight: 500; }
.nav-clock .dot { background: var(--hi); }
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--orange);
    display: inline-block;
    animation: blink 1.6s steps(2, start) infinite;
}
@keyframes blink { to { opacity: 0.2; } }

.nav-menu { display: flex; justify-content: flex-end; gap: 22px; }
.nav-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 0.86rem;
    font-weight: 500;
    position: relative;
}
.nav-link i { font-size: 0.56rem; opacity: 0.5; margin-top: 1px; }
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s var(--ease);
}
.nav-link.active::after { transform: scaleX(1); transform-origin: left; }

.sound-toggle { display: inline-flex; align-items: center; gap: 8px; }
.eq { display: inline-flex; gap: 2px; height: 12px; align-items: center; }
.eq i { width: 2px; height: 12px; background: currentColor; animation: eq 0.8s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.55s; }
.sound-toggle.muted .eq i { animation: none; transform: scaleY(0.25); }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

.hamburger-menu { display: none; }
.menu-word { display: inline-flex; flex-direction: column; overflow: hidden; height: 1.2em; line-height: 1.2; font-size: 0.82rem; }
.menu-word > span { transition: transform 0.6s var(--ease); }
.hamburger-menu.active .menu-word > span { transform: translateY(-100%); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 18px;
    height: 60px;
    font-size: 1rem;
    font-weight: 600;
    isolation: isolate;
}
.btn-solid {
    padding: 0 10px 0 26px;
    background: var(--fg);
    color: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    transition: color 0.5s var(--ease);
}
.btn-bg {
    position: absolute;
    inset: 0;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.7s var(--ease);
    z-index: -1;
}
.btn-solid:hover .btn-bg { transform: scaleX(1); transform-origin: left; }
.btn-solid:hover { color: var(--ink); }
.btn-arrow {
    width: 42px;
    height: 42px;
    border-radius: 3px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    background: var(--bg);
    color: var(--fg);
    transition: transform 0.7s var(--ease), background-color 0.4s;
}
.btn-arrow { overflow: hidden; }
.btn-arrow i { font-style: normal; display: inline-block; text-shadow: -42px 0 currentColor; transition: transform 0.7s var(--ease); }
.btn:hover .btn-arrow i { transform: translateX(42px); }
.btn-solid:hover .btn-arrow { background: var(--ink); color: var(--orange); }
.btn-ink { background: var(--ink); color: var(--orange); }
.btn-ink .btn-bg { background: var(--paper); }
.btn-ink .btn-arrow { background: var(--orange); color: var(--ink); }

.btn-line {
    padding: 0 4px;
    gap: 10px;
}
.btn-line::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    height: 2px;
    background: currentColor;
    transform-origin: right;
    transition: transform 0.6s var(--ease);
}
.btn-line:hover::after { animation: lineRedraw 0.9s var(--ease) forwards; }
@keyframes lineRedraw {
    0% { transform: scaleX(1); transform-origin: right; }
    45% { transform: scaleX(0); transform-origin: right; }
    46% { transform: scaleX(0); transform-origin: left; }
    100% { transform: scaleX(1); transform-origin: left; }
}
.btn-line .btn-arrow { width: 1.1em; height: 1.2em; background: none; color: var(--orange); }
.btn-line .btn-arrow i { text-shadow: -1.1em 1.1em currentColor; }
.btn-line:hover .btn-arrow i { transform: translate(1.1em, -1.1em); }

/* ==========================================================================
   SECTION HEADINGS
   ========================================================================== */
.section-head { margin-bottom: clamp(48px, 7vw, 100px); }
.section-head--split { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.subtitle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--mid);
}
.subtitle b {
    font-weight: 500;
    color: var(--bg);
    background: var(--fg);
    padding: 2px 6px;
    border-radius: 2px;
}
.section-title {
    font-family: var(--display);
    font-size: clamp(3.4rem, 9.6vw, 10rem);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    max-width: 12ch;
}
.section-title--xl { font-size: clamp(4rem, 13vw, 14rem); max-width: none; }
.head-note { color: var(--mid); }

/* word masks */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.w > span { display: inline-block; will-change: transform; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: stretch;
    padding: 96px 0 36px;
}
.hero-section .container { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.status-badge { display: inline-flex; align-items: center; gap: 10px; }
.hero-index span { color: var(--mid); }

.hero-headline {
    font-family: var(--display);
    font-size: clamp(3rem, 9vw, 10rem);
    font-weight: 400;
    line-height: 0.96;
    letter-spacing: 0.005em;
    text-transform: uppercase;
}
.hl-row { display: block; white-space: nowrap; }
.hl-accent { color: var(--orange); }
.pill {
    display: inline-block;
    width: 1.75em;
    height: 0.74em;
    border-radius: 999px;
    overflow: hidden;
    vertical-align: 0.02em;
    margin-right: 0.04em;
    background: var(--fg);
    transform-origin: left center;
}
.pill img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.4); will-change: transform; }

.hero-bottom {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: clamp(24px, 4vw, 64px);
    align-items: end;
}
.hero-subtext { max-width: 440px; font-size: 1.05rem; color: var(--mid); line-height: 1.5; }
.hero-actions { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.hero-badge { position: relative; width: 116px; height: 116px; }
.hero-badge svg { width: 100%; height: 100%; animation: spin 14s linear infinite; }
.hero-badge text { font-family: var(--mono); font-size: 15.5px; letter-spacing: 1.5px; text-transform: uppercase; fill: var(--fg); }
.badge-arrow {
    position: absolute;
    inset: 34px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    font-weight: 700;
    animation: bob 2s var(--ease-io) infinite alternate;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { to { transform: translateY(5px); } }

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-section { padding: clamp(110px, 14vw, 200px) 0; }
.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 110px);
    align-items: start;
}
.about-aside { position: sticky; top: 110px; }
.profile-card { position: relative; }
.profile-frame {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 6px;
    background: var(--card);
    clip-path: inset(0 0 0 0);
}
.profile-image { width: 100%; height: 118%; object-fit: cover; will-change: transform; }
.profile-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    margin-top: 14px;
}
.profile-label strong { font-weight: 700; letter-spacing: -0.02em; }
.profile-label span { color: var(--mid); }

.about-text p {
    font-size: clamp(1.25rem, 2.15vw, 2rem);
    line-height: 1.25;
    font-weight: 500;
    letter-spacing: -0.025em;
    margin-bottom: 1em;
    max-width: 30ch;
}
.about-text p:first-child::first-letter { color: var(--orange); }
.about-highlights { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 48px; }
.highlight-badge {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 0.98rem;
    font-weight: 500;
    isolation: isolate;
    transition: color 0.5s var(--ease), border-color 0.5s;
}
.highlight-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--orange);
    border-radius: inherit;
    transform: translateY(101%);
    transition: transform 0.6s var(--ease);
    z-index: -1;
}
.highlight-badge:hover { color: var(--ink); border-color: var(--orange); }
.highlight-badge:hover::before { transform: translateY(0); }

/* ==========================================================================
   SKILLS — horizontal pinned track (desktop) / swipe (mobile)
   ========================================================================== */
.skills-section { padding: clamp(100px, 12vw, 160px) 0 clamp(80px, 10vw, 140px); }
.skills-pin { display: flex; flex-direction: column; justify-content: center; }
.skills-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(36px, 5vw, 64px); }
.skills-head .section-head, .skills-head .section-title { margin-bottom: 0; }
.skills-counter { display: flex; align-items: center; gap: 10px; color: var(--mid); }
.skills-counter b { color: var(--fg); font-weight: 500; }
.skills-bar { position: relative; width: 120px; height: 2px; background: var(--line); overflow: hidden; }
.skills-bar i { position: absolute; inset: 0; background: var(--orange); transform-origin: left; transform: scaleX(0.111); }

.skills-viewport { overflow: hidden; }
.skills-grid {
    display: flex;
    gap: 16px;
    padding: 0 var(--gutter);
    width: max-content;
    will-change: transform;
}
.skill-card {
    position: relative;
    border: 1px solid var(--line);
    width: clamp(260px, 26vw, 380px);
    height: clamp(340px, 52vh, 480px);
    flex: none;
    padding: 28px;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: 6px;
    overflow: hidden;
    isolation: isolate;
    transition: color 0.5s var(--ease);
}
.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ink);
    clip-path: circle(0% at 100% 0%);
    transition: clip-path 0.8s var(--ease);
    z-index: -1;
}
.skill-card:hover { color: var(--paper); }
.skill-card:hover .skill-num { -webkit-text-stroke-color: var(--orange); opacity: 1; }
.skill-card:hover::before { clip-path: circle(150% at 100% 0%); }
.skill-num {
    font-size: clamp(4rem, 7vw, 6.4rem);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 0.8;
    color: transparent;
    -webkit-text-stroke: 1.2px var(--fg);
    opacity: 0.6;
    transition: -webkit-text-stroke-color 0.5s;
}
.skill-icon {
    position: absolute;
    top: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--orange);
    color: var(--ink);
    transition: transform 0.8s var(--ease);
}
.skill-card:hover .skill-icon { transform: rotate(360deg) scale(1.1); }
.skill-card h3 {
    margin-top: auto;
    font-size: clamp(2.4rem, 3.4vw, 3.2rem);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    line-height: 1;
}
.skill-card p { margin-top: 12px; font-size: 0.95rem; opacity: 0.72; max-width: 30ch; }

/* ==========================================================================
   PROJECTS — index rows + floating preview
   ========================================================================== */
.projects-section { padding: clamp(100px, 12vw, 170px) 0; }
.projects-grid { border-top: 1px solid var(--fg); }
.project-card {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1.25fr) minmax(0, 1fr) auto;
    gap: 24px 32px;
    align-items: center;
    padding: clamp(26px, 3vw, 40px) 0;
    border-bottom: 1px solid var(--line);
    isolation: isolate;
}
.project-card::before {
    content: '';
    position: absolute;
    inset: 0 calc(var(--gutter) * -1);
    background: var(--fg);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s var(--ease);
    z-index: -1;
}
.row-num { color: var(--mid); align-self: start; padding-top: 0.6em; transition: color 0.4s; }
.project-title {
    font-size: clamp(2.6rem, 5.2vw, 5.6rem);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 0.92;
    text-transform: uppercase;
    transition: transform 0.7s var(--ease), color 0.4s;
}
.project-description { color: var(--mid); font-size: 0.95rem; max-width: 46ch; transition: color 0.4s; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.project-tags span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 0.66rem; transition: border-color 0.4s; }
.btn-project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--fg);
    border-radius: 999px;
    transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.btn-project-link .ar { transition: transform 0.6s var(--ease); }
.btn-project-link:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn-project-link:hover .ar { transform: rotate(45deg); }

@media (hover: hover) and (min-width: 1025px) {
    .project-card:hover::before { transform: scaleY(1); transform-origin: top; }
    .project-card:hover { color: var(--bg); }
    .project-card:hover .project-title { transform: translateX(18px); color: var(--orange); }
    .project-card:hover .row-num,
    .project-card:hover .project-description { color: var(--bg); opacity: 0.75; }
    .project-card:hover .project-tags span { border-color: currentColor; }
    .project-card:hover .btn-project-link { border-color: var(--bg); }
    .project-card:hover .btn-project-link:hover { border-color: var(--orange); }
    .row-media { display: none; }
}

.row-media {
    position: relative;
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: var(--ink);
}
.project-img { width: 100%; height: 100%; object-fit: cover; }
.code-tag {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 6px 10px;
    background: var(--paper);
    color: var(--ink);
    border-radius: 3px;
    font-size: 0.66rem;
    z-index: 2;
}

/* floating preview */
.preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 380px;
    height: 250px;
    margin: -125px 0 0 -190px;
    border-radius: 8px;
    overflow: hidden;
    pointer-events: none;
    z-index: 50;
    visibility: hidden;
    will-change: transform;
}
.preview-track { position: absolute; inset: 0; will-change: transform; }
.preview-track .row-media { display: block; position: absolute; left: 0; right: 0; height: 100%; aspect-ratio: auto; border-radius: 0; }

/* project art (orange on ink) */
.art { position: absolute; inset: 0; overflow: hidden; }
.art-agent {
    background-image: linear-gradient(rgba(236,233,226,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(236,233,226,.07) 1px, transparent 1px);
    background-size: 28px 28px;
}
.art-agent svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-agent path { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 5 6; fill: none; vector-effect: non-scaling-stroke; animation: dash 2.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -44; } }
.art-agent .n { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--paper); }
.art-agent .n1 { left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; background: var(--orange); box-shadow: 0 0 0 10px rgba(255,74,28,.18); animation: pulseRing 2s var(--ease) infinite; }
.art-agent .n2 { left: 17.5%; top: 23%; }
.art-agent .n3 { left: 82.5%; top: 21%; }
.art-agent .n4 { left: 77.5%; top: 79%; }
@keyframes pulseRing { 50% { box-shadow: 0 0 0 22px rgba(255,74,28,0); } }

.art-dash { padding: 22px; display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; }
.art-dash > * { border: 1px solid rgba(236,233,226,.14); border-radius: 6px; padding: 12px; }
.art-dash .bars { grid-row: span 2; display: flex; align-items: flex-end; gap: 7%; }
.art-dash .bars i { flex: 1; background: var(--orange); border-radius: 2px; transform-origin: bottom; animation: bars 2.4s var(--ease-io) infinite alternate; }
.art-dash .bars i:nth-child(odd) { background: var(--paper); }
.art-dash .bars i:nth-child(1) { height: 40%; animation-delay: -.3s; }
.art-dash .bars i:nth-child(2) { height: 70%; animation-delay: -1s; }
.art-dash .bars i:nth-child(3) { height: 52%; animation-delay: -1.6s; }
.art-dash .bars i:nth-child(4) { height: 88%; animation-delay: -.6s; }
.art-dash .bars i:nth-child(5) { height: 60%; animation-delay: -2s; }
.art-dash .bars i:nth-child(6) { height: 76%; animation-delay: -1.2s; }
.art-dash .bars i:nth-child(7) { height: 46%; animation-delay: -.2s; }
@keyframes bars { from { transform: scaleY(.5); } to { transform: scaleY(1); } }
.art-dash .spark { width: 100%; height: 100%; }
.art-dash .spark path { fill: none; stroke: var(--orange); stroke-width: 2; vector-effect: non-scaling-stroke; }
.art-dash .kpi { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.art-dash .kpi b { height: 8px; border-radius: 4px; background: rgba(236,233,226,.2); }
.art-dash .kpi b:first-child { width: 78%; background: var(--paper); }
.art-dash .kpi b:last-child { width: 50%; }

.art-flow { display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 24px; }
.art-flow .fr { display: flex; align-items: center; }
.art-flow .fr + .fr { padding-left: 10%; opacity: .65; }
.art-flow span { flex: none; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; color: var(--paper); border: 1px solid rgba(236,233,226,.25); border-radius: 4px; padding: 9px 12px; }
.art-flow span:nth-child(3) { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.art-flow i { flex: 1; height: 1px; margin: 0 4px; background: rgba(236,233,226,.2); position: relative; overflow: hidden; }
.art-flow i::after { content: ''; position: absolute; top: -1px; height: 3px; width: 30%; background: var(--orange); animation: packet 1.6s var(--ease-io) infinite; }
.art-flow .fr + .fr i::after { animation-delay: -.8s; }
@keyframes packet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.art-lumen { display: grid; place-items: center; background: var(--orange); }
.art-lumen .lw { font-family: var(--display); font-size: clamp(4.5rem, 11vw, 9rem); font-weight: 400; letter-spacing: 0; text-transform: uppercase; color: var(--ink); position: relative; z-index: 1; }
.art-lumen .lc { position: absolute; width: 42%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); animation: orbit 7s ease-in-out infinite alternate; }
@keyframes orbit { from { transform: translate(-45%, 12%); } to { transform: translate(45%, -12%); } }

.art-kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 22px; background: var(--paper-2); }
.art-kanban .kc { display: flex; flex-direction: column; gap: 9px; padding: 10px; border-radius: 6px; background: rgba(15,15,14,.06); }
.art-kanban i { display: block; height: 36px; border-radius: 4px; background: rgba(15,15,14,.12); }
.art-kanban i.h { background: var(--orange); animation: lift 2.8s var(--ease-io) infinite alternate; }
.art-kanban .kc:nth-child(2) i.h { background: var(--ink); animation-delay: -1.4s; }
@keyframes lift { to { transform: translateY(-8px) rotate(-3deg); } }

/* ==========================================================================
   SERVICES — expanding panels
   ========================================================================== */
.services-section { padding: clamp(100px, 12vw, 170px) 0; }
.services-grid { display: flex; gap: 12px; height: clamp(440px, 62vh, 580px); }
.service-card {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    border-radius: 6px;
    background: var(--card);
    overflow: hidden;
    padding: 26px;
    outline: none;
    isolation: isolate;
    transition: flex-grow 0.9s var(--ease), background-color 0.5s, color 0.5s;
}
.service-card.is-active { flex-grow: 3.4; background: var(--orange); color: var(--ink); }
.service-decor {
    font-size: clamp(3rem, 5vw, 5rem);
    font-family: var(--display);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 0.8;
}
.service-vert {
    position: absolute;
    left: 26px;
    bottom: 26px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--display);
    font-size: 1.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: opacity 0.4s;
}
.service-card.is-active .service-vert { opacity: 0; }
.service-body {
    position: absolute;
    left: 26px;
    bottom: 26px;
    width: min(520px, calc(100vw - 2 * var(--gutter) - 52px));
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.4s, transform 0.8s var(--ease);
    pointer-events: none;
}
.service-card.is-active .service-body { opacity: 1; transform: none; transition-delay: 0.25s; pointer-events: auto; }
.service-body h3 {
    font-size: clamp(2.4rem, 4vw, 4rem);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 0.92;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.service-body p { font-size: 1rem; max-width: 46ch; opacity: 0.8; }

/* ==========================================================================
   EXPERIENCE — outline years fill on scroll
   ========================================================================== */
.experience-section { padding: clamp(100px, 12vw, 170px) 0; }
.timeline-item {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 24px 48px;
    padding: clamp(28px, 3.5vw, 48px) 0;
    border-top: 1px solid var(--line);
    align-items: start;
}
.timeline-item:last-child { border-bottom: 1px solid var(--line); }
.timeline-date {
    position: relative;
    font-size: clamp(3.2rem, 8vw, 8.6rem);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 0.9;
    text-transform: uppercase;
    white-space: nowrap;
}
.td-outline { color: transparent; -webkit-text-stroke: 1.2px var(--fg); }
.td-fill {
    position: absolute;
    inset: 0;
    color: var(--orange);
    clip-path: inset(0 100% 0 0);
    will-change: clip-path;
}
.timeline-content h3 { font-size: clamp(1.4rem, 2.2vw, 2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.timeline-company { color: var(--orange); margin: 8px 0 14px; }
.timeline-content p:last-child { color: var(--mid); max-width: 52ch; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-section { padding: 0 0 clamp(100px, 12vw, 160px); }
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: clamp(70px, 9vw, 130px); }
.ticker-track { display: flex; width: max-content; animation: tick 26s linear infinite; }
.ticker-track span { font-family: var(--mono); text-transform: uppercase; font-size: 0.9rem; padding-right: 48px; white-space: nowrap; }
@keyframes tick { to { transform: translateX(-50%); } }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: 28px; }
.form-group { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 14px; position: relative; }
.form-group::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.8s var(--ease); }
.form-group:focus-within::after { transform: scaleX(1); }
.form-group label { color: var(--mid); }
.form-group input,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--fg);
    font: inherit;
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    resize: vertical;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--mid); opacity: 0.6; }
.contact-form .btn { align-self: flex-start; margin-top: 8px; }
.form-feedback { display: none; padding: 12px 16px; border: 1px solid var(--fg); border-radius: 4px; }
.form-feedback.success { background: var(--ink); color: var(--orange); border-color: var(--ink); }

.contact-info { display: flex; flex-direction: column; gap: 36px; }
.info-label { display: block; color: var(--mid); margin-bottom: 8px; }
.info-item p { font-size: 1.15rem; font-weight: 500; }
.info-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(3.4rem, 7vw, 6.4rem);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    line-height: 1;
}
.info-link [data-roll] { height: 1.05em; line-height: 1.05; }
.info-link .ch { text-shadow: 0 1.05em currentColor !important; }
.info-link:hover .ch { transform: translateY(-1.05em) !important; }
.info-link .ar { font-size: 0.6em; transition: transform 0.6s var(--ease); }
.info-link:hover .ar { transform: rotate(45deg); }
.socials { display: flex; gap: 10px; }
.socialContainer {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ink);
    display: grid;
    place-items: center;
    transition: transform 0.6s var(--ease), background-color 0.4s;
}
.socialSvg { width: 18px; height: 18px; fill: var(--orange); transition: fill 0.4s, transform 0.6s var(--ease); }
.socialContainer:hover { transform: translateY(-6px) rotate(-8deg); background: var(--paper); }
.socialContainer:hover .socialSvg { fill: var(--ink); transform: scale(1.15); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { padding: clamp(60px, 8vw, 100px) 0 24px; overflow: hidden; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.footer-links { display: flex; gap: 28px; font-size: 1.05rem; font-weight: 600; }
.back-to-top { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; transition: background-color 0.4s, color 0.4s, border-color 0.4s; }
.back-to-top:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.back-to-top .ar { transition: transform 0.6s var(--ease); }
.back-to-top:hover .ar { transform: translateY(-3px); }
.footer-mark-wrap { padding: clamp(36px, 5vw, 60px) 0 clamp(20px, 3vw, 36px); }
.footer-mark {
    display: block;
    font-size: 11vw;
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 0.82;
    text-transform: uppercase;
    white-space: nowrap;
}
.footer-mark span { display: inline-block; will-change: transform; }
.footer-mark i { color: var(--orange); font-style: normal; }
.footer-container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--mid); }

/* scroll progress */
.progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 150; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--orange); transform-origin: left; transform: scaleX(0); will-change: transform; }

/* ==========================================================================
   INITIAL STATES (JS on) & fallbacks
   ========================================================================== */
html.js .hero-fade,
html.js [data-fade],
html.js [data-group] > * { opacity: 0; }
html.no-anim .hero-fade,
html.no-anim [data-fade],
html.no-anim [data-group] > * { opacity: 1 !important; transform: none !important; }
html.no-anim .td-fill { clip-path: inset(0 0 0 0); }
html.no-anim section[data-theme="dark"], html.no-anim .footer { background: var(--ink); color: var(--paper); }
html.no-anim section[data-theme="accent"] { background: var(--orange); color: var(--ink); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1180px) {
    .nav-clock { display: none; }
    .nav-container { grid-template-columns: auto 1fr auto; }
}

@media (max-width: 1024px) {
    .hamburger-menu { display: inline-flex; align-items: center; padding: 10px 0 10px 10px; }
    .nav-container { grid-template-columns: auto 1fr auto; }
    .sound-toggle { justify-self: end; }
    .nav-menu {
        position: fixed;
        inset: 0;
        z-index: -1;
        flex-direction: column;
        justify-content: flex-end;
        gap: 2px;
        padding: 100px var(--gutter) 48px;
        background: var(--orange);
        color: var(--ink);
        clip-path: inset(0 0 100% 0);
        transition: clip-path 0.9s var(--ease-io);
        pointer-events: none;
    }
    .main-header.menu-open { color: var(--ink); }
    .main-header.menu-open .logo span { color: var(--hi); transition: color 0.6s; }
    .nav-menu.active { clip-path: inset(0 0 0 0); pointer-events: auto; }
    .nav-link {
        font-size: clamp(2.6rem, 11vw, 4.8rem);
        font-family: var(--display);
        font-weight: 400;
        letter-spacing: 0.005em;
        text-transform: uppercase;
        line-height: 0.95;
        transform: translateY(40px);
        opacity: 0;
        transition: transform 0.8s var(--ease), opacity 0.5s;
    }
    .nav-link i { font-size: 0.7rem; opacity: 0.6; margin-top: 0.5em; }
    .nav-link::after { display: none; }
    .nav-link [data-roll] { height: 1.2em; }
    .nav-menu.active .nav-link { transform: none; opacity: 1; }
    .nav-menu.active .nav-link:nth-child(1) { transition-delay: .25s; }
    .nav-menu.active .nav-link:nth-child(2) { transition-delay: .3s; }
    .nav-menu.active .nav-link:nth-child(3) { transition-delay: .35s; }
    .nav-menu.active .nav-link:nth-child(4) { transition-delay: .4s; }
    .nav-menu.active .nav-link:nth-child(5) { transition-delay: .45s; }
    .nav-menu.active .nav-link:nth-child(6) { transition-delay: .5s; }
    .nav-menu.active .nav-link:nth-child(7) { transition-delay: .55s; }

    .hl-row { white-space: normal; }
    .hero-bottom { grid-template-columns: 1fr; }
    .hero-badge { display: none; }

    .about-layout { grid-template-columns: 1fr; }
    .about-aside { position: relative; top: 0; max-width: 340px; }

    .skills-viewport { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .skills-viewport::-webkit-scrollbar { display: none; }
    .skill-card { scroll-snap-align: start; height: 380px; width: min(78vw, 340px); }
    .skill-card::before { display: none; }

    .project-card { grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
    .project-card .row-info, .project-card .project-links { grid-column: 2; }
    .row-media { grid-column: 1 / -1; }

    .services-grid { flex-direction: column; height: auto; }
    .service-card { flex: none; background: var(--orange); color: var(--ink); min-height: 0; }
    .service-vert { display: none; }
    .service-body { position: relative; left: 0; bottom: 0; width: auto; opacity: 1; transform: none; margin-top: 40px; pointer-events: auto; }

    .timeline-item { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .sound-toggle #soundLabel { display: none; }
    .hero-headline { font-size: 15vw; line-height: 0.92; }
    .section-title, .section-title--xl { font-size: 14vw; }
    .info-link { font-size: 16vw; }
    .hero-top .hero-index { display: none; }
    .hero-actions { width: 100%; }
    .hero-actions .btn-solid { flex: 1; justify-content: space-between; }
    .section-head--split { flex-direction: column; align-items: flex-start; }
    .skills-head { flex-direction: column; align-items: flex-start; }
    .form-group { grid-template-columns: 1fr; gap: 6px; }
    .footer-links { gap: 18px; flex-wrap: wrap; }
    .timeline-date { font-size: 15vw; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
