/* Planty: soil, 3D-print white and LED blue. Dark sections are soil, light sections are print. */
:root {
  --soil: #15110e;
  --soil-deep: #100d0b;
  --print: #f2efe8;
  --led: #7fd8ff;
  --led-ink: #0b1a24;
  --sprout: #3fae5c;
  --sprout-ink: #23803d;
  --display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(18px, 4.5vw, 56px);
  --section: clamp(72px, 10vw, 136px);
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--soil);
  color: #efe9df;
  font: 400 19px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; max-width: 62ch; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
:focus-visible { outline: 2px solid var(--led); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 50;
  padding: 8px 14px;
  background: var(--led);
  color: var(--led-ink);
}
.skip-link:focus { left: 12px; }

.wrap {
  width: calc(100% - 2 * var(--gutter));
  max-width: 1180px;
  margin-inline: auto;
}

/* ---------- sections ---------- */
.section {
  position: relative;
  padding-block: var(--section);
  background: var(--bg);
  color: var(--fg);
  scroll-margin-top: 72px;
}
.light { --bg: var(--print); --fg: #1d1a16; --mute: #5f574d; --line: #d3ccbf; --accent: var(--sprout-ink); }
.dark { --bg: var(--soil); --fg: #efe9df; --mute: #aaa094; --line: #3a2f27; --accent: var(--led); }

.section h2 { font-size: clamp(40px, 5.6vw, 76px); max-width: 17ch; }
.lede {
  margin-top: 22px;
  max-width: 44ch;
  font-size: clamp(20px, 2vw, 23px);
  line-height: 1.5;
  color: var(--mute);
}

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(21, 17, 14, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #2e2620;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 28px;
  min-height: 64px;
  padding-block: 10px;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font: 500 15px/1.2 var(--display);
}
.nav-links a { text-decoration: none; opacity: 0.78; transition: opacity 0.2s, color 0.2s; }
.nav-links a:hover { opacity: 1; color: var(--led); }

/* ---------- wordmark ---------- */
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: -0.04em;
  color: inherit;
  text-decoration: none;
}
.wordmark span { display: inline-block; }
.wordmark .y { color: var(--sprout); position: relative; }
.wordmark .y::after {
  content: "";
  position: absolute;
  right: 0.02em;
  top: -0.16em;
  width: 0.36em;
  height: 0.2em;
  background: var(--sprout);
  border-radius: 0 100% 0 100%;
  transform: rotate(-28deg);
}
.wordmark-sm { font-size: 30px; line-height: 1; }

.hero-wm {
  margin-top: 22px;
  font-size: clamp(96px, 19vw, 240px);
  line-height: 0.86;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-wm span { animation: weight-morph 4s ease-in-out infinite alternate; }
  .hero-wm span:nth-child(2) { animation-delay: -0.5s; }
  .hero-wm span:nth-child(3) { animation-delay: -1s; }
  .hero-wm span:nth-child(4) { animation-delay: -1.5s; }
  .hero-wm span:nth-child(5) { animation-delay: -2s; }
  .hero-wm span:nth-child(6) { animation-delay: -2.5s; }
}
@keyframes weight-morph {
  from { font-variation-settings: "wght" 230; }
  to   { font-variation-settings: "wght" 820; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: clamp(580px, 76vh, 800px);
  padding-block: clamp(120px, 18vh, 200px) clamp(48px, 8vh, 88px);
  background: var(--soil);
  color: #efe9df;
}
.stage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(72%, 1000px);
}
.stage canvas { display: block; width: 100%; height: 100%; }
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, var(--soil) 0%, rgba(21, 17, 14, 0) 42%);
}
.stage-fallback {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}
.no-webgl canvas { display: none; }
.no-webgl .stage-fallback { display: block; }

.hero-copy { position: relative; z-index: 2; }
.hero-status {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: none;
  font: 500 17px/1.2 var(--display);
  color: #cfc6b9;
}
.led-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 0 5px rgba(127, 216, 255, 0.16), 0 0 16px var(--led);
}
.hero-lead {
  margin-top: 26px;
  max-width: 36ch;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.5;
  color: #d9d1c4;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
  font: 600 16px var(--display);
  text-decoration: none;
  border: 1px solid currentColor;
  border-radius: 2px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn-primary { background: var(--led); border-color: var(--led); color: var(--led-ink); }
.btn-primary:hover { background: #a9e6ff; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin: 48px 0 0;
  padding-top: 22px;
  border-top: 1px solid #3a2f27;
}
.facts dt { font: 500 14px/1.2 var(--display); color: #a69c90; }
.facts dd { margin: 4px 0 0; font: 600 20px/1.2 var(--display); }

@media (max-width: 760px) {
  .stage { width: 100%; }
  .stage::before {
    background: linear-gradient(0deg, var(--soil) 24%, rgba(21, 17, 14, 0.5) 66%, rgba(21, 17, 14, 0.2) 100%);
  }
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.about-grid p + p { margin-top: 1.1em; }

/* ---------- question: morphing blob and pillars ---------- */
.question {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
}
.blob { width: min(100%, 460px); justify-self: center; }
.blob svg { display: block; width: 100%; height: auto; overflow: visible; }
.blob-fill { fill: var(--led); fill-opacity: 0.16; }
.blob-ring { fill: none; stroke: var(--sprout); stroke-width: 1.5; }

.pillars { display: grid; gap: 14px; margin-top: 40px; }
.pillar {
  padding: 22px 26px;
  background: rgba(127, 216, 255, 0.035);
  border-left: 2px solid var(--led);
}
.pillar h3 { font-size: 26px; }
.pillar p { margin-top: 8px; font-size: 18px; color: var(--mute); }

/* ---------- 3D tilt (pointer-driven, set by app.js) ---------- */
[data-tilt] {
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- build rows ---------- */
.spec-list { margin-top: 48px; }
.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.spec-row:last-child { border-bottom: 1px solid var(--line); }
.spec-row:nth-child(even) .spec-media { order: 2; }
.spec-media { margin: 0; }
.spec-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: 0 40px 70px -44px rgba(29, 26, 22, 0.55);
}
.spec-row h3 { font-size: clamp(30px, 3.4vw, 42px); }
.spec-row p { margin-top: 16px; color: var(--mute); }
.specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 26px;
  margin: 26px 0 0;
  font-size: 17px;
}
.specs dt { font: 600 15px/1.4 var(--display); color: var(--accent); }
.specs dd { margin: 0; }

/* ---------- gallery ---------- */
.gallery {
  columns: 3 260px;
  column-gap: 18px;
  margin-top: 48px;
}
.shot { break-inside: avoid; margin: 0 0 18px; }
.shot-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.shot-open img { width: 100%; height: auto; transition: filter 0.3s; }
.shot-open:hover img { filter: brightness(1.08) saturate(1.05); }
.shot figcaption {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--mute);
}

/* ---------- competition timeline ---------- */
.timeline {
  max-width: 820px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
  padding-block: 30px;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.step-no {
  font: 700 48px/1 var(--display);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.timeline h3 { font-size: clamp(24px, 2.6vw, 32px); }
.timeline p { margin-top: 10px; color: var(--mute); }

/* ---------- team ---------- */
.team-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center 35%;
  margin-top: 48px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 40px;
  border-top: 1px solid var(--line);
}
.member { padding: 28px 24px 0 0; }
.member + .member { padding-left: 24px; border-left: 1px solid var(--line); }
.member h3 { font-size: clamp(24px, 2.4vw, 30px); }
.member p { margin-top: 10px; font-size: 18px; color: var(--mute); }
.team-note { margin-top: 32px; color: var(--mute); }

/* ---------- footer ---------- */
.site-footer {
  padding-block: clamp(64px, 9vw, 110px) 44px;
  background: var(--soil-deep);
  color: #efe9df;
  border-top: 1px solid #2e2620;
}
.foot-wm { font-size: clamp(88px, 18vw, 230px); line-height: 0.9; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
  margin-top: 40px;
}
.foot-links a {
  font: 600 18px/1.3 var(--display);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.foot-links a:hover { color: var(--led); }
.foot-note { margin-top: 40px; font-size: 16px; color: #a69c90; }

/* ---------- photo viewer ---------- */
.lightbox {
  width: min(1200px, calc(100vw - 2 * var(--gutter)));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #efe9df;
}
.lightbox::backdrop { background: rgba(10, 8, 6, 0.9); }
.lb-frame {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: var(--soil);
}
.lb-frame img {
  width: auto;
  max-width: 100%;
  max-height: 76vh;
  margin-inline: auto;
  object-fit: contain;
}
.lb-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
}
.lb-cap { max-width: none; font-size: 17px; color: #cfc6b9; }
.lb-controls { display: flex; align-items: center; gap: 8px; }
.lb-count {
  margin-right: 6px;
  font: 500 15px var(--display);
  color: #a69c90;
  font-variant-numeric: tabular-nums;
}
.lb-btn {
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  color: inherit;
  border: 1px solid #4a3e34;
  font: 600 15px var(--display);
  cursor: pointer;
}
.lb-btn:hover { border-color: var(--led); color: var(--led); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .question,
  .about-grid,
  .spec-row { grid-template-columns: 1fr; }
  .spec-row:nth-child(even) .spec-media { order: 0; }
  .blob { width: min(100%, 340px); }
}
@media (max-width: 820px) {
  .team-grid { grid-template-columns: 1fr; }
  .member,
  .member + .member { padding: 22px 0; border-left: 0; }
  .member + .member { border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
