/* ==========================================================================
   Saizen Acuity — Wael Elrifai — "Schematic"
   A profile drawn like a circuit board: black solder mask, emerald copper,
   phosphor-green signal. Wael is an electrical engineer building AI that
   designs hardware, so the page is wired — the portrait sits in its package
   like a chip, the career is a signal bus, the close is a circuit that closes.
   Type is the site's: Playfair Display SC headlines, Playfair Display for
   serif text, DM Sans body, DM Mono labels. Emphasis is upright colour.
   ========================================================================== */

:root {
  /* solder mask */
  --bg:     #030605;
  --bg-2:   #06100C;
  --panel:  rgba(9, 22, 16, 0.62);
  --panel-s:#08130E;
  /* silkscreen */
  --ink:    #E9F3EE;
  --ink-2:  #B4C6BC;
  --muted:  #7B9085;
  --dim:    #3E5047;
  --line:   rgba(120, 255, 190, 0.10);
  --line-2: rgba(120, 255, 190, 0.18);
  --line-3: rgba(120, 255, 190, 0.32);
  /* copper + signal */
  --em:     #0E9F6E;
  --em-2:   #2FC48D;
  --phos:   #5CFFB1;
  --glow:   rgba(92, 255, 177, 0.55);
  /* brand gold, only for "Acuity" */
  --gold:   #E2AE36;
  --gold-d: #B8892B;

  --f-sc:      'Playfair Display SC', 'Playfair Display', Georgia, serif;
  --f-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --f-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --f-mono:    'DM Mono', ui-monospace, 'SFMono-Regular', monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io:  cubic-bezier(0.65, 0, 0.35, 1);
  --spring:   cubic-bezier(0.34, 1.4, 0.64, 1);

  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(96px, 13vw, 184px);
  --r: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* the board itself: a faint solder-mask grid under everything */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(rgba(92, 255, 177, 0.075) 1px, transparent 1.3px) 0 0 / 24px 24px,
    radial-gradient(70% 50% at 100% 0%, rgba(14, 159, 110, 0.10), transparent 70%),
    radial-gradient(60% 50% at 0% 100%, rgba(14, 159, 110, 0.07), transparent 70%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, rgba(0, 0, 0, 0.35));
  mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, rgba(0, 0, 0, 0.35));
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--em); color: #02130C; }
:focus-visible { outline: 2px solid var(--phos); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
em, i { font-style: normal; }
.mono { font-family: var(--f-mono); font-size: 11px; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.4; }

/* the wordmark: "Saizen" in ink, "Acuity" bold gold */
.wm { font-family: var(--f-sc); font-weight: 400; letter-spacing: 0.01em; }
.wm b { font-weight: 700; color: var(--gold); }

/* LEDs */
.led { position: relative; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; transition: background 0.4s, box-shadow 0.4s; }
.led--live, .is-hot .led, .mod:hover .led { background: var(--phos); box-shadow: 0 0 0 3px rgba(92, 255, 177, 0.14), 0 0 12px var(--glow); }
.led--live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--phos); opacity: 0; animation: ledPing 2.4s var(--ease-out) infinite; }
@keyframes ledPing { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(2.2); opacity: 0; } }

/* ── buttons: chamfered like a PCB pad; current runs the edge on hover ── */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.btn {
  --c: 11px; --edge: var(--line-3); --edge-hover: var(--line-2);
  --fill: linear-gradient(rgba(9, 22, 16, 0.8), rgba(9, 22, 16, 0.8)); --sheen: rgba(92, 255, 177, 0.16);
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 18px; height: 54px; padding: 0 7px 0 20px;
  font: 500 14.5px/1 var(--f-body); letter-spacing: 0.01em; white-space: nowrap; color: var(--ink);
  transition: transform 0.5s var(--spring), color 0.3s, filter 0.4s;
}
/* edge layer, then fill layer 1px inside it — both cut on opposite corners */
.btn::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--edge); clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); }
.btn::after {
  content: ''; position: absolute; inset: 1px; z-index: -1;
  clip-path: polygon(calc(var(--c) - 0.6px) 0, 100% 0, 100% calc(100% - var(--c) + 0.6px), calc(100% - var(--c) + 0.6px) 100%, 0 100%, 0 calc(var(--c) - 0.6px));
  background: linear-gradient(105deg, transparent 42%, var(--sheen) 50%, transparent 58%) 150% 0 / 250% 100% no-repeat, var(--fill);
  transition: background-position 0.9s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::before { background: conic-gradient(from var(--spin), var(--edge-hover) 0 58%, var(--phos) 76%, #EFFFF7 81%, var(--phos) 86%, var(--edge-hover) 100%); animation: edgeRun 1.6s linear infinite; }
.btn:hover::after { background-position: -50% 0, 0 0; }
.btn:active { transform: translateY(0) scale(0.97); }
@keyframes edgeRun { to { --spin: 360deg; } }

/* a status LED before the label */
.btn__txt { display: inline-flex; align-items: center; gap: 11px; }
.btn__txt::before { content: ''; width: 5px; height: 5px; flex: none; background: currentColor; opacity: 0.3; transition: opacity 0.3s, background 0.3s, box-shadow 0.3s; }
.btn:hover .btn__txt::before { opacity: 1; background: var(--phos); box-shadow: 0 0 8px var(--phos); }

/* the icon block is cut on the other diagonal */
.btn__ico { --ci: 8px; display: grid; place-items: center; width: 40px; height: 40px; clip-path: polygon(0 0, calc(100% - var(--ci)) 0, 100% var(--ci), 100% 100%, var(--ci) 100%, 0 calc(100% - var(--ci))); transition: background 0.3s, color 0.3s; }
.btn__ico svg { width: 15px; height: 15px; transition: transform 0.5s var(--spring); }
.btn:hover .btn__ico svg { transform: translate(2px, -2px); }

.btn--em { --edge: #9CFFD0; --edge-hover: #2FC48D; --fill: linear-gradient(135deg, #7DFFC0, var(--em-2) 48%, var(--em)); --sheen: rgba(255, 255, 255, 0.5); color: #02130C; filter: drop-shadow(0 14px 26px rgba(47, 196, 141, 0.32)); }
.btn--em:hover { filter: drop-shadow(0 18px 34px rgba(92, 255, 177, 0.45)); }
.btn--em .btn__txt::before, .btn--em:hover .btn__txt::before { background: #02130C; box-shadow: none; opacity: 0.6; }
.btn--em:hover .btn__txt::before { animation: blink 0.8s steps(2) infinite; }
.btn--em .btn__ico { background: rgba(2, 19, 12, 0.9); color: var(--phos); }
.btn--line .btn__ico { background: rgba(92, 255, 177, 0.08); color: var(--phos); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--line .btn__ico svg[fill="currentColor"] { width: 14px; height: 14px; }
.btn--line:hover .btn__ico { background: var(--phos); color: #02130C; }
.btn--line { backdrop-filter: none; }

/* ══ POWER-ON ═══════════════════════════════════════════════════════════ */
.boot { display: none; }
.js .boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #020403;
  clip-path: inset(0 0 0 0); transition: clip-path 0.9s var(--ease-io);
  animation: bootFailsafe 0.01s 4.5s forwards; /* never strand the page behind it */
}
.js .boot::before { content: ''; position: absolute; inset: 0; background: radial-gradient(rgba(92, 255, 177, 0.06) 1px, transparent 1.3px) 0 0 / 24px 24px; }
.boot.is-done { clip-path: inset(0 0 100% 0); }
.boot.is-gone { display: none; }
.boot.is-exit { clip-path: inset(0 0 0 0); animation: none; }
.boot.is-enter { clip-path: inset(100% 0 0 0); animation: none; transition: none; }
@keyframes bootFailsafe { to { visibility: hidden; } }
.boot__in { position: relative; width: min(380px, 78vw); display: grid; gap: 14px; }
.boot__line { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.boot__led { width: 7px; height: 7px; border-radius: 50%; background: var(--phos); box-shadow: 0 0 12px var(--glow); animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.boot__bar { height: 1px; background: var(--line-2); overflow: hidden; }
.boot__bar i { display: block; height: 100%; width: 100%; background: var(--phos); box-shadow: 0 0 10px var(--phos); transform: scaleX(var(--p, 0)); transform-origin: left; }
.boot__meta { display: flex; justify-content: space-between; color: var(--muted); }
.boot__pct { color: var(--phos); }

/* ══ BACK — the only chrome (a chamfered .btn) ═════════════════════════ */
.back { position: fixed; z-index: 60; top: clamp(14px, 2.4vw, 26px); left: var(--gutter); --c: 10px; height: 48px; padding: 0 18px 0 5px; gap: 12px; font-size: 14px; color: var(--ink-2);
  --fill: linear-gradient(rgba(3, 8, 6, 0.7), rgba(3, 8, 6, 0.7)); }
.back::after { backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
.back .btn__ico { width: 38px; height: 38px; }
.back:hover .btn__ico svg { transform: translateX(-3px); }
.back .wm { color: var(--ink); font-size: 15px; margin-left: 2px; }
.back:hover { color: var(--ink); }
.js .back { opacity: 0; transform: translateY(-12px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), color 0.3s; }
.is-live .back, html:not(.boot-pending) .back { opacity: 1; transform: none; }

/* ══ SCROLL BUS (decorative progress) ═══════════════════════════════════ */
.bus { position: fixed; z-index: 40; right: clamp(16px, 2vw, 30px); top: 50%; transform: translateY(-50%); display: none; flex-direction: column; align-items: center; gap: 18px; pointer-events: none; }
@media (min-width: 1180px) { .bus { display: flex; } }
.bus__track { position: relative; width: 1px; height: 30vh; background: var(--line-2); }
.bus__track::before, .bus__track::after { content: ''; position: absolute; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; border: 1px solid var(--line-3); background: var(--bg); }
.bus__track::before { top: -8px; } .bus__track::after { bottom: -8px; }
.bus__fill { position: absolute; inset: 0; background: linear-gradient(var(--em), var(--phos)); box-shadow: 0 0 10px var(--glow); transform: scaleY(var(--p, 0)); transform-origin: top; }
.bus__label { writing-mode: vertical-rl; display: flex; gap: 10px; color: var(--muted); font-size: 10px; }
.bus__ref { color: var(--phos); font-weight: 500; }

/* ══ HERO ═══════════════════════════════════════════════════════════════ */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; isolation: isolate; padding: clamp(96px, 12vh, 140px) 0 clamp(28px, 4vh, 48px); }
.hero__photo { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; opacity: 0.62; filter: saturate(0.95);
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.4) 34%, #000 66%), linear-gradient(#000 60%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.4) 34%, #000 66%), linear-gradient(#000 60%, transparent); mask-composite: intersect; }
.hero:has(.hero__photo) .hero__board { opacity: 0.7; }
.hero__board { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.55) 38%, #000 62%), linear-gradient(#000 70%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.55) 38%, #000 62%), linear-gradient(#000 70%, transparent); mask-composite: intersect; }
.hero__veil { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 60% at 76% 46%, rgba(14, 159, 110, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(3, 6, 5, 0.6), transparent 22%, transparent 70%, var(--bg)); }

.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero__copy { position: relative; z-index: 2; }

.status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 16px 9px 14px; border-radius: 3px; background: rgba(9, 22, 16, 0.6); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); font-size: 10.5px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.status b { color: var(--ink); font-weight: 500; }
.status__sep { color: var(--dim); }

.hero__name { margin: clamp(22px, 3vh, 34px) 0 clamp(18px, 2.4vh, 26px); font-family: var(--f-sc); font-weight: 400; font-size: clamp(64px, 10.4vw, 168px); line-height: 0.86; letter-spacing: -0.025em; }
.hero__l { display: block; padding-bottom: 0.05em; }
.hero__w { display: inline-block; color: var(--ink); --final: var(--ink); }
.hero__w--em { color: var(--em-2); --final: var(--em-2); text-shadow: 0 0 40px rgba(47, 196, 141, 0.28); }
.hero__w .ch { display: inline-block; }
.js .hero__w .ch { opacity: 0; transform: translateY(42%); }
.is-live .hero__w .ch { animation: chOn 1.25s var(--ease-out) forwards; animation-delay: calc(var(--i) * 55ms + var(--w, 0ms)); }
@keyframes chOn {
  0%   { opacity: 0; transform: translateY(42%); color: var(--phos); text-shadow: 0 0 0 transparent; }
  35%  { opacity: 1; color: #E8FFF4; text-shadow: 0 0 28px var(--phos), 0 0 4px #fff; }
  100% { opacity: 1; transform: none; color: var(--final); text-shadow: 0 0 40px rgba(47, 196, 141, var(--glow-a, 0)); }
}
.hero__w--em .ch { --glow-a: 0.28; }

.hero__roles { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; color: var(--ink-2); font-size: 11.5px; }
.hero__roles i { width: 5px; height: 5px; border: 1px solid var(--em-2); transform: rotate(45deg); }
.hero__lead { margin-top: 22px; max-width: 34em; color: var(--ink-2); font-size: clamp(16.5px, 1.25vw, 19px); line-height: 1.62; }
.hero__lead em { color: var(--em-2); }
.hero__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.js [data-boot] { opacity: 0; transform: translateY(18px); }
.is-live [data-boot] { opacity: 1; transform: none; transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
html.js:not(.boot-pending):not(.is-live) [data-boot], html.js:not(.boot-pending):not(.is-live) .hero__w .ch, html.js:not(.boot-pending):not(.is-live) .chip__pkg { opacity: 1; transform: none; } /* failsafe */

/* ── the chip: portrait in its package ───────────────────────────────── */
.chip { position: relative; margin: 0; justify-self: end; width: min(520px, 100%); perspective: 1400px; z-index: 1; }
.chip__pkg { position: relative; aspect-ratio: 1; margin-top: 14%; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.6s var(--ease-out); }
.js .chip__pkg { opacity: 0; transform: translateY(40px) scale(0.96); }
.is-live .chip__pkg { opacity: 1; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: opacity 1.2s var(--ease-out) 0.25s, transform 1.4s var(--ease-out) 0.25s; }
.is-live .chip__pkg.is-tilting { transition: transform 0.6s var(--ease-out); }

.chip__die {
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(70% 70% at 50% 55%, rgba(14, 159, 110, 0.32), transparent 70%),
    linear-gradient(160deg, #0B1A13, #050B08 60%);
  box-shadow: inset 0 0 0 1px var(--line-3), inset 0 0 60px rgba(92, 255, 177, 0.06), 0 50px 100px -40px rgba(0, 0, 0, 0.9), 0 0 80px -30px rgba(47, 196, 141, 0.45);
}
.chip__grid { position: absolute; inset: 0; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 32px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 100%; -webkit-mask-image: radial-gradient(80% 80% at 50% 50%, #000, transparent); mask-image: radial-gradient(80% 80% at 50% 50%, #000, transparent); }
.chip__scan { position: absolute; left: 0; right: 0; top: 0; height: 30%; background: linear-gradient(transparent, rgba(92, 255, 177, 0.12) 80%, rgba(92, 255, 177, 0.5) 99%, transparent); transform: translateY(-100%); animation: scan 5.5s var(--ease-io) 1.4s infinite; mix-blend-mode: screen; }
@keyframes scan { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(340%); } }
.chip__dot { position: absolute; top: 18px; left: 18px; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--em-2); }
.chip__ref { position: absolute; top: 15px; left: 36px; color: var(--em-2); font-size: 11px; }
.chip__part { position: absolute; top: 15px; right: 18px; color: var(--muted); font-size: 9.5px; }
.chip__corner { position: absolute; width: 16px; height: 16px; border: 0 solid var(--phos); opacity: 0.7; }
.chip__corner--tl { top: 8px; left: 8px; border-width: 1px 0 0 1px; border-radius: 8px 0 0 0; display: none; }
.chip__corner--tr { top: 8px; right: 8px; border-width: 1px 1px 0 0; border-radius: 0 8px 0 0; display: none; }
.chip__corner--bl { bottom: 8px; left: 8px; border-width: 0 0 1px 1px; border-radius: 0 0 0 8px; }
.chip__corner--br { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; border-radius: 0 0 8px 0; }

/* the figure overflows the top of the die but is cut by its sides and floor */
.chip__fig { position: absolute; inset: 0; z-index: 2; clip-path: inset(-30% 0 0 0 round 0 0 22px 22px); pointer-events: none; }
.chip__fig img { position: absolute; left: -10%; bottom: 0; width: 120%; max-width: none; height: auto; filter: drop-shadow(0 0 28px rgba(47, 196, 141, 0.18)) contrast(1.03); transform: translateZ(30px); }

/* pins: copper legs with data running through them */
.chip__pins { position: absolute; z-index: 0; --pin: linear-gradient(#24342C, #1A2620); }
.chip__pins::before, .chip__pins::after { content: ''; position: absolute; inset: 0; }
.chip__pins--l, .chip__pins--r { top: 9%; bottom: 9%; width: 16px; }
.chip__pins--l { left: -16px; } .chip__pins--r { right: -16px; }
.chip__pins--t { left: 9%; right: 9%; height: 16px; top: -16px; }
.chip__pins--l::before, .chip__pins--r::before { background: repeating-linear-gradient(180deg, #2A3B32 0 7px, transparent 7px 19px); border-radius: 2px; }
.chip__pins--t::before { background: repeating-linear-gradient(90deg, #2A3B32 0 7px, transparent 7px 19px); }
.chip__pins--l::after, .chip__pins--r::after {
  background: linear-gradient(180deg, transparent 0%, var(--phos) 8%, transparent 16%) 0 0 / 100% 300%;
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 7px, transparent 7px 19px); mask: repeating-linear-gradient(180deg, #000 0 7px, transparent 7px 19px);
  animation: pinData 3.6s linear infinite; filter: drop-shadow(0 0 4px var(--phos));
}
.chip__pins--r::after { animation-delay: -1.8s; animation-direction: reverse; }
.chip__pins--t::after {
  background: linear-gradient(90deg, transparent 0%, var(--phos) 8%, transparent 16%) 0 0 / 300% 100%;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 19px); mask: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 19px);
  animation: pinDataX 4.2s linear infinite;
}
@keyframes pinData { from { background-position: 0 100%; } to { background-position: 0 -200%; } }
@keyframes pinDataX { from { background-position: 100% 0; } to { background-position: -200% 0; } }

.chip__cap { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 22px; color: var(--muted); font-size: 10.5px; }
.chip__cap i { width: 18px; height: 1px; background: var(--line-3); }

/* ── readouts ────────────────────────────────────────────────────────── */
.readouts { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: clamp(40px, 6vh, 72px); }
.readouts::before { content: ''; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 1px; background: linear-gradient(90deg, var(--line-3), var(--line) 70%, transparent); }
.ro { position: relative; padding: 22px 18px 0 0; }
.ro::before { content: ''; position: absolute; left: -3px; top: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--em-2); }
.ro:first-child::before { left: 0; }
.ro + .ro { padding-left: 18px; }
.ro + .ro::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(var(--line-2), transparent); }
.ro dt { font: 400 10px/1.4 var(--f-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.ro dd { margin: 8px 0 0; font-family: var(--f-display); font-size: clamp(34px, 3.8vw, 56px); line-height: 1; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.ro dd small { font-size: 0.55em; color: var(--em-2); margin: 0 0.04em; }


/* ══ SECTIONS ═══════════════════════════════════════════════════════════ */
.sec { position: relative; padding: var(--section) 0 0; overflow-x: clip; }
.sh { margin-bottom: clamp(40px, 5vw, 72px); }
.sh__ref { display: flex; align-items: center; gap: 14px; color: var(--muted); margin-bottom: 22px; }
.sh__ref b { display: inline-grid; place-items: center; min-width: 38px; height: 24px; padding: 0 8px; border-radius: 6px; color: var(--phos); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-3); background: rgba(92, 255, 177, 0.05); }
.sh__ref i { flex: 1; max-width: 220px; height: 1px; background: linear-gradient(90deg, var(--line-3), transparent); transform-origin: left; }
.js .sh__ref i { transform: scaleX(0); transition: transform 1.4s var(--ease-out) 0.2s; }
.js .is-in .sh__ref i, .js .sh__ref.is-in i { transform: none; }
.sh__h { font-family: var(--f-sc); font-weight: 400; font-size: clamp(40px, 5.4vw, 84px); line-height: 1; letter-spacing: -0.02em; max-width: 14em; }
.sh__h em { color: var(--em-2); }
.sh__sub { margin-top: 22px; max-width: 36em; color: var(--ink-2); font-size: 17.5px; }

/* reveal */
.js .rv { opacity: 0; transform: translateY(30px); }
.js .rv.is-in { opacity: 1; transform: none; transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }

/* panels share one surface */
.panel, .sheet, .mod, .role__card, .hc, .ic {
  position: relative; border-radius: var(--r); background: linear-gradient(180deg, rgba(12, 28, 20, 0.66), rgba(6, 14, 10, 0.66));
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -40px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* ── J1 biography ────────────────────────────────────────────────────── */
.bio__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.bio__quote { margin: 0; font-family: var(--f-display); font-size: clamp(24px, 2.55vw, 38px); line-height: 1.36; letter-spacing: -0.01em; color: var(--ink); }
.bio__quote b { font-weight: 500; color: var(--em-2); }
.bio__quote .w { transition: color 0.5s, text-shadow 0.6s; }
.js .bio__quote.is-split .w { color: #24332B; }
.js .bio__quote.is-split .w.on { color: var(--ink); }
.js .bio__quote.is-split b .w.on { color: var(--em-2); text-shadow: 0 0 22px rgba(47, 196, 141, 0.35); }
.js .bio__quote.is-split .w.tip { color: var(--phos); text-shadow: 0 0 18px var(--glow); }

.sheet { padding: 8px 0 6px; position: sticky; top: 110px; }
.sheet__h { display: flex; justify-content: space-between; padding: 16px 22px 14px; color: var(--muted); border-bottom: 1px dashed var(--line-2); }
.sheet__h span:first-child { color: var(--phos); }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet tr { position: relative; }
.sheet th, .sheet td { text-align: left; vertical-align: top; padding: 13px 22px; border-bottom: 1px dashed var(--line); }
.sheet tr:last-child th, .sheet tr:last-child td { border-bottom: 0; }
.sheet th { width: 34%; padding-right: 8px; font: 400 10px/1.7 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sheet td { font-size: 14.5px; line-height: 1.45; color: var(--ink-2); transition: color 0.3s; }
.sheet td i { color: var(--em-2); }
.sheet tr:hover td { color: var(--ink); }
.sheet tr:hover th { color: var(--phos); }

/* ── J2 practice board ───────────────────────────────────────────────── */
.board { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) minmax(0, 1fr); grid-template-areas: "m0 core m2" "m1 core m3"; gap: 28px clamp(48px, 7vw, 110px); align-items: stretch; }
.board__traces { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.board__traces .t-base { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.board__traces .t-flow { fill: none; stroke: var(--phos); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 10 90; filter: drop-shadow(0 0 4px var(--phos)); animation: flow 2.8s linear infinite; opacity: 0.85; }
.board__traces .t-pad { fill: var(--bg); stroke: var(--em-2); stroke-width: 1.5; }
.board__traces .t-via { fill: var(--line-3); }
.board__traces g.is-hot .t-base { stroke: var(--em-2); }
.board__traces g.is-hot .t-flow { animation-duration: 1s; opacity: 1; }
.board__traces g.is-hot .t-pad { fill: var(--phos); }
@keyframes flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

.mod { z-index: 1; padding: clamp(24px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 14px; transition: box-shadow 0.4s, transform 0.6s var(--spring); }
.mod[data-pin="0"] { grid-area: m0; } .mod[data-pin="1"] { grid-area: m1; } .mod[data-pin="2"] { grid-area: m2; } .mod[data-pin="3"] { grid-area: m3; }
.mod:hover, .mod.is-hot { box-shadow: inset 0 0 0 1px var(--line-3), 0 0 50px -18px rgba(92, 255, 177, 0.4), 0 30px 60px -40px #000; transform: translateY(-3px); }
.mod__ref { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.mod__ref span:first-child { color: var(--em-2); }
.mod h3 { font-family: var(--f-display); font-size: clamp(22px, 1.9vw, 28px); line-height: 1.15; letter-spacing: -0.01em; }
.mod h3 em { color: var(--em-2); }
.mod p:not(.mod__ref) { color: var(--ink-2); font-size: 15.5px; }

.core { grid-area: core; z-index: 1; display: grid; place-items: center; }
.core__pkg { position: relative; width: 100%; aspect-ratio: 1; border-radius: 26px; background: linear-gradient(150deg, #0E2219, #040A07); box-shadow: inset 0 0 0 1px var(--line-3), 0 0 0 10px rgba(3, 6, 5, 0.9), 0 0 0 11px var(--line), 0 0 100px -20px rgba(47, 196, 141, 0.5); }
.core__pkg::before { content: ''; position: absolute; inset: -22%; border-radius: 50%; border: 1px dashed var(--line-2); animation: spin 80s linear infinite; pointer-events: none; }
.core__pkg::after { content: ''; position: absolute; inset: -22%; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 82%, rgba(92, 255, 177, 0.5) 96%, transparent); -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); animation: spin 6s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.core__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.core__pkg:has(.core__img) { background: #030605; }
.core__pkg:has(.core__img) .core__pins { display: none; }
.core__pkg:has(.core__img) .core__die { inset: 24%; background: radial-gradient(70% 70% at 50% 42%, rgba(47, 196, 141, 0.12), transparent 75%); box-shadow: none; }
.core__die { position: absolute; inset: 18%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; border-radius: 14px; background: radial-gradient(80% 80% at 50% 40%, rgba(47, 196, 141, 0.18), rgba(3, 8, 6, 0.85)); box-shadow: inset 0 0 0 1px var(--line-2); }
.core__logo { width: 46%; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6)); }
.core__name { font-size: clamp(15px, 1.4vw, 19px); }
.core__name { font-family: var(--f-sc); }
.core__name b { font-weight: 700; color: var(--gold); }
.core__sub { color: var(--em-2); font-size: 9px; }
.core__pins { position: absolute; }
.core__pins--l, .core__pins--r { top: 16%; bottom: 16%; width: 12px; background: repeating-linear-gradient(180deg, #2A3B32 0 5px, transparent 5px 15px); }
.core__pins--t, .core__pins--b { left: 16%; right: 16%; height: 12px; background: repeating-linear-gradient(90deg, #2A3B32 0 5px, transparent 5px 15px); }
.core__pins--l { left: -12px; } .core__pins--r { right: -12px; } .core__pins--t { top: -12px; } .core__pins--b { bottom: -12px; }

/* ── J3 career trace ─────────────────────────────────────────────────── */
.trace { position: relative; --when: clamp(150px, 16vw, 220px); --gap: 56px; }
.trace__rail { position: absolute; top: 6px; bottom: 0; left: calc(var(--when) + var(--gap) / 2); width: 2px; margin-left: -1px; background: var(--line); border-radius: 2px; }
.trace__fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(var(--em), var(--phos)); box-shadow: 0 0 12px var(--glow); transform: scaleY(var(--p, 0)); transform-origin: top; }
.trace__spark { position: absolute; left: 50%; top: calc(var(--p, 0) * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #E8FFF4; box-shadow: 0 0 0 4px rgba(92, 255, 177, 0.2), 0 0 24px 6px var(--phos); opacity: var(--spark, 0); transition: opacity 0.3s; }
.trace__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.role { position: relative; display: grid; grid-template-columns: var(--when) var(--gap) minmax(0, 1fr); align-items: start; }
.role__when { grid-column: 1; grid-row: 1; text-align: right; padding-top: 26px; display: grid; gap: 6px; color: var(--muted); font-size: 10.5px; }
.role__when b { color: var(--ink); font-weight: 500; font-size: 12px; transition: color 0.4s; }
.role__node { grid-column: 2; grid-row: 1; justify-self: center; margin-top: 26px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--dim); position: relative; z-index: 1; transition: box-shadow 0.5s, background 0.5s; }
.role__node::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--dim); transition: background 0.4s; }
.role.is-on .role__node { box-shadow: inset 0 0 0 2px var(--phos), 0 0 18px var(--glow); }
.role.is-on .role__node::after { background: var(--phos); }
.role.is-on .role__when b { color: var(--phos); }
.role__card { grid-column: 3; grid-row: 1; padding: clamp(22px, 2.4vw, 32px); transition: box-shadow 0.5s; }
.role__card::before { content: ''; position: absolute; top: 33px; left: calc(var(--gap) / -2 + 8px); width: calc(var(--gap) / 2 - 8px); height: 1px; background: var(--line-2); transition: background 0.5s, box-shadow 0.5s; }
.role.is-on .role__card::before { background: var(--phos); box-shadow: 0 0 8px var(--phos); }
.role.is-on .role__card { box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 60px -40px #000; }
.role__card:hover { box-shadow: inset 0 0 0 1px var(--line-3), 0 0 50px -24px rgba(92, 255, 177, 0.45); }
.role__org { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--em-2); font-size: 10.5px; }
.role__live { display: inline-flex; align-items: center; gap: 8px; color: var(--phos); }
.role h3 { margin: 10px 0 14px; font-family: var(--f-display); font-size: clamp(23px, 2.2vw, 32px); line-height: 1.12; letter-spacing: -0.01em; }
.role ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.role li li, .role ul li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.role ul li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 9px; height: 1px; background: var(--em-2); }
.role ul li::after { content: ''; position: absolute; left: 10px; top: calc(0.62em - 2px); width: 5px; height: 5px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--em-2); }

/* ── J4 honours ──────────────────────────────────────────────────────── */
.hgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hc { padding: clamp(22px, 2.2vw, 30px); display: flex; flex-direction: column; gap: 10px; overflow: hidden; --x: 50%; --y: 50%; transition: transform 0.6s var(--spring); }
.hc--wide { grid-row: span 2; justify-content: flex-end; background: radial-gradient(90% 70% at 30% 0%, rgba(14, 159, 110, 0.22), transparent 70%), linear-gradient(180deg, rgba(12, 28, 20, 0.7), rgba(6, 14, 10, 0.7)); }
.hc::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--x) var(--y), rgba(92, 255, 177, 0.08), transparent 45%); opacity: 0; transition: opacity 0.4s; }
.hc::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--x) var(--y), rgba(92, 255, 177, 0.7), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity 0.4s; }
.hgrid:hover .hc::before, .hgrid:hover .hc::after { opacity: 1; }
.hc:hover { transform: translateY(-3px); }
.hc__top { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: auto; padding-bottom: 18px; }
.hc__top span:first-child { color: var(--em-2); }
.hc__big { font-family: var(--f-display); font-size: clamp(96px, 11vw, 168px); line-height: 1; letter-spacing: -0.04em; color: var(--em-2); text-shadow: 0 0 60px rgba(47, 196, 141, 0.35); margin-bottom: 4px; }
.hc__big small { font-size: 0.38em; letter-spacing: 0; margin-left: 0.06em; vertical-align: 0.9em; color: var(--phos); }
.hc h3 { font-family: var(--f-display); font-size: clamp(21px, 1.8vw, 26px); line-height: 1.15; }
.hc--wide h3 { font-size: clamp(28px, 2.6vw, 38px); }
.hc h3 i { color: var(--em-2); }
.hc__src { color: var(--em-2); font-size: 10px; }
.hc p:last-child { color: var(--ink-2); font-size: 15px; }

/* ── J5 competencies ─────────────────────────────────────────────────── */
.lab__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 100px); align-items: start; }
.lab__grid > div:first-child { position: sticky; top: 110px; }
.meters { padding-top: 6px; }
.scope { width: 100%; height: 130px; color: rgba(120, 255, 190, 0.09); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: rgba(6, 14, 10, 0.6); }
.scope__wave { fill: none; stroke: var(--phos); stroke-width: 1.6; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 5px var(--phos)); }
.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: baseline; }
.meter__name { font-size: 16px; color: var(--ink); }
.meter__val { grid-row: 1; grid-column: 2; font-size: 13px; letter-spacing: 0.08em; color: var(--phos); font-variant-numeric: tabular-nums; }
.meter__bar { grid-column: 1 / -1; display: flex; gap: 3px; height: 14px; }
.meter__bar i { flex: 1; border-radius: 2px; background: rgba(92, 255, 177, 0.07); box-shadow: inset 0 0 0 1px rgba(92, 255, 177, 0.06); transition: background 0.25s, box-shadow 0.3s; transition-delay: calc(var(--k) * 28ms + var(--dl, 0ms)); }
.meter.is-in .meter__bar i.lit { background: linear-gradient(var(--em-2), var(--em)); box-shadow: 0 0 10px -2px rgba(92, 255, 177, 0.55); }
.meter.is-in .meter__bar i.lit.hi { background: linear-gradient(#B9FFDD, var(--phos)); box-shadow: 0 0 12px rgba(92, 255, 177, 0.8); }
html:not(.js) .meter__bar { background: linear-gradient(90deg, var(--em-2) var(--lv, 100%), rgba(92, 255, 177, 0.07) 0); border-radius: 3px; }

/* ── J6 education ────────────────────────────────────────────────────── */
.edu { margin-top: var(--section); }
.sh--row .sh__h { font-size: clamp(34px, 4.2vw, 64px); }
.edu__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 18px; }
.ic { padding: 30px 24px 26px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; transition: transform 0.6s var(--spring), box-shadow 0.4s; }
.ic::before { /* the DIP notch */ content: ''; position: absolute; top: -1px; left: 50%; width: 30px; height: 15px; margin-left: -15px; border-radius: 0 0 15px 15px; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line-2); }
.ic__pins::before, .ic__pins::after { content: ''; position: absolute; left: 14%; right: 14%; height: 10px; background: repeating-linear-gradient(90deg, #2A3B32 0 6px, transparent 6px 18px); transition: background 0.4s; }
.ic__pins::before { top: -10px; } .ic__pins::after { bottom: -10px; }
.ic:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line-3), 0 0 50px -20px rgba(92, 255, 177, 0.4); }
.ic:hover .ic__pins::before, .ic:hover .ic__pins::after { background: repeating-linear-gradient(90deg, var(--em-2) 0 6px, transparent 6px 18px); }
.ic__mono { font-family: var(--f-sc); font-size: clamp(40px, 4vw, 56px); line-height: 1; color: var(--em-2); margin: 8px 0 14px; }
.ic h3 { font-family: var(--f-display); font-size: 21px; line-height: 1.2; }
.ic__deg { color: var(--phos); font-size: 10px; }
.ic p:last-child { color: var(--muted); font-size: 14.5px; }

/* ── J7 publication ──────────────────────────────────────────────────── */
.pub { isolation: isolate; }
.pub__photo { position: absolute; z-index: -1; left: 0; top: calc(var(--section) - 80px); width: min(1180px, 88%); height: auto; opacity: 0.55; pointer-events: none;
  -webkit-mask-image: radial-gradient(60% 70% at 32% 50%, #000 25%, transparent 72%); mask-image: radial-gradient(60% 70% at 32% 50%, #000 25%, transparent 72%); }
.pub__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 7vw, 120px); align-items: center; }
.book { position: relative; display: grid; place-items: center; perspective: 1800px; padding: 40px 0 60px; }
.book__glow { position: absolute; inset: 10% 15%; border-radius: 50%; background: radial-gradient(closest-side, rgba(47, 196, 141, 0.38), transparent); filter: blur(30px); }
.book__obj { --w: min(330px, 66vw); --t: 34px; position: relative; width: var(--w); aspect-ratio: 676 / 1000; transform-style: preserve-3d; transform: rotateY(var(--by, -26deg)) rotateX(var(--bx, 6deg)); transition: transform 0.8s var(--ease-out); }
.book__front, .book__back, .book__spine, .book__pages { position: absolute; }
.book__front { inset: 0; transform: translateZ(calc(var(--t) / 2)); border-radius: 2px 6px 6px 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05); }
.book__front img { width: 100%; height: 100%; object-fit: cover; }
.book__front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(255, 255, 255, 0.28) calc(var(--sx, 30%) - 18%), transparent var(--sx, 30%)), linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 6%); mix-blend-mode: soft-light; }
.book__back { inset: 0; transform: translateZ(calc(var(--t) / -2)) rotateY(180deg); background: #1A2430; border-radius: 6px 2px 2px 6px; }
.book__spine { top: 0; bottom: 0; left: 0; width: var(--t); transform: translateX(calc(var(--t) / -2)) rotateY(-90deg); background: linear-gradient(90deg, #142030, #24384B 50%, #142030); display: grid; place-items: center; }
.book__spine span { writing-mode: vertical-rl; font: 500 10px var(--f-body); letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.book__pages { top: 4px; bottom: 4px; right: 0; width: var(--t); transform: translateX(calc(var(--t) / 2 - 2px)) rotateY(90deg); background: repeating-linear-gradient(90deg, #E9E6DD 0 1px, #CFCBC0 1px 2px); }
.book__shadow { position: absolute; bottom: 20px; width: 60%; height: 30px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.8), transparent); filter: blur(8px); }
.pub__copy .sh { margin-bottom: 18px; }
.pub__sub { font-family: var(--f-display); font-size: clamp(19px, 1.7vw, 24px); color: var(--em-2); margin-bottom: 22px; }
.pub__copy > p:not(.pub__sub):not(.pub__by) { color: var(--ink-2); max-width: 36em; }
.pub__by { margin: 22px 0 30px; color: var(--muted); }

.press { margin-top: clamp(80px, 10vw, 140px); }
.press__label { color: var(--muted); margin-bottom: 22px; }
.press__belt { overflow: hidden; border-block: 1px solid var(--line); padding: 26px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.press__track { display: flex; align-items: center; gap: clamp(28px, 4vw, 56px); width: max-content; animation: belt 38s linear infinite; }
.press__belt:hover .press__track { animation-play-state: paused; }
.press__track span { font-family: var(--f-sc); font-size: clamp(28px, 3.2vw, 46px); color: var(--dim); white-space: nowrap; transition: color 0.3s, text-shadow 0.3s; }
.press__track span:hover { color: var(--ink); text-shadow: 0 0 30px rgba(92, 255, 177, 0.35); }
.press__track i { flex: none; width: 7px; height: 7px; transform: rotate(45deg); box-shadow: inset 0 0 0 1px var(--em-2); }
@keyframes belt { to { transform: translateX(-50%); } }

/* ══ CLOSE THE CIRCUIT ═════════════════════════════════════════════════ */
.close { position: relative; margin-top: clamp(64px, 8vw, 120px); padding: var(--section) 0 36px; overflow: hidden; isolation: isolate; border-top: 1px solid var(--line); }
.close__photo { position: absolute; left: 0; right: 0; bottom: 0; z-index: -3; width: 100%; height: clamp(420px, 50vw, 760px); object-fit: cover; object-position: 60% 100%; opacity: 0.75;
  -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); }
.close:has(.close__photo) .close__board { opacity: 0.28; }
.close__board { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: 0.6; -webkit-mask-image: radial-gradient(70% 80% at 50% 100%, #000, transparent 85%); mask-image: radial-gradient(70% 80% at 50% 100%, #000, transparent 85%); }
.close::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 60% at 50% 110%, rgba(14, 159, 110, 0.2), transparent 70%), linear-gradient(var(--bg), transparent 30%); pointer-events: none; }
.close__h { font-family: var(--f-sc); font-weight: 400; font-size: clamp(52px, 8.6vw, 140px); line-height: 0.92; letter-spacing: -0.025em; max-width: 9em; }
.close__h em { color: var(--em-2); }

/* ── schematics: small working circuits placed through the page ──────── */
.sh--deco { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); column-gap: clamp(32px, 5vw, 80px); align-items: end; }
.sh--deco > :not(.sh__deco) { grid-column: 1; }
.sh__deco { grid-column: 2; grid-row: 1 / span 3; align-self: end; padding-bottom: 4px; }
.sch--pot { margin-top: 30px; max-width: 360px; }
.sch--iot { margin-top: 48px; max-width: 340px; }

.sch { display: block; width: 100%; height: auto; overflow: visible; }
.sch .w { fill: none; stroke: rgba(120, 255, 190, 0.42); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.5s var(--ease-io), stroke 0.4s, filter 0.4s; }
.sch .p { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.7s 0.55s, stroke 0.5s, fill 0.5s, filter 0.5s; }
.sch .pf { fill: var(--ink-2); opacity: 0; transition: opacity 0.7s 0.55s, fill 0.5s; }
.sch .j { fill: var(--ink-2); opacity: 0; transition: opacity 0.5s 0.9s; }
.sch .t { fill: var(--muted); font: 400 9.5px var(--f-mono); letter-spacing: 0.1em; text-anchor: middle; opacity: 0; transition: opacity 0.6s 0.9s, fill 0.3s; }
.sch.is-in .w { stroke-dashoffset: 0; }
.sch.is-in .p, .sch.is-in .pf, .sch.is-in .j, .sch.is-in .t { opacity: 1; }

/* powered: current in the wires, signals, glowing parts */
.sch .f { fill: none; stroke: var(--phos); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 2 10; opacity: 0; transition: opacity 0.6s; animation: wire 0.9s linear infinite; filter: drop-shadow(0 0 3px var(--phos)); }
.sch.is-on .f { opacity: 0.85; }
@keyframes wire { to { stroke-dashoffset: -12; } }
.sch .p.lt { opacity: 1; fill: transparent; stroke: transparent; transition: fill 0.5s, stroke 0.5s, filter 0.5s; transition-delay: var(--dl, 0.9s); }
.sch.is-on .p.lt { fill: var(--phos); stroke: var(--phos); filter: drop-shadow(0 0 7px var(--phos)) drop-shadow(0 0 18px rgba(92, 255, 177, 0.6)); }
.sch .halo { fill: url(#glowG); opacity: 0; transition: opacity 0.8s; transition-delay: var(--dl, 0.9s); }
.sch.is-on .halo { opacity: 1; }
.sch.is-in .p.ray, .sch.is-in .pf.ray { opacity: 0; transition-delay: var(--dl, 1s); }
.sch.is-on .p.ray { opacity: 1; stroke: var(--phos); }
.sch.is-on .pf.ray { opacity: 1; fill: var(--phos); }
.sch .sig { fill: none; stroke: rgba(92, 255, 177, 0.3); stroke-width: 1.4; stroke-linejoin: round; opacity: 0; transition: opacity 0.6s 1s; }
.sch .sig-run { fill: none; stroke: var(--phos); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26 260; opacity: 0; filter: drop-shadow(0 0 4px var(--phos)); animation: sigRun 2.2s linear infinite; transition: opacity 0.6s 1.1s; }
.sch.is-on .sig, .sch.is-on .sig-run { opacity: 1; }
@keyframes sigRun { from { stroke-dashoffset: 286; } to { stroke-dashoffset: 0; } }
.sch .bar { fill: var(--phos); transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 100%; transition: transform 1.6s var(--ease-out); transition-delay: var(--dl, 0.5s); filter: drop-shadow(0 0 4px var(--phos)); }
.sch.is-on .bar { transform: scaleY(1); }
.sch.is-on .xtal { animation: xtal 0.5s steps(2) infinite; }
@keyframes xtal { 50% { fill: var(--phos); stroke: var(--phos); } }
.sch.is-in .p.wave { opacity: 0; }
.sch.is-on .p.wave { stroke: var(--phos); animation: waveP 1.8s var(--ease-out) infinite; animation-delay: var(--dl, 0s); }
@keyframes waveP { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.sch.is-on .wiper { animation: wiper 3.4s var(--ease-io) infinite alternate; }
@keyframes wiper { to { transform: translateX(96px); } }
.sch .needle { fill: none; stroke: var(--phos); stroke-width: 1.8; stroke-linecap: round; transform-origin: 250px 84px; transform: rotate(-58deg); opacity: 0; transition: opacity 0.6s 1s; filter: drop-shadow(0 0 3px var(--phos)); }
.sch.is-on .needle { opacity: 1; animation: needle 3.4s var(--ease-io) infinite alternate; }
@keyframes needle { to { transform: rotate(58deg); } }

/* logic: the LED follows Q, wires carrying a 1 light up */
.sch--logic { --dl: 0s; }
.sch--logic .lg.hi { stroke: var(--phos); filter: drop-shadow(0 0 3px var(--phos)); }
.sch--logic .bit.hi { fill: var(--phos); }
.sch--logic.is-on .p.lt { fill: transparent; stroke: transparent; filter: none; }
.sch--logic.is-on.q-on .p.lt { fill: var(--phos); stroke: var(--phos); filter: drop-shadow(0 0 7px var(--phos)) drop-shadow(0 0 18px rgba(92, 255, 177, 0.6)); }
.sch--logic.is-on .halo, .sch--logic.is-on .p.ray { opacity: 0; }
.sch--logic.is-on.q-on .halo, .sch--logic.is-on.q-on .p.ray { opacity: 1; }

/* ── the closing board ──────────────────────────────────────────────── */
.circuit { margin: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 48px); }
.circuit__scroll { overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.circuit__scroll::-webkit-scrollbar { display: none; }
.circuit__svg { min-width: 760px; }
.circuit__svg .t { font-size: 11px; }
.circuit__lever { transform-origin: 162px 60px; transform: rotate(-28deg); transition: transform 0.6s var(--spring), stroke 0.4s; }
.sch.is-on .circuit__lever { transform: none; stroke: var(--phos); }
.circuit__hit { fill: transparent; cursor: pointer; pointer-events: all; }
.circuit__svg .core-l, .circuit__svg .ldr, .circuit__svg .q1 { transition: stroke 0.5s, filter 0.5s; }
.sch.is-on .core-l { stroke: var(--em-2); filter: drop-shadow(0 0 4px var(--phos)); transition-delay: 0.7s; }
.sch.is-on .ldr { stroke: var(--phos); filter: drop-shadow(0 0 4px var(--phos)); transition-delay: 0.9s; }
.sch.is-on .q1 { stroke: var(--phos); filter: drop-shadow(0 0 6px var(--phos)); transition-delay: 1.1s; }

.circuit__hud {
  --c: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin-top: 18px; padding: 12px 12px 12px 18px;
  color: var(--muted); font-size: 10.5px; background: rgba(6, 14, 10, 0.72); box-shadow: inset 0 0 0 1px var(--line-2);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.hud__led { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: background 0.4s, box-shadow 0.4s; }
.circuit.is-live .hud__led { background: var(--phos); box-shadow: 0 0 10px var(--glow); }
.hud__state { color: var(--ink); min-width: 10ch; }
.hud__cell b { color: var(--phos); font-weight: 500; font-variant-numeric: tabular-nums; }
.hud__btn {
  --c: 7px; margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px 0 9px; border: 0; cursor: pointer;
  background: rgba(92, 255, 177, 0.07); color: var(--ink); font: inherit; letter-spacing: inherit; text-transform: inherit;
  box-shadow: inset 0 0 0 1px var(--line-3); clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); transition: background 0.3s;
}
.hud__btn:hover { background: rgba(92, 255, 177, 0.14); }
.hud__sw { position: relative; width: 30px; height: 14px; border-radius: 2px; background: rgba(120, 255, 190, 0.12); box-shadow: inset 0 0 0 1px var(--line-2); }
.hud__sw i { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 1px; background: var(--muted); transition: transform 0.45s var(--spring), background 0.3s, box-shadow 0.3s; }
.hud__btn[aria-pressed="true"] .hud__sw i { transform: translateX(16px); background: var(--phos); box-shadow: 0 0 8px var(--phos); }


.links { display: grid; border-top: 1px solid var(--line-2); }
.links a { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: clamp(20px, 2.4vw, 30px) 4px; border-bottom: 1px solid var(--line-2); overflow: hidden; isolation: isolate; }
.links a::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(92, 255, 177, 0.1), rgba(92, 255, 177, 0.02) 60%, transparent); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease-out); }
.links a::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--phos); box-shadow: 0 0 10px var(--phos); transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--ease-out); }
.links a:hover::before, .links a:hover::after { transform: none; }
.links span { color: var(--muted); }
.links b { font-family: var(--f-display); font-weight: 400; font-size: clamp(22px, 3vw, 42px); letter-spacing: -0.015em; line-height: 1.1; overflow-wrap: anywhere; transition: transform 0.6s var(--ease-out), color 0.3s; }
.links i { --ci: 10px; display: grid; place-items: center; width: 48px; height: 48px; color: var(--phos); background: rgba(92, 255, 177, 0.06); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 18px; clip-path: polygon(0 0, calc(100% - var(--ci)) 0, 100% var(--ci), 100% 100%, var(--ci) 100%, 0 calc(100% - var(--ci))); transition: transform 0.6s var(--spring), background 0.3s, color 0.3s; }
.links a:hover b { transform: translateX(10px); color: var(--phos); }
.links a:hover i { transform: translate(3px, -3px); background: var(--phos); color: #02130C; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px 32px; margin-top: clamp(56px, 8vw, 110px); color: var(--muted); }
.foot__brand { display: inline-flex; align-items: center; gap: 12px; }
.foot__brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.18); }
.foot__brand .wm { font-size: 22px; color: var(--ink); }
.foot .mono { font-size: 10px; }

/* ══ RESPONSIVE ═════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "core core" "m0 m2" "m1 m3"; gap: 20px; }
  .core { padding: 30px 0 40px; }
  .core__pkg { width: min(260px, 70vw); }
  .board__traces { display: none; }
  .edu__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .sh--deco { grid-template-columns: 1fr; }
  .sh__deco { grid-column: 1; grid-row: auto; max-width: 320px; margin-top: 30px; }
  .pub__photo { width: 140%; left: -20%; top: 40px; }
  .hero__grid { grid-template-columns: 1fr; }
  .chip { justify-self: center; width: min(400px, 86%); margin-top: 8px; }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 26px; }
  .ro, .ro + .ro { padding: 18px 12px 0 0; }
  .ro + .ro::after, .ro::before { display: none; }
  .ro { border-top: 1px solid var(--line-2); }
  .ro:last-child { grid-column: 1 / -1; }
  .readouts::before { display: none; }
  .bio__grid, .lab__grid, .pub__grid { grid-template-columns: 1fr; }
  .sheet { position: relative; top: 0; }
  .hgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc--wide { grid-column: 1 / -1; grid-row: auto; }
  .trace { --when: 0px; --gap: 34px; }
  .role { grid-template-columns: var(--gap) minmax(0, 1fr); }
  .role__when { grid-column: 2; grid-row: 1; text-align: left; padding: 0 0 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
  .role__node { grid-column: 1; grid-row: 1; margin: 1px 0 0 -6.5px; justify-self: start; }
  .role__card { grid-column: 2; grid-row: 2; }
  .trace__rail { left: 0; margin-left: 0; }
  .role__card::before { display: none; }
  .book { order: 1; }
  .pub__copy { order: 2; }
}
@media (max-width: 640px) {
  :root { --r: 16px; }
  .board { grid-template-columns: 1fr; grid-template-areas: "core" "m0" "m1" "m2" "m3"; }
  .hgrid, .edu__grid { grid-template-columns: 1fr; }
  .hero__name { font-size: clamp(56px, 17vw, 96px); }
  .status { font-size: 9.5px; letter-spacing: 0.12em; }
  .status__sep { display: none; }
  .btn { height: 50px; font-size: 14.5px; }
  .back { height: 44px; font-size: 13px; padding-right: 15px; }
  .back .btn__ico { width: 34px; height: 34px; }
  .back .wm { font-size: 14px; }
  .circuit__hud { gap: 8px 16px; }
  .hud__btn { margin-left: 0; }
  .hero__photo { opacity: 0.38; object-position: 78% 50%; -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.35), #000 55%, transparent); mask-image: linear-gradient(rgba(0, 0, 0, 0.35), #000 55%, transparent); }
  .close { padding-bottom: 120px; }
  .close__photo { height: 360px; opacity: 0.6; }
  .links a { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; }
  .links span, .links b { grid-column: 1; }
  .links i { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 40px; height: 40px; }
  .chip__part { display: none; }
  .sheet th, .sheet td { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; transition-delay: 0s !important; }
  .chip__scan, .chip__pins::after { display: none; }
  .press__track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .press__track [aria-hidden="true"], .press__track [aria-hidden="true"] + i { display: none; }
}

/* back button: a solid plate (the backdrop blur never applied, so page text showed through) */
.back { --fill: linear-gradient(rgba(3, 8, 6, 0.95), rgba(3, 8, 6, 0.95)); padding: 0 20px 0 5px; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55)); }
.back::after { backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 640px) { .back { padding-right: 16px; } }

/* ══ MOBILE (≤640px only; desktop untouched) ═════════════════════════════ */
@media (max-width: 640px) {
  /* back: a compact icon button, so it never sits over headings */
  .back { height: 44px; padding: 0 3px; gap: 0; }
  .back .btn__ico { width: 38px; height: 38px; }
  .back__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* once the columns stack, the sticky intro would slide over the skill bars */
@media (max-width: 920px) { .lab__grid > div:first-child { position: relative; top: 0; } }
