/* =========================================================
   Tere Labs
   Black, typographic, hairline-structured.
   Type: Overused Grotesk (sans) + JetBrains Mono (labels)
   ========================================================= */

@font-face {
  font-family: "Overused Grotesk";
  src: url("../assets/fonts/OverusedGrotesk-VF.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #050505;
  --bg-1: #0a0a0b;
  --bg-2: #111113;
  --bg-3: #17171a;

  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.24);

  --fg: #eef0f3;
  --fg-2: #adb3bd;
  --fg-3: #7f8590;
  --fg-4: #575c64;

  --live: #3ddc84;

  --sans: "Overused Grotesk", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1240px;
  --pad: clamp(20px, 4vw, 40px);
  --r: 6px;
  --head: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; background: var(--bg); }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg-3);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }

/* page rails: two hairlines on the edges of the content column */
body::before {
  content: "";
  position: fixed;
  top: 0; bottom: 0;
  left: 50%;
  width: min(var(--max), 100%);
  transform: translateX(-50%);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  pointer-events: none;
  z-index: -1;
}

::selection { background: rgba(255, 255, 255, .2); color: #fff; }

a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--fg-2); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.wrap.narrow { max-width: 920px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- type primitives ---------- */
h1, h2, h3, h4 { color: var(--fg); font-weight: 500; }

.eyebrow,
.label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.em { color: var(--fg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.005em;
  line-height: 1;
  white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; transition: transform .3s var(--ease); }
.btn:hover svg[stroke] { transform: translateX(3px); }
.btn:active { transform: scale(.97); }

.btn-primary { background: #fff; color: #050505; }
.btn-primary:hover { background: #dfe2e7; }
.btn-ghost { color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--line-3); background: rgba(255, 255, 255, .035); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5, 5, 5, .78);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--head);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1;
}
.brand img { width: 22px; height: 22px; transition: transform .5s var(--ease); }
.brand:hover img { transform: translateX(2px); }
.brand span b { font-weight: 600; margin-left: .34em; }

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  position: relative;
  z-index: 1;
  padding: 9px 15px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: color .25s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--fg); }
.nav-links .only-mobile { display: none; }

/* nav indicator: hairline viewfinder brackets. They lock onto the current page
   (closing in from a few px out) and travel to the hovered item, opening slightly
   while they move. Same corner language as the card hover. */
.nav-indicator {
  position: absolute;
  top: 50%; left: 0;
  height: 30px; width: 0;
  margin-top: -15px;
  opacity: 0;
  transition: transform .5s var(--ease), width .5s var(--ease), opacity .25s linear;
  pointer-events: none;
}
.nav-indicator::before {
  content: "";
  position: absolute;
  inset: -7px;
  --c: var(--fg-2);
  --l: 6px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l);
  background-repeat: no-repeat;
  transition: inset .55s var(--ease);
}
.nav-indicator.on { opacity: 1; }
.nav-indicator.on::before { inset: 0; }
.nav-indicator.on.is-moving::before { inset: -3px; }
@media (prefers-reduced-motion: reduce) {
  .nav-indicator::before { transition: none; }
}

.nav-actions { justify-self: end; display: flex; align-items: center; }
.nav-actions .btn { height: 36px; padding: 0 16px; font-size: 14px; gap: 8px; }
.nav-actions .btn svg { width: 13px; height: 13px; }

.nav-toggle {
  display: none;
  justify-self: end;
  width: 40px; height: 40px;
  margin-right: -8px;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 50%;
  width: 20px; height: 1.5px;
  margin-left: -10px;
  background: var(--fg);
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.nav-toggle span { top: 50%; background: transparent; }
.nav-toggle span::before,
.nav-toggle span::after { content: ""; left: 0; margin-left: 0; }
.nav-toggle span::before { top: -4px; }
.nav-toggle span::after { top: 4px; }
body.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

/* ---------- section dividers (hairline + rail squares) ---------- */
.block,
.site-footer { position: relative; }
.block::before,
.site-footer::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(min(var(--max), 100%) + 4px);
  height: 5px;
  background:
    linear-gradient(var(--line-2), var(--line-2)) 0 2px / 100% 1px no-repeat,
    linear-gradient(var(--fg-4), var(--fg-4)) 0 0 / 5px 5px no-repeat,
    linear-gradient(var(--fg-4), var(--fg-4)) 100% 0 / 5px 5px no-repeat;
  pointer-events: none;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(72px, 13vh, 150px) 0 clamp(64px, 9vw, 112px);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .11) 1px, transparent 1.3px);
  background-size: 24px 24px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 78% 18%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 70% at 78% 18%, #000 0%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 48px;
  align-items: end;
}
.hero-inner > * { grid-column: 1 / -1; }
.hero-inner .eyebrow { margin-bottom: 36px; color: var(--fg-2); font-size: 12px; }

.hero h1 {
  font-size: clamp(50px, 8.6vw, 132px);
  font-weight: 500;
  line-height: .93;
  letter-spacing: -.048em;
  color: var(--fg-2);
  max-width: 11.5em;
}

.hero-lead {
  grid-column: 1 / 2;
  max-width: 30em;
  margin-top: clamp(36px, 5vw, 56px);
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--fg-3);
}
.hero-actions {
  grid-column: 2 / 3;
  display: flex;
  gap: 10px;
  align-self: end;
}

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(28px, 3.2vw, 56px);
  border-top: 1px solid var(--line);
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 18px;
  padding: 26px 24px 0;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .n {
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.045em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.stat .l {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-4);
}

/* odometer (digit-roll counters) */
.odo { --odo-h: 1.05em; display: inline-flex; vertical-align: baseline; }
.odo-slot { display: block; height: var(--odo-h); overflow: hidden; }
.odo-col { display: block; transition: transform .9s cubic-bezier(.16, 1, .3, 1); will-change: transform; }
.odo-col > span { display: block; height: var(--odo-h); line-height: var(--odo-h); text-align: center; }
.odo-sfx { display: block; height: var(--odo-h); line-height: var(--odo-h); }
.odo-count .odo-col { transition: transform 1.6s cubic-bezier(.16, 1, .3, 1); }
/* until main.js has built the reels, hide the final numbers so they do not flash; shown anyway after 1.2s */
.js .stat .n[data-count]:not(.is-live) { visibility: hidden; animation: odo-fallback 0s 1.2s forwards; }
@keyframes odo-fallback { to { visibility: visible; } }

/* home hero: keep the stats inside the first screen */
.hero-home { padding-top: clamp(32px, 6vh, 96px); }
.hero-home h1 { font-size: clamp(50px, 8vw, 120px); }
.hero-home .hero-lead { grid-column: 1 / -1; margin-top: clamp(24px, 3vw, 36px); }
.hero-home .hero-actions {
  grid-column: 1 / -1;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 2.8vw, 44px);
}
.btn-lg { height: 58px; min-width: 240px; padding: 0 32px; font-size: 17px; gap: 12px; }
.btn-lg svg { width: 17px; height: 17px; }
.btn:hover svg.icon-down { transform: translateY(2px); }
/* home hero: headline, lead and stats centered, to sit on the same axis as the buttons */
.hero-home::before {
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 18%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 18%, #000 0%, transparent 72%);
}
.hero-home .hero-inner { justify-items: center; text-align: center; }
.hero-home .hero-lead { margin-left: auto; margin-right: auto; }
.hero-home .stat { align-items: center; text-align: center; padding-left: 24px; padding-right: 24px; }
@media (max-width: 560px) {
  .hero-home .hero-actions .btn-lg { width: 100%; height: 54px; }
}
/* list pages (projects, quants): a shorter page header, so the first cards show in the first screen */
.hero-page { padding: clamp(48px, 8vh, 96px) 0 clamp(36px, 4vw, 52px); }
.hero-page h1 { font-size: clamp(46px, 7vw, 108px); }
.hero-page .hero-inner .eyebrow { margin-bottom: 24px; }
.hero-page .hero-lead { margin-top: clamp(24px, 3vw, 36px); }
.hero-page + .block { padding-top: clamp(32px, 3.5vw, 48px); }

/* ---------- blocks ---------- */
.block { padding: clamp(72px, 8.5vw, 124px) 0; }

.block-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: clamp(48px, 6vw, 80px);
}
.block-head .eyebrow { margin-bottom: 24px; color: var(--fg-2); font-size: 12px; }
.block-head .section-lead { margin-top: 24px; }

.section-title {
  font-size: clamp(36px, 4.8vw, 68px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--fg-2);
}
.section-lead {
  max-width: 32em;
  margin-top: 24px;
  font-size: 18px;
  color: var(--fg-3);
}

/* features: hairline grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  counter-reset: feat;
}
.feature {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 28px 34px;
  border-left: 1px solid var(--line);
  counter-increment: feat;
  transition: background .4s var(--ease);
}
.feature:first-child { border-left: 0; }
.feature::before {
  content: counter(feat, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--fg-4);
}
.feature .ico {
  position: absolute;
  top: 24px; right: 24px;
  width: 22px; height: 22px;
  color: var(--fg-4);
  transition: color .4s var(--ease);
}
.feature .ico svg { width: 22px; height: 22px; stroke-width: 1.4; }
.feature .ico + h3 { margin-top: clamp(40px, 4.2vw, 60px); }
.feature h3 {
  margin-top: clamp(40px, 4.2vw, 60px);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--fg);
}
.feature p { margin-top: 12px; font-size: 15.5px; line-height: 1.55; color: var(--fg-3); max-width: 26em; }
.feature:hover { background: var(--bg-1); }
.feature:hover .ico { color: var(--fg); }

/* ---------- viewfinder corners (hover detail) ---------- */
.cat-card::after,
.member::after {
  content: "";
  position: absolute;
  inset: -1px;
  --c: var(--fg-2);
  --l: 12px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l);
  background-repeat: no-repeat;
  border-radius: var(--r);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), inset .45s var(--ease);
}
.cat-card:hover::after,
.member:hover::after { opacity: 1; inset: -7px; }

/* ---------- project cards ---------- */
.catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color .3s var(--ease);
}
.cat-card:hover { border-color: var(--line-2); }
.cat-main { display: flex; flex-direction: column; flex: 1; }

.cat-thumb {
  position: relative;
  aspect-ratio: 16 / 9.5;
  overflow: hidden;
  border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0;
  border-bottom: 1px solid var(--line);
  background: #000;
}
.cat-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: left top;
  opacity: .82;
  filter: saturate(.85);
  transition: transform .9s var(--ease), opacity .5s var(--ease), filter .5s var(--ease);
}
.cat-card:hover .cat-thumb img { transform: scale(1.025); opacity: 1; filter: none; }

.cat-inner { padding: 24px 24px 26px; }
.cat-head { display: flex; align-items: center; gap: 14px; }
.cat-head img {
  width: 40px; height: 40px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 0 1px var(--line);
}
.cat-head h3 { font-size: 21px; line-height: 1.15; letter-spacing: -.02em; }
.cat-head .sub {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.cat-head .badge { margin-left: auto; align-self: flex-start; }
.cat-desc { margin-top: 18px; font-size: 15.5px; line-height: 1.55; color: var(--fg-3); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
}
.badge.live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, .14);
}

.cat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 14px 16px 14px 24px;
  border-top: 1px solid var(--line);
}
.cat-details {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg);
}
.cat-details svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.cat-details:hover svg { transform: translateX(4px); }
.cat-links { display: flex; gap: 6px; }

.icon-link {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--fg-3);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.icon-link svg { width: 15px; height: 15px; }
.icon-link:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-3); background: rgba(255, 255, 255, .03); }

.center-btn { display: flex; justify-content: center; margin-top: 56px; }

/* ---------- CTA ---------- */
.cta-plain { text-align: center; }
main > .block:last-child { padding-bottom: clamp(80px, 9vw, 128px); }
.cta-plain h2 {
  max-width: 13em;
  margin: 28px auto 0;
  font-size: clamp(42px, 7vw, 108px);
  line-height: .95;
  letter-spacing: -.05em;
  color: var(--fg-2);
}
.cta-plain p {
  max-width: 32em;
  margin: 28px auto 0;
  font-size: 18px;
  color: var(--fg-3);
}
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 40px; }

/* ---------- team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.member {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color .3s var(--ease);
}
.member:hover { border-color: var(--line-2); }
.member-photo {
  position: relative;
  aspect-ratio: 1 / 1.08;
  overflow: hidden;
  border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at 50% 35%, rgba(255, 255, 255, .07), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.3px) center / 22px 22px,
    #070708;
}
.member-photo img {
  position: absolute;
  left: 50%; bottom: -14%;
  width: 82%;
  max-width: none;
  transform: translateX(-50%);
  filter: grayscale(1) contrast(1.06) brightness(.92);
  transition: filter .7s var(--ease), transform .9s var(--ease);
}
.member:hover .member-photo img { filter: none; transform: translateX(-50%) scale(1.02); }
.member-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(to bottom, rgba(10, 10, 11, 0) 0%, rgba(10, 10, 11, .55) 45%, var(--bg-1) 100%);
  pointer-events: none;
}

.member-body { padding: 28px 28px 30px; display: flex; flex-direction: column; flex: 1; }
.member-role {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.member h3 {
  margin-top: 14px;
  font-size: clamp(32px, 3.2vw, 44px);
  line-height: 1;
  letter-spacing: -.035em;
}
.member .age { margin-top: 10px; font-size: 15px; color: var(--fg-2); }
.member p { margin-top: 20px; font-size: 16px; line-height: 1.6; color: var(--fg-3); max-width: 34em; }
.member-social { margin-top: auto; padding-top: 28px; }
.x-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--fg);
  transition: box-shadow .25s var(--ease), background .25s var(--ease);
}
.x-link svg { width: 13px; height: 13px; }
.x-link:hover { box-shadow: inset 0 0 0 1px var(--line-3); background: rgba(255, 255, 255, .035); }

/* ---------- project detail ---------- */
.detail { padding: clamp(48px, 7vw, 96px) 0 clamp(96px, 12vw, 160px); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(40px, 6vw, 72px);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-4);
  transition: color .25s var(--ease);
}
.back-link svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.back-link:hover { color: var(--fg); }
.back-link:hover svg { transform: translateX(-4px); }

.detail-head { display: flex; align-items: center; gap: 22px; }
.detail-head img {
  width: 64px; height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 0 1px var(--line-2);
}
.detail-head h1 {
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: .95;
  letter-spacing: -.045em;
}
.detail-head .sub {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-4);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 32px; }
.tag {
  padding: 6px 10px 5px;
  border-radius: 4px;
  background: var(--bg-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-2);
}

/* media gallery */
.gallery {
  position: relative;
  margin: 40px 0 clamp(56px, 7vw, 80px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  outline: none;
}
.gallery:focus-visible { border-color: var(--line-3); }
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.gallery-slide img,
.gallery-slide video { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  background: rgba(5, 5, 5, .72);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s var(--ease), color .25s var(--ease), opacity .25s;
}
.gallery-nav svg { width: 16px; height: 16px; }
.gallery-nav:hover { background: #fff; color: #050505; }
.gallery-nav.prev { left: 14px; }
.gallery-nav.next { right: 14px; }
.gallery-nav[disabled] { opacity: 0; pointer-events: none; }
.gallery-dots {
  position: absolute;
  left: 50%; bottom: 14px;
  z-index: 3;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
}
.gallery-dots .dot {
  width: 14px; height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .3);
  transition: width .35s var(--ease), background .35s;
}
.gallery-dots .dot.active { width: 28px; background: #fff; }

/* media switcher (segmented) */
.switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-top: 40px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.switch button {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.switch button:hover { color: var(--fg); }
.switch button.on { background: #fff; color: #050505; }
.switch + .gallery { margin-top: 14px; }
.media-pane[hidden] { display: none; }
.media-pane img,
.media-pane video { width: 100%; height: auto; display: block; }

/* long-form body */
.modal-body > p { font-size: 18px; line-height: 1.7; color: var(--fg-3); max-width: 40em; }
.modal-body strong { color: var(--fg); font-weight: 500; }
.modal-body .statement {
  max-width: 18em;
  margin-bottom: 24px;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.08;
  letter-spacing: -.035em;
  color: var(--fg-2);
}
.modal-body h4,
.modal-body h3 {
  margin: clamp(48px, 6vw, 72px) 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.modal-body ul { list-style: none; }
.modal-body li {
  display: grid;
  grid-template-columns: minmax(140px, 12em) minmax(0, 1fr);
  column-gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--fg-3);
}
.modal-body li strong { font-weight: 500; }
.modal-code {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 2;
  color: var(--fg-2);
  white-space: pre;
  overflow-x: auto;
}
.modal-body .note {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.8;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.modal-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(48px, 6vw, 64px); }
.plink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.plink svg { width: 15px; height: 15px; }
.plink:hover { box-shadow: inset 0 0 0 1px var(--line-3); background: rgba(255, 255, 255, .035); }
.plink.primary { background: #fff; color: #050505; box-shadow: none; }
.plink.primary:hover { background: #dfe2e7; }

/* ---------- quants ---------- */
.catalog.quants { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cat-thumb.chart { aspect-ratio: 4 / 3; }
.cat-thumb.chart img { object-position: center top; }
.cat-thumb.center img { object-position: center 30%; }

.q-card .cat-head h3 { font-size: 19px; }
.q-card .cat-desc { margin-top: 14px; font-size: 15px; }
.q-spec { margin-top: 20px; border-top: 1px solid var(--line); }
.q-spec > div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  column-gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.q-spec > div:last-child { border-bottom: 0; }
.q-spec dt {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 20px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.q-spec dd {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 20px;
  color: var(--fg-2);
  overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
  .catalog.quants { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .catalog.quants { grid-template-columns: minmax(0, 1fr); }
  .cat-thumb.chart { aspect-ratio: 16 / 10; }
}

/* ---------- footer ---------- */
.site-footer { padding: clamp(64px, 8vw, 96px) 0 28px; }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
}
.footer-brand .brand { font-size: 14px; }
.footer-brand .brand img { width: 20px; height: 20px; }
.footer-brand p { max-width: 26em; margin-top: 20px; font-size: 15px; line-height: 1.6; color: var(--fg-4); }
.footer-cols { display: flex; gap: clamp(48px, 8vw, 120px); }
.footer-col h4 {
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.footer-col a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 5px 0;
  font-size: 15px;
  color: var(--fg-3);
  transition: color .25s var(--ease);
}
.footer-col a svg { width: 14px; height: 14px; color: var(--fg-4); transition: color .25s var(--ease); }
.footer-col a:hover,
.footer-col a:hover svg { color: var(--fg); }
.footer-bottom {
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-4);
}

/* ---------- cursor pixel trail ---------- */
.pixel-trail { position: fixed; inset: 0; pointer-events: none; z-index: -1; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.features .reveal:nth-child(2), .stats .reveal:nth-child(2), .catalog .reveal:nth-child(2), .team-grid .reveal:nth-child(2) { transition-delay: .08s; }
.features .reveal:nth-child(3), .stats .reveal:nth-child(3) { transition-delay: .16s; }
.hero-inner .reveal:nth-child(2) { transition-delay: .08s; }
.hero-inner .reveal:nth-child(3) { transition-delay: .16s; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-actions { grid-column: 1; margin-top: 32px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .feature { min-height: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .feature:first-child { border-top: 0; }
  .feature h3, .feature .ico + h3 { margin-top: 40px; }
}

@media (max-width: 860px) {
  body::before { display: none; }
  /* backdrop-filter would make the header the containing block of the fixed menu */
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(5, 5, 5, .97); }
  .nav { grid-template-columns: 1fr auto; }
  .nav-actions { display: none; }
  .nav-toggle { display: block; }
  .nav-indicator { display: none; }

  .nav-links {
    position: fixed;
    top: var(--head); left: 0; right: 0; bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--pad) 40px;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--ease), visibility 0s linear .3s;
  }
  body.nav-open .nav-links { opacity: 1; visibility: visible; transition: opacity .3s var(--ease); }
  .nav-links a {
    flex: none;
    padding: 20px 0;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--sans);
    font-size: 34px;
    font-weight: 500;
    letter-spacing: -.035em;
    text-transform: none;
    color: var(--fg-3);
  }
  .nav-links a.active { color: var(--fg); }
  .nav-links a.btn.only-mobile {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 32px;
    padding: 0 22px;
    height: 46px;
    border-radius: 999px;
    border: 0;
    font-size: 15px;
    letter-spacing: -.005em;
    color: #050505;
  }

  .catalog,
  .team-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .modal-body li { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .cat-card::after, .member::after { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .stat { flex-direction: column; justify-content: flex-start; padding: 20px 12px 0; gap: 10px; }
  .stat .l { font-size: 10px; letter-spacing: .12em; }
  .hero-actions { flex-wrap: wrap; }
  .cat-inner { padding: 20px 18px 22px; }
  .cat-foot { padding: 12px 12px 12px 18px; }
  .member-body { padding: 22px 20px 24px; }
  .detail-head { gap: 16px; }
  .detail-head img { width: 52px; height: 52px; border-radius: 12px; }
  .footer-cols { gap: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .odo-col { transition: none; }
  .pixel-trail { display: none; }
  .nav-indicator { transition: none; }
}
