/* =====================================================================
   Mohamed Abdelsalam — Portfolio
   Aesthetic: night blueprint · drawing title blocks · BIM wireframes
   ===================================================================== */

:root {
  --bg: #080c11;
  --bg-2: #0b1118;
  --surface: #0f161e;
  --surface-2: #141d27;
  --surface-3: #1a2531;
  --line: color-mix(in srgb, var(--steel) 8%, transparent);
  --line-2: color-mix(in srgb, var(--steel) 16%, transparent);
  --line-3: color-mix(in srgb, var(--steel) 30%, transparent);
  --text: #e9eef3;
  --text-2: #b3c0cc;
  --muted: #7a8897;
  --amber: #2dd4bf;                                            /* accent (default teal) — set by the palette */
  --amber-ink: #051917;                                        /* text on accent fills */
  --amber-2: color-mix(in srgb, var(--amber) 70%, #fff);      /* emphasis text */
  --accent-text: var(--amber);                                 /* accent used as text/lines */
  --steel: #9fb3c8;
  --sky: #6cc4e8;
  --mint: #79d7a4;
  --edu: #8fa6ff;                                              /* timeline: education */
  --vol: #f2b544;                                              /* timeline: volunteering */
  --logo-ink: #2f3b48;                                         /* dark parts of the portrait logo */
  --red: #ff5d52;
  --paper: #f4f3ef;
  --paper-ink: #11161c;
  --shadow-c: rgba(0, 0, 0, 0.8);
  --h1-a: #ffffff;
  --h1-b: #b9c6d3;
  color-scheme: dark;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ---------- light theme: blueprint on paper ---------- */
:root[data-theme="light"] {
  --bg: #f2f1ed;
  --bg-2: #eae8e2;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --surface-3: #ecebe6;
  --steel: #3d5266;
  --line: rgba(40, 56, 74, 0.09);
  --line-2: rgba(40, 56, 74, 0.17);
  --line-3: rgba(40, 56, 74, 0.32);
  --text: #10161d;
  --text-2: #3b4957;
  --muted: #687786;
  --amber-2: color-mix(in srgb, var(--amber) 62%, #000);
  --accent-text: color-mix(in srgb, var(--amber) 65%, #000);
  --sky: #1c86b8;
  --mint: #1f9d63;
  --edu: #3d5fd1;
  --vol: #a8701a;
  --logo-ink: #10161d;
  --red: #e0453a;
  --paper: #ffffff;
  --shadow-c: rgba(30, 42, 56, 0.28);
  --h1-a: #0b1015;
  --h1-b: #3b4957;
  color-scheme: light;
}
:root[data-theme="light"] body::after { opacity: 0.035; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--steel) 3.5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--steel) 3.5%, transparent) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 20%, transparent 85%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 20%, transparent 85%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .footer { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
strong { font-weight: 650; color: var(--text); }
em { font-style: italic; }
::selection { background: var(--amber); color: var(--amber-ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--f-mono); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--amber); color: var(--amber-ink); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: var(--h);
  padding: 0 22px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font: 600 14px/1 var(--f-display);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn--primary:hover { filter: brightness(1.08) saturate(1.05); }
.btn--line:hover { border-color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
.btn--sm { --h: 38px; padding: 0 14px; font-size: 13px; }
.link-arrow { font-weight: 600; font-size: 14px; text-decoration: none; color: var(--text-2); padding: 6px 2px; border-bottom: 1px solid var(--line-3); transition: color 0.2s, border-color 0.2s; }
.link-arrow:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s;
}
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom-color: var(--line-2); }
.nav-inner { display: flex; align-items: center; gap: 24px; }
.nav-links { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
/* the portrait logo on a transparent background, in two layers (independent of the palette):
   the dark parts (hair, beard, suit) in --logo-ink, the light parts (face, shirt) always white.
   Dark mode reads as a white logo; light mode as the original black artwork. */
.brand-mark { width: 40px; height: 40px; border: 1px solid var(--line-3); display: grid; place-items: center; overflow: hidden; background: transparent; transition: border-color 0.3s, box-shadow 0.3s; }
.brand-mark i { position: relative; width: 34px; height: 34px; }
.brand-mark i::before,
.brand-mark i::after { content: ""; position: absolute; inset: 0; }
.brand-mark i::before {
  background: var(--logo-ink);
  -webkit-mask: url("../assets/img/logo-ink.png") center / contain no-repeat;
  mask: url("../assets/img/logo-ink.png") center / contain no-repeat;
}
.brand-mark i::after {
  background: #ffffff;
  -webkit-mask: url("../assets/img/logo-fill.png") center / contain no-repeat;
  mask: url("../assets/img/logo-fill.png") center / contain no-repeat;
}
.brand:hover .brand-mark { border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 30%, transparent); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-weight: 700; font-size: 15px; font-stretch: 105%; letter-spacing: -0.005em; }
.brand-text small { font: 500 10px/1.3 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links > a:not(.btn) {
  position: relative;
  padding: 10px 10px;
  font: 500 12px/1 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links > a:not(.btn) i { display: none; font-style: normal; color: var(--muted); margin-right: 6px; font-size: 10px; }
.nav-links > a:not(.btn)::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease); }
.nav-links > a:not(.btn):hover, .nav-links > a.is-active { color: var(--text); }
.nav-links > a.is-active i { color: var(--accent-text); }
.nav-links > a:not(.btn):hover::after, .nav-links > a.is-active::after { transform: scaleX(1); }
.nav-cv { margin-left: 10px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line-3); background: transparent; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--text); transition: transform 0.3s var(--ease), top 0.3s var(--ease); }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + clamp(28px, 6vh, 72px));
  display: flex;
  flex-direction: column;
  overflow: clip;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 60% at 78% 40%, color-mix(in srgb, var(--sky) 8%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 40% at 70% 70%, color-mix(in srgb, var(--amber) 6%, transparent), transparent 70%);
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  flex: 1;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font: 500 12px/1.5 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow::before { content: ""; flex: 0 0 34px; height: 1px; background: var(--amber); }
.h1 { margin: 22px 0 0; font-weight: 400; line-height: 0.92; }
.h1-line { display: block; overflow: hidden; overflow: visible clip; padding-bottom: 0.06em; }
.h1-first {
  display: block;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 7.4vw, 6.6rem);
  letter-spacing: -0.01em;
  color: var(--text-2);
}
.h1-last {
  display: block;
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(2.3rem, 5.2vw, 4.75rem);
  letter-spacing: -0.025em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--h1-a) 30%, var(--h1-b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { max-width: 34em; margin: 28px 0 0; font-size: clamp(1.05rem, 1.35vw, 1.22rem); line-height: 1.6; color: var(--text-2); }
.lede em { font-family: var(--f-serif); font-size: 1.18em; color: var(--amber-2); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 36px; }
.hero-cta .link-arrow { margin-left: 8px; }

.hero-visual { position: relative; justify-self: end; width: min(100%, 540px); aspect-ratio: 1 / 1.12; }
.hero-globe { position: absolute; z-index: 0; width: 120%; aspect-ratio: 1; right: -38%; top: -23%; cursor: grab; }
.hero-globe.is-dragging { cursor: grabbing; }
.portrait { position: absolute; z-index: 1; left: 0; bottom: 34px; width: 61%; aspect-ratio: 4 / 5; margin: 0; pointer-events: none; }
.portrait-frame { position: relative; height: 100%; padding: 10px; border: 1px solid var(--line-3); background: color-mix(in srgb, var(--bg) 60%, transparent); box-shadow: 0 50px 100px -40px var(--shadow-c); }
.portrait-frame picture, .portrait-frame img { display: block; width: 100%; height: 100%; }
.portrait-frame img { object-fit: cover; object-position: 50% 20%; filter: saturate(0.92) contrast(1.04); }
.portrait-cap {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  display: flex;
  justify-content: space-between;
  padding: 26px 14px 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 85%, transparent));
}
.cm { position: absolute; width: 18px; height: 18px; border-color: var(--accent-text); border-style: solid; border-width: 0; }
.cm-tl { left: -9px; top: -9px; border-left-width: 1px; border-top-width: 1px; }
.cm-tr { right: -9px; top: -9px; border-right-width: 1px; border-top-width: 1px; }
.cm-bl { left: -9px; bottom: -9px; border-left-width: 1px; border-bottom-width: 1px; }
.cm-br { right: -9px; bottom: -9px; border-right-width: 1px; border-bottom-width: 1px; }
/* ---------- hero ID scan (CIA-style): reveal → face lock → typed role boxes ---------- */
.scan { position: absolute; inset: 10px; z-index: 2; overflow: hidden; pointer-events: none; }
.scan::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px); opacity: 0.35; }
.scan-beam { position: absolute; left: 0; right: 0; top: 0; height: 2px; opacity: 0; background: var(--amber); box-shadow: 0 0 10px 1px var(--amber), 0 0 34px 6px color-mix(in srgb, var(--amber) 45%, transparent); }
.scan-beam::before { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 110px; background: linear-gradient(transparent, color-mix(in srgb, var(--amber) 26%, transparent)); }
.js .portrait-frame picture { clip-path: inset(0 0 100% 0); }
.portrait.is-scanning .portrait-frame picture { animation: idReveal 1.7s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards; }
.portrait.is-scanned .portrait-frame picture { clip-path: none; animation: none; }
.portrait.is-scanning .scan-beam { animation: idBeam 1.7s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards; }
.portrait.is-live .scan-beam { animation: idSweep 7s linear 0.6s infinite; }
@keyframes idReveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes idBeam { 0% { top: 0; opacity: 1; } 94% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes idSweep { 0% { top: 0; opacity: 0; } 3% { opacity: 0.85; } 30% { top: 100%; opacity: 0.85; } 31%, 100% { top: 100%; opacity: 0; } }

.face-lock {
  --b: var(--amber);
  position: absolute; left: 29%; top: 23%; width: 44%; height: 50%; z-index: 3; pointer-events: none;
  background:
    linear-gradient(var(--b), var(--b)) left top / 16px 2px no-repeat, linear-gradient(var(--b), var(--b)) left top / 2px 16px no-repeat,
    linear-gradient(var(--b), var(--b)) right top / 16px 2px no-repeat, linear-gradient(var(--b), var(--b)) right top / 2px 16px no-repeat,
    linear-gradient(var(--b), var(--b)) left bottom / 16px 2px no-repeat, linear-gradient(var(--b), var(--b)) left bottom / 2px 16px no-repeat,
    linear-gradient(var(--b), var(--b)) right bottom / 16px 2px no-repeat, linear-gradient(var(--b), var(--b)) right bottom / 2px 16px no-repeat;
  transition: opacity 0.35s, transform 0.6s var(--ease);
}
.js .face-lock { opacity: 0; transform: scale(1.35); }
.portrait.is-scanned .face-lock { opacity: 1; transform: none; }
.face-lock em { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; font-size: 9px; font-style: normal; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.fl-top { left: 0; bottom: calc(100% + 6px); background: var(--amber); color: var(--amber-ink); }
.fl-top .pulse { width: 5px; height: 5px; background: currentColor; box-shadow: none; animation: blink 1s steps(1) infinite; }
.fl-bot { right: 0; top: calc(100% + 6px); background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--amber) 50%, transparent); }
.rec { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--red); vertical-align: 1px; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.id-stack { position: absolute; z-index: 2; left: calc(61% + 30px); bottom: 34px; width: max-content; margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.idbox { position: relative; padding: 8px 12px 9px; border: 1px solid var(--line-3); border-left: 2px solid var(--amber); background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: opacity 0.35s, transform 0.45s var(--ease); }
.idbox::before { content: ""; position: absolute; right: 100%; top: 50%; width: 30px; height: 1px; background: var(--line-3); transform-origin: right; transition: transform 0.4s var(--ease); }
.idbox::after { content: ""; position: absolute; left: -33px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.idbox-k { display: block; min-height: 1.3em; margin-bottom: 3px; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.idbox-v { display: block; min-height: 1.3em; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; letter-spacing: -0.005em; color: var(--text); }
.idbox.is-typing .idbox-v::after { content: "▍"; margin-left: 1px; color: var(--amber); animation: blink 0.8s steps(1) infinite; }
.js .idbox:not(.is-on) { opacity: 0; transform: translateX(-10px); }
.js .idbox:not(.is-on)::before { transform: scaleX(0); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 60%, transparent); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--mint) 0%, transparent); } 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 0%, transparent); } }
.dimline { position: absolute; left: 0; right: 0; bottom: -34px; height: 12px; border-left: 1px solid var(--line-3); border-right: 1px solid var(--line-3); }
.dimline::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-3); }
.dimline span { white-space: nowrap; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 0 10px; background: var(--bg); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(56px, 8vh, 88px) 0 0; border-top: 1px solid var(--line-2); }
.stat { position: relative; padding: 22px 22px 26px 0; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.stat + .stat { padding-left: 22px; border-left: 1px solid var(--line-2); }
.stat::before { content: ""; position: absolute; top: -1px; left: 0; width: 28px; height: 2px; background: var(--amber); }
.stat + .stat::before { left: 22px; }
.stat dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); line-height: 1.5; }
.stat dd { margin: 0; display: flex; align-items: flex-start; }
.stat b { font-size: clamp(2.2rem, 3.6vw, 3.3rem); line-height: 1; font-weight: 700; font-stretch: 110%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat sup { font-size: 1.3rem; color: var(--accent-text); font-weight: 600; margin-left: 2px; top: 0; }

.titleblock { margin-top: 28px; border-top: 1px solid var(--line-2); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.titleblock-inner { display: flex; }
.titleblock span { flex: 1; padding: 14px 0 16px; display: flex; flex-direction: column; gap: 3px; color: var(--text-2); }
.titleblock span + span { padding-left: 16px; border-left: 1px solid var(--line-2); }
.titleblock i { font-style: normal; font-size: 9px; color: var(--muted); letter-spacing: 0.16em; }
.titleblock .scroll-cue { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 12px; padding-right: 0; }
.scroll-cue b { width: 1px; height: 28px; background: var(--line-3); position: relative; overflow: hidden; }
.scroll-cue b::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--amber); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }

/* CAD crosshair in hero */
.xhair { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; z-index: 0; }
.hero:hover .xhair.on { opacity: 1; }
.xhair .xh, .xhair .xv { position: absolute; background: color-mix(in srgb, var(--amber) 16%, transparent); }
.xhair .xh { left: 0; right: 0; height: 1px; top: var(--y, 50%); }
.xhair .xv { top: 0; bottom: 0; width: 1px; left: var(--x, 50%); }
.xread { position: absolute; left: var(--x, 50%); top: var(--y, 50%); transform: translate(12px, 10px); font-size: 10px; letter-spacing: 0.08em; color: var(--accent-text); white-space: nowrap; }

/* load choreography */
.js [data-anim] { opacity: 0; transform: translateY(26px); animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 1ms); }
.js .h1-line [data-anim] { transform: translateY(105%); opacity: 1; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- section scaffolding ---------- */
.section { position: relative; padding: clamp(96px, 13vw, 160px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; margin-bottom: clamp(48px, 6vw, 80px); }
.sec-index { margin: 12px 0 0; display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sec-index b { color: var(--accent-text); font-weight: 600; }
.sec-index span { width: 32px; height: 1px; background: var(--line-3); }
.sec-title { margin: 0; font-size: clamp(2.1rem, 4.6vw, 3.8rem); line-height: 1.04; font-weight: 700; font-stretch: 106%; letter-spacing: -0.025em; }
.sec-title em { font-family: var(--f-serif); font-weight: 400; font-stretch: 100%; letter-spacing: -0.01em; color: var(--amber-2); }
.sec-sub { max-width: 60ch; margin: 20px 0 0; color: var(--text-2); font-size: 1.05rem; }

.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--rd, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 5px 10px; font: 500 11px/1.3 var(--f-mono); letter-spacing: 0.02em; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; background: color-mix(in srgb, var(--steel) 3%, transparent); }

/* ---------- profile ---------- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: clamp(40px, 7vw, 110px); align-items: start; }
.sheet-wrap { perspective: 1400px; }
.sheet {
  position: relative;
  padding: 14px;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 2px;
  transform: rotate(-1.6deg);
  box-shadow: 0 50px 90px -40px var(--shadow-c), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.8s var(--ease);
}
.sheet::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(17, 22, 28, 0.35); pointer-events: none; }
.sheet-wrap:hover .sheet { transform: rotate(0deg) translateY(-6px); }
.sheet-photo { position: relative; aspect-ratio: 4 / 4.4; overflow: hidden; background: #fff; border: 1px solid var(--paper-ink); }
.sheet-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.sheet-scale { position: absolute; right: 8px; bottom: 8px; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 6px; border: 1px solid var(--paper-ink); background: #fff; }
.sheet-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 11px; line-height: 1.4; }
.sheet-table th, .sheet-table td { border: 1px solid var(--paper-ink); padding: 7px 9px; text-align: left; vertical-align: top; }
.sheet-table th { width: 30%; font-weight: 500; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: #5a6470; }
.sheet-table td { font-weight: 500; }
.sheet-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: #5a6470; }

.profile-copy p { margin: 0 0 1.2em; color: var(--text-2); font-size: 1.06rem; max-width: 62ch; }
.profile-copy p.big { font-size: clamp(1.25rem, 1.9vw, 1.6rem); line-height: 1.45; color: var(--text); font-weight: 400; letter-spacing: -0.01em; }
.callouts { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); }
.callout { display: flex; flex-direction: column; gap: 8px; padding: 22px 20px 6px 0; }
.callout + .callout { padding-left: 20px; border-left: 1px solid var(--line-2); }
.callout-k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.callout b { font-size: 1.08rem; font-weight: 700; font-stretch: 104%; }
.callout > span:last-child { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }

/* ---------- expertise ---------- */
.disc-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; }
.disc { grid-column: span 2; position: relative; padding: clamp(24px, 3vw, 36px); background: var(--bg-2); box-shadow: 0 0 0 1px var(--line-2); transition: background 0.4s, opacity 0.9s var(--ease), transform 0.9s var(--ease); overflow: hidden; }
.disc--wide { grid-column: span 3; }
.disc::after { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); }
.disc:hover { background: var(--surface); }
.disc:hover::after { transform: scaleX(1); }
.disc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.disc-code { font-size: 64px; line-height: 0.8; font-weight: 800; font-stretch: 125%; color: transparent; -webkit-text-stroke: 1px var(--line-3); transition: -webkit-text-stroke-color 0.4s; }
.disc:hover .disc-code { -webkit-text-stroke-color: var(--accent-text); }
.disc-ico { width: 34px; height: 34px; fill: none; stroke: var(--amber); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.disc h3 { margin: 0 0 10px; font-size: 1.35rem; font-weight: 700; font-stretch: 106%; letter-spacing: -0.01em; }
.disc p { margin: 0 0 22px; color: var(--text-2); max-width: 46ch; }

.marquee { margin-top: clamp(72px, 9vw, 120px); padding: 18px 0; border-block: 1px solid var(--line-2); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee span { padding: 0 28px; font-size: clamp(2rem, 5.4vw, 4.4rem); line-height: 1.1; font-weight: 800; font-stretch: 122%; text-transform: uppercase; letter-spacing: -0.02em; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--steel) 32%, transparent); white-space: nowrap; }
.marquee span:nth-child(4n + 2) { -webkit-text-stroke-color: color-mix(in srgb, var(--amber) 75%, transparent); }
.marquee span::after { content: "/"; margin-left: 56px; -webkit-text-stroke: 1px var(--line-2); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- career / 3D timeline ---------- */
.tl-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: calc(clamp(48px, 6vw, 80px) * -0.45) 0 40px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px;
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.chip-btn:hover { border-color: var(--line-3); color: var(--text); }
.chip-btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-btn i, .tl-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.c-work { background: var(--amber); }
.c-edu { background: var(--edu); }
.c-vol { background: var(--vol); }

.tl-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.tl-panel { position: sticky; top: calc(var(--nav-h) + 20px); height: calc(100vh - var(--nav-h) - 40px); min-height: 520px; max-height: 880px; }
.tl-stage {
  position: relative;
  height: 100%;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(ellipse 70% 55% at 55% 62%, color-mix(in srgb, var(--sky) 7%, transparent), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg-2);
  overflow: hidden;
}
.tl-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.tl-stage canvas.is-dragging { cursor: grabbing; }
.tl-hud { position: absolute; left: 22px; top: 20px; right: 22px; pointer-events: none; }
.hud-top { display: flex; align-items: baseline; gap: 10px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hud-top b { font-size: 34px; letter-spacing: -0.02em; color: var(--hud-c, var(--amber)); font-weight: 600; transition: color 0.4s; }
.hud-year { margin-top: 4px; font-size: 12px; letter-spacing: 0.12em; color: var(--text-2); }
.hud-title { margin-top: 10px; max-width: 26ch; font-family: var(--f-display); font-size: 19px; line-height: 1.2; font-weight: 700; font-stretch: 104%; color: var(--text); letter-spacing: -0.01em; }
.hud-org { margin-top: 4px; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.hud-bar { margin-top: 14px; width: 160px; height: 2px; background: var(--line-2); }
.hud-bar i { display: block; height: 100%; width: 0; background: var(--hud-c, var(--amber)); transition: width 0.5s var(--ease), background 0.4s; }
.tl-legend { position: absolute; left: 22px; bottom: 18px; margin: 0; padding: 0; list-style: none; display: flex; gap: 14px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tl-legend li { display: flex; align-items: center; gap: 6px; }
.tl-hint { position: absolute; right: 18px; bottom: 18px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); pointer-events: none; }

.tl-track { position: relative; padding-left: 64px; display: flex; flex-direction: column; gap: 30px; }
.tl-rail { position: absolute; left: 21px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.tl-rail i { position: absolute; left: 0; top: 0; width: 1px; height: var(--p, 0%); background: linear-gradient(var(--sky), var(--amber)); box-shadow: 0 0 10px color-mix(in srgb, var(--amber) 50%, transparent); }

.tl-card {
  --c: var(--accent-text);
  position: relative;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  transition: border-color 0.4s, box-shadow 0.5s, opacity 0.4s;
  will-change: transform;
}
.tl-card[data-type="edu"] { --c: var(--edu); }
.tl-card[data-type="vol"] { --c: var(--vol); }
.tl-card.is-active { border-color: color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 0 40px 90px -50px color-mix(in srgb, var(--c) 55%, transparent), inset 0 1px 0 color-mix(in srgb, var(--c) 30%, transparent); }
.tl-card[hidden] { display: none; }
.tl-card.is-entering { animation: cardIn 0.6s var(--ease); }
@keyframes cardIn { from { opacity: 0; } to { opacity: 1; } }

.tl-marker { position: absolute; left: -64px; top: 20px; width: 44px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 0.08em; color: var(--muted); transform: translateZ(0); }
.lvl-sym {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-3);
  background: conic-gradient(var(--line-3) 0 90deg, var(--bg) 90deg 180deg, var(--line-3) 180deg 270deg, var(--bg) 270deg);
  transition: border-color 0.4s, background 0.4s, transform 0.6s var(--ease);
}
.tl-card.is-active .lvl-sym { border-color: var(--c); background: conic-gradient(var(--c) 0 90deg, var(--bg) 90deg 180deg, var(--c) 180deg 270deg, var(--bg) 270deg); transform: rotate(90deg) scale(1.12); }
.tl-card.is-active .tl-marker { color: var(--c); }

.tl-media { position: relative; aspect-ratio: 16 / 8; border-bottom: 1px solid var(--line-2); background: radial-gradient(ellipse 70% 70% at 50% 60%, color-mix(in srgb, var(--sky) 7%, transparent), transparent 70%), var(--bg); overflow: hidden; }
.tl-media canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.tl-media canvas.is-dragging { cursor: grabbing; }
.media-tag { position: absolute; left: 14px; top: 12px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); pointer-events: none; }
.media-tag::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; background: var(--c); vertical-align: 1px; }
.media-hint { position: absolute; right: 14px; bottom: 10px; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); pointer-events: none; }

/* photo card: text on the left, the full photo (never cropped) framed on the right */
.tl-card--photo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
.tl-photo { display: flex; align-items: center; justify-content: center; padding: 26px 30px; border-left: 1px solid var(--line-2); }
.tl-photo-frame { position: relative; width: 100%; margin: 0; padding: 6px; border: 1px solid var(--line-3); background: var(--bg); }
.tl-photo-frame picture, .tl-photo-frame img { display: block; width: 100%; height: auto; }
/* the type badge sits top-right of the card like every other card; the photo starts below it */
.tl-card--photo .tl-type { position: absolute; top: clamp(20px, 2.6vw, 30px); right: clamp(20px, 2.6vw, 30px); }
.tl-card--photo .tl-photo { padding-top: 72px; }
.tl-photo-frame .media-tag { top: auto; left: 16px; bottom: 14px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75); }

.tl-body { padding: clamp(20px, 2.6vw, 30px); }
.tl-head { display: flex; align-items: center; gap: 14px; }
/* every company logo uses the same tile: as tall as the name + location block beside it (40px),
   with the 288×156 proportion of the pre-normalised PNG canvases — same ratio for all, never stretched */
.logo {
  flex: 0 0 auto;
  height: 40px; width: auto; aspect-ratio: 288 / 156;
  display: grid; place-items: center;
  border: 1px solid var(--line-3);
  background: linear-gradient(135deg, var(--surface-3), var(--surface));
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.02em;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.logo::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--c); }
.logo.has-img { padding: 0; background: #fff; }
.logo.has-img span { display: none; }
.logo img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.tl-org { flex: 1; min-width: 0; }
.tl-company { margin: 0; font-weight: 650; font-size: 15px; line-height: 1.3; }
.via { font: 500 10px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.tl-loc { margin: 3px 0 0; font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }
.tl-type { align-self: flex-start; padding: 5px 9px; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 999px; white-space: nowrap; }
.tl-role { margin: 20px 0 6px; font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.15; font-weight: 700; font-stretch: 106%; letter-spacing: -0.02em; }
.tl-date { margin: 0 0 16px; font-size: 12px; letter-spacing: 0.04em; color: var(--text-2); }
.tl-dur { margin-left: 8px; padding: 3px 8px; font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; }
.tl-dur:empty { display: none; }
.tl-points { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 9px; }
.tl-points li { position: relative; padding-left: 20px; color: var(--text-2); font-size: 0.97rem; line-height: 1.55; }
.tl-points li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 10px; height: 1px; background: var(--c); }
.tl-next { display: flex; align-items: center; gap: 14px; margin-left: -64px; padding: 6px 0 0 11px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tl-next .lvl-sym { border-style: dashed; background: var(--bg); }

/* ---------- systems ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sys {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  transition: border-color 0.35s, transform 0.5s var(--ease), box-shadow 0.5s;
}
.sys::before { content: ""; position: absolute; inset: -1px; border: 1px solid transparent; background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 50%, transparent), transparent 40%) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.sys:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -40px color-mix(in srgb, var(--amber) 40%, transparent); }
.sys:hover::before { opacity: 1; }
.sys-top { display: flex; align-items: center; justify-content: space-between; }
.sys-ico { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--accent-text); }
.sys-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sys-n { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.sys .sys-cat { margin: 22px 0 6px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sky); }
.sys h3 { margin: 0 0 10px; font-size: 1.25rem; line-height: 1.2; font-weight: 700; font-stretch: 104%; letter-spacing: -0.01em; }
.sys p { margin: 0; color: var(--text-2); font-size: 0.95rem; line-height: 1.55; }
.sys .sys-client { margin-top: auto; padding-top: 18px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sys .sys-client::before { content: ""; display: block; height: 1px; margin-bottom: 14px; background: repeating-linear-gradient(90deg, var(--line-3) 0 4px, transparent 4px 8px); }
.sys h3 + p { margin-bottom: 4px; }

/* ---------- contact ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 120px); }
.contact::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 60% 50% at 20% 60%, color-mix(in srgb, var(--amber) 7%, transparent), transparent 70%); }
.contact-title { font-size: clamp(2rem, 4.4vw, 3.6rem); }
.contact-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.mail {
  display: inline-block;
  font-size: clamp(1.3rem, 2.7vw, 2.35rem);
  font-weight: 700;
  font-stretch: 104%;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--amber), var(--amber)) 0 100% / 0% 2px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.3s;
  padding-bottom: 4px;
}
.mail:hover { background-size: 100% 2px; color: var(--amber-2); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.contact-list li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.contact-list .mono { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.contact-list a, .contact-list p { margin: 0; font-weight: 600; text-decoration: none; color: var(--text); }
.contact-list a { transition: color 0.2s; }
.contact-list a:hover { color: var(--accent-text); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-2); }
.tb { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.tb-cell { padding: 20px 0 22px; display: flex; flex-direction: column; gap: 4px; }
.tb-cell + .tb-cell { padding-left: 18px; border-left: 1px solid var(--line-2); }
.tb-cell i { font-style: normal; font-size: 9px; letter-spacing: 0.16em; color: var(--muted); }
.tb-cell b { font-weight: 500; color: var(--text-2); }
.to-top { align-self: flex-start; margin-top: auto; text-decoration: none; color: var(--text-2); transition: color 0.2s; }
.to-top:hover { color: var(--accent-text); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translate(-50%, 20px); padding: 11px 18px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- noviqore (venture) ---------- */
.venture::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 45% 45% at 22% 55%, color-mix(in srgb, var(--mint) 7%, transparent), transparent 70%); }
.venture-grid { position: relative; display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.venture-visual {
  --c: var(--mint);
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  aspect-ratio: 1 / 1.04;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(ellipse 55% 55% at 50% 50%, color-mix(in srgb, var(--mint) 10%, transparent), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg-2);
  overflow: hidden;
}
.venture-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.venture-visual canvas.is-dragging { cursor: grabbing; }
.venture-visual .media-tag { left: 16px; top: 16px; }
.venture-visual .media-hint { right: 16px; bottom: 26px; }
.brand-chip { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; padding: 10px 14px; background: #fff; border-radius: 2px; text-decoration: none; box-shadow: 0 20px 40px -20px var(--shadow-c); transition: transform 0.3s var(--ease); }
.brand-chip:hover { transform: translateY(-2px); }
.brand-chip img { height: 26px; width: auto; display: block; }
.brand-chip span { display: none; font: 800 14px/1 var(--f-display); letter-spacing: 0.2em; color: var(--bg-2); }
.brand-chip.no-img img { display: none; }
.brand-chip.no-img span { display: inline; }

.venture-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-block: 1px solid var(--line-2); }
.venture-stats div { padding: 18px 0 18px 18px; }
.venture-stats div:first-child { padding-left: 0; }
.venture-stats div + div { border-left: 1px solid var(--line-2); }
.venture-stats dt { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
.venture-stats dd { margin: 8px 0 0; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1; font-weight: 700; font-stretch: 110%; letter-spacing: -0.03em; }
.venture-stats sup { font-size: 1rem; color: var(--mint); top: -0.6em; }

.ribbon { margin-top: 28px; border: 1px solid var(--line-2); background: var(--surface); }
.ribbon-head { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); background: linear-gradient(90deg, color-mix(in srgb, var(--mint) 10%, transparent), transparent 60%); }
.ribbon-head span:first-child { color: var(--mint); }
.ribbon-tools { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.ribbon-tools li { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 12px; font: 500 10.5px/1.25 var(--f-mono); color: var(--text-2); text-align: center; border: 1px solid transparent; transition: background 0.25s, border-color 0.25s, color 0.25s; }
.ribbon-tools li:hover { background: color-mix(in srgb, var(--mint) 7%, transparent); border-color: color-mix(in srgb, var(--mint) 40%, transparent); color: var(--text); }
.ribbon-tools svg { width: 26px; height: 26px; fill: none; stroke: var(--mint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--ease); }
.ribbon-tools li:hover svg { transform: translateY(-2px) scale(1.08); }
.ribbon-foot { margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--line-2); font-size: 0.9rem; line-height: 1.55; color: var(--muted); }

.venture-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 32px; }
.venture-cols h3 { margin: 0 0 14px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mint); }
.venture-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.venture-cols li { display: flex; flex-direction: column; gap: 3px; padding-left: 14px; border-left: 1px solid var(--line-3); }
.venture-cols b { font-size: 1rem; font-weight: 650; }
.venture-cols span { font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
.venture-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 34px; }

.tl-link { display: inline-flex; gap: 6px; margin-top: 4px; padding-bottom: 2px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); text-decoration: none; border-bottom: 1px solid currentColor; }
.tl-link:hover { color: var(--amber-2); }
.tl-promo { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 -8px; padding: 5px 10px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mint); border: 1px dashed color-mix(in srgb, var(--mint) 45%, transparent); }
.tl-promo span { font-size: 13px; letter-spacing: 0; }
.tl-card--promo { background: linear-gradient(160deg, color-mix(in srgb, var(--amber) 7%, transparent), transparent 45%), linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%); }

/* ---------- theme toggle + accent palette ---------- */
.nav-tools { position: relative; display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-3); border-radius: 2px; background: transparent; color: var(--text); cursor: pointer; transition: border-color 0.25s, background 0.25s; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-moon { display: none; }
:root[data-theme="light"] .ico-sun { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }
.swatch-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 28%, transparent); transition: background 0.3s; }

.palette-panel { position: absolute; right: 0; top: calc(100% + 12px); z-index: 80; width: min(288px, calc(100vw - 32px)); padding: 16px; background: var(--surface); border: 1px solid var(--line-3); box-shadow: 0 30px 60px -24px var(--shadow-c); }
.palette-panel[hidden] { display: none; }
.palette-panel::before { content: ""; position: absolute; right: 56px; top: -6px; width: 10px; height: 10px; background: var(--surface); border-left: 1px solid var(--line-3); border-top: 1px solid var(--line-3); transform: rotate(45deg); }
.pp-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 14px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pp-head b { font-weight: 600; color: var(--text); letter-spacing: 0.06em; }
.pp-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pp-swatches button { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); transition: transform 0.2s var(--ease); }
.pp-swatches button:hover { transform: scale(1.08); }
.pp-swatches button[aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--text); }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.pp-custom { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pp-custom input { width: 46px; height: 30px; padding: 0; border: 1px solid var(--line-3); border-radius: 2px; background: none; cursor: pointer; }
.pp-custom input::-webkit-color-swatch-wrapper { padding: 3px; }
.pp-custom input::-webkit-color-swatch { border: 0; border-radius: 1px; }
.pp-custom input::-moz-color-swatch { border: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-3); }
.seg button { padding: 7px 11px; border: 0; background: transparent; color: var(--text-2); font: 500 10px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.pp-reset { padding: 0; border: 0; background: none; color: var(--accent-text); font: 500 10px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- research / publications ---------- */
.pub-stats { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0 0 8px; border-block: 1px solid var(--line-2); }
.pub-stats div { padding: 18px 0 18px 18px; }
.pub-stats div:first-child { padding-left: 0; }
.pub-stats div + div { border-left: 1px solid var(--line-2); }
.pub-stats dt { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pub-stats dd { margin: 8px 0 0; font-size: clamp(1.6rem, 2.3vw, 2.15rem); line-height: 1; font-weight: 700; font-stretch: 110%; letter-spacing: -0.03em; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pub { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px; gap: 28px; padding: 30px 18px 30px 0; border-bottom: 1px solid var(--line-2); transition: background 0.35s; }
.pub::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 2px; background: var(--amber); transform: scaleY(0); transform-origin: top; transition: transform 0.45s var(--ease); }
.pub:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 6%, transparent), transparent 70%); }
.pub:hover::before { transform: scaleY(1); }
.pub-no { padding: 4px 0 0 16px; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.pub-venue { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 12px; font-size: 11px; letter-spacing: 0.04em; color: var(--text-2); }
.pub-venue em { font-family: var(--f-display); font-style: italic; font-size: 12.5px; letter-spacing: 0; color: var(--text); }
.pub-type { padding: 4px 9px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: 999px; }
.pub-type--conf { color: var(--edu); border-color: color-mix(in srgb, var(--edu) 45%, transparent); }
.pub-q { display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); border-radius: 999px; font-size: 9.5px; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; cursor: help; }
.pub-q b { display: grid; place-items: center; padding: 4px 7px 4px 8px; font-weight: 700; letter-spacing: 0.04em; color: var(--amber-ink); background: var(--amber); }
.pub-q span { display: grid; place-items: center; padding: 4px 8px 4px 6px; color: var(--accent-text); }
.pub-q--conf { border-color: color-mix(in srgb, var(--edu) 55%, transparent); }
.pub-q--conf b { color: #fff; background: var(--edu); }
.pub-q--conf span { color: var(--edu); }
.pub-flag { padding: 4px 9px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-ink); background: var(--amber); border-radius: 999px; }
.pub-title { margin: 0 0 10px; font-size: clamp(1.15rem, 1.65vw, 1.42rem); line-height: 1.32; font-weight: 650; letter-spacing: -0.01em; }
.pub-title a { color: var(--text); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1px no-repeat; transition: background-size 0.45s var(--ease), color 0.25s; }
.pub-title a:hover { color: var(--amber-2); background-size: 100% 1px; }
.pub-authors { margin: 0 0 14px; font-size: 0.95rem; color: var(--muted); }
.pub-authors b { font-weight: 650; color: var(--text); box-shadow: inset 0 -0.35em 0 color-mix(in srgb, var(--amber) 28%, transparent); }
.pub-note { margin: -6px 0 14px; font-size: 0.9rem; color: var(--text-2); }
.pub-note a { color: var(--accent-text); }
.pub-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; text-align: right; }
.pub-cite { margin: 0; }
.pub-cite b { display: block; font-size: 2.3rem; line-height: 1; font-weight: 700; font-stretch: 110%; letter-spacing: -0.03em; }
.pub-cite b.is-new { font-size: 1.3rem; padding-top: 0.5rem; color: var(--accent-text); }
.pub-cite span { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pub-bar { position: relative; display: block; width: 100%; height: 3px; background: var(--line-2); }
.pub-bar i { position: absolute; right: 0; top: 0; bottom: 0; width: calc(var(--v) * 100%); background: var(--amber); transform-origin: right; transition: transform 1.2s var(--ease) 0.25s; }
.js .pub:not(.in) .pub-bar i { transform: scaleX(0); }
.pub-link { margin-top: auto; padding-bottom: 2px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); text-decoration: none; border-bottom: 1px solid currentColor; transition: color 0.2s; }
.pub-link:hover { color: var(--amber-2); }
.collab { margin-top: 40px; border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--surface), var(--bg-2)); }
.collab-head { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 18px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.collab-head span:first-child { color: var(--accent-text); }
.collab-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.collab-uni { padding: 18px 18px 20px; }
.collab-uni + .collab-uni { border-left: 1px solid var(--line-2); }
.collab-name { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.collab-name i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: 0 0 auto; }
.collab-person { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; text-decoration: none; }
.collab-person + .collab-person { border-top: 1px dashed var(--line-2); }
.collab-person b { font-size: 0.98rem; font-weight: 650; color: var(--text); transition: color 0.2s; }
.collab-person b span { font-size: 0.8em; color: var(--muted); transition: color 0.2s, transform 0.2s; display: inline-block; }
.collab-person > span { font-size: 0.85rem; color: var(--muted); }
.collab-person:hover b, .collab-person:hover b span { color: var(--amber-2); }
.collab-person:hover b span { transform: translate(2px, -2px); }
.pub-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin: 18px 0 0; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.scholar-btn { margin-top: 24px; }
.scholar-btn svg { width: 18px; height: 18px; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1439px) and (min-width: 961px) {
  .id-stack { width: clamp(168px, 40%, 232px); }
  .idbox-v { white-space: normal; }
}

@media (max-width: 1120px) {
  :root { --nav-h: 62px; }
  .nav-toggle { display: block; }
  .nav-tools { margin-left: auto; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 24px;
    background: color-mix(in srgb, var(--bg) 97%, transparent);
    border-bottom: 1px solid var(--line-2);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-links > a:not(.btn) { padding: 16px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
  .nav-links > a:not(.btn) i { display: inline; }
  .nav-links > a:not(.btn)::after { display: none; }
  .nav-cv { margin: 18px 0 0; --h: 48px; }
  .nav.menu-open { background: color-mix(in srgb, var(--bg) 97%, transparent); border-bottom-color: var(--line-2); }
}

@media (max-width: 1100px) {
  .sys-grid { grid-template-columns: repeat(2, 1fr); }
  .callouts { grid-template-columns: 1fr; }
  .callout + .callout { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-2); }
  .callout { padding-right: 0; padding-bottom: 18px; }
}

@media (max-width: 960px) {

  .hero-grid { grid-template-columns: 1fr; gap: 72px; }
  .hero-visual { width: min(100%, 420px); justify-self: center; margin-top: 8px; }
  .hero-visual { aspect-ratio: auto; display: flex; flex-direction: column; }
  .hero-globe { width: 84%; right: -12%; top: -44px; }
  .portrait { position: relative; left: auto; bottom: auto; width: 54%; }
  .id-stack { position: static; width: 100%; margin-top: 52px; grid-template-columns: 1fr 1fr; }
  .idbox-v { white-space: normal; }
  .idbox:first-child { grid-column: 1 / -1; }
  .idbox::before, .idbox::after { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(3)::before { left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line-2); }

  .sec-head { grid-template-columns: 1fr; gap: 14px; }
  .sec-index { margin: 0; }
  .profile-grid { grid-template-columns: 1fr; }
  .sheet-wrap { max-width: 420px; }
  .disc, .disc--wide { grid-column: span 6; }

  .tl-layout { grid-template-columns: 1fr; gap: 20px; }
  .tl-panel { top: var(--nav-h); z-index: 5; height: 96px; min-height: 0; margin: 0 calc(var(--gutter) * -1); }
  .tl-stage { border-left: 0; border-right: 0; background: color-mix(in srgb, var(--bg-2) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .tl-stage canvas { left: auto; right: 0; width: 120px; }
  .tl-hud { left: var(--gutter); top: 14px; right: 130px; }
  .hud-top b { font-size: 22px; }
  .hud-year { display: none; }
  .hud-title { margin-top: 2px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; }
  .hud-org { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud-bar { position: absolute; left: 0; right: -130px; top: auto; bottom: -14px; width: auto; margin: 0; }
  .tl-legend, .tl-hint { display: none; }
  .tl-track { padding-left: 44px; gap: 22px; }
  .tl-rail { left: 13px; }
  .tl-marker { left: -44px; width: 28px; }
  .tl-marker .mono { display: none; }
  .lvl-sym { width: 18px; height: 18px; }
  .tl-next { margin-left: -44px; padding-left: 5px; }

  .contact-grid { grid-template-columns: 1fr; }

  .pub-stats { grid-template-columns: repeat(2, 1fr); }
  .pub-stats div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .pub-stats div:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .collab-list { grid-template-columns: 1fr; }
  .collab-uni + .collab-uni { border-left: 0; border-top: 1px solid var(--line-2); }
  .collab-head { flex-direction: column; }
  .pub { grid-template-columns: 1fr; gap: 10px; padding: 26px 0 26px 0; }
  .pub-no { padding: 0 0 0 14px; }
  .pub-main { padding-left: 14px; }
  .pub-side { flex-direction: row; align-items: center; gap: 16px; padding-left: 14px; text-align: left; }
          .pub-cite { display: flex; align-items: baseline; gap: 8px; flex: 0 0 auto; }
  .pub-cite b { font-size: 1.5rem; }
  .pub-cite b.is-new { font-size: 1.1rem; padding-top: 0; }
  .pub-cite span { margin-top: 0; }
  .pub-bar { flex: 1; }
  .pub-link { margin-top: 0; flex: 0 0 auto; }

  .venture-grid { grid-template-columns: 1fr; }
  .venture-visual { position: relative; top: 0; aspect-ratio: 1 / 0.9; max-width: 560px; width: 100%; }
  .venture-stats { grid-template-columns: repeat(2, 1fr); }
  .venture-stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .venture-stats div:nth-child(n + 3) { border-top: 1px solid var(--line-2); }

}

@media (max-width: 640px) {
  .nav-inner { gap: 12px; }
  .brand { gap: 10px; }
  .brand, .brand-text { min-width: 0; }
  .brand-text b { white-space: nowrap; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
  .brand-text small { display: none; }
  .nav-toggle, .icon-btn, .brand-mark { flex-shrink: 0; }
  .nav-tools { gap: 6px; }
  .icon-btn { width: 40px; height: 40px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .hero-cta .link-arrow { margin-left: 0; }
  .hero-visual { width: 100%; }
  .portrait { width: 56%; }
  .idbox-v { font-size: 12.5px; }
  .titleblock .hide-sm { display: none; }
  .sys-grid { grid-template-columns: 1fr; }
  .ribbon-tools { grid-template-columns: repeat(3, 1fr); }
  .venture-cols { grid-template-columns: 1fr; }
  .tl-card--photo { grid-template-columns: 1fr; }
  .tl-photo, .tl-card--photo .tl-photo { padding: 4px 22px 26px; border-left: 0; }
  .tl-card--photo .tl-type { position: static; }
  .tl-media { aspect-ratio: 16 / 10; }
  .tl-head { flex-wrap: wrap; row-gap: 10px; }
  .tl-org { flex: 1 1 150px; }
  .tl-type { order: 3; margin-left: 88px; }
  .portrait-cap { font-size: 9px; padding: 22px 10px 10px; }
  .via { display: block; margin: 4px 0 0; }
  .contact-list li { grid-template-columns: 1fr; gap: 4px; }
  .tb { grid-template-columns: 1fr 1fr; }
  .tb-wide { grid-column: 1 / -1; }
  .tb-cell:nth-child(2) { padding-left: 0; border-left: 0; }
  .tb-cell:nth-child(n + 2) { border-top: 1px solid var(--line-2); }
  .tb-cell:nth-child(4) { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js [data-anim], .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}

@media print {
  .nav, .xhair, canvas, .marquee, .toast, .tl-panel { display: none !important; }
  body { background: #fff; color: #000; }
}
