:root {
  --bg: #090705;
  --plate: #16110d;
  --ink: #f6f1ea;
  --muted: #d2c3b6;
  --dim: #a89486;
  --line: rgba(255, 196, 150, 0.16);
  --nav: rgba(9, 7, 5, 0.94);
  --wash: rgba(255, 244, 232, 0.045);
  --wash-2: rgba(255, 244, 232, 0.02);
  --ghost: rgba(255, 210, 170, 0.28);
  --glow: rgba(255, 90, 24, 0.16);
  --glow-2: rgba(255, 170, 60, 0.06);
  --ember: #ff4d1c;
  --ember-2: #ff8a1e;
  --gold: #ffc15a;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Outfit", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1120px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f7f2eb;
  --plate: #efe4d6;
  --ink: #1b140f;
  --muted: #5e4c41;
  --dim: #7d6a5e;
  --line: rgba(60, 32, 16, 0.14);
  --nav: rgba(247, 242, 235, 0.94);
  --wash: rgba(40, 22, 10, 0.045);
  --wash-2: rgba(40, 22, 10, 0.02);
  --ghost: rgba(60, 32, 16, 0.22);
  --glow: rgba(255, 90, 24, 0.1);
  --glow-2: rgba(255, 150, 40, 0.08);
  --gold: #9a5410;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 88% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 420px at -10% 16%, var(--glow-2), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
}

img { max-width: 100%; display: block; }

a { color: inherit; }

button, input { font: inherit; color: inherit; }

h1, h2, h3, p { overflow-wrap: break-word; }

::selection { background: #ff6a22; color: #1a0904; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 60;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--gold);
  color: #1a0904;
  text-decoration: none;
}

.skip:focus { top: 12px; }

.progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 40;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--ember), var(--gold));
  pointer-events: none;
}

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin-inline: auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 72px;
  padding: 0 22px;
  background: var(--nav);
  border-bottom: 1px solid transparent;
}

.nav.is-stuck { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 0.92rem;
}

.brand img,
.lockup img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: transparent;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.16em;
}

.lockup img { width: 28px; height: 28px; }

.missing .brand { margin-bottom: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a[aria-current="true"] { color: var(--ink); }

.nav-toggle {
  display: none;
  margin-left: auto;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  padding: 0;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme svg { display: block; }
.theme .moon { display: none; }
html[data-theme="light"] .theme .sun { display: none; }
html[data-theme="light"] .theme .moon { display: block; }

body > .theme {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  margin: 0;
  background: var(--nav);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font: 600 0.95rem/1 var(--body);
}

.nav-cta {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.btn-primary {
  background: linear-gradient(180deg, #ff9a45 0%, #ff4d1c 100%);
  color: #2a0e07;
  box-shadow: 0 10px 28px rgba(255, 77, 28, 0.28);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ghost);
}

@media (hover: hover) {
  .btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
  .btn-ghost:hover { background: rgba(255, 244, 232, 0.05); }
}

.hero { padding: 28px 0 72px; }

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--gold);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 rgba(255, 77, 28, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 77, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 28, 0); }
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.4rem, 8.6vw, 7.4rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
}

h1 span { display: block; }

.grad {
  background: linear-gradient(100deg, #ff3b1a 0%, #ff6a12 40%, #ffb03a 78%, #ffe1a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.amd {
  margin: 18px 0 0;
  color: var(--muted);
  font: 500 0.95rem/1 var(--body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 42px;
  align-items: end;
  margin-top: 28px;
}

.lede {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 300;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-note { margin: 14px 0 0; }

.hero-note a {
  color: var(--gold);
  text-underline-offset: 3px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font: 400 0.92rem/1.4 var(--mono);
}

.hero-art {
  position: relative;
  margin: 0;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 180, 120, 0.22);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4), 0 0 80px rgba(255, 80, 20, 0.12);
}

.hero-art img {
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 1360;
  object-fit: cover;
}

.hero-art figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(9, 7, 5, 0.72);
  color: #f6f1ea;
  font-size: 0.85rem;
}

.section { padding: 88px 0; border-top: 1px solid var(--line); }

.index {
  margin: 0 0 12px;
  color: var(--gold);
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 14px;
  max-width: 18ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.dek {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 300;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--gold);
}

.ways {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.ways li {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--wash), var(--wash-2));
}

.ways h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.ways li > p { margin: 0; color: var(--muted); font-weight: 300; }

.kind {
  margin: 0 0 8px;
  color: var(--gold);
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sample {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 400;
}

.rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.rail li {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 138, 61, 0.45);
}

.n {
  color: var(--gold);
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.14em;
}

.rail h3 {
  margin: 12px 0 8px;
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.rail p { margin: 0; color: var(--muted); font-weight: 300; }

.studio-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.switch { display: flex; gap: 8px; }

.switch button[aria-pressed="true"] {
  background: rgba(255, 138, 30, 0.14);
  border-color: rgba(255, 160, 70, 0.7);
  color: var(--ink);
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.plate,
.viewer {
  min-height: 420px;
  height: min(68vh, 620px);
  border-radius: 22px;
  overflow: hidden;
}

.plate {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--plate);
  color: var(--ink);
}

.plate img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.plate figcaption,
.viewer-caption {
  margin: 0;
  font: 400 0.85rem/1.4 var(--mono);
}

.viewer { position: relative; }

model-viewer {
  display: block;
  /* :host sets contain:strict. In Firefox a percentage height then
     becomes 0, the canvas never sizes, and the mesh stays on Loading. */
  contain: none;
  width: 100%;
  height: min(68vh, 620px);
  min-height: 420px;
  background: radial-gradient(ellipse at 50% 38%, #3a2a22 0%, #14110f 68%);
  --progress-bar-color: #ff8a1e;
}

.viewer-status {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 16px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(9, 7, 5, 0.75);
  color: #f6f1ea;
  font-size: 0.85rem;
}

.viewer-tools {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
}

.viewer-tools button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 170, 0.35);
  background: rgba(9, 7, 5, 0.55);
  color: #f6f1ea;
  cursor: pointer;
}

.shot {
  margin: 18px 0 0;
}

.shot img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 22px 50px rgba(40, 18, 8, 0.28);
}

html[data-theme="dark"] .shot img {
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.65), 0 14px 36px rgba(255, 120, 40, 0.42);
}

.shot figcaption {
  margin: 0;
  padding: 14px 2px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tree {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--wash);
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
}

.tree p { margin: 0 0 8px; color: var(--gold); }

.tree ul { margin: 0; padding-left: 1.1rem; }
.tree li { color: var(--muted); }
.tree span { color: var(--dim); }

.trades {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.trade {
  padding: 22px 22px 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--wash), var(--wash-2));
}

.trade h3 {
  margin: 0 0 16px;
  max-width: 22ch;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.roles li {
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
}

.roles h4 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.roles p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 300;
  line-height: 1.55;
}

.uses-note { margin-top: 22px; }

.machine-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 36px;
  align-items: start;
}

.machine-grid h2 { max-width: 12ch; }

.specs {
  margin: 0;
  padding: 6px 22px 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--wash);
}

.specs div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.specs div:first-child { border-top: 0; }

.specs dt {
  margin: 0;
  color: var(--gold);
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.specs dd { margin: 0; }

.note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 300;
}

.warn {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 180, 70, 0.38);
  background: rgba(255, 150, 40, 0.07);
}

.warn strong { display: block; margin-bottom: 6px; }
.warn p { margin: 0; color: var(--muted); font-weight: 300; }

.credit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.credit-list a { color: var(--ink); text-underline-offset: 3px; }
.credit-list span { display: block; color: var(--dim); font-size: 0.85rem; }

.close h2 { max-width: 16ch; }

.footer {
  display: grid;
  gap: 14px;
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.92rem;
}

.footer a { color: var(--muted); }

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}

.footer p { margin: 0; max-width: 78ch; }

.missing {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 0;
}

.missing .wrap { width: min(34rem, calc(100% - 48px)); }

.missing h1 { font-size: clamp(3rem, 8vw, 6rem); }

@media (max-width: 900px) {
  .hero-grid,
  .ways,
  .studio-grid,
  .machine-grid,
  .rail { grid-template-columns: 1fr 1fr; }

  .hero-grid,
  .ways,
  .machine-grid { grid-template-columns: 1fr; }

  h2 { max-width: 18ch; }
}

@media (max-width: 720px) {
  .nav { padding-inline: 16px; }
  .nav-toggle { display: inline-flex; margin-left: 8px; }
  .nav-cta { margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 16px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    background: var(--nav);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.is-open {
    display: flex;
    position: fixed;
    z-index: 29;
    inset: 72px 0 0 0;
    background: var(--bg);
    overflow: auto;
  }
  .rail,
  .ways,
  .studio-grid { grid-template-columns: 1fr; }
  .job-row .btn { width: 100%; }
  .specs div,
  .roles { grid-template-columns: 1fr; }
  .plate,
  .viewer,
  model-viewer { height: 420px; }
  .wrap { width: min(var(--wrap), calc(100% - 32px)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
  .btn-primary:hover { transform: none; }
}
