/* ============================================================
   UZ LABZ | BRAND SITE
   Dark ink, warm off-white type, one signal orange.
   Motif: signals / waveforms. Film grain over everything.
   Motion is driven by assets/site.js; everything here works
   (static) without it.
   ============================================================ */

:root {
  --bg: #0c0c0b;
  --bg-2: #131311;
  --line: #24231f;
  --line-2: #3a3833;
  --text: #ece8df;
  --text-2: #a29d91;
  --text-3: #6d6960;
  --unlit: #34322d;
  --signal: #ff5a1f;

  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1320px;
  --gutter: clamp(1rem, 3.5vw, 2.5rem);
  --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  --head-h: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

/* ----- Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--head-h); }

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Film grain */
body::after {
  content: '';
  position: fixed; inset: -50%;
  z-index: 200; pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
ol { list-style: none; }
mark { background: none; color: inherit; }

::selection { background: var(--signal); color: var(--bg); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: fixed; top: -100%; left: var(--gutter); z-index: 300;
  padding: 0.5rem 0.9rem;
  background: var(--text); color: var(--bg);
  font-family: var(--mono); font-size: 0.8rem;
}
.skip-link:focus { top: 0; }

.signal { color: var(--signal); }

/* Shared mono label style */
.sec-no,
.meta-bar dt,
.card-top,
.card-cta,
.colophon-row,
.text-link,
.track-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* Magnetic elements are nudged by JS through --tx / --ty */
[data-magnetic] {
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  transition: transform 0.45s var(--ease);
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--head-h);
}

.wordmark {
  display: inline-flex; align-items: flex-end; gap: 0.22rem;
  font-weight: 900; font-stretch: 125%;
  font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1;
}
.signal-sq {
  width: 0.32em; height: 0.32em;
  background: var(--signal);
  margin-bottom: 0.04em;
}

.masthead-nav { display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.25rem); }
.masthead-nav a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-2);
  transition: color 0.2s ease, transform 0.45s var(--ease);
}
.masthead-nav a:hover,
.masthead-nav a.active { color: var(--text); }
.masthead-nav a:not(.nav-cta).active::before {
  content: '';
  display: inline-block; width: 5px; height: 5px;
  margin-right: 0.45rem; vertical-align: 0.15em;
  background: var(--signal);
}
.masthead-nav .nav-cta {
  color: var(--text);
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line-2);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.45s var(--ease);
}
.masthead-nav .nav-cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.masthead-nav .nav-cta.active { border-color: var(--signal); }

/* Scroll progress line */
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: clamp(4rem, 11vw, 8.5rem);
  border-bottom: 1px solid var(--line);
}

.hero-title {
  font-size: clamp(2.9rem, 9.4vw, 9rem);
  font-weight: 800; font-stretch: 122%;
  line-height: 0.92;
  letter-spacing: -0.04em;
}
/* Each line is a mask; its inner text rises into it on load.
   JS slides whole lines sideways as you scroll. */
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.2em; margin-bottom: -0.2em;
  will-change: transform;
}
.hero-title .line-in { display: inline-block; }
.hero-title em {
  font-style: normal;
  font-weight: 300; font-stretch: 100%;
  letter-spacing: -0.03em;
  color: var(--text-2);
}

.js .hero-title .line-in { animation: lineUp 1.2s var(--ease) both; }
.js .hero-title .line:nth-child(2) .line-in { animation-delay: 0.1s; }
.js .hero-title .line:nth-child(3) .line-in { animation-delay: 0.2s; }
.js .hero-row { animation: rise 1s var(--ease) 0.45s both; }

@keyframes lineUp { from { transform: translateY(110%); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(1.5rem); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.hero-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
}

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 34rem;
}

.text-link {
  display: inline-flex; gap: 0.5rem;
  padding-bottom: 0.3rem;
  color: var(--text);
  border-bottom: 1px solid var(--line-2);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.45s var(--ease);
}
.text-link:hover { color: var(--signal); border-color: var(--signal); }

.spectrum-wrap {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding: 0 var(--gutter);
}
.js .spectrum-wrap { animation: fade 1.6s ease 0.5s both; }
.spectrum { display: block; width: 100%; height: clamp(110px, 16vw, 200px); }

.meta-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  margin-top: clamp(2rem, 4vw, 3rem);
}
.meta-bar > div {
  padding: 1.1rem 0 1.3rem 1.1rem;
  border-left: 1px solid var(--line);
}
.meta-bar > div:first-child { border-left: 0; padding-left: 0; }
.meta-bar dt { color: var(--text-3); text-transform: uppercase; margin-bottom: 0.3rem; }
.meta-bar dd { font-size: 0.95rem; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============================================================
   MARQUEE (speed, direction and lean follow your scroll)
   ============================================================ */
.marquee {
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2.25rem) 0;
  border-bottom: 1px solid var(--line);
}
.marquee-track {
  display: flex; align-items: center;
  width: max-content;
  will-change: transform;
}
.mq {
  padding: 0 0.45em;
  font-size: clamp(2.4rem, 7vw, 6.25rem);
  font-weight: 800; font-stretch: 125%;
  letter-spacing: -0.035em; line-height: 1;
  white-space: nowrap;
}
.mq--outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--text-2);
}
.mq-sep {
  flex-shrink: 0;
  width: clamp(0.6rem, 1.2vw, 1rem); aspect-ratio: 1;
  background: var(--signal);
}

/* ============================================================
   MANIFESTO (pinned; words light up as you scroll)
   ============================================================ */
.manifesto { border-bottom: 1px solid var(--line); }
.js .manifesto { height: 260vh; }

.manifesto-pin { padding: clamp(5rem, 12vw, 9rem) 0; }
.js .manifesto-pin {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; align-items: center;
  padding: var(--head-h) 0 0;
}
.manifesto-pin > .wrap { width: 100%; }

.manifesto .sec-no { display: block; color: var(--signal); margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }

.manifesto-text {
  font-size: clamp(1.8rem, 4.5vw, 4.2rem);
  font-weight: 700; font-stretch: 112%;
  letter-spacing: -0.035em; line-height: 1.08;
  max-width: 19em;
}
.manifesto-text mark { color: var(--signal); }

/* Words are wrapped in .w by JS */
.manifesto-text .w { color: var(--unlit); transition: color 0.35s ease; }
.manifesto-text .w.on { color: var(--text); }
.manifesto-text .w.hl.on { color: var(--signal); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  border-bottom: 1px solid var(--line);
}

.sec-head {
  position: relative;
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.sec-no { color: var(--signal); }
.sec-head h2 {
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  font-weight: 800; font-stretch: 118%;
  letter-spacing: -0.035em; line-height: 1;
  overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em;
}
.sec-head p { color: var(--text-2); font-size: 0.95rem; text-align: right; max-width: 24rem; }

/* ============================================================
   MODEL CARDS
   ============================================================ */
.models {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  border-bottom: 1px solid var(--line);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 21rem;
  padding: 1.5rem 1.5rem 1.4rem;
  border: 1px solid var(--line);
  margin: 0 -1px -1px 0;
  background: var(--bg);
  overflow: hidden;
  transition: background 0.3s ease;
}
.card > * { position: relative; z-index: 1; }

/* Orange rule that draws across the top on hover */
.card::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 2;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease);
}
/* Spotlight that follows the cursor (--mx / --my set by JS) */
.card::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 90, 31, 0.11), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.card:hover { background: var(--bg-2); }
.card:hover::before { transform: scaleX(1); }
.card:hover::after { opacity: 1; }

.card-top {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--text-3);
}

.sig {
  display: block;
  height: 56px;
  margin: 2.25rem 0 auto;
}
.sig svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sig rect {
  fill: var(--text-3);
  transform-box: fill-box; transform-origin: center;
  transition: fill 0.3s ease;
}
.card:hover .sig rect {
  fill: var(--signal);
  animation: breathe 0.9s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -45ms);
}
@keyframes breathe { to { transform: scaleY(0.35); } }

.sig--empty {
  background: repeating-linear-gradient(90deg, var(--line-2) 0 2px, transparent 2px 5px) center / 100% 2px no-repeat;
}

.card-name {
  margin-top: 2.25rem;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 700; font-stretch: 115%;
  letter-spacing: -0.03em; line-height: 1.05;
}
.card-desc {
  margin-top: 0.6rem;
  color: var(--text-2); font-size: 0.95rem;
}
.card-cta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  transition: color 0.2s ease;
}
.card .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.card:hover .card-cta { color: var(--text); }
.card:hover .arrow { color: var(--signal); transform: translate(3px, -3px); }
.card--slot:hover .arrow { transform: translateX(4px); }

.card--slot .card-name { color: var(--text-2); }
.card--slot:hover .card-name { color: var(--text); }

.track-foot { display: none; }

/* ----- Horizontal mode (desktop, set by JS as html.hs) ----- */
.hs .models { padding: 0; }
.hs .models-pin {
  position: sticky; top: var(--head-h);
  height: calc(100vh - var(--head-h));
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.hs .models-pin > .wrap { width: 100%; }  /* auto margins would shrink it in a flex column */
.hs .models-pin .sec-head { margin-bottom: clamp(1.25rem, 3vh, 2.25rem); }
.hs .cards {
  display: flex;
  width: max-content; max-width: none;
  margin: 0;
  padding: 0 var(--edge);
  will-change: transform;
}
.hs .card {
  width: clamp(300px, 27vw, 390px);
  min-height: min(24rem, 52vh);
}
.hs .track-foot {
  display: flex; align-items: center; gap: 1.25rem;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  color: var(--text-3);
}
.track-bar { position: relative; flex: 1; height: 1px; background: var(--line-2); }
.track-fill {
  position: absolute; inset: 0;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left;
}
#track-pct { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   METHOD
   ============================================================ */
.rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}
.rules li { display: flex; flex-direction: column; }

.rule-no {
  display: block;
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 900; font-stretch: 125%;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px var(--signal);
  margin-bottom: 1.75rem;
  overflow: hidden;                 /* mask for the rise-in below */
  padding: 0.06em 0;
  transition: color 0.4s ease;
}
.rule-no-in { display: inline-block; }
.rules li:hover .rule-no { color: var(--signal); }

/* Numbers rise out of their mask once, when the rule scrolls into view,
   then stay put (no scroll-linked movement, so they never cover the text) */
.js .rule-no-in {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease) calc(var(--d, 0s) + 0.15s);
}
.js .rules li.in .rule-no-in { transform: none; }
.rules h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 700; font-stretch: 112%;
  letter-spacing: -0.025em; line-height: 1.1;
  margin-bottom: 0.6rem;
}
.rules p { color: var(--text-2); max-width: 30rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.mail {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  border-bottom: 1px solid var(--line-2);
  transition: border-color 0.3s ease;
}
.mail-text {
  font-size: clamp(1.1rem, 5.2vw, 5rem);
  font-weight: 800; font-stretch: 112%;
  letter-spacing: -0.04em; line-height: 1;
  overflow-wrap: anywhere;
  transition: color 0.3s ease;
}
.mail-arrow {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: clamp(3rem, 6vw, 5rem); aspect-ratio: 1;
  border: 1px solid var(--line-2); border-radius: 50%;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  transform: translate(var(--tx, 0px), var(--ty, 0px)) rotate(var(--rot, 0deg));
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.45s var(--ease);
}
.mail:hover { border-color: var(--signal); }
.mail:hover .mail-text { color: var(--signal); }
.mail:hover .mail-arrow {
  --rot: -45deg;
  background: var(--signal); border-color: var(--signal); color: var(--bg);
}

/* ============================================================
   COLOPHON
   ============================================================ */
.colophon { padding-top: 1.5rem; overflow: hidden; }

.colophon-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.6rem 1rem;
  color: var(--text-3);
}
.colophon-row a { color: var(--text-2); transition: color 0.2s ease; }
.colophon-row a:hover { color: var(--signal); }

.giant {
  display: block; width: 100%; height: auto;
  margin-top: clamp(2rem, 6vw, 4.5rem);
  margin-bottom: -0.4%;
  overflow: visible;
}
.giant text {
  fill: none;
  stroke: #4a4740;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  font-family: var(--sans);
  font-size: 232px;
  font-weight: 900; font-stretch: 125%;
  shape-rendering: geometricPrecision;
}

/* Orange glow layers on the wordmark's edges */
.giant .giant-glow text { stroke: var(--signal); stroke-linecap: butt; }

/* Blurred copy underneath = the glow; sharp copy on top = the crisp line */
.giant .glow-soft { opacity: 0.85; }
.giant .glow-soft text { stroke-width: 3; }

/* Soft full-outline glow that breathes */
.giant .glow-halo {
  stroke-width: 3;
  opacity: 1;
  animation: haloBreathe 4.5s ease-in-out infinite;
}
/* Long streaks of light running around every letter */
.giant .glow-run {
  stroke-width: 1;
  stroke-dasharray: 90 260;       /* period 350 */
  animation: glowRun 7s linear infinite;
}
/* Short sparks running the other way, crossing the streaks */
.giant .glow-spark {
  stroke-width: 0.5;
  stroke-dasharray: 6 54;         /* period 60 */
  opacity: 0.75;
  animation: glowSpark 5s linear infinite;
}

@keyframes glowRun { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -700; } }
@keyframes glowSpark { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 240; } }
@keyframes haloBreathe {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.35; }
}

/* ============================================================
   SCROLL REVEALS (classes added by JS)
   ============================================================ */
.js .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 1s var(--ease) var(--d, 0s),
    transform 1s var(--ease) var(--d, 0s),
    background 0.3s ease;
}
.js .reveal.in { opacity: 1; transform: none; }

/* Section heads: title rises out of a mask, rule draws across */
.js .sec-head { border-bottom-color: transparent; }
.js .sec-head::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--line-2);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.4s var(--ease) 0.15s;
}
.js .sec-head .mask-in {
  display: inline-block;
  transform: translateY(110%) rotate(4deg);
  transform-origin: left bottom;
  transition: transform 1.1s var(--ease);
}
.js .sec-head .sec-no,
.js .sec-head p {
  opacity: 0;
  transition: opacity 0.8s ease 0.35s;
}
.js .sec-head.in::after,
.js .sec-head.in .mask-in { transform: none; }
.js .sec-head.in .sec-no,
.js .sec-head.in p { opacity: 1; }

/* Card waveforms grow in, bar by bar */
.js .sig rect {
  transform: scaleY(0.05);
  transition:
    transform 0.9s var(--ease) calc(var(--d, 0s) + 0.2s + var(--i) * 14ms),
    fill 0.3s ease;
}
.js .card.in .sig rect { transform: scaleY(1); }

/* Footer wordmark draws itself, then the orange glow comes up */
.js .giant .giant-base {
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
  transition: stroke-dashoffset 3s cubic-bezier(0.65, 0, 0.35, 1);
}
.js .giant.in .giant-base { stroke-dashoffset: 0; }

.js .giant .giant-glow { opacity: 0; transition: opacity 1.6s ease 1.8s; }
.js .giant.in .giant-glow { opacity: 1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .rules { grid-template-columns: 1fr; gap: 0; }
  .rules li {
    display: grid; grid-template-columns: clamp(4.5rem, 14vw, 7rem) 1fr;
    column-gap: 1rem;
    padding: 1.75rem 0; border-top: 1px solid var(--line);
  }
  .rules li:first-child { border-top: 0; padding-top: 0; }
  .rule-no { grid-row: span 2; margin-bottom: 0; }
}

@media (max-width: 720px) {
  .meta-bar { grid-template-columns: repeat(2, 1fr); }
  .meta-bar > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .meta-bar > div:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .sec-head { grid-template-columns: auto 1fr; }
  .sec-head p { grid-column: 1 / -1; text-align: left; }

  .colophon-row { grid-template-columns: 1fr 1fr; }

  .js .manifesto { height: 220vh; }
}

@media (max-width: 600px) {
  .hide-sm { display: none; }
  .masthead-nav { gap: 1rem; }
  .masthead-nav a { font-size: 0.85rem; }
  .masthead-nav .nav-cta { padding: 0.35rem 0.7rem; }

  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .sig { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .manifesto { height: auto; }
  .js .manifesto-pin { position: static; height: auto; padding: clamp(5rem, 12vw, 9rem) 0; }
}
