/* Dark take on the Hermes Agent design language:
   fixed glowing frame, condensed gothic display type, uppercase tracked labels,
   square buttons with a travelling arc border, 150ms ease-out transitions, Lenis scroll. */

:root {
  --bg: #06060c;
  --surface: #0b0b17;
  --surface-2: #11111f;
  --fg: #f2f2f2;
  --fg-2: color-mix(in srgb, var(--fg) 64%, transparent);
  --fg-3: color-mix(in srgb, var(--fg) 40%, transparent);
  --line: color-mix(in srgb, var(--fg) 14%, transparent);
  --brand: #3333f5;          /* Hermes blue (#0000f2) lifted 20% so it reads on black */
  --brand-ink: #8c8cff;
  --accent: #f2f200;         /* Hermes yellow, used for selection */

  --f-display: "Antonio", "Arial Narrow", sans-serif;
  --f-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Space Grotesk", system-ui, sans-serif;
  --f-code: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --frame: 5px;
  --col: 1120px;
  --pad: clamp(20px, 4vw, 48px);
  --btn-h: 36px;
  --ease: cubic-bezier(0, 0, .2, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);

  color-scheme: dark;
  interpolate-size: allow-keywords;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  padding: var(--frame);
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
img, canvas, svg { display: block; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.col { width: 100%; max-width: calc(var(--col) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); }

.eyebrow, .nav-link, .btn, .chips span, .terminal-tabs button, label, .footer-base {
  font-family: var(--f-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.eyebrow { font-size: 12px; color: var(--fg-2); }

/* ---------- Frame ---------- */
.frame {
  --frame-fg: var(--fg);
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  border: var(--frame) solid color-mix(in srgb, var(--brand) 55%, var(--bg));
}
.frame-ambient {
  position: absolute; overflow: clip; contain: strict; pointer-events: none;
  opacity: .3; animation: frame-bloom 42s ease-in-out infinite;
}
.frame-ambient::before {
  content: ""; position: absolute; top: 0; left: 0; width: 300%; height: 300%;
  background: linear-gradient(160deg, transparent 0%, var(--frame-fg) 15%, var(--brand) 20%, var(--bg) 25%, transparent 35% 40%,
    var(--frame-fg) 55%, var(--brand) 60%, var(--bg) 65%, transparent 75% 80%, var(--frame-fg) 95%, var(--brand) 100%);
  animation: frame-arc 14s linear infinite alternate;
}
.frame-ambient.top, .frame-ambient.bottom { left: calc(-1 * var(--frame)); right: calc(-1 * var(--frame)); height: var(--frame); }
.frame-ambient.top { top: calc(-1 * var(--frame)); }
.frame-ambient.bottom { bottom: calc(-1 * var(--frame)); }
.frame-ambient.left, .frame-ambient.right { top: 0; bottom: 0; width: var(--frame); }
.frame-ambient.left { left: calc(-1 * var(--frame)); }
.frame-ambient.right { right: calc(-1 * var(--frame)); }

/* Ring mask: paint only the frame border, not the page */
.frame-click, .frame-scroll {
  position: absolute; inset: calc(-1 * var(--frame)); padding: var(--frame); opacity: 0; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.frame-scroll {
  background:
    radial-gradient(ellipse 120px 240px at 0% var(--scroll-y, 10%), var(--frame-fg), transparent),
    radial-gradient(ellipse 120px 240px at 100% var(--scroll-y, 10%), var(--frame-fg), transparent);
  transition: opacity .6s ease-out;
}
.frame.is-scrolling .frame-scroll { opacity: .45; transition-duration: .16s; }
.frame-click { background: radial-gradient(ellipse 180px 180px at var(--cue-x, 50%) var(--cue-y, 0%), var(--frame-fg), transparent 100%); }
.frame-click.is-cued { animation: frame-cue .9s var(--ease) both; }

@keyframes frame-arc { from { transform: translate(-10%, -10%); } to { transform: translate(-50%, -50%); } }
@keyframes frame-bloom { 0%, 68%, 92%, 100% { opacity: .48; } 80% { opacity: .9; } }
@keyframes frame-cue { from { opacity: .75; } to { opacity: 0; } }

/* ---------- Buttons ---------- */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 12px;
  font-size: 15px; letter-spacing: .02em; line-height: 1;
  border: 0; border-radius: 0; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: color-mix(in srgb, var(--fg) 98%, transparent); color: var(--bg); }
.btn-primary:hover { background: #fff; }
.btn-secondary, .btn-ghost { background: color-mix(in srgb, var(--fg) 12%, transparent); color: var(--fg); }
.btn-secondary:hover, .btn-ghost:hover { background: color-mix(in srgb, var(--fg) 18%, transparent); }
.btn-solid { background: var(--brand); color: var(--fg); }
.btn-solid:hover { background: color-mix(in srgb, var(--brand) 85%, #fff); }
.btn-sm { font-size: 14px; letter-spacing: .1em; height: 32px; padding: 0 10px; }
.btn:disabled { opacity: .5; cursor: progress; }

/* Travelling arc border on hover */
.btn-arc {
  --arc-tail: color-mix(in srgb, currentColor 45%, transparent);
  position: absolute; inset: 0; z-index: -1; overflow: hidden; padding: 1.25px; opacity: 0; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.btn-primary .btn-arc { color: var(--brand); }
.btn-arc::before {
  content: ""; position: absolute; top: 0; left: 0; width: 300%; height: 300%;
  background: linear-gradient(160deg, transparent 0% 15%, currentColor 20%, var(--arc-tail) 25%, transparent 35% 55%,
    currentColor 60%, var(--arc-tail) 65%, transparent 75% 95%, currentColor 100%);
  transform: translate(-10%, -10%);
}
.btn:hover > .btn-arc, .btn:focus-visible > .btn-arc { opacity: 1; }
.btn:hover > .btn-arc::before, .btn:focus-visible > .btn-arc::before { will-change: transform; animation: arc-border 2.23s linear infinite; }
@keyframes arc-border { from { transform: translate(-10%, -10%); } to { transform: translate(-50%, -50%); } }

/* Same arc, as a card outline */
.card-arc {
  position: absolute; inset: 0; z-index: 2; padding: 1.25px; opacity: 0; pointer-events: none;
  background: linear-gradient(160deg, transparent 0%, var(--fg) 15%, var(--accent) 20%, var(--brand) 25%, transparent 35% 40%,
    var(--fg) 55%, var(--accent) 60%, var(--brand) 65%, transparent 75% 80%, var(--fg) 95%, var(--accent) 100%);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .2s; animation: arc-stroke 2.23s linear infinite paused;
}
.card:hover .card-arc, .card:focus-visible .card-arc { opacity: 1; transition-duration: 0s; animation-play-state: running; }
@keyframes arc-stroke { from { background-position: 15% 15%; } to { background-position: 75% 75%; } }

/* ---------- Nav ---------- */
.nav-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  width: 100%; max-width: calc(var(--col) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad);
}
.nav-side { display: flex; align-items: center; gap: 24px; }
.nav-side.end { justify-content: flex-end; }
.nav-link { font-size: 14px; letter-spacing: .1em; opacity: .8; transition: opacity .15s var(--ease); white-space: nowrap; }
.nav-link:hover { opacity: 1; }

.site-header { position: relative; z-index: 90; padding: 40px 0 20px; }
.wordmark { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wordmark-name {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: 500 36px/.9 var(--f-display); text-transform: uppercase; letter-spacing: -.01em;
}
.wordmark-links { display: flex; gap: 12px; }
.wordmark-links a { font: 500 11px/1 var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); transition: color .15s var(--ease); }
.wordmark-links a:hover { color: var(--fg); }

.sticky-nav {
  position: fixed; top: var(--frame); left: var(--frame); right: var(--frame); z-index: 95;
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 -.5px 0 var(--line);
  transform: translateY(calc(-100% - var(--frame)));
  transition: transform .35s var(--ease-io);
}
.sticky-nav.is-on { transform: none; }
.monogram { font: 500 26px/1 var(--f-display); letter-spacing: -.01em; text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero { padding-block: 80px; overflow: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; min-height: 520px; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 30px; min-width: 0; position: relative; z-index: 1; }
.hero-title {
  font: 100 clamp(3.25rem, 8.2vw, 108px)/1 var(--f-display);
  letter-spacing: -.02em;
}
.hero-title > span { display: block; overflow: clip; padding-bottom: .14em; margin-bottom: -.1em; } /* room for descenders */
.hero-title > span > span {
  display: block; transform: translateY(105%);
  animation: line-rise 1s var(--ease) forwards; animation-delay: calc(.08s + var(--i) * .09s);
}
@keyframes line-rise { to { transform: none; } }
.hero-intro { max-width: 46ch; color: var(--fg-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.terminal-wrap { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 480px; margin-top: 8px; }
.terminal { background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--line); }
.terminal-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 4px 4px 0; }
.terminal-tabs button {
  height: 28px; border: 0; cursor: pointer; font-size: 13px; letter-spacing: .06em;
  background: color-mix(in srgb, var(--fg) 5%, transparent); color: var(--fg-2);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.terminal-tabs button::before, .terminal-tabs button::after { content: ":"; opacity: .4; margin-inline: 6px; }
.terminal-tabs button:hover { color: var(--fg); }
.terminal-tabs button[aria-selected="true"] { background: var(--bg); color: var(--fg); }
.terminal-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); margin: 0 4px 4px; }
.terminal-line code { flex: 1; min-width: 0; font: 13px/1.4 var(--f-code); color: var(--fg); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.terminal-line code::before { content: "$ "; color: var(--brand-ink); }
.copy { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--fg-2); cursor: pointer; transition: color .15s var(--ease); }
.copy:hover { color: var(--fg); }
.copy svg { width: 16px; height: 16px; fill: currentColor; grid-area: 1 / 1; transition: opacity .15s var(--ease), transform .15s var(--ease); }
.copy .i-check { opacity: 0; transform: scale(.6); }
.copy.done .i-copy { opacity: 0; transform: scale(.6); }
.copy.done .i-check { opacity: 1; transform: none; color: var(--accent); }

.hero-art { position: relative; min-width: 0; mix-blend-mode: lighten; }
.hero-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 10vw, 140px); }
.paper { background: var(--surface); box-shadow: inset 0 .5px 0 var(--line), inset 0 -.5px 0 var(--line); }
.section-title { font: 400 clamp(3rem, 6vw, 80px)/1 var(--f-display); letter-spacing: -.02em; }
.section-title sup { font-size: .3em; vertical-align: top; margin-left: .15em; color: var(--brand-ink); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.lede { color: var(--fg-2); max-width: 44ch; }

/* Work */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 72px 30px; margin-top: clamp(40px, 6vw, 72px); }
.card { display: flex; flex-direction: column; gap: 16px; }
.card-meta { display: flex; flex-direction: column; gap: 12px; }
.card h3 { font: 500 clamp(2rem, 3.6vw, 40px)/1.1 var(--f-display); letter-spacing: -.005em; }
.card h3 span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--ease); }
.card:hover h3 span { background-size: 100% 1px; }
.card p { color: var(--fg-2); }
.plate { position: relative; height: 360px; margin-top: 8px; background: var(--bg); overflow: hidden; }
.plate canvas, .plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .plate canvas, .card:hover .plate img { transform: scale(1.025); }
.work-grid .card:nth-child(n+3) { flex-direction: column-reverse; justify-content: flex-end; }
.banner-pcb, .banner-gl { transition: opacity .9s var(--ease), transform .8s var(--ease); }
.banner-gl { opacity: 0; }
.banner-gl.is-on { opacity: 1; }
.banner-pcb.is-off { opacity: 0; }

.card .card-cta { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); transition: color .15s var(--ease); }
.card-cta svg { width: 14px; height: 14px; fill: currentColor; transition: transform .25s var(--ease); }
.card:hover .card-cta { color: var(--fg); }
.card:hover .card-cta svg { transform: translateX(3px); }

/* Project files sheet (native <dialog>; enter/exit timings from the reference) */
.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0;
  width: min(480px, 100vw); height: 100dvh; max-width: none; max-height: none;
  background: var(--surface); color: var(--fg);
  box-shadow: inset .5px 0 0 var(--line), 0 4px 40px 0 rgba(0, 0, 0, .5);
  overflow-y: auto; overscroll-behavior: contain;
}
.sheet[open] { animation: sheet-in .2s ease-out; }
.sheet::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet[open]::backdrop { animation: fade-in .15s ease-out; }
.sheet.is-closing { animation: sheet-out .2s ease-in forwards; }
.sheet.is-closing::backdrop { animation: fade-out .2s ease-in forwards; }
@keyframes sheet-in { from { transform: translateX(110%); } }
@keyframes sheet-out { to { opacity: 0; transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(6px); } }

.sheet-panel { display: flex; flex-direction: column; gap: 20px; min-height: 100%; padding: 28px clamp(20px, 4vw, 32px) 32px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sheet-close { display: grid; place-items: center; width: 32px; height: 32px; margin-right: -8px; padding: 0; border: 0; background: none; color: var(--fg-2); cursor: pointer; transition: color .15s var(--ease), background-color .15s var(--ease); }
.sheet-close:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.sheet-close svg { width: 20px; height: 20px; fill: currentColor; }
.sheet-title { font: 400 clamp(40px, 6vw, 56px)/1 var(--f-display); letter-spacing: -.02em; }
.sheet-desc { color: var(--fg-2); }
.sheet-files-head { display: flex; justify-content: space-between; margin-top: 12px; padding-bottom: 10px; border-bottom: .5px solid var(--line); }

.file-list { list-style: none; margin: -20px 0 0; padding: 0; }
.file-list li { border-bottom: .5px solid var(--line); animation: slide-up .35s var(--ease) both; animation-delay: calc(.08s + var(--n, 0) * .04s); }
.file { display: flex; align-items: center; gap: 14px; padding: 14px 8px; margin-inline: -8px; transition: background-color .15s var(--ease); }
.file:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.file-ext {
  flex: none; display: grid; place-items: center; min-width: 44px; height: 26px; padding: 0 6px;
  font: 600 11px/1 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink);
  box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--brand-ink) 60%, transparent);
}
.file-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.file-name small { font: 500 12px/1.3 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.file-dl { flex: none; display: grid; place-items: center; width: 32px; height: 32px; color: var(--fg-2); transition: color .15s var(--ease), transform .25s var(--ease); }
.file-dl svg { width: 18px; height: 18px; fill: currentColor; }
.file:hover .file-dl { color: var(--fg); transform: translateY(2px); }
.file-empty { padding: 18px 0; color: var(--fg-3); font-size: 15px; }
.sheet-actions:empty { display: none; }

/* Case-study content inside the sheet (projects with video / gallery / breakdown) */
.sheet.is-wide { width: min(880px, 100vw); }
.sheet-credit:empty, .story:empty { display: none; }
.sheet-credit { margin-top: -8px; color: var(--brand-ink); }
.story { display: flex; flex-direction: column; gap: 36px; margin-top: 8px; }
.story-block { display: flex; flex-direction: column; gap: 14px; }
.block-head { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: .5px solid var(--line); }

.story-video { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.video-poster, .story-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: var(--bg); }
.video-poster { position: relative; padding: 0; cursor: pointer; overflow: hidden; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .3s var(--ease), transform .8s var(--ease); }
.video-poster:hover img { opacity: 1; transform: scale(1.02); }
.video-play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: grid; place-items: center; width: 64px; height: 64px;
  background: var(--fg); color: var(--bg); transition: transform .2s var(--ease), background-color .15s var(--ease);
}
.video-play svg { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.video-poster:hover .video-play { transform: scale(1.06); background: #fff; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: .5px solid var(--line); border-bottom: .5px solid var(--line); }
.stats div { padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.stats div + div { box-shadow: inset .5px 0 0 var(--line); }
.stats dd { margin: 0; font: 300 clamp(32px, 5vw, 48px)/1 var(--f-display); letter-spacing: -.02em; }
.stats dt { font: 500 12px/1.2 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); }

/* Horizontal filmstrip; native scroll + snap, edges fade out */
.strip {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  padding-bottom: 8px; -webkit-mask: linear-gradient(90deg, #000 92%, transparent); mask: linear-gradient(90deg, #000 92%, transparent);
}
.strip figure { flex: none; margin: 0; width: min(300px, 72vw); scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.zoom { display: block; padding: 0; border: 0; background: var(--bg); cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden; }
.zoom img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .3s var(--ease); opacity: .9; }
.zoom:hover img { transform: scale(1.04); opacity: 1; }
.strip figcaption { font-size: 13px; line-height: 1.4; color: var(--fg-2); }

/* Breakdown accordion reuses the experience accordion */
.accordion.breakdown { margin-top: -14px; border-top: 0; }
.breakdown .acc-q { font-size: 22px; }
.breakdown .acc-body { display: flex; flex-direction: column; gap: 14px; max-width: none; padding-bottom: 28px; }
.breakdown .acc-body p { max-width: 64ch; }
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 64ch; }
.points li { position: relative; padding-left: 18px; }
.points li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--brand-ink); }
.code { margin: 4px 0 0; padding: 14px 16px; background: var(--bg); box-shadow: inset 0 0 0 .5px var(--line); overflow-x: auto; }
.code code { font: 13px/1.6 var(--f-code); color: var(--fg); white-space: pre; }

.figures { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.fig { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fig-media { position: relative; background: var(--bg); box-shadow: inset 0 0 0 .5px var(--line); }
.fig-media img { width: 100%; height: auto; }
.fig.drawing .fig-media { padding: 0; }
.fig figcaption { font-size: 13px; color: var(--fg-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1.3 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); cursor: default; transition: color .15s var(--ease); }
.legend span:hover { color: var(--fg); }
.legend i { font-style: normal; display: grid; place-items: center; width: 16px; height: 16px; font-size: 10px; color: var(--fg); background: var(--brand); }

/* Hotspots on drawings */
.spot { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; padding: 0; border: 0; background: none; cursor: help; z-index: 1; }
.spot-dot {
  display: grid; place-items: center; width: 22px; height: 22px; font: 600 11px/1 var(--f-label); color: var(--fg); background: var(--brand);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); animation: spot-pulse 2.4s var(--ease) infinite;
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.spot:nth-of-type(2) .spot-dot { animation-delay: .4s; }
.spot:nth-of-type(3) .spot-dot { animation-delay: .8s; }
.spot:nth-of-type(4) .spot-dot { animation-delay: 1.2s; }
@keyframes spot-pulse { 70%, 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--brand) 0%, transparent); } }
.spot-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; translate: -50% 4px; width: max-content; max-width: 220px;
  display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; background: var(--fg); color: var(--bg); text-align: left;
  opacity: 0; pointer-events: none; transition: opacity .15s var(--ease), translate .15s var(--ease);
}
.spot-tip b { font: 600 12px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; }
.spot-tip small { font: 13px/1.35 var(--f-body); }
.spot.tip-l .spot-tip { left: auto; right: -4px; translate: 0 4px; }
.spot.tip-r .spot-tip { left: -4px; translate: 0 4px; }
.spot:hover .spot-dot, .spot:focus-visible .spot-dot, .spot.is-hot .spot-dot { background: var(--fg); color: var(--bg); transform: scale(1.1); }
.spot:hover .spot-tip, .spot:focus .spot-tip, .spot.is-hot .spot-tip { opacity: 1; translate: -50% 0; }
.spot.tip-l:hover .spot-tip, .spot.tip-l:focus .spot-tip, .spot.tip-l.is-hot .spot-tip,
.spot.tip-r:hover .spot-tip, .spot.tip-r:focus .spot-tip, .spot.tip-r.is-hot .spot-tip { translate: 0 0; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent); color: var(--fg);
}
.lightbox[open] { animation: fade-in .2s ease-out; }
.lightbox::backdrop { background: transparent; }
.lb-figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 56px clamp(16px, 8vw, 96px) 28px; }
.lb-figure img { max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; }
.lb-figure figcaption { display: flex; gap: 16px; align-items: baseline; justify-content: center; flex-wrap: wrap; text-align: center; font-size: 15px; color: var(--fg-2); }
.lb-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); cursor: pointer; transition: background-color .15s var(--ease); }
.lb-btn:hover { background: color-mix(in srgb, var(--fg) 16%, transparent); }
.lb-btn svg { width: 22px; height: 22px; fill: currentColor; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
.lb-close { right: 16px; top: 16px; }

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { box-shadow: none; }
  .stats div:nth-child(n+3) { border-top: .5px solid var(--line); }
  .figures { grid-template-columns: minmax(0, 1fr); }
  .lb-prev, .lb-next { top: auto; bottom: 16px; translate: none; }
}

/* Experience accordion (native <details>, animated height) */
.accordion { margin-top: clamp(40px, 6vw, 64px); border-top: .5px solid var(--line); }
.accordion details { border-bottom: .5px solid var(--line); }
.accordion summary {
  display: flex; align-items: center; gap: 16px; min-height: 64px; padding-block: 14px; cursor: pointer; list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.acc-q { flex: 1; min-width: 0; font: 400 clamp(20px, 2.2vw, 26px)/1.3 var(--f-display); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--fg-3); transition: text-decoration-color .15s var(--ease); }
.accordion summary:hover .acc-q { text-decoration-color: var(--fg); }
.acc-when { font: 500 13px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.acc-icon { position: relative; width: 14px; height: 14px; flex: none; }
.acc-icon::before, .acc-icon::after { content: ""; position: absolute; inset: 6px 0; background: currentColor; transition: transform .3s var(--ease); }
.acc-icon::after { transform: rotate(90deg); }
details[open] .acc-icon::after { transform: rotate(0); }
.accordion details::details-content {
  block-size: 0; overflow: clip;
  transition: block-size .35s var(--ease-io), content-visibility .35s allow-discrete;
}
.accordion details[open]::details-content { block-size: auto; }
.acc-body { padding: 0 0 24px; color: var(--fg-2); max-width: 64ch; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px 30px; align-items: start; }
.contact-copy { display: flex; flex-direction: column; gap: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; letter-spacing: .1em; padding: 3px 6px; box-shadow: inset 0 0 0 .5px var(--fg-2); }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--fg-2); }
.contact-form input, .contact-form textarea {
  font: 16px/1.5 var(--f-body); color: var(--fg); background: var(--bg);
  border: 0; border-radius: 0; padding: 10px 12px; box-shadow: inset 0 0 0 .5px var(--line);
  transition: box-shadow .15s var(--ease);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:hover, .contact-form textarea:hover { box-shadow: inset 0 0 0 .5px var(--fg-3); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--brand-ink); }
.hp { position: absolute; left: -9999px; }
.form-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-status { font-size: 14px; color: var(--fg-2); }
.form-status.err { color: #f0949e; }
.form-status.ok { color: #8cc4a7; }

/* Footer */
.site-footer { padding: 72px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-name { font: 300 clamp(48px, 7vw, 96px)/.9 var(--f-display); text-transform: uppercase; letter-spacing: -.02em; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font: 500 26px/1 var(--f-display); text-transform: uppercase; opacity: .8; transition: opacity .15s var(--ease); width: fit-content; }
.footer-col a:hover { opacity: 1; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; margin-top: 72px; padding-top: 16px; border-top: .5px solid var(--line); font-size: 12px; color: var(--fg-2); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .7s var(--ease) var(--d, 0s), transform .7s var(--ease) var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 32px; }
  .hero-art { order: -1; height: 340px; }
  .work-grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .work-grid .card:nth-child(n+3) { flex-direction: column; }
  .plate { height: 260px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-inner { grid-template-columns: auto 1fr; }
  .nav-inner > .nav-side:first-child, .nav-side.end .nav-link { display: none; }
  .wordmark { align-items: flex-start; }
  .wordmark-name { align-items: center; }
  .sticky-nav .nav-inner { grid-template-columns: 1fr auto; }
  .sticky-nav .nav-side:first-child { display: none; }
  .footer-base { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-title > span > span { transform: none; }
  .frame-ambient, .frame-click, .frame-scroll { display: none; }
}

/* Nickname in the name, e.g. "Han (Alan) Bao" */
.aka { font-size: .55em; letter-spacing: .02em; color: var(--fg-2); vertical-align: .18em; }
.wordmark-name .aka { display: block; font-size: .5em; line-height: 1; vertical-align: 0; letter-spacing: .06em; }

.nowrap { white-space: nowrap; }
