/* ==========================================================================
   Gabriel Țintărescu — Code & Business
   ========================================================================== */

:root {
  --ink: #0b0b0a;
  --ink-2: #161614;
  --paper: #efe9dd;
  --paper-2: #e3dbca;
  --lime: #c8f23c;
  --brass: #d2a862;
  --brass-deep: #87601f;

  --bg: var(--ink);
  --fg: var(--paper);
  --muted: rgba(239, 233, 221, 0.56);
  --line: rgba(239, 233, 221, 0.14);
  --card: rgba(239, 233, 221, 0.04);
  --accent: var(--lime);

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 3.2vw, 48px);
  --max: 1680px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --header-h: 72px;
}

body[data-theme="light"] {
  --bg: var(--paper);
  --fg: var(--ink);
  --muted: rgba(11, 11, 10, 0.58);
  --line: rgba(11, 11, 10, 0.14);
  --card: rgba(11, 11, 10, 0.035);
  --accent: var(--brass-deep);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
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(--fg);
  font-family: var(--sans);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color 0.9s var(--ease), color 0.9s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { list-style: none; padding: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
strong { font-weight: 600; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.hide-sm { display: none; }
@media (min-width: 900px) { .hide-sm { display: initial; } }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 6px;
}
.skip:focus { top: 12px; }

.label { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.label-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transition: background-color 0.9s; }

/* Grain overlay */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .grain { animation: grain 0.9s steps(5) infinite; }
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); }
  60% { transform: translate(-2%, 6%); } 80% { transform: translate(5%, -2%); } 100% { transform: translate(0, 0); }
}

/* ---------- Preloader ---------- */
.loader { display: none; }
.js:not(.no-motion) .loader {
  display: flex; position: fixed; inset: 0; z-index: 150; clip-path: inset(0 0 0% 0);
  background: var(--ink); color: var(--paper);
  flex-direction: column; justify-content: center; align-items: center;
}
.loader-inner { display: flex; align-items: baseline; gap: 0.25em; font-size: clamp(2.4rem, 7vw, 6rem); font-weight: 600; letter-spacing: -0.04em; overflow: hidden; line-height: 1.1; }
.loader-inner > span { display: inline-block; }
.loader-amp { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--lime); }
.loader-count { position: absolute; left: var(--gutter); bottom: calc(var(--gutter) + 18px); font-family: var(--mono); font-size: 0.8rem; color: rgba(239, 233, 221, 0.6); }
.loader-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(239, 233, 221, 0.1); }
.loader-bar span { display: block; height: 100%; width: 100%; background: var(--lime); transform-origin: left; transform: scaleX(0); }

/* ---------- Cursor ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .has-cursor .cursor {
    display: grid; place-items: center;
    position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none;
    width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
    background: var(--paper); mix-blend-mode: difference;
    transition: width 0.45s var(--ease), height 0.45s var(--ease), margin 0.45s var(--ease), opacity 0.3s;
  }
  .has-cursor .cursor.is-hover { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .has-cursor .cursor.is-label {
    width: 92px; height: 92px; margin: -46px 0 0 -46px; mix-blend-mode: normal;
    background: var(--accent);
  }
  .cursor-label { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); opacity: 0; transition: opacity 0.25s; }
  .cursor.is-label .cursor-label { opacity: 1; }
  .cursor.is-hidden { opacity: 0; }
}

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: var(--header-h); padding-inline: var(--gutter);
  color: var(--paper); mix-blend-mode: difference;
  transition: transform 0.6s var(--ease);
}
.header.is-hidden { transform: translateY(-100%); }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.01em; }
.logo-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid currentColor; border-radius: 50%;
  font-size: 0.8rem; letter-spacing: 0.02em;
}
.logo-text { display: none; }
@media (min-width: 600px) { .logo-text { display: inline; } }

.nav { display: none; gap: 36px; }
.nav-link { position: relative; font-size: 0.92rem; }
.nav-link span { font-family: var(--mono); font-size: 0.65rem; opacity: 0.55; margin-right: 4px; vertical-align: 2px; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.6s var(--ease);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.header-meta { display: none; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7cff6b; box-shadow: 0 0 0 0 rgba(124, 255, 107, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(124, 255, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 255, 107, 0); } }

.menu-btn { display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 2px; font-size: 0.9rem; }
.menu-btn-lines { position: relative; width: 26px; height: 10px; }
.menu-btn-lines i { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform 0.5s var(--ease), top 0.5s var(--ease); }
.menu-btn-lines i:first-child { top: 0; }
.menu-btn-lines i:last-child { top: 8.5px; }
.menu-open .menu-btn-lines i:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-open .menu-btn-lines i:last-child { top: 4.25px; transform: rotate(-45deg); }

@media (min-width: 900px) {
  .nav, .header-meta { display: flex; }
  .menu-btn { display: none; }
}

.mobile-menu {
  position: fixed; inset: 0; z-index: 95;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--header-h) + 32px) var(--gutter) calc(28px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper);
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path 0.8s var(--ease-io), visibility 0s linear 0.8s;
}
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 0.8s var(--ease-io), visibility 0s; }
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a {
  display: flex; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(239, 233, 221, 0.12);
  font-size: clamp(2.4rem, 11vw, 4rem); font-weight: 500; letter-spacing: -0.045em; line-height: 1.05;
  transform: translateY(30px); opacity: 0; transition: transform 0.8s var(--ease), opacity 0.8s var(--ease);
}
.mobile-menu nav a span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0; color: var(--lime); }
.menu-open .mobile-menu nav a { transform: none; opacity: 1; }
.menu-open .mobile-menu nav a:nth-child(2) { transition-delay: 0.06s; }
.menu-open .mobile-menu nav a:nth-child(3) { transition-delay: 0.12s; }
.menu-open .mobile-menu nav a:nth-child(4) { transition-delay: 0.18s; }
.mobile-menu-foot { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 0.75rem; color: rgba(239, 233, 221, 0.6); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding-top: calc(var(--header-h) + 8px);
  --accent: var(--lime);
}
.hero.is-investor { --accent: var(--brass); }
.hero-top { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; }
.eyebrow .sep { color: var(--accent); transition: color 0.6s; }

.hero-mid {
  display: grid; gap: 28px;
  grid-template-columns: 1fr;
  padding-block: 28px 12px;
  align-items: end;
}
.hero-statement { display: flex; flex-direction: column; gap: 22px; }

.role-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-self: flex-start;
  padding: 4px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.role-switch button { position: relative; z-index: 1; padding: 9px 16px; min-height: 36px; color: var(--muted); transition: color 0.5s var(--ease); }
.role-switch button[aria-selected="true"] { color: var(--ink); }
.role-switch-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 999px; background: var(--accent);
  transition: transform 0.7s var(--ease), background-color 0.6s;
}
.hero.is-investor .role-switch-pill { transform: translateX(100%); }

.statement {
  position: relative; display: grid;
  font-size: clamp(1.7rem, 3.1vw, 3rem); font-weight: 400; line-height: 1.08; letter-spacing: -0.035em;
  max-width: 17ch;
}
.statement em { color: var(--accent); transition: color 0.6s; }
.st { grid-area: 1 / 1; transition: opacity 0.8s var(--ease), transform 0.9s var(--ease), filter 0.8s var(--ease); }
.st-inv { opacity: 0; transform: translateY(18px); filter: blur(6px); }
.hero.is-investor .st-eng { opacity: 0; transform: translateY(-18px); filter: blur(6px); }
.hero.is-investor .st-inv { opacity: 1; transform: none; filter: none; }

.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 45% at 50% 62%, rgba(46, 38, 32, 0.55), transparent 70%);
}
.hero-top, .hero-mid, .hero-name { position: relative; z-index: 1; }

.hero-figure { position: relative; width: 100%; aspect-ratio: 1 / 1; margin-top: 6px; cursor: pointer; }
.hero-figure-frame {
  position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 66%, transparent 100%), linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 66%, transparent 100%), linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-composite: intersect;
}
.portrait { position: absolute; inset: 0; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transform: scale(1.03); transition: transform 1.6s var(--ease); }
.portrait-inv { clip-path: inset(100% 0 0 0); transition: clip-path 1.1s var(--ease-io); }
.hero.is-investor .portrait-inv { clip-path: inset(0 0 0 0); }
.hero-figure:hover .portrait img { transform: scale(1); }
.scan {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 2; height: 1px;
  background: var(--accent); box-shadow: 0 0 22px 5px var(--accent);
  opacity: 0; transition: top 1.1s var(--ease-io), opacity 0.35s, background-color 0.6s;
}
.hero.is-investor .scan { top: 0%; }
.hero.is-scanning .scan { opacity: 0.85; }
.hero-figure figcaption {
  position: absolute; left: var(--gutter); top: 9%; z-index: 1;
  display: grid; gap: 4px; color: var(--muted);
}
.hero-figure figcaption span:first-child { color: var(--accent); transition: color 0.6s; }
.cap-inv { display: none; }
.hero.is-investor .cap-eng { display: none; }
.hero.is-investor .cap-inv { display: inline; }

.hero-aside { display: none; }
.facts { display: grid; gap: 14px; }
.facts div { display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.facts dd { font-size: 0.95rem; }

.scroll-cue { display: inline-flex; align-items: center; gap: 12px; margin-top: 28px; color: var(--muted); }
.scroll-cue-line { position: relative; width: 1px; height: 46px; background: var(--line); overflow: hidden; }
.scroll-cue-line::after { content: ""; position: absolute; inset: 0; background: var(--fg); animation: cue 2.2s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

.hero-name {
  font-size: 17vw; /* refined by fitText in JS */
  font-weight: 600; line-height: 0.82; letter-spacing: -0.06em;
  padding-bottom: clamp(10px, 2vw, 28px);
  margin-top: -0.78em;
  white-space: nowrap;
}
.hero-name-inner { display: inline-block; }
.hero-name .line { display: block; overflow: hidden; padding: 0.06em 0.04em 0.16em 0; margin-bottom: -0.14em; }
.hero-name .line:last-child { margin-left: 0.04em; }
.hero-name .ch { display: inline-block; will-change: transform; }

@media (min-width: 900px) {
  .hero { --fig-h: min(94svh, 1100px); }
  .hero::before { background: radial-gradient(ellipse 34% 60% at 50% 52%, rgba(46, 38, 32, 0.6), transparent 70%); }
  .hero-mid {
    flex: 1; grid-template-columns: 1fr calc(var(--fig-h) * 0.5) 1fr; gap: clamp(24px, 3vw, 56px);
    align-items: center; padding-block: 2vh;
  }
  .hero-aside { display: block; grid-column: 3; justify-self: end; width: min(100%, 340px); }
  .hero-figure {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; margin: 0 auto;
    height: var(--fig-h); width: calc(var(--fig-h) * 2 / 3); aspect-ratio: auto;
  }
  .hero-figure-frame {
    -webkit-mask-image: radial-gradient(ellipse 62% 66% at 50% 40%, #000 52%, transparent 100%);
    -webkit-mask-composite: source-over;
    mask-image: radial-gradient(ellipse 62% 66% at 50% 40%, #000 52%, transparent 100%);
    mask-composite: add;
  }
  .hero-figure figcaption { left: auto; right: -2%; top: 30%; text-align: right; }
  .hero-name { white-space: nowrap; margin-top: 0; }
  .hero-name .line { display: inline-block; }
  .hero-name .line + .line { margin-left: 0.18em; }
}

/* ---------- Manifesto ---------- */
.manifesto { padding-block: clamp(110px, 18vw, 260px) clamp(80px, 12vw, 180px); display: grid; gap: 34px; }
.manifesto-text {
  font-size: clamp(1.75rem, 4.3vw, 4.6rem); line-height: 1.06; letter-spacing: -0.04em; font-weight: 400;
  max-width: 22ch;
}
.manifesto-text em { color: var(--accent); }
@media (min-width: 900px) {
  .manifesto { grid-template-columns: 1fr 3fr; }
  .manifesto-text { max-width: 24ch; }
}

/* ---------- Split / reveal helpers ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0.06em 0.12em 0; margin: -0.04em -0.06em -0.12em 0; }
.wi { display: inline-block; will-change: transform; }

/* ---------- Dual ---------- */
.dual { display: grid; gap: 56px; padding-bottom: clamp(100px, 14vw, 220px); }
.dual-card { display: block; }
.dual-media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--ink-2); }
.dual-media picture { height: 100%; }
.dual-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.4s var(--ease); }
.dual-card:hover .dual-media img { transform: scale(1); }
.dual-meta { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 6px 16px; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 18px; }
.dual-meta .mono { color: var(--accent); }
.dual-meta h3 { font-size: clamp(2.2rem, 5vw, 4.6rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.dual-meta p { grid-column: 2 / 3; color: var(--muted); max-width: 34ch; }
.dual-arrow { grid-row: 1; grid-column: 3; font-size: clamp(1.6rem, 3vw, 2.6rem); transition: transform 0.6s var(--ease); }
.dual-card:hover .dual-arrow { transform: translate(6px, 6px) rotate(-45deg); }
@media (min-width: 900px) {
  .dual { grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 56px); }
  .dual-card--offset { margin-top: 18vh; }
  .dual-media { aspect-ratio: 4 / 4.4; }
}

/* ---------- Chapter heads ---------- */
.chapter { padding-top: clamp(80px, 10vw, 160px); }
.chapter-head { display: grid; gap: 22px; padding-bottom: clamp(48px, 7vw, 110px); }
.chapter-kicker { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.chapter-kicker span:first-child { color: var(--accent); }
.chapter-title { font-size: clamp(3.3rem, 11.5vw, 13rem); font-weight: 500; line-height: 0.88; letter-spacing: -0.06em; }
.chapter-title em { color: var(--accent); letter-spacing: -0.03em; }

/* ---------- Engineering intro ---------- */
.eng-intro { display: grid; gap: 40px; padding-bottom: clamp(90px, 12vw, 180px); }
.eng-photo, .ven-photo { position: relative; overflow: hidden; border-radius: 4px; aspect-ratio: 4 / 5; background: var(--ink-2); }
.eng-photo img, .ven-photo img { position: absolute; left: 0; top: -9%; width: 100%; height: 118%; object-fit: cover; }
.eng-photo img { object-position: 56% 35%; }
.eng-copy { display: grid; gap: 22px; align-content: start; }
.lead { font-size: clamp(1.35rem, 2.2vw, 2.1rem); line-height: 1.2; letter-spacing: -0.025em; }
.eng-copy > p:not(.lead), .ven-copy > p:not(.lead) { color: var(--muted); max-width: 52ch; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 18px; border-top: 1px solid var(--line); }
.stat { display: grid; gap: 6px; padding: 22px 12px 22px 0; border-bottom: 1px solid var(--line); }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-child(even) { padding-left: 16px; }
.stat-num { font-size: clamp(3rem, 6vw, 5.6rem); font-weight: 500; line-height: 0.9; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.85rem; color: var(--muted); max-width: 18ch; }
@media (min-width: 900px) {
  .eng-intro { grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 120px); }
  .eng-copy { padding-top: 6vh; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat, .stat:nth-child(even) { padding: 26px 16px 26px 16px; border-right: 1px solid var(--line); }
  .stat:first-child { padding-left: 0; }
  .stat:last-child { border-right: 0; }
}

/* ---------- Experience ---------- */
.experience { padding-bottom: clamp(100px, 14vw, 200px); }
.section-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-note { color: var(--muted); }
.xp-list { border-top: 1px solid var(--line); }
.xp { border-bottom: 1px solid var(--line); }
.xp-head {
  position: relative; width: 100%; text-align: left;
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "year icon" "company icon" "role icon";
  gap: 4px 16px; align-items: center; padding: 22px 0;
}
.xp-head::before {
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); background: var(--card);
  transform: scaleY(0); transform-origin: bottom; transition: transform 0.6s var(--ease); z-index: -1;
}
.xp-head:hover::before, .xp-head[aria-expanded="true"]::before { transform: scaleY(1); }
.xp-year { grid-area: year; color: var(--muted); }
.xp-company { grid-area: company; font-size: clamp(2rem, 5.2vw, 5rem); font-weight: 500; line-height: 1; letter-spacing: -0.05em; transition: transform 0.7s var(--ease), color 0.4s; }
.xp-role { grid-area: role; color: var(--muted); font-size: 0.95rem; }
.xp-icon { grid-area: icon; position: relative; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; transition: background-color 0.4s, border-color 0.4s, transform 0.6s var(--ease); }
.xp-icon::before, .xp-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; margin: -0.75px 0 0 -7px; background: currentColor; transition: transform 0.6s var(--ease); }
.xp-icon::after { transform: rotate(90deg); }
.xp-head[aria-expanded="true"] .xp-icon { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: rotate(180deg); }
.xp-head[aria-expanded="true"] .xp-icon::after { transform: rotate(0deg); }
@media (hover: hover) { .xp-head:hover .xp-company { transform: translateX(12px); } }
.xp-head[aria-expanded="true"] .xp-company { color: var(--accent); }

.xp-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.7s var(--ease); }
.booted .xp-body { grid-template-rows: 0fr; }
.booted .xp.is-open .xp-body { grid-template-rows: 1fr; }
.xp-body-inner { overflow: hidden; min-height: 0; }
.xp-body-inner > * { max-width: 70ch; }
.xp-body-inner > p:first-child { padding-top: 4px; color: var(--fg); }
.xp-body-inner ul { display: grid; gap: 10px; margin: 18px 0; color: var(--muted); }
.xp-body-inner li { position: relative; padding-left: 22px; }
.xp-body-inner li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.xp-body-inner li strong { color: var(--fg); font-weight: 500; }
.xp-body-inner .tags { padding-bottom: 28px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }

@media (min-width: 900px) {
  .xp-head { grid-template-columns: 180px 1fr minmax(240px, 0.6fr) 44px; grid-template-areas: "year company role icon"; padding: 30px 0; }
  .xp-body-inner { padding-left: 196px; }
}

/* ---------- Case files ---------- */
.cases { padding-bottom: clamp(80px, 10vw, 140px); }
.cases-pin { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 56px); }
.cases-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.cases-head .label { grid-column: 1 / -1; }
.cases-title { font-size: clamp(3rem, 9vw, 9rem); font-weight: 500; line-height: 0.9; letter-spacing: -0.06em; }
.cases-title em { color: var(--accent); }
.cases-hint { color: var(--muted); padding-bottom: 10px; }

.cases-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); padding-bottom: 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cases-track::-webkit-scrollbar { display: none; }
.case {
  flex: 0 0 min(84vw, 440px); scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 18px;
  min-height: 460px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  transition: border-color 0.5s, transform 0.7s var(--ease);
}
.case:hover { border-color: var(--accent); }
.case header { display: flex; justify-content: space-between; color: var(--muted); }
.case header .mono:first-child { color: var(--accent); }
.case h4 { font-size: clamp(1.7rem, 2.4vw, 2.4rem); font-weight: 500; line-height: 1.02; letter-spacing: -0.04em; }
.case > p { color: var(--muted); font-size: 0.95rem; }
.case footer { margin-top: auto; }

.flow {
  display: flex; align-items: center; gap: 6px; padding: 18px 14px; margin-block: 4px;
  border: 1px dashed var(--line); border-radius: 4px; font-size: 0.64rem;
}
.flow span { flex: none; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); transition: background-color 0.9s; }
.flow span:last-child { border-color: var(--accent); color: var(--accent); }
.flow i { position: relative; flex: 1; min-width: 8px; height: 1px; background: var(--line); overflow: hidden; }
.flow i::after { content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 1px; background: var(--accent); animation: packet 1.8s linear infinite; }
.flow i:nth-of-type(2)::after { animation-delay: 0.3s; }
.flow i:nth-of-type(3)::after { animation-delay: 0.6s; }
@keyframes packet { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.medal {
  display: grid; place-items: center; align-self: flex-start; width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f1c899, #a36a35 55%, #5d3a1a);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.12), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: #2a1606; font-family: var(--serif); font-style: italic; font-size: 2rem;
}

@media (min-width: 900px) {
  .cases-hint { display: none; }
  .js:not(.no-motion) .cases-pin { height: 100vh; justify-content: center; }
  .js:not(.no-motion) .cases-track { overflow: visible; scroll-snap-type: none; padding-right: 20vw; will-change: transform; }
  .case { flex-basis: clamp(360px, 30vw, 480px); min-height: min(62vh, 560px); padding: 28px; }
}

/* ---------- Marquee ---------- */
.marquee { padding-block: clamp(50px, 7vw, 110px) clamp(70px, 9vw, 140px); border-top: 1px solid var(--line); overflow: hidden; }
.marquee-row { display: flex; overflow: hidden; }
.marquee-track { display: flex; flex: none; animation: marquee 38s linear infinite; }
.marquee-row--rev .marquee-track { animation-direction: reverse; animation-duration: 44s; }
.marquee-track span {
  flex: none; padding-right: 0.9em; font-size: clamp(2.6rem, 7vw, 7.2rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1.08;
}
.marquee-track span::after {
  content: ""; display: inline-block; width: 0.36em; height: 0.36em; margin-left: 0.9em; vertical-align: 0.24em;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2v20M2 12h20M4.9 4.9l14.2 14.2M19.1 4.9 4.9 19.1' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2v20M2 12h20M4.9 4.9l14.2 14.2M19.1 4.9 4.9 19.1' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.marquee-row--rev .marquee-track span { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: var(--muted); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .flow i::after, .grain, .scroll-cue-line::after, .status-dot { animation: none !important; }
}

/* ---------- Business ---------- */
.business { padding-bottom: clamp(60px, 8vw, 120px); }
.ven-hero { display: grid; gap: 40px; padding-bottom: clamp(90px, 12vw, 180px); }
.ven-photo { aspect-ratio: 1312 / 1199; background: var(--paper-2); }
.ven-photo img { object-position: 50% 20%; }
.ven-copy { display: grid; gap: 22px; align-content: start; }
.pull { margin-top: 18px; padding-top: 26px; border-top: 1px solid var(--line); }
.pull p { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.9rem); line-height: 1.05; letter-spacing: -0.02em; }
.pull em { color: var(--accent); }
@media (min-width: 900px) {
  .ven-hero { grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 120px); }
  .ven-copy { padding-top: 10vh; }
}

.pillars { padding-bottom: clamp(100px, 14vw, 200px); }
.pillar-list { margin-top: 20px; border-top: 1px solid var(--line); counter-reset: p; }
.pillar {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 10px;
  padding: 26px 0; border-bottom: 1px solid var(--line); isolation: isolate;
}
.pillar::before {
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1; background: var(--ink);
  clip-path: inset(0 0 100% 0); transition: clip-path 0.7s var(--ease);
}
.pillar-num { color: var(--accent); }
.pillar-title { font-size: clamp(2.6rem, 8.2vw, 8.4rem); font-weight: 500; line-height: 0.92; letter-spacing: -0.06em; transition: color 0.5s, transform 0.8s var(--ease); }
.pillar-copy { color: var(--muted); max-width: 38ch; transition: color 0.5s; }
@media (hover: hover) {
  .pillar:hover::before { clip-path: inset(0 0 0 0); }
  .pillar:hover .pillar-title { color: var(--paper); transform: translateX(14px); }
  .pillar:hover .pillar-copy { color: rgba(239, 233, 221, 0.7); }
  .pillar:hover .pillar-num { color: var(--brass); }
}
@media (min-width: 900px) {
  .pillar { grid-template-columns: 80px 1fr minmax(260px, 0.42fr); padding: 34px 0; align-items: center; }
  .pillar-copy { grid-column: 3; }
}

.loop { padding-bottom: clamp(100px, 14vw, 200px); }
.loop-head { display: grid; gap: 20px; margin-bottom: clamp(40px, 6vw, 90px); }
.loop-title { font-size: clamp(2.4rem, 6.4vw, 6.6rem); font-weight: 500; line-height: 0.95; letter-spacing: -0.055em; max-width: 14ch; }
.loop-title em { color: var(--accent); }
.loop-flow { position: relative; --p: 0; }
.loop-line { position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.loop-line span { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--p)); }
.loop-flow ol { display: grid; gap: 34px; }
.loop-flow li { position: relative; display: grid; gap: 6px; padding-left: 40px; }
.loop-flow li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line); transition: background-color 0.5s, border-color 0.5s, transform 0.6s var(--ease);
}
.loop-flow li.is-on::before { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.loop-flow li .mono { color: var(--muted); }
.loop-flow li strong { font-size: clamp(1.8rem, 2.6vw, 2.6rem); font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
.loop-flow li p { color: var(--muted); font-size: 0.95rem; max-width: 30ch; }
.no-motion .loop-flow { --p: 1; }
.no-motion .loop-flow li::before { background: var(--accent); border-color: var(--accent); }
@media (min-width: 900px) {
  .loop-line { left: 0; right: 0; top: 7px; bottom: auto; width: auto; height: 1px; }
  .loop-line span { transform-origin: left; transform: scaleX(var(--p)); }
  .loop-flow ol { grid-template-columns: repeat(5, 1fr); gap: 28px; }
  .loop-flow li { padding: 40px 0 0; }
  .loop-flow li::before { top: 0; }
}

.open { display: grid; gap: 20px; padding-bottom: clamp(40px, 6vw, 80px); }
.open-list { border-top: 1px solid var(--line); }
.open-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(1.3rem, 2.6vw, 2.4rem); letter-spacing: -0.035em; line-height: 1.1;
}
.open-list li .mono { font-size: 1rem; color: var(--accent); }
.btn {
  position: relative; justify-self: start; display: inline-flex; align-items: center; gap: 14px; margin-top: 16px;
  padding: 18px 26px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 500; overflow: hidden;
  transition: background-color 0.9s, color 0.9s;
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--accent); border-radius: inherit; transform: translateY(101%); transition: transform 0.6s var(--ease); }
.btn > span { position: relative; }
.btn:hover::before { transform: none; }
.btn:hover { color: var(--paper); }
.btn-arrow { transition: transform 0.6s var(--ease); }
.btn:hover .btn-arrow { transform: rotate(45deg); }
@media (min-width: 900px) {
  .open { grid-template-columns: 1fr 2fr; align-items: start; }
  .open .btn { grid-column: 2; }
}

/* ---------- Recognition ---------- */
.recognition { padding-block: clamp(110px, 14vw, 220px) clamp(90px, 12vw, 180px); }
.rec-grid { display: grid; gap: 70px; }
.rec-list { margin-top: 20px; border-top: 1px solid var(--line); }
.rec-list li { display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.rec-list .mono { color: var(--accent); padding-top: 6px; }
.rec-list strong { display: block; font-size: clamp(1.3rem, 1.9vw, 1.8rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 6px; }
.rec-list p { color: var(--muted); font-size: 0.95rem; }
@media (min-width: 900px) { .rec-grid { grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 120px); } }

/* ---------- Contact ---------- */
.contact { padding-top: clamp(60px, 8vw, 120px); border-top: 1px solid var(--line); }
.contact-title {
  margin: 28px 0 clamp(50px, 7vw, 100px);
  font-size: clamp(3.6rem, 14vw, 15rem); font-weight: 500; line-height: 0.86; letter-spacing: -0.065em;
}
.ct-line { display: block; }
.ct-rotator { height: 0.98em; overflow: hidden; color: var(--accent); }
.rotator { display: flex; flex-direction: column; animation: rotate-words 9s var(--ease-io) infinite; }
.rotator span { display: block; height: 0.98em; line-height: 0.98; }
.rotator em { letter-spacing: -0.035em; }
@keyframes rotate-words {
  0%, 18% { transform: translateY(0); }
  25%, 43% { transform: translateY(-0.98em); }
  50%, 68% { transform: translateY(-1.96em); }
  75%, 93% { transform: translateY(-2.94em); }
  100% { transform: translateY(-3.92em); }
}
@media (prefers-reduced-motion: reduce) { .rotator { animation: none; } }

.contact-grid { display: grid; gap: 40px; padding-bottom: clamp(70px, 10vw, 140px); }
.contact-mail { display: grid; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.contact-mail .mono { color: var(--muted); }
.contact-mail-addr { font-size: clamp(1.45rem, 4.2vw, 4rem); font-weight: 500; letter-spacing: -0.045em; line-height: 1.05; overflow-wrap: anywhere; transition: color 0.4s; }
.contact-mail:hover .contact-mail-addr { color: var(--accent); }
.contact-links { border-top: 1px solid var(--line); }
.contact-links a { display: flex; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; transition: padding 0.6s var(--ease), color 0.4s; }
.contact-links a:hover { padding-inline: 10px; color: var(--accent); }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 2fr 1fr; align-items: end; gap: clamp(40px, 6vw, 120px); }
}

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  padding-block: 26px calc(26px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.to-top:hover { color: var(--fg); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 130;
  padding: 12px 18px; border-radius: 999px; background: var(--accent); color: var(--ink);
  font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  transform: translate(-50%, calc(100% + 60px)); transition: transform 0.6s var(--ease); pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); }

/* ---------- Generative visuals (replace photos outside the hero) ---------- */
.viz { position: relative; overflow: hidden; border-radius: 4px; }
.viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform 1.4s var(--ease); }
.viz-tag { position: absolute; left: 16px; bottom: 14px; z-index: 1; color: rgba(239, 233, 221, 0.5); }
.dual-card .viz canvas { transform: scale(1.04); }
.dual-card:hover .viz canvas { transform: scale(1); }

.viz--console { display: flex; flex-direction: column; background: #0d0e0c; box-shadow: inset 0 0 0 1px rgba(239, 233, 221, 0.08); }
.console-bar {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid rgba(239, 233, 221, 0.08);
  color: rgba(239, 233, 221, 0.5); font-size: 0.64rem;
}
.console-dots { display: flex; gap: 6px; }
.console-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(239, 233, 221, 0.16); }
.console-live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--lime); }
.console-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); animation: pulse 2.2s infinite; }
.console-body {
  flex: 1; min-height: 0; margin: 0; padding: 18px 16px; overflow: hidden; white-space: pre;
  display: flex; flex-direction: column; justify-content: flex-end;
  font-family: var(--mono); font-size: clamp(0.6rem, 0.72vw, 0.72rem); line-height: 1.85; color: rgba(239, 233, 221, 0.62);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%); mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
}
.console-body .ln { display: block; animation: ln-in 0.5s var(--ease) both; }
.console-body .t { color: rgba(239, 233, 221, 0.3); }
.console-body .s { color: var(--paper); }
.console-body .ok { color: var(--lime); }
.console-body .ev { color: #9fd3ff; }
@keyframes ln-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 599px) { .console-body .t { display: none; } }

.viz--ledger { display: flex; flex-direction: column; background: #12100c; box-shadow: inset 0 0 0 1px rgba(239, 233, 221, 0.08); }
.viz--ledger .console-live { color: var(--brass); }
.viz--ledger .console-live::before { background: var(--brass); }
.ledger {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  font-family: var(--mono); font-size: clamp(0.6rem, 0.72vw, 0.72rem); color: rgba(239, 233, 221, 0.6);
}
.ledger-head, .lr { display: grid; grid-template-columns: 0.9fr 1.15fr 0.8fr 0.95fr 1.15fr; gap: 10px; align-items: center; padding: 0 16px; }
.ledger-head { padding-block: 12px; border-bottom: 1px solid rgba(239, 233, 221, 0.08); color: rgba(239, 233, 221, 0.32); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9em; }
.ledger-rows { flex: 1; min-height: 0; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent); }
.lr { position: relative; padding-block: 12px; border-bottom: 1px solid rgba(239, 233, 221, 0.06); white-space: nowrap; animation: ln-in 0.6s var(--ease) both; }
.lr > span { overflow: hidden; text-overflow: ellipsis; }
.lr-ref { color: var(--paper); }
.lr-st { display: inline-flex; align-items: center; gap: 8px; }
.lr-st i { flex: none; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--brass); transition: background-color 0.4s, box-shadow 0.4s, border-color 0.4s; }
.lr-st b { font-weight: 400; transition: color 0.4s; }
.lr[data-s="1"] .lr-st i { background: rgba(210, 168, 98, 0.35); }
.lr[data-s="2"] .lr-st i { background: var(--brass); box-shadow: 0 0 0 3px rgba(210, 168, 98, 0.2); }
.lr[data-s="2"] .lr-st b { color: var(--brass); }
.lr[data-s="3"] .lr-st i { background: var(--paper); border-color: var(--paper); }
.lr[data-s="3"] .lr-st b { color: var(--paper); }
.lr-bar {
  position: absolute; left: 16px; right: 16px; bottom: -1px; height: 1px; background: var(--brass); opacity: 0.75;
  transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 1.2s var(--ease);
}
.lr.flash { animation: lr-flash 1.4s var(--ease); }
@keyframes lr-flash { from { background-color: rgba(210, 168, 98, 0.14); } }
.ledger-foot { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(239, 233, 221, 0.08); }
.ledger-foot div { display: grid; gap: 2px; padding: 12px 16px; border-right: 1px solid rgba(239, 233, 221, 0.06); }
.ledger-foot div:last-child { border-right: 0; }
.ledger-foot span { color: rgba(239, 233, 221, 0.35); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85em; }
.ledger-foot b { font-family: var(--sans); font-weight: 500; font-size: 1.9em; line-height: 1.1; letter-spacing: -0.03em; color: var(--paper); font-variant-numeric: tabular-nums; }
.ledger-foot div:nth-child(3) b { color: var(--brass); }
@media (max-width: 599px) {
  .dual-media.viz { aspect-ratio: 1 / 1; }
  .ledger-head span:nth-child(2), .lr-ch { display: none; }
  .ledger-head, .lr { grid-template-columns: 0.9fr 0.8fr 0.95fr 1.25fr; gap: 8px; padding-inline: 12px; }
  .lr-bar { left: 12px; right: 12px; }
  .ledger-foot div { padding: 10px 12px; }
}

.viz--compound { background: var(--paper-2); }
.viz--compound .viz-tag { color: rgba(11, 11, 10, 0.5); }

/* ---------- Initial motion states (only when JS + motion enabled) ---------- */
.js:not(.no-motion) [data-reveal] { opacity: 0; transform: translateY(40px); }
.js:not(.no-motion) [data-clip] { clip-path: inset(100% 0 0 0); }
.js:not(.no-motion) [data-hero-fade] { opacity: 0; }
.js:not(.no-motion) .hero-figure-frame { clip-path: inset(100% 0 0 0); }
.js:not(.no-motion) .hero-name .ch { transform: translateY(105%); }
.js:not(.no-motion) .hero:not(.is-in) .statement .st-eng { opacity: 0; transform: translateY(18px); filter: blur(6px); }
