/* ==========================================================================
   Wajih Arfaoui — Portfolio
   Dark · cinematic · one lime signal.
   Fonts: Fraunces (display) · DM Sans (body)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #08080e;
  --bg-2: #0d0d15;
  --ink: #f0eee8;
  --ink-2: rgba(240, 238, 232, 0.72);
  --line: rgba(240, 238, 232, 0.12);
  --line-2: rgba(240, 238, 232, 0.24);
  --accent: #b8ff3c;
  --accent-soft: rgba(184, 255, 60, 0.12);

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --pad: clamp(20px, 4vw, 64px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* Grid texture — fixed, masked so it fades toward the edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(240, 238, 232, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(240, 238, 232, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 100% 85% at 50% 35%, #000 25%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 85% at 50% 35%, #000 25%, transparent 100%);
}
main, .footer, .header { position: relative; z-index: 1; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 10000;
  background: var(--accent); color: var(--bg);
  padding: 10px 16px; border-radius: 6px; font-weight: 600;
  transition: top 0.2s;
}
.skip:focus { top: 16px; }

.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: var(--pad); }

/* ---------- Type ---------- */
.label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 1.6rem;
}
.label--sm { margin-bottom: 1rem; }

.display {
  font-family: var(--serif);
  font-weight: 320;
  font-size: clamp(2.5rem, 6vw, 6.4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 17ch;
}
.display--md { font-size: clamp(2.3rem, 5vw, 5.4rem); max-width: 14ch; }
.display em { font-weight: 300; color: var(--accent); }

.section__sub { margin-top: 1.8rem; max-width: 52ch; color: var(--ink-2); font-size: 1.05rem; text-wrap: pretty; }

.link-u {
  position: relative;
  display: inline-block;
  font-size: 1rem;
  /* +10px of vertical padding for a comfortable tap target; the underline stays 4px under the text */
  padding: 5px 0 9px;
  color: var(--ink);
}
.link-u::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 1px;
  background: var(--ink-2); transform-origin: right; transition: transform 0.6s var(--ease), background 0.3s;
}
.link-u:hover::after { background: var(--accent); transform: scaleX(0.35); transform-origin: left; }
.link-u:hover { color: var(--accent); }

/* ---------- Word slide-up ---------- */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0 0.07em 0.16em;
  margin: 0 -0.07em -0.16em;
}
.w__i { display: inline-block; will-change: transform; }
.w__i--ital { font-style: italic; font-weight: 300; }

.js .w__i { transform: translateY(112%); }
.js .is-ready .w__i,
.js .in .w__i {
  transform: none;
  transition: transform 1.15s var(--ease) calc(var(--i, 0) * 70ms + 80ms);
}
.js .is-ready .hero__name .w__i { transition-delay: calc(var(--i, 0) * 130ms + 220ms); transition-duration: 1.4s; }

/* ---------- Reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); }
.js [data-reveal].in {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--ease) calc(var(--d, 0) * 110ms), transform 1.1s var(--ease) calc(var(--d, 0) * 110ms);
}
.js [data-hero-fade] { opacity: 0; transform: translateY(18px); }
.js .is-ready [data-hero-fade] {
  opacity: 1; transform: none;
  transition: opacity 1s var(--ease) calc(var(--i, 0) * 110ms + 450ms), transform 1.1s var(--ease) calc(var(--i, 0) * 110ms + 450ms);
}

/* ---------- Custom cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.3s; will-change: transform; }
.cursor--dot::before {
  content: ""; display: block; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--accent); transition: transform 0.3s var(--ease);
}
.cursor--ring::before {
  content: ""; display: block; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  border: 1px solid rgba(240, 238, 232, 0.55);
  transition: transform 0.45s var(--ease), background 0.3s, border-color 0.3s;
}
.cursor-on .cursor { opacity: 1; }
.cursor-hover .cursor--ring::before { transform: scale(1.8); background: var(--accent-soft); border-color: var(--accent); }
.cursor-hover .cursor--dot::before { transform: scale(0.5); }
.cursor-down .cursor--ring::before { transform: scale(0.8); }
.cursor-hover.cursor-down .cursor--ring::before { transform: scale(1.5); }

.has-cursor, .has-cursor a, .has-cursor button, .has-cursor [data-hover] { cursor: none; }
@media (hover: none), (pointer: coarse) {
  .cursor { display: none !important; }
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 14px var(--pad) 0;
  pointer-events: none;
}
.header__bar {
  position: relative;
  pointer-events: auto;
  max-width: 1680px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: border-color 0.5s, box-shadow 0.5s, max-width 0.6s var(--ease);
}
.header__bar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0;
  background: rgba(14, 14, 22, 0.58);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  transition: opacity 0.5s;
}
.header.is-scrolled .header__bar {
  border-color: var(--line);
  box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(240, 238, 232, 0.06);
  max-width: 1180px;
}
.header.is-scrolled .header__bar::before { opacity: 1; }

/* Padding gives a 44px tap target; the negative margin keeps the header height unchanged */
.brand { display: inline-flex; align-items: center; gap: 12px; padding-block: 5px; margin-block: -5px; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--accent);
  transition: background 0.3s, color 0.3s;
}
.brand:hover .brand__mark { background: var(--accent); color: var(--bg); }
.brand__name { font-size: 0.9rem; font-weight: 500; letter-spacing: 0.01em; }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); font-size: 0.9rem; }
.nav a { position: relative; color: var(--ink-2); padding: 6px 0; transition: color 0.3s; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav .nav__cta {
  color: var(--bg); background: var(--accent); padding: 8px 18px; border-radius: 999px; font-weight: 600;
  transition: background 0.3s;
}
.nav .nav__cta::after { display: none; }
.nav .nav__cta:hover { background: var(--ink); color: var(--bg); }
/* Contact is a button, so its "you are here" state is a ring rather than an underline */
.nav .nav__cta.is-active { color: var(--bg); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

.menu-btn { display: none; width: 44px; height: 44px; position: relative; border-radius: 50%; border: 1px solid var(--line-2); }
.menu-btn span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink); transition: transform 0.4s var(--ease), top 0.4s var(--ease); }
.menu-btn span:first-child { top: 18px; }
.menu-btn span:last-child { top: 25px; }
.menu-open .menu-btn span:first-child { top: 21.5px; transform: rotate(45deg); }
.menu-open .menu-btn span:last-child { top: 21.5px; transform: rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  transition: transform 0.55s var(--ease), background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.4s;
  will-change: transform;
}
.btn__label { display: inline-flex; align-items: center; gap: 0.6em; padding: 1.05em 1.8em; transition: transform 0.55s var(--ease); }
.btn__label b { font-weight: 500; display: inline-block; transition: transform 0.4s var(--ease); }
.btn:hover .btn__label b { transform: translateY(2px); }
.btn--accent { background: var(--accent); color: var(--bg); }
.btn--accent:hover { background: var(--ink); box-shadow: 0 0 0 6px var(--accent-soft); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg .btn__label { padding: 1.3em 2.2em; font-size: 1.05rem; }

/* ==========================================================================
   1 · HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.hero::before { /* left scrim for legibility + bottom blend */
  content: "";
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 8, 14, 0.82) 0%, rgba(8, 8, 14, 0) 52%),
    linear-gradient(0deg, var(--bg) 0%, rgba(8, 8, 14, 0) 22%);
}
.hero__stage { position: absolute; inset: 0; z-index: 0; }

.hero__glow {
  position: absolute; right: 4vw; top: 6svh; width: min(62vw, 120svh); aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(184, 255, 60, 0.2), rgba(184, 255, 60, 0.05) 55%, transparent 74%);
}
.hero__dag {
  position: absolute; right: -3vw; bottom: 2svh;
  width: min(66vw, 118svh); aspect-ratio: 1;
}
.dag__edges path { stroke: rgba(240, 238, 232, 0.2); stroke-width: 1; fill: none; }
.dag__edges .dag__dash { stroke-dasharray: 5 9; }
.dag__edges .dag__flow {
  stroke: var(--accent); stroke-opacity: 0.7; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 1 16; animation: flow 3.4s linear infinite;
}
.dag__edges .dag__flow--b { animation-duration: 4.6s; stroke-opacity: 0.45; }
.dag__nodes circle, .dag__nodes rect { fill: var(--bg); stroke: rgba(240, 238, 232, 0.55); stroke-width: 1.5; }
.dag__nodes .is-live { fill: var(--accent); stroke: var(--accent); stroke-opacity: 0.5; animation: pulse 2.6s ease-out infinite; }
@keyframes flow { to { stroke-dashoffset: -170; } }
@keyframes pulse { 0% { stroke-width: 1.5; stroke-opacity: 0.6; } 100% { stroke-width: 22; stroke-opacity: 0; } }

.hero__portrait {
  position: absolute; right: 1vw; bottom: 0;
  height: min(93svh, 64vw);
  aspect-ratio: 856 / 887;
}
.hero__portrait img {
  width: 100%; height: 100%; object-fit: contain; object-position: bottom;
  filter: contrast(1.06) saturate(0.92) drop-shadow(0 0 1.5px rgba(184, 255, 60, 0.55)) drop-shadow(0 0 46px rgba(184, 255, 60, 0.14));
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
.js .hero__portrait img { opacity: 0; transform: scale(1.04); transition: opacity 1.6s var(--ease) 0.1s, transform 2.2s var(--ease) 0.1s; }
.js .is-ready .hero__portrait img { opacity: 1; transform: none; }

/* Floating glass tags (restrained) */
.tags { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.tag {
  position: absolute;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap;
  background: rgba(240, 238, 232, 0.07);
  border: 1px solid rgba(240, 238, 232, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(240, 238, 232, 0.14);
  animation: float 9s ease-in-out infinite;
}
.tag__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tag--1 { top: 24%; right: 5vw; animation-delay: -1s; }
.tag--2 { top: 35%; right: 47vw; animation-delay: -4s; animation-duration: 10s; }
.tag--3 { top: 66%; right: 4vw; animation-delay: -6s; animation-duration: 11s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.js .tag { opacity: 0; }
.js .is-ready .tag { opacity: 1; transition: opacity 1.2s var(--ease) calc(var(--ti, 0) * 150ms + 900ms); }
.tag--1 { --ti: 0; } .tag--2 { --ti: 1; } .tag--3 { --ti: 2; }

/* Hero content */
.hero__content {
  position: absolute; z-index: 4;
  left: var(--pad); bottom: clamp(76px, 11svh, 120px);
  width: min(100% - var(--pad) * 2, 70vw);
}
.eyebrow {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500;
  color: var(--ink); margin-bottom: clamp(14px, 2.4svh, 28px);
}
.eyebrow__line { width: 44px; height: 1px; background: var(--accent); }
.eyebrow__sep { color: var(--accent); }

.hero__name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(4.2rem, 13.4vw, 16rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
}
.hero__foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 28px 48px; flex-wrap: wrap;
  margin-top: clamp(22px, 4svh, 48px);
  max-width: 64vw;
}
.hero__lede { max-width: 44ch; font-size: clamp(1rem, 1.12vw, 1.12rem); color: var(--ink-2); text-wrap: pretty; }
.hero__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__li { font-size: 0.92rem; }

.scroll-hint {
  position: absolute; z-index: 4; left: var(--pad); bottom: 28px;
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2);
}
.scroll-hint__line { position: relative; width: 56px; height: 1px; background: var(--line-2); overflow: hidden; }
.scroll-hint__line::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: scrollhint 2.2s var(--ease-io) infinite; }
@keyframes scrollhint { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ==========================================================================
   2 · PROOF STRIP (static)
   ========================================================================== */
.proof { border-block: 1px solid var(--line); background: rgba(13, 13, 21, 0.72); }
.proof__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: 0; }
.proof__list li { padding: clamp(28px, 3vw, 44px) clamp(18px, 2.2vw, 36px); border-left: 1px solid var(--line); }
.proof__list li:first-child { border-left: 0; padding-left: 0; }
.proof__list strong {
  display: block; font-family: var(--serif); font-weight: 300; line-height: 1.05; letter-spacing: -0.03em;
  font-size: clamp(1.7rem, 2.6vw, 2.8rem); margin-bottom: 12px;
}
.proof__list li:first-child strong { color: var(--accent); }
.proof__list span { display: block; font-size: 0.92rem; line-height: 1.55; color: var(--ink-2); max-width: 32ch; text-wrap: pretty; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: clamp(96px, 12vw, 190px); position: relative; }
.section__head { margin-bottom: clamp(48px, 7vw, 96px); }

/* ==========================================================================
   3 · EXPERIENCE — numbered editorial list
   ========================================================================== */
.xp__list { border-top: 1px solid var(--line); }
.xp__row { position: relative; border-bottom: 1px solid var(--line); }
.xp__row::before { /* wash */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(184, 255, 60, 0.07), transparent 65%);
  transition: opacity 0.7s var(--ease);
}
.xp__row::after { /* signal line */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--ease);
}
.xp__row.is-open::before { opacity: 1; }
.xp__row.is-open::after { transform: scaleX(1); }
.xp__row:not(.is-open):hover::before { opacity: 0.55; }
.xp__row:not(.is-open):hover::after { transform: scaleX(0.18); }

.xp__h { font: inherit; }
.xp__head {
  position: relative; z-index: 1;
  width: 100%; text-align: left;
  display: grid;
  grid-template-columns: 5rem minmax(0, 2.2fr) minmax(0, 1fr) 2.5rem;
  grid-template-areas: "num co role plus" ". scope scope plus";
  align-items: center; column-gap: 24px; row-gap: 16px;
  padding-block: clamp(26px, 3.2vw, 50px);
}
.xp__num { grid-area: num; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink-2); transition: color 0.4s; align-self: start; padding-top: 0.6em; }
.xp__row.is-open .xp__num { color: var(--accent); }
.xp__co {
  grid-area: co;
  font-family: var(--serif); font-weight: 300; line-height: 1;
  font-size: clamp(2.1rem, 4.9vw, 5.4rem); letter-spacing: -0.04em;
  transition: transform 0.8s var(--ease), color 0.4s;
}
.xp__row.is-open .xp__co, .xp__head:hover .xp__co { transform: translateX(clamp(6px, 1vw, 16px)); }
.xp__head:hover .xp__co { color: var(--accent); }
.xp__role { grid-area: role; font-size: 1.02rem; line-height: 1.35; }
.xp__role small { display: block; margin-top: 6px; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.xp__scope { grid-area: scope; max-width: 62ch; color: var(--ink-2); font-size: 1rem; line-height: 1.55; text-wrap: pretty; }
.xp__plus { grid-area: plus; position: relative; width: 28px; height: 28px; justify-self: end; transition: transform 0.7s var(--ease); }
.xp__plus::before, .xp__plus::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--ink); transition: background 0.3s; }
.xp__plus::after { transform: rotate(90deg); }
.xp__row.is-open .xp__plus { transform: rotate(135deg); }
.xp__row.is-open .xp__plus::before, .xp__row.is-open .xp__plus::after { background: var(--accent); }

/* Expanding panel — grid-rows for height, clip-path for the reveal */
.xp__panel { display: grid; grid-template-rows: 1fr; }
.js .xp__panel {
  grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows 0.9s var(--ease), visibility 0s linear 0.9s;
}
.js .is-open > .xp__panel { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.9s var(--ease), visibility 0s; }
.xp__panel-in { min-height: 0; overflow: hidden; }
.js .xp__body { clip-path: inset(0 0 100% 0); transition: clip-path 0.9s var(--ease-io); }
.js .is-open .xp__body { clip-path: inset(0 0 0 0); transition-delay: 0.08s; }

.xp__body {
  display: grid; grid-template-columns: minmax(220px, 19rem) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 72px); align-items: start;
  padding: 8px 0 clamp(40px, 4.5vw, 72px) calc(5rem + 24px);
}
.xp__aside { display: grid; gap: 20px; }
.xp__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2); }
.xp__media img { width: 100%; height: 100%; object-fit: cover; }
.js .xp__media { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s var(--ease) 0.15s; }
.js .is-open .xp__media { clip-path: inset(0 0 0 0); }
.xp__stack { display: flex; flex-wrap: wrap; gap: 8px; }
.xp__stack li { padding: 5px 13px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.78rem; color: var(--ink-2); letter-spacing: 0.02em; }

.xp__blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3vw, 48px) clamp(28px, 3.4vw, 56px); }
.xp__block--wide { grid-column: 1 / -1; }
.xp__block h4 {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 14px;
}
.xp__block--mine h4 { color: var(--accent); }
.xp__block--team h4::after { content: " · shared"; letter-spacing: 0.08em; text-transform: none; font-weight: 400; }
.xp__block p, .xp__block li { color: var(--ink-2); font-size: 0.98rem; line-height: 1.6; text-wrap: pretty; }
.xp__block--wide p { max-width: 70ch; color: var(--ink); }
.xp__block ul { display: grid; gap: 12px; }
.xp__block li { position: relative; padding-left: 20px; }
.xp__block li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 8px; height: 1px; background: var(--accent); }
.xp__block--team li::before { background: var(--ink-2); }

/* ==========================================================================
   4 · TECHNICAL EXPERTISE
   ========================================================================== */
.section__head--tight { margin-bottom: clamp(36px, 5vw, 64px); }
.cap__grid { --cap-gap: clamp(24px, 3vw, 56px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 48px) var(--cap-gap); }
.cap__item { padding-top: 20px; border-top: 1px solid var(--line); transition: border-color 0.5s; }
.cap__item:hover { border-top-color: var(--accent); }
.cap__item h3 { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.cap__tools { font-family: var(--serif); font-weight: 300; font-size: clamp(1.7rem, 2.4vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; }
.cap__note { margin-top: 10px; color: var(--ink-2); font-size: 0.95rem; line-height: 1.5; }

/* Seventh item closes the grid as a full-width row so no card is left orphaned */
.cap__item--wide { grid-column: 1 / -1; }
@media (min-width: 901px) {
  .cap__item--wide { display: grid; grid-template-columns: calc((100% - 2 * var(--cap-gap)) / 3) minmax(0, 1fr); column-gap: var(--cap-gap); align-items: start; }
  .cap__item--wide h3 { grid-row: 1 / span 2; margin-bottom: 0; padding-top: 0.6em; }
  .cap__item--wide .cap__note { margin-top: 10px; }
}

/* ==========================================================================
   4b · CERTIFICATIONS & LATEST READS — ticker strip
   ========================================================================== */
.tk { padding-bottom: clamp(72px, 9vw, 140px); }
.tk__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(32px, 4vw, 56px); }
.tk__toggle {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); transition: color 0.3s, border-color 0.3s;
}
.tk__toggle::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tk__toggle[aria-pressed="true"]::before { background: transparent; border: 1px solid var(--accent); }
.tk__toggle:hover { color: var(--accent); border-color: var(--accent); }

.tk__strip {
  position: relative; overflow: hidden;
  border-block: 1px solid var(--line);
  background:
    radial-gradient(ellipse 40% 140% at 50% 50%, rgba(184, 255, 60, 0.06), transparent 70%),
    rgba(13, 13, 21, 0.72);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.tk__track { display: flex; width: max-content; animation: tk-scroll 80s linear infinite; }
.tk__strip:hover .tk__track, .tk__strip:focus-within .tk__track, .tk__strip.is-paused .tk__track { animation-play-state: paused; }
.tk__group { display: flex; flex-shrink: 0; }
.tk__item { display: inline-flex; align-items: center; gap: clamp(20px, 2vw, 32px); padding: clamp(36px, 4vw, 56px) 0; }
.tk__item::after {
  content: ""; width: 1px; height: 96px; flex-shrink: 0; margin: 0 clamp(32px, 3.6vw, 64px);
  background: linear-gradient(to bottom, transparent, var(--line-2), transparent);
}
.tk__badge { width: clamp(124px, 11vw, 164px); height: clamp(124px, 11vw, 164px); flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55)); }
.tk__book {
  position: relative; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between;
  width: clamp(92px, 8vw, 120px); aspect-ratio: 3 / 4; padding: 14px 12px 12px 20px; border-radius: 2px 5px 5px 2px;
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(184, 255, 60, 0.16), transparent 55%), var(--bg-2);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.7), inset -2px 0 0 rgba(240, 238, 232, 0.05);
}
.tk__book::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.tk__book::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); border-radius: 2px 5px 0 0; }
.tk__book-top { font-family: var(--serif); font-weight: 300; font-size: clamp(1.7rem, 2.2vw, 2.3rem); line-height: 1; letter-spacing: -0.04em; color: var(--accent); margin-top: 6px; }
.tk__book-mid { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(0.85rem, 1vw, 1rem); line-height: 1.1; }
.tk__book-by { font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.tk__text { display: flex; flex-direction: column; gap: 6px; width: clamp(240px, 22vw, 320px); }
.tk__kind { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.tk__text strong { font-family: var(--serif); font-weight: 300; font-size: clamp(1.5rem, 2vw, 2.1rem); line-height: 1.08; letter-spacing: -0.025em; }
.tk__sub { font-size: 0.88rem; line-height: 1.5; color: var(--ink-2); }
@keyframes tk-scroll { to { transform: translateX(-50%); } }

/* ==========================================================================
   5 · ABOUT & ENGINEERING APPROACH
   ========================================================================== */
.about__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 7vw, 120px); align-items: start; }
.about__side { position: sticky; top: 13vh; align-self: start; }
.about__frame {
  position: relative; aspect-ratio: 3 / 4; max-height: 76vh; width: 100%; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px;
  background:
    radial-gradient(closest-side at 50% 42%, rgba(184, 255, 60, 0.2), transparent 80%),
    linear-gradient(to right, rgba(240, 238, 232, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(to bottom, rgba(240, 238, 232, 0.05) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg-2);
}
.about__frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%;
  filter: contrast(1.05) drop-shadow(0 0 1.5px rgba(184, 255, 60, 0.45));
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}
.about__corner { position: absolute; width: 22px; height: 22px; border: 1px solid var(--accent); z-index: 2; }
.about__corner--tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.about__corner--br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
.about__figure figcaption { display: flex; justify-content: space-between; margin-top: 14px; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }

.about__big {
  font-family: var(--serif); font-weight: 300; letter-spacing: -0.03em; line-height: 1.07;
  font-size: clamp(2rem, 4.2vw, 4.8rem); text-wrap: pretty;
}
.hw-wrap { display: inline-block; }
.hw { display: inline-block; transition: opacity 0.5s var(--ease); }
.js .hw { opacity: 0.22; }
.js .hw.is-lit { opacity: 1; }
.about__lede { margin-top: clamp(40px, 5vw, 72px); max-width: 58ch; font-size: clamp(1.05rem, 1.3vw, 1.25rem); line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }

.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 4vw, 56px) clamp(24px, 3vw, 48px); margin-top: clamp(48px, 6vw, 88px); counter-reset: pr; }
.principles li { position: relative; padding-top: 20px; border-top: 1px solid var(--line); counter-increment: pr; }
.principles li::before { content: "0" counter(pr); display: block; font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1rem; margin-bottom: 10px; }
.principles h3 { font-family: var(--serif); font-weight: 340; font-size: clamp(1.35rem, 1.8vw, 1.8rem); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 10px; }
.principles p { color: var(--ink-2); font-size: 0.98rem; line-height: 1.6; text-wrap: pretty; }

.edu { margin-top: clamp(56px, 7vw, 100px); padding-top: 28px; border-top: 1px solid var(--line); }
.edu__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.edu__t { display: block; font-family: var(--serif); font-weight: 320; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.015em; }
.edu__m { display: block; margin-top: 6px; font-size: 0.88rem; line-height: 1.5; color: var(--ink-2); }

/* ==========================================================================
   6 · CV DOWNLOAD
   ========================================================================== */
.cv { background: linear-gradient(180deg, transparent, rgba(13, 13, 21, 0.9) 18%, rgba(13, 13, 21, 0.9) 82%, transparent); border-block: 1px solid var(--line); }
.cv__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 7vw, 120px); align-items: end; }
.cv__text { max-width: 40ch; color: var(--ink-2); font-size: clamp(1.05rem, 1.25vw, 1.2rem); line-height: 1.65; text-wrap: pretty; }
.cv__actions { display: flex; align-items: center; gap: 20px 32px; flex-wrap: wrap; margin-top: clamp(28px, 3.5vw, 48px); }
.cv__meta { margin-top: 22px; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }

/* ==========================================================================
   7 · CONTACT
   ========================================================================== */
.contact { overflow: hidden; padding-bottom: clamp(80px, 11vw, 160px); }
.contact::before {
  content: ""; position: absolute; left: 50%; bottom: -30%; width: min(120vw, 1600px); aspect-ratio: 2 / 1; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(184, 255, 60, 0.13), transparent 75%);
}
.contact .wrap { position: relative; }
.contact__cta {
  font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 10.4vw, 12.5rem); line-height: 0.92; letter-spacing: -0.05em; max-width: 13ch; text-wrap: balance;
}
.contact__cta em { color: var(--accent); font-weight: 300; }
.contact__row { display: flex; align-items: center; justify-content: space-between; gap: 28px 56px; flex-wrap: wrap; margin-top: clamp(40px, 6vw, 88px); padding-top: clamp(28px, 3vw, 44px); border-top: 1px solid var(--line); }
.contact__mail {
  display: inline-flex; font-family: var(--serif); font-weight: 300; font-size: clamp(1.4rem, 4.2vw, 4.6rem); letter-spacing: -0.035em; line-height: 1.1;
  transition: transform 0.55s var(--ease);
  max-width: 100%;
}
.contact__mail .btn__label { padding: calc(0.15em + 5px) 0; gap: 0.3em; flex-wrap: wrap; overflow-wrap: anywhere; }
.contact__mail b { font-weight: 300; color: var(--accent); font-family: var(--sans); font-size: 0.7em; }
.contact__mail .btn__label { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size 0.7s var(--ease), transform 0.55s var(--ease); }
.contact__mail:hover .btn__label { background-size: 100% 2px; }
.contact__copy { display: none; align-items: center; gap: 14px; margin-top: 14px; min-height: 44px; }
.js .contact__copy { display: flex; }
.copy {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); transition: color 0.3s, border-color 0.3s;
}
.copy::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--accent); transition: background 0.3s; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.is-done { color: var(--accent); border-color: var(--accent); }
.copy.is-done::before { background: var(--accent); }
.copy__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* announced to screen readers only; the button label already shows "Copied" */
.contact__links { display: flex; gap: 12px 32px; flex-wrap: wrap; align-items: center; }
.contact__loc { color: var(--ink-2); font-size: 1rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: 0.85rem; color: var(--ink-2); }
.footer__row { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; align-items: center; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer__nav a, .footer__top { display: inline-block; padding-block: 5px; }
.footer a { transition: color 0.3s; }
.footer a:hover { color: var(--accent); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .xp__head { grid-template-columns: 3.5rem minmax(0, 2fr) minmax(0, 1fr) 2.5rem; }
  .xp__body { grid-template-columns: 1fr; padding-left: calc(3.5rem + 24px); }
  .xp__aside { grid-template-columns: minmax(200px, 18rem) minmax(0, 1fr); align-items: start; }
  .hero__foot { max-width: 100%; }
  .proof__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof__list li:nth-child(3) { border-left: 0; padding-left: 0; }
  .proof__list li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .nav {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px;
    padding: 100px var(--pad) 48px; background: rgba(8, 8, 14, 0.97);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
  }
  .nav a { font-family: var(--serif); font-size: clamp(2.4rem, 10vw, 4rem); font-weight: 300; color: var(--ink); padding: 4px 0; letter-spacing: -0.03em; }
  .nav .nav__cta { background: none; color: var(--accent); padding: 4px 0; font-weight: 300; border-radius: 0; }
  .nav .nav__cta:hover { background: none; color: var(--ink); }
  .nav .nav__cta.is-active { background: none; box-shadow: none; color: var(--ink); }
  .menu-open .nav { opacity: 1; visibility: visible; transition: opacity 0.4s var(--ease), visibility 0s; }
  .menu-open { overflow: hidden; }
  .menu-btn { display: block; position: relative; z-index: 2; }
  .brand { position: relative; z-index: 2; }

  .about__grid { grid-template-columns: 1fr; }
  .about__side { position: relative; top: 0; max-width: 440px; }
  .about__frame { max-height: none; }
  .cv__grid { grid-template-columns: 1fr; align-items: start; }
  .cap__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__name { font-size: clamp(4rem, 15.5vw, 12rem); }
  .hero__content { width: calc(100% - var(--pad) * 2); }
  .hero__lede { max-width: 30ch; }
  .hero__portrait { height: min(60svh, 84vw); right: -4vw; }
  .tag--2 { display: none; }
  .tag--1 { top: 22%; right: 6vw; }
  .tag--3 { top: 56%; right: 4vw; }
}

@media (max-width: 720px) {
  .header { padding-top: 10px; }
  .brand__name { font-size: 0.85rem; }

  .hero::before {
    background:
      linear-gradient(0deg, var(--bg) 0%, rgba(8, 8, 14, 0.92) 26%, rgba(8, 8, 14, 0) 56%),
      linear-gradient(90deg, rgba(8, 8, 14, 0.5) 0%, rgba(8, 8, 14, 0) 60%);
  }
  .hero__portrait { height: auto; width: min(96vw, 440px); right: -4vw; bottom: 22svh; }
  .hero__portrait img { -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); }
  .hero__glow { width: 130vw; right: -25vw; top: 18svh; }
  .hero__dag { width: 150vw; right: -50vw; bottom: 22svh; opacity: 0.7; }
  /* Content flows in normal layout so the primary actions are never pushed off-screen */
  .hero__content {
    position: relative; left: auto; bottom: auto; width: 100%;
    min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between;
    padding: 100px var(--pad) 28px;
  }
  .hero__name { font-size: clamp(3.6rem, 22vw, 7rem); }
  .hero__foot { flex-direction: column; align-items: flex-start; margin-top: 24px; gap: 18px; }
  .hero__lede { max-width: 34ch; font-size: 1rem; }
  .hero__actions { gap: 14px; width: 100%; }
  .hero__cta { gap: 10px; }
  .hero__cta .btn__label { padding: 0.95em 1.3em; font-size: 0.9rem; }
  .eyebrow { font-size: 0.75rem; letter-spacing: 0.16em; }
  .eyebrow__line { width: 28px; }
  .scroll-hint { display: none; }
  .tag--1 { top: 37%; right: 4vw; font-size: 0.78rem; padding: 9px 14px 9px 12px; }
  .tag--3 { display: none; }

  .proof__list { grid-template-columns: 1fr; }
  .proof__list li { border-left: 0; padding-left: 0; padding-block: 24px; }
  .proof__list li + li { border-top: 1px solid var(--line); }

  .xp__head { grid-template-columns: 2.2rem minmax(0, 1fr) 2rem; grid-template-areas: "num co plus" ". role plus" ". scope plus"; row-gap: 12px; column-gap: 12px; }
  .xp__num { font-size: 1rem; }
  .xp__co { font-size: clamp(2rem, 10.5vw, 3.4rem); }
  .xp__role { font-size: 0.95rem; }
  .xp__scope { font-size: 0.95rem; }
  .xp__plus { align-self: start; margin-top: 0.4em; width: 22px; height: 22px; }
  .xp__body { padding-left: 0; gap: 24px; }
  .xp__aside { grid-template-columns: 1fr; }
  .xp__media { max-width: 420px; }
  .xp__blocks { grid-template-columns: 1fr; }

  .cap__grid { grid-template-columns: 1fr; gap: 24px; }
  .tk__badge { width: 104px; height: 104px; }
  .tk__book { width: 84px; padding: 11px 9px 9px 16px; }
  .tk__text { width: 210px; }
  .tk__text strong { font-size: 1.35rem; }
  .tk__item { gap: 16px; padding: 28px 0; }
  .tk__item::after { height: 72px; margin-inline: 36px; }
  .edu__list { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .contact__cta { max-width: none; }
  .footer__row { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .js .w__i, .js [data-reveal], .js [data-hero-fade], .js .tag, .js .hw, .js .hero__portrait img { opacity: 1 !important; transform: none !important; }
  .js .xp__body, .js .xp__media { clip-path: none !important; }
  .tk__strip { -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .tk__track { display: block; width: auto; animation: none; }
  .tk__group:not(:first-child) { display: none; }
  .tk__group { flex-wrap: wrap; flex-shrink: 1; padding-inline: var(--pad); gap: 0 clamp(32px, 5vw, 72px); }
  .tk__item { padding-block: 24px; max-width: 100%; }
  .tk__item::after { display: none; }
  .tk__toggle { display: none; }
}
