@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-wght.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* The sweep percentage the firing animation drives. Registered so it can be animated,
   and inherited so the glow band and the fired image read the same position. */
@property --sweep {
  syntax: "<percentage>";
  inherits: true;
  initial-value: -14%;
}

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

body {
  margin: 0;
  background: var(--kiln-ground);
  color: var(--kiln-body);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

:root {
  --kiln-ground: #14100D;
  --kiln-raise: #1C1713;
  --kiln-line: #302620;
  --kiln-ink: #F7F1EA;
  --kiln-body: #B7A99D;
  --kiln-faint: #7E7168;
  --font-display: "Archivo", var(--font-sans);
}

h1, h2, h3, .wordmark, .btn {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--kiln-ink);
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-4); line-height: 0.96; }
h2 { font-size: var(--step-3); line-height: 1.05; }
h3 { font-size: var(--step-0); letter-spacing: -0.015em; }
p { margin: 0; max-width: var(--measure); }
a { color: inherit; }
code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--kiln-raise); border: 1px solid var(--kiln-line);
  padding: 1px 5px; border-radius: 4px; color: var(--fired-200);
}

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--space-6); }
.label {
  font-family: var(--font-mono); font-size: var(--step--1);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--kiln-faint);
  margin: 0;
}
.lead { font-size: var(--step-1); color: #C8BAAE; }
section { padding: clamp(64px, 8vw, 120px) 0; }

/* The heat line: a rule that glows in the middle, like an element in a kiln. */
.heat { height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--ember-500) 22%, #6d3208 60%, transparent); opacity: 0.5; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: var(--space-16); align-items: center;
  padding: clamp(40px, 6vw, 84px) 0 clamp(56px, 7vw, 96px); }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: var(--space-6);
  padding: var(--space-6) 0; }
.wordmark { font-size: 1.15rem; letter-spacing: -0.04em; }
.wordmark em { font-style: normal; color: var(--ember-500); }
.nav { display: flex; gap: var(--space-6); }
.nav a { color: var(--kiln-faint); text-decoration: none; font-size: 0.92rem; }
.nav a:hover { color: var(--kiln-ink); }

.cta-row { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-8); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700;
  letter-spacing: -0.01em; text-decoration: none; border: 1px solid transparent;
  transition: transform .12s ease, background .12s ease, border-color .12s ease; }
.btn:focus-visible { outline: 2px solid var(--ember-400); outline-offset: 3px; }
.btn-fire { background: var(--ember-500); color: #170F08; }
.btn-fire:hover { background: var(--ember-400); transform: translateY(-1px); }
.btn-ghost { border-color: var(--kiln-line); color: #CBBCB0; }
.btn-ghost:hover { border-color: var(--fired-600); color: var(--kiln-ink); }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { transform: none; }

/* ── The kiln: a raw sphere fires into a finished asset (2D intro),
      then hands off to a live 3D model you can turn ────────────────── */
.stage { position: relative; aspect-ratio: 1 / 1; }
.kiln { position: absolute; inset: 0; transition: opacity .7s ease; }
.kiln.gone { opacity: 0; pointer-events: none; }
.kiln img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.kiln .fired {
  -webkit-mask-image: linear-gradient(102deg, #000 var(--sweep), transparent calc(var(--sweep) + 12%));
  mask-image: linear-gradient(102deg, #000 var(--sweep), transparent calc(var(--sweep) + 12%));
}
.kiln .glow {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0;
  background: linear-gradient(102deg, transparent calc(var(--sweep) - 8%), #FF9433 var(--sweep), transparent calc(var(--sweep) + 6%));
  -webkit-mask-image: url("img/hero-fired.webp"); mask-image: url("img/hero-fired.webp");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.kiln.firing { animation: fire 2900ms cubic-bezier(.42,0,.2,1) forwards; }
.kiln.firing .glow { animation: glow 2900ms cubic-bezier(.42,0,.2,1) forwards; }
@keyframes fire { from { --sweep: -16%; } to { --sweep: 120%; } }
@keyframes glow { 0% { opacity: 0; } 10% { opacity: .9; } 90% { opacity: .9; } 100% { opacity: 0; } }
.kiln.done { --sweep: 120%; }

/* Live 3D — sits over the 2D intro, fades in once the model has loaded */
.hero-3d {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; --poster-color: transparent;
  opacity: 0; transition: opacity .8s ease; cursor: grab;
  --mdc-theme-primary: var(--ember-500);
}
.hero-3d.shown { opacity: 1; }
.hero-3d:active { cursor: grabbing; }

.kiln-hint { display: flex; align-items: center; gap: 10px; margin-top: var(--space-4); min-height: 22px; }
.kiln-hint .label { opacity: 0; transition: opacity .5s ease .2s; }
.stage.live + .kiln-hint .label { opacity: 1; }
.refire { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ember-500);
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; }
.refire:hover { color: var(--ember-400); }

@media (prefers-reduced-motion: reduce) {
  .kiln.firing, .kiln.firing .glow { animation: none; }
  .kiln { --sweep: 120%; }
  .kiln .glow { opacity: 0; }
}

/* ── Material switcher — centered sphere + swatch row (no empty sides) ── */
.swap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column;
  align-items: center; gap: var(--space-6); }
.swap-stage { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1 / 1; }
.swap-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .35s ease; }
.swap-stage img.on { opacity: 1; }
.swatch-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.swatch { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: none; border: 1px solid var(--kiln-line); border-radius: 999px;
  color: var(--kiln-body); font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer;
  transition: border-color .14s ease, color .14s ease; }
.swatch:hover { border-color: var(--fired-600); color: var(--kiln-ink); }
.swatch[aria-pressed="true"] { border-color: var(--ember-500); color: var(--kiln-ink); }
.swatch:focus-visible { outline: 2px solid var(--ember-400); outline-offset: 2px; }
.chip { width: 16px; height: 16px; border-radius: 4px; flex: none; border: 1px solid rgba(255,255,255,.14); }

/* ── Grids ─────────────────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8) var(--space-6); }
.feat { border-top: 1px solid var(--kiln-line); padding-top: var(--space-4); }
.feat p { font-size: 0.95rem; color: var(--kiln-faint); margin-top: 6px; }

.angles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.angles figure { margin: 0; }
.angles img { width: 100%; height: auto; display: block; background: var(--kiln-raise);
  border: 1px solid var(--kiln-line); border-radius: var(--radius-sm); }
.angles figcaption { margin-top: 8px; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: start; }
.plate { border: 1px solid var(--kiln-line); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--kiln-raise); display: block; }
.plate img { display: block; width: 100%; height: auto; }
.cap { margin-top: 10px; }

/* ── Steps, table, scope ───────────────────────────────────────────── */
.steps { counter-reset: s; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-12); }
.step { display: flex; gap: var(--space-4); }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ember-500); padding-top: 5px;
  font-variant-numeric: tabular-nums; }
.step p { font-size: 0.95rem; color: var(--kiln-faint); margin-top: 4px; }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--kiln-line); }
th:not(:first-child), td:not(:first-child) { text-align: center; width: 116px; }
thead th { color: var(--kiln-ink); font-family: var(--font-display); font-weight: 700; }
.yes { color: var(--ember-500); font-weight: 700; }
.no { color: #5E524A; }

.scope { padding-left: 20px; }
.scope li { color: var(--kiln-faint); margin-bottom: 10px; }
.scope strong { color: var(--kiln-body); font-weight: 600; }

footer { padding: var(--space-12) 0 var(--space-16); color: var(--kiln-faint); font-size: 0.9rem; }
footer a { color: #CBBCB0; text-decoration: none; border-bottom: 1px solid var(--kiln-line); }
footer a:hover { color: var(--ember-400); border-color: var(--ember-500); }
.foot-row { display: flex; gap: var(--space-8); flex-wrap: wrap; justify-content: space-between; }
.foot-links { display: flex; gap: var(--space-6); flex-wrap: wrap; align-items: flex-start; }

@media (max-width: 900px) {
  .hero, .grid2, .grid3, .steps, .swap, .panels { grid-template-columns: 1fr; gap: var(--space-8); }
  .swap-stage { max-height: 420px; }
  .angles { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
}
