/* ============================================================
   Fares Neghiz — Portfolio
   Tokens + base + sections. Light is default; dark follows OS
   (prefers-color-scheme) and can be force-toggled via [data-theme].
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --lime: #d4ff00;
  --ink: #212121;
  --white: #ffffff;

  /* light theme (default) */
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --text: #212121;
  --muted: #6b6b6b;
  --line: #d9d9d9;
  --hairline: rgba(33, 33, 33, 0.12);
  --acc-text: #4d6b00;
  --wave: #212121;
  --wave-op: 0.9;
  --thread: #8a8a8a;
  --thread-op: 0.65;
  --sheet-bg: #ffffff;
  --sheet-text: #212121;
  --circuit: #d9d9d9;
  --card-border: transparent;
  --nav-bg: rgba(242, 242, 242, 0.72);
  --shadow: 0 30px 60px -30px rgba(33, 33, 33, 0.25);

  --maxw: 1384px;
  --gutter: clamp(20px, 4.2vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1a1a;
    --surface: #242424;
    --surface-2: #242424;
    --text: #ffffff;
    --muted: #8a8a8a;
    --line: rgba(255, 255, 255, 0.14);
    --hairline: rgba(255, 255, 255, 0.12);
    --acc-text: #d4ff00;
    --wave: #ffffff;
    --wave-op: 0.5;
    --thread: #d4ff00;
    --thread-op: 0.7;
    --sheet-bg: #242424;
    --sheet-text: #d4ff00;
    --circuit: rgba(255, 255, 255, 0.16);
    --card-border: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(26, 26, 26, 0.72);
    --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
  }
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --surface: #242424;
  --surface-2: #242424;
  --text: #ffffff;
  --muted: #8a8a8a;
  --line: rgba(255, 255, 255, 0.14);
  --hairline: rgba(255, 255, 255, 0.12);
  --acc-text: #d4ff00;
  --wave: #ffffff;
  --wave-op: 0.5;
  --thread: #d4ff00;
  --thread-op: 0.7;
  --sheet-bg: #242424;
  --sheet-text: #d4ff00;
  --circuit: rgba(255, 255, 255, 0.16);
  --card-border: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(26, 26, 26, 0.72);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease);
}

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

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }

.mono {
  font-family: "DM Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0.02em;
}

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Focus & skip link ---------- */
:focus-visible {
  outline: 2px solid var(--acc-text);
  outline-offset: 3px;
}
[tabindex="-1"]:focus-visible { outline: none; } /* skip-link target: move focus, no ring */

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  padding: 10px 20px;
  background: var(--lime);
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 14px;
  border-radius: 999px;
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible {
  transform: none;
  outline-offset: 2px;
}

/* ---------- Reveal animation primitive ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.reveal[data-d="5"] { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Word-level reveal (staggered) ---------- */
.reveal-words .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
  transition:
    opacity 0.7s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 40ms);
  will-change: opacity, transform;
}
.reveal-words.in .word {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-words .word { opacity: 1; transform: none; transition: none; }
}

/* ---------- Animated threads (fixed full-viewport background) ---------- */
.threads-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--thread-op);
  transition: opacity 0.5s var(--ease);
}
.threads-bg canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Wave field ---------- */
.wave {
  position: absolute;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  color: var(--wave);
  opacity: var(--wave-op);
}
.wave svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wave path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wave path.accent { stroke: var(--lime); opacity: 1; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  width: 100%;
  z-index: 60;
  height: 88px;
  display: flex;
  align-items: center;
  background: linear-gradient(var(--nav-bg), color-mix(in srgb, var(--nav-bg) 0%, transparent));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform: translateY(0);
  transition: background 0.5s var(--ease), transform 0.55s var(--ease);
  will-change: transform;
}
.nav--hidden { transform: translateY(-100%); }

.nav__inner {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* brand label — fades in once user scrolls past the hero */
.nav__brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -4px);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.45s var(--ease);
}
.nav--scrolled .nav__brand {
  opacity: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.burger {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  padding: 8px 0;
  background: none;
  border: 0;
}
.burger span {
  display: block;
  height: 2px;
  width: 35px;
  background: var(--text);
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease), width 0.45s var(--ease);
}
.burger span:nth-child(2) { width: 24px; }
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 35px; }
.burger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 35px; }
.nav__right { display: flex; align-items: center; gap: 12px; }

/* CTA group — pill "Get in touch" + arrow icon that expand toward each other on hover */
.cta-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.4s var(--ease);
}
.cta-group:hover {
  transform: translateY(-2px);
}
.cta-group .pill--cta {
  transition: filter 0.3s var(--ease),
              padding-right 0.4s var(--ease),
              border-top-right-radius 0.4s var(--ease),
              border-bottom-right-radius 0.4s var(--ease);
}
.cta-group .icon-btn {
  transition: background 0.3s var(--ease),
              margin-left 0.4s var(--ease),
              border-top-left-radius 0.4s var(--ease),
              border-bottom-left-radius 0.4s var(--ease);
}
.cta-group:hover .pill--cta {
  padding-right: 28px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}
.cta-group:hover .icon-btn {
  margin-left: -6px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.icon-btn {
  width: 41px; height: 41px;
  border-radius: 999px;
  border: 0;
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease);
}
.icon-btn:hover { transform: translateY(-2px); }
.icon-btn svg { width: 18px; height: 18px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 41px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  border: 0;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), filter 0.3s var(--ease);
}
.pill:hover { transform: translateY(-2px); filter: brightness(1.04); }
.pill--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline);
}
.pill--ghost:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }

/* theme toggle */
.theme-toggle {
  width: 41px; height: 41px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.theme-toggle svg { width: 18px; height: 18px; position: absolute; transition: transform 0.5s var(--ease), opacity 0.4s var(--ease); }
.theme-toggle .i-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.theme-toggle .i-moon { opacity: 1; transform: none; }
[data-theme="dark"] .theme-toggle .i-sun { opacity: 1; transform: none; }
[data-theme="dark"] .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
}

/* ---------- Menu overlay ---------- */
.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  z-index: 55;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 64px;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease);
  pointer-events: none;
}
.menu.open { clip-path: inset(0 0 0 0); pointer-events: auto; }
.menu__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(6px, 1.4vw, 14px); }
.menu__list a {
  font-size: clamp(40px, 9vw, 96px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 18px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), color 0.3s;
}
.menu.open .menu__list a { opacity: 1; transform: none; }
.menu.open .menu__list li:nth-child(1) a { transition-delay: 0.12s; }
.menu.open .menu__list li:nth-child(2) a { transition-delay: 0.18s; }
.menu.open .menu__list li:nth-child(3) a { transition-delay: 0.24s; }
.menu.open .menu__list li:nth-child(4) a { transition-delay: 0.30s; }
.menu.open .menu__list li:nth-child(5) a { transition-delay: 0.36s; }
.menu__list a:hover { color: var(--muted); }
.menu__list .idx { font-size: 14px; font-weight: 500; color: var(--lime); font-family: "DM Mono", monospace; transform: translateY(-0.4em); }
.menu__foot { margin-top: clamp(28px, 5vw, 56px); display: flex; gap: 28px; flex-wrap: wrap; }
.menu__foot a { font-size: 15px; color: var(--muted); }
.menu__foot a:hover { color: var(--text); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: clamp(120px, 18vh, 240px);
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero__wave { top: -60px; right: -2%; width: 78%; height: 720px; }
.hero__inner { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; }
.hero__hi { font-size: clamp(22px, 2.4vw, 32px); font-weight: 300; }
.hero__title {
  margin: 18px 0 0;
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.02em;
}
.hero__scroll {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}
.hero__scroll .track {
  width: 1.5px; height: 64px;
  background: var(--hairline);
  position: relative;
  overflow: hidden;
}
.hero__scroll .track::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 26px;
  background: var(--lime);
  animation: scrolldot 2.2s var(--ease) infinite;
}
@keyframes scrolldot {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(260%); }
}
.hero__scroll span { font-size: 16px; color: var(--muted); }

/* ============================================================
   STATEMENT / intro
   ============================================================ */
.statement {
  position: relative;
  padding: clamp(80px, 14vw, 200px) 0;
  overflow: hidden;
}
.statement__wave { left: -10%; top: 20%; width: 120%; height: 560px; }
.statement__inner { position: relative; z-index: 2; max-width: 980px; margin-inline: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 64px; }
.statement h2 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 300;
  line-height: 1.78;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* ============================================================
   STORY
   ============================================================ */
.story { position: relative; padding: clamp(80px, 12vw, 180px) 0; }
.story__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}
.h-section { font-size: clamp(28px, 3.4vw, 36px); font-weight: 300; letter-spacing: -0.01em; margin: 0; }
.story__lead { grid-column: 7 / 13; display: flex; flex-direction: column; gap: 28px; }
.story__lead p { margin: 0; max-width: 50ch; }
.story__second {
  grid-column: 2 / 9;
  margin-top: clamp(40px, 7vw, 100px);
  max-width: 52ch;
}
.story__media {
  grid-column: 1 / 7;
  margin: 0;
  aspect-ratio: 3 / 2;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.story__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.6s var(--ease);
}
.story__media:hover img { transform: scale(1.03); }

/* image reveal — slides in from the left, soft scale */
.reveal-img {
  opacity: 0;
  transform: translateX(-48px) scale(0.96);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
  will-change: opacity, transform;
}
.reveal-img.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-img { opacity: 1; transform: none; transition: none; }
}

/* placeholder */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--line) 60%, transparent) 0 1px, transparent 1px 11px),
    var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text) 55%, transparent);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ============================================================
   WHAT I DO
   ============================================================ */
.whatido { padding: clamp(40px, 7vw, 90px) 0; }
.whatido__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 4vw, 56px); }
.whatido__col { grid-column: 4 / 11; display: flex; flex-direction: column; gap: 47px; }
.whatido__paras { display: flex; flex-direction: column; gap: 36px; max-width: 60ch; }
.whatido__paras p { margin: 0; }
.divider { height: 4px; background: var(--lime); border: 0; border-radius: 4px; width: 100%; }
.facts { display: flex; gap: clamp(40px, 7vw, 90px); flex-wrap: wrap; }
.fact { display: flex; flex-direction: column; gap: 16px; }
.fact .mono { color: var(--text); }
.fact p { margin: 0; line-height: 1.7; }

/* ============================================================
   STATS
   ============================================================ */
.stats { position: relative; padding: clamp(60px, 11vw, 150px) 0; overflow: hidden; }
.stats__wave { left: -8%; bottom: -10%; width: 116%; height: 520px; }
.stats__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 28px;
  align-items: center;
}
.stat-card {
  border-radius: 22px;
  padding: 30px;
  min-height: 258px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .mono { letter-spacing: 0.08em; text-transform: uppercase; }
.stat-card .num {
  font-size: clamp(86px, 9vw, 128px);
  font-weight: 300;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-card--ink { background: var(--ink); }
.stat-card--ink .mono { color: var(--lime); }
.stat-card--ink .num { color: var(--lime); }
.stat-card--ink.alt .mono { color: var(--white); }
.stat-card--ink.alt .num { color: var(--white); }
.stat-card--light { background: var(--white); }
.stat-card--light .mono,
.stat-card--light .num { color: var(--ink); }

.stat-1 { grid-column: 1 / 5; }
.stat-2 { grid-column: 5 / 9; }
.stat-3 { grid-column: 9 / 13; }

/* ============================================================
   EXPERIENCE
   ============================================================ */
.section-head { text-align: center; padding: clamp(40px, 7vw, 90px) 0 clamp(30px, 5vw, 64px); }
.section-head .h-section { display: inline-block; }

.experience { position: relative; padding-bottom: clamp(40px, 8vw, 120px); }
.experience .section-head {
  text-align: left;
  padding: clamp(60px, 10vw, 120px) 0 clamp(20px, 3vw, 40px);
}
.experience .section-head .h-section {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.exp-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 7vw, 110px);
  padding: clamp(20px, 4vw, 48px) 0;
}
/* curved, glowing timeline drawn as an SVG path (built in JS) */
.exp-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 0;
  pointer-events: none;
}
.exp-line path { fill: none; }
.exp-line__base {
  stroke: url(#expFade);
  stroke-width: 2;
  opacity: 0.28;
}
.exp-line__trail {
  /* the portion already travelled by the dot — bright + glowing.
     stroke-dasharray / -dashoffset are driven by scroll in JS. */
  stroke: url(#expFade);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter:
    drop-shadow(0 0 6px rgba(212, 255, 0, 0.9))
    drop-shadow(0 0 16px rgba(212, 255, 0, 0.55))
    drop-shadow(0 0 30px rgba(212, 255, 0, 0.3));
}

.exp-card {
  position: relative;
  z-index: 2;
  width: min(430px, 92%);
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.exp-card[data-side="left"] {
  align-self: flex-start;
  margin-left: clamp(20px, 10%, 160px);
}
.exp-card[data-side="right"] {
  align-self: flex-end;
  margin-right: clamp(20px, 10%, 160px);
}
/* single glowing dot that travels along the curved line as the user scrolls.
   left / top (in px, relative to the track) are set by JS from the path. */
.exp-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow:
    0 0 8px rgba(212, 255, 0, 0.95),
    0 0 20px rgba(212, 255, 0, 0.6),
    0 0 44px rgba(212, 255, 0, 0.3);
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.exp-dot.is-ready { opacity: 1; }

/* experience cards slide in from their own side, with a soft blur + scale */
.exp-card[data-side="left"].reveal {
  opacity: 0;
  transform: translate(-64px, 32px) scale(0.94);
  filter: blur(8px);
}
.exp-card[data-side="right"].reveal {
  opacity: 0;
  transform: translate(64px, 32px) scale(0.94);
  filter: blur(8px);
}
.exp-card.reveal {
  transition:
    opacity 0.9s var(--ease),
    transform 1.05s var(--ease),
    filter 0.9s var(--ease);
}
.exp-card[data-side].reveal.in {
  opacity: 1;
  transform: none;
  filter: none;
}
@media (prefers-reduced-motion: reduce) {
  .exp-card[data-side].reveal { opacity: 1; transform: none; filter: none; }
}
.exp-card .meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 48px; }
.exp-card h3 {
  margin: 0 0 40px;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
}
.exp-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.exp-card li { line-height: 1.6; position: relative; padding-left: 18px; }
.exp-card li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; background: var(--lime); border-radius: 1px; }

/* ============================================================
   EDUCATION
   ============================================================ */
.education { padding-bottom: clamp(60px, 10vw, 140px); }
.edu-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px; align-items: start; }
.edu-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.edu-card .meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 48px; }
.edu-card h3 {
  margin: 0 0 60px;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.edu-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.edu-card li { line-height: 1.7; }
.edu-1 { grid-column: 1 / 6; }
.edu-2 { grid-column: 7 / 13; align-self: start; }

/* ============================================================
   SELECTED WORK
   ============================================================ */
.work { padding-bottom: clamp(60px, 10vw, 140px); }
.work .section-head {
  text-align: left;
  padding: clamp(60px, 10vw, 120px) 0 clamp(20px, 3vw, 40px);
}
.work .section-head .h-section {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.work__block { margin-bottom: clamp(48px, 7vw, 88px); }
.work__block:last-child { margin-bottom: 0; }
.work__kicker {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.work__kicker .mono { letter-spacing: 0.08em; text-transform: uppercase; }
.work__note { color: var(--muted); font-size: 12px; }
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px; }
.work-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.work-card .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 36px;
  color: var(--muted);
}
.work-card .meta .mono { letter-spacing: 0.08em; text-transform: uppercase; }
.work-card h3 {
  margin: 0 0 16px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.work-card p { margin: 0 0 28px; line-height: 1.7; max-width: 58ch; }
.work-card__tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.work-card__tags .mono {
  font-size: 12px;
  line-height: 1;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}
.wc--4 { grid-column: span 4; }
.wc--6 { grid-column: span 6; }
.wc--8 { grid-column: span 8; }

/* ============================================================
   CORE STACK — pinned section + overlapping card deck
   ============================================================ */
.stack {
  position: relative;
}
.stack__pin {
  position: relative;
  display: block;
}
.stack__shell {
  padding-top: clamp(80px, 12vh, 150px);
  padding-bottom: clamp(70px, 14vh, 160px);
}
.stack-head {
  padding: 0 0 clamp(28px, 5vh, 60px);
}
.stack-head h2 {
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stack__deck {
  position: relative;
}
.sheet {
  position: sticky;
  top: 110px;
  height: clamp(340px, 60vh, 520px);
  margin-bottom: clamp(44px, 9vh, 120px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  transform-origin: top center;
  transform: translateZ(0);
  will-change: transform, filter;
}
.sheet:last-child { margin-bottom: 0; }
.sheet__art { position: relative; overflow: hidden; }
.sheet__art .circuit { display: none; }
.sheet__title {
  position: absolute;
  left: 38px; bottom: 30px;
  z-index: 3;
  font-size: clamp(40px, 5.2vw, 96px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0;
}
.sheet__tags {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2vw, 30px);
  padding: 40px clamp(30px, 4vw, 56px);
}
.sheet__tags .mono { color: inherit; }

/* unified sheet style — colours follow the active theme */
.sheet,
.sheet--ink,
.sheet--lime,
.sheet--light {
  background: var(--sheet-bg);
  color: var(--sheet-text);
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
.sheet .sheet__title,
.sheet--ink .sheet__title,
.sheet--lime .sheet__title,
.sheet--light .sheet__title { color: var(--sheet-text); }
.sheet .sheet__tags,
.sheet--ink .sheet__tags,
.sheet--lime .sheet__tags,
.sheet--light .sheet__tags { color: var(--sheet-text); opacity: 0.75; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { position: relative; padding: clamp(80px, 14vw, 200px) 0 64px; overflow: hidden; }
.footer__wave { left: -6%; bottom: -16%; width: 112%; height: 560px; }
.footer__inner { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px; align-items: end; }
.footer__name { grid-column: 1 / 9; }
.footer__kicker { display: flex; flex-direction: column; margin-bottom: 24px; }
.footer__kicker span { font-size: clamp(20px, 2.4vw, 32px); font-weight: 300; line-height: 1.15; }
.footer__big { margin: 0; font-weight: 500; font-size: clamp(64px, 13vw, 160px); line-height: 0.86; letter-spacing: -0.03em; }
.footer__big em { font-style: italic; font-weight: 500; }
.footer__links { grid-column: 10 / 13; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.footer__avail {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer__links a {
  font-family: "DM Mono", monospace;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.footer__links a::after {
  content: "";
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease);
}
.footer__links a:hover::after { width: 28px; }
.footer__links .i-dl {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.35s var(--ease);
}
.footer__links a:hover .i-dl { transform: translateY(2px); }
.footer__bottom {
  position: relative;
  z-index: 2;
  margin-top: clamp(60px, 10vw, 120px);
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 13px;
}
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.footer__legal a {
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.footer__legal a:hover { color: var(--text); }

/* ============================================================
   COOKIE BANNER — injected on every page by js/cookie-consent.js.
   Lives here (not legal.css) so it is a fixed popup on all pages.
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: clamp(16px, 4vw, 28px);
  right: clamp(16px, 4vw, 28px);
  bottom: clamp(16px, 4vw, 28px);
  z-index: 80;
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.cookie-banner.in { opacity: 1; transform: none; }
.cookie-banner__text {
  flex: 1 1 280px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}
.cookie-banner__text a {
  color: var(--acc-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner__actions { flex: 0 0 auto; }
.cookie-banner__btn {
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}
.cookie-banner__btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .story__media { grid-column: 1 / 7; }
  .story__lead { grid-column: 7 / 13; }
  .story__second { grid-column: 1 / 10; }
  .whatido__col { grid-column: 2 / 12; }
  .stat-1 { grid-column: 1 / 5; }
  .stat-2 { grid-column: 5 / 9; }
  .stat-3 { grid-column: 9 / 13; }
  .edu-1 { grid-column: 1 / 7; }
  .edu-2 { grid-column: 7 / 13; }
  .wc--4 { grid-column: span 6; }
  .wc--8 { grid-column: span 12; }
}

@media (max-width: 760px) {
  .nav { height: 72px; }
  /* anchor the brand next to the burger — centred it collides with the
     theme toggle once the right-hand group grows on narrow screens */
  .nav__brand {
    left: calc(var(--gutter) + 52px);
    transform: translate(0, -4px);
  }
  .nav--scrolled .nav__brand { transform: translate(0, -50%); }
  .cta-group .icon-btn { display: none; }
  .cta-group { pointer-events: none; }
  .cta-group .pill--cta { pointer-events: auto; }
  .hero { padding-top: 92px; padding-bottom: 32px; }
  .story__grid { display: flex; flex-direction: column; }
  .story__lead, .story__second, .story__media { margin: 0; max-width: none; }
  .whatido__grid { display: block; }
  .facts { gap: 36px; }
  .stats__grid { display: flex; flex-direction: column; gap: 22px; }
  .stat-card { transform: none !important; width: 100%; }
  .stat-2, .stat-3 { transform: none; }
  /* keep the curved line on mobile: it runs down a left rail and the
     cards are indented to its right (path + dot are rebuilt for this in JS). */
  .exp-card { width: auto; align-self: stretch !important; margin-left: 50px !important; margin-right: 0 !important; }
  .exp-card[data-side="left"].reveal,
  .exp-card[data-side="right"].reveal { transform: translateY(28px) scale(0.96); }
  .edu-grid { display: flex; flex-direction: column; }
  .edu-1, .edu-2 { width: 100%; }
  .work-grid { display: flex; flex-direction: column; gap: 22px; }
  .work-card { width: 100%; }
  .work-card p { max-width: none; }
  /* Core Stack: keep the pinned deck animation on mobile too,
     just adjust the card's internal layout to a single column. */
  .stack__shell { padding-top: clamp(80px, 14vh, 110px); padding-bottom: clamp(28px, 5vh, 50px); }
  .stack-head h2 { font-size: clamp(32px, 8vw, 48px); }
  .sheet { grid-template-columns: 1fr; height: clamp(320px, 66vh, 460px); margin-bottom: clamp(36px, 8vh, 80px); }
  .sheet__art { min-height: 140px; }
  .sheet__title { font-size: clamp(34px, 9vw, 52px); left: 26px; bottom: 22px; }
  .sheet__tags { flex-direction: row; flex-wrap: wrap; gap: 12px 22px; padding: 22px 26px; }
  .footer__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 40px; }
  .footer__links { flex-direction: row; flex-wrap: wrap; gap: 24px; }
  .footer__avail { flex-basis: 100%; }
}

/* ============================================================
   Varianti applicate — 1C case study · 2C manifest · 3B hero live
   ============================================================ */

/* ---------- HERO · two columns + profile terminal ---------- */
.hero__cols {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
  min-width: 0;
}
.hero__copy { display: flex; flex-direction: column; }
.hero__sub {
  margin: 28px 0 0;
  max-width: 46ch;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--muted);
}
.hero__term {
  width: 100%;
  max-width: 460px;
  min-width: 0;
  justify-self: end;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.term__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline);
}
.term__head .mono { color: var(--muted); }
.term__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--lime);
}
@media (prefers-reduced-motion: no-preference) {
  .term__dot { animation: termpulse 2.6s var(--ease) infinite; }
  @keyframes termpulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 255, 0, 0.5); }
    70% { box-shadow: 0 0 0 9px rgba(212, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 255, 0, 0); }
  }
}
.term__body {
  padding: 20px 22px 24px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 400;
  min-width: 0;
}
.term__line {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  line-height: 1.85;
}
.term__line .t { flex: none; color: var(--muted); }
.term__line .m {
  min-width: 0;
  color: color-mix(in srgb, var(--text) 82%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.term__line--cmd .t,
.term__line--cmd .m {
  color: var(--acc-text);
}
.term__line .m--acc { color: var(--acc-text); }
.term__caret::after {
  content: "";
  display: inline-block;
  width: 9px; height: 15px;
  background: var(--lime);
  transform: translateY(3px);
}
@media (prefers-reduced-motion: no-preference) {
  .term__caret::after { animation: caretblink 1.1s steps(1) infinite; }
  @keyframes caretblink { 50% { opacity: 0; } }
}

/* ---------- WORK · flagship case study ---------- */
.case-wrap { display: block; }
.case {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  overflow: hidden;
}
.case__main {
  padding: clamp(28px, 3.4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.case__id { color: var(--acc-text); letter-spacing: 0.08em; text-transform: uppercase; }
.case__main h3 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.case__main p { margin: 0; line-height: 1.7; max-width: 46ch; }
.case__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 3.5vw, 48px);
  margin-top: auto;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}
.metric { display: flex; flex-direction: column; gap: 6px; }
.metric .num {
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--acc-text);
}
.metric .mono { color: var(--muted); }
.case__arch {
  border-left: 1px solid var(--hairline);
  padding: 32px 36px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 1px) 0 0 / 18px 18px;
}
.case__archlabel {
  align-self: flex-start;
  margin-bottom: 18px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chip {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}
.chip--acc {
  border-color: var(--acc-text);
  color: var(--acc-text);
  background: color-mix(in srgb, var(--lime) 8%, transparent);
}
.vline { display: block; width: 1px; height: 18px; background: var(--hairline); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.case-minor {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mini-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.mini-card .mono { color: var(--muted); text-transform: lowercase; }

/* ---------- CORE STACK · manifest ---------- */
.manifest {
  max-width: 780px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.manifest__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hairline);
}
.mdot { width: 10px; height: 10px; border-radius: 50%; background: var(--hairline); }
.mdot--lime { background: var(--lime); }
.manifest__path { color: var(--muted); margin-left: 10px; }
.manifest__body {
  padding: 30px 34px 36px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.9;
  overflow-x: auto;
}
.ml { white-space: nowrap; }
.ml--1 { padding-left: 26px; }
.mk { color: var(--acc-text); }
.mp, .mc { color: var(--muted); }
.mv { color: color-mix(in srgb, var(--text) 88%, transparent); }

/* ---------- responsive for the new blocks ---------- */
@media (max-width: 1080px) {
  .hero__cols { grid-template-columns: 1fr; gap: 44px; align-content: center; }
  .hero__term { justify-self: start; }
  .case { grid-template-columns: 1fr; }
  .case__arch { border-left: 0; border-top: 1px solid var(--hairline); }
  .case-minor { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  /* Hero fits within one viewport: title + profile terminal both visible. */
  .hero__cols { gap: 24px; align-content: start; }
  .hero__hi { font-size: 20px; }
  .hero__title { font-size: clamp(34px, 8.6vw, 44px); margin-top: 10px; }
  .hero__sub { margin-top: 14px; font-size: 15px; line-height: 1.5; }
  .hero__term { max-width: none; }
  .term__head { padding: 10px 16px; }
  .term__body { font-size: 12px; padding: 14px 16px 16px; }
  .term__line { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; line-height: 1.5; }
  .hero__scroll { display: none; }
  .case-minor { grid-template-columns: 1fr; gap: 16px; }
  .manifest__body { font-size: 13px; padding: 22px 20px 26px; }
  .stats__strip { flex-direction: column; gap: 36px; }
  .stat-sep { width: 100%; height: 1px; }
}

/* ---------- STATS · 4A strip inline (niente card) ---------- */
.stats__strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(8px, 2vw, 34px) 0;
}
.stats__strip .stat-card {
  flex: 1;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}
.stats__strip .stat-card .num {
  font-size: clamp(64px, 8vw, 112px);
  font-weight: 300;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--acc-text);
}
.stats__strip .stat-card .mono {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-sep { width: 1px; background: var(--hairline); }

/* ---------- WORK · project cards (open details in terminal modal) ---------- */
.xgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}
.xcard {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.45s var(--ease);
}
.xcard:hover { transform: translateY(-3px); }
.xcard--open { border-color: color-mix(in srgb, var(--lime) 55%, transparent); }
.xcard__head {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 20px 24px 24px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.xcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.xcard__id {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.xcard__t {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.xcard__t h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.xcard__t .mono { color: var(--muted); text-transform: lowercase; }
.acc__arrow {
  color: var(--muted);
  display: inline-block;
  transition: transform 0.4s var(--ease), color 0.3s var(--ease);
}
.xcard__head:hover .xcard__id { color: var(--acc-text); }
.xcard__head:hover .acc__arrow { color: var(--acc-text); transform: translateX(3px); }
.xcard--open .acc__arrow,
.xcard--open .xcard__head:hover .acc__arrow { transform: rotate(90deg); color: var(--acc-text); }
.xcard__body { display: none; }
@media (max-width: 1080px) {
  .xgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .xgrid { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- WORK · project terminal modal ---------- */
.work-term {
  position: fixed;
  inset: 0;
  width: 100%;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  pointer-events: none;
}
.work-term__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.55);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.work-term__win {
  position: relative;
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.work-term--open { pointer-events: auto; }
.work-term--open .work-term__scrim { opacity: 1; }
.work-term--open .work-term__win { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .work-term__scrim, .work-term__win { transition: none; }
}
.work-term .manifest__bar { flex: none; }
.work-term__path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-term__close {
  flex: none;
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.work-term__close:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.work-term__close svg { width: 13px; height: 13px; }
.work-term__body {
  flex: 1;
  overflow-y: auto;
  padding: 26px 30px 32px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.85;
}
.work-term__body .tl { min-height: 1.85em; overflow-wrap: break-word; white-space: pre-wrap; }
.work-term__body .tl-k { color: var(--acc-text); }
.work-term__body .tl-c { color: var(--muted); }
.work-term__body .tl-t { color: color-mix(in srgb, var(--text) 88%, transparent); }
.work-term__body .tl-p { color: var(--acc-text); }
.term-caret {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 2px;
  background: var(--lime);
  transform: translateY(2px);
}
@media (prefers-reduced-motion: no-preference) {
  .term-caret--blink { animation: caretblink 1.1s steps(1) infinite; }
}
@media (max-width: 760px) {
  .work-term__body { font-size: 12.5px; padding: 20px 18px 24px; }
}

/* ---------- FOOTER · tagline + pill links ---------- */
.footer__tagline {
  position: relative;
  z-index: 2;
  margin: 0 0 clamp(48px, 8vw, 110px);
  font-size: clamp(16px, 4.2vw, 56px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.footer__tagline em { font-style: italic; color: var(--acc-text); }
.footer__links { grid-column: 9 / 13; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
.footer__avail { flex-basis: 100%; }
.footer__links .pill {
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  height: 44px;
}
.footer__links .pill::after { display: none; }
@media (max-width: 760px) {
  .footer__links { gap: 10px; }
  .footer__links .pill { height: 42px; padding: 0 18px; font-size: 14px; }
}
