/* ==========================================================================
   sections — hero → mill → draft → cloths → floor → contact → footer
   ========================================================================== */

/* ── hero ──────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: end;
  gap: clamp(1.1rem, 3vh, 2.2rem);
  padding: calc(var(--gut) * 2 + 3rem) var(--gut) clamp(1.4rem, 4vh, 2.6rem);
}

.hero__eyebrow { display: flex; align-items: center; flex-wrap: wrap; }

.hero__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-size: var(--t-hero);
  line-height: 0.94;
  letter-spacing: -0.022em;
}

.hero__em { font-style: italic; color: var(--madder); }

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 3rem);
  padding-top: clamp(0.7rem, 2vh, 1.2rem);
  border-top: 1px solid var(--line);
}

.hero__sub { max-width: 50ch; color: var(--thread-2); }
.hero__cue { display: flex; align-items: center; gap: 0.8em; }

.hero__cue-rule {
  position: relative;
  display: block;
  width: clamp(40px, 8vw, 90px);
  height: 1px;
  background: var(--line-2);
  overflow: hidden;
}

.hero__cue-rule::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--madder);
  transform-origin: left;
  animation: throw 2.8s var(--beat) infinite;
}

@keyframes throw {
  0%   { transform: scaleX(0); transform-origin: left; }
  45%  { transform: scaleX(1); transform-origin: left; }
  55%  { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* ── the mill ──────────────────────────────────────────────────────────── */

.mill { padding: var(--sec) var(--gut); display: grid; gap: clamp(2.5rem, 7vh, 5rem); }

.mill__body {
  max-width: 26ch;
  font-family: var(--f-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96;
  font-size: var(--t-h2);
  line-height: 1.04;
  letter-spacing: -0.018em;
}

.mill__grid { display: grid; gap: clamp(1.6rem, 4vw, 3.2rem); grid-template-columns: 1fr; max-width: 1100px; }
@media (min-width: 760px) { .mill__grid { grid-template-columns: repeat(3, 1fr); } }

.mill__grid p { color: var(--thread-2); max-width: 36ch; }

.mill__h {
  margin-bottom: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--madder);
  color: var(--madder);
}

/* ── the draft ─────────────────────────────────────────────────────────────
   minmax(0, 1fr): a grid item's default min-width is min-CONTENT, and the
   two canvases plus the code block would otherwise force this column wider
   than a phone and drag the whole page sideways.
   ------------------------------------------------------------------------ */

.draft {
  padding: var(--sec) var(--gut);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.8rem, 4.5vh, 3rem);
}

.draft__head { display: grid; gap: clamp(0.9rem, 2.4vh, 1.6rem); max-width: 62ch; }

.draft__h {
  font-family: var(--f-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96;
  font-size: var(--t-h2);
  line-height: 1;
  letter-spacing: -0.018em;
}

.draft__lead { max-width: 56ch; color: var(--thread-2); font-size: var(--t-lead); line-height: 1.4; }

.draft__panel {
  display: grid;
  min-width: 0;
  gap: clamp(1rem, 2.6vh, 1.7rem);
  padding: clamp(0.9rem, 2.4vw, 1.8rem);
  background: var(--ink-2);
  border: 1px solid var(--line);
}

.draft__controls {
  display: grid;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  grid-template-columns: 1fr;
  padding-bottom: clamp(0.7rem, 1.8vh, 1.1rem);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 820px) { .draft__controls { grid-template-columns: 1fr auto; } }

.ctrl { display: grid; gap: 0.5rem; min-width: 0; }
.ctrl__k { color: var(--thread-3); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chips button {
  padding: 0.42em 0.85em;
  border: 1px solid var(--line-2);
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--thread-3);
  transition: color 0.35s var(--throw), border-color 0.35s var(--throw),
              background-color 0.35s var(--throw);
}

.chips button:hover { color: var(--thread); border-color: var(--thread-3); }
.chips button.is-on { background: var(--madder); border-color: var(--madder); color: var(--ink); }

.draft__note { color: var(--thread-3); font-size: 0.98rem; max-width: 64ch; min-height: 1.5em; }

.draft__pair { display: grid; gap: clamp(0.9rem, 2.2vw, 1.6rem); grid-template-columns: 1fr; min-width: 0; }
@media (min-width: 900px) { .draft__pair { grid-template-columns: 1fr 1fr; } }

.pane { margin: 0; display: grid; gap: 0.55rem; min-width: 0; }

.pane__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}

.pane__legend { display: inline-flex; align-items: center; gap: 0.4em; color: var(--thread-4); }

.key {
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 0.15em;
  vertical-align: -1px;
}

.key--warp { background: var(--thread-3); }
.key--calc { background: var(--madder); margin-left: 0.7em; }

.pane canvas {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  background: var(--ink);
  border: 1px solid var(--line);
  /* Taps land on cells, so the browser must not wait to see if it is a
     double-tap zoom — but vertical scrolling has to survive, because this
     canvas is most of the screen on a phone. */
  touch-action: pan-y;
}

.pane--draft canvas { cursor: crosshair; }
.pane__hint { color: var(--thread-4); }

.draft__spec { border-top: 1px solid var(--line); padding-top: 1rem; }
.draft__spec summary { cursor: pointer; color: var(--thread-3); transition: color 0.3s var(--throw); }
.draft__spec summary:hover { color: var(--madder); }
.draft__spec > * + * { margin-top: 0.9rem; }
.draft__spec p { color: var(--thread-3); font-size: 0.95rem; max-width: 64ch; }

.draft__spec pre {
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--ink);
  border-left: 2px solid var(--madder);
  overflow-x: auto;
}

.draft__spec code {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  color: var(--thread-2);
  white-space: pre;
}

/* ── cloths ────────────────────────────────────────────────────────────── */

.cloths { padding: var(--sec) var(--gut); display: grid; gap: clamp(2rem, 5vh, 3.5rem); }
.cloths__head { display: grid; gap: clamp(0.9rem, 2.4vh, 1.6rem); max-width: 62ch; }

.cloths__h {
  font-family: var(--f-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96;
  font-size: var(--t-h2);
  line-height: 1;
  letter-spacing: -0.018em;
}

.cloths__lead { max-width: 52ch; color: var(--thread-2); font-size: var(--t-lead); line-height: 1.4; }

.cloths__list { display: grid; gap: clamp(0.8rem, 2vw, 1.4rem); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .cloths__list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .cloths__list { grid-template-columns: repeat(6, 1fr); } }

.swatch {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  transition: transform 0.4s var(--throw);
}

.swatch:hover { transform: translateY(-3px); }
.swatch canvas { width: 100%; aspect-ratio: 1; display: block; border: 1px solid var(--line); background: var(--ink-2); }
.swatch__t { font-family: var(--f-display); font-weight: 500; font-size: 1.02rem; line-height: 1.2; }
.swatch:hover .swatch__t { color: var(--madder); }

/* ── the floor ─────────────────────────────────────────────────────────── */

.floor { padding: var(--sec) var(--gut); display: grid; gap: clamp(2rem, 5vh, 3.5rem); }
.floor__head { display: grid; gap: clamp(0.9rem, 2.4vh, 1.6rem); }

.floor__h {
  font-family: var(--f-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96;
  font-size: var(--t-h2);
  line-height: 1;
  letter-spacing: -0.018em;
}

.band { display: grid; gap: clamp(1rem, 2.4vw, 1.8rem); grid-template-columns: 1fr; }
@media (min-width: 640px) { .band { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .band { grid-template-columns: repeat(4, 1fr); } }

.band__item { display: grid; gap: 0.45rem; align-content: start; }

.band__item video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--ink-2);
  filter: grayscale(0.55) contrast(1.05);
  transition: filter 0.6s var(--throw);
}

.band__item:hover video { filter: grayscale(0) contrast(1); }

.band__t {
  margin-top: 0.3rem;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  line-height: 1.15;
}

/* ── contact ───────────────────────────────────────────────────────────── */

.contact { padding: var(--sec) var(--gut); display: grid; gap: clamp(1.6rem, 4.5vh, 3rem); }

.contact__h {
  font-family: var(--f-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-size: var(--t-hero);
  line-height: 0.94;
  letter-spacing: -0.022em;
}

.contact__em { font-style: italic; color: var(--madder); }

.rows { display: grid; max-width: 900px; }
.rows li { border-top: 1px solid var(--line); }
.rows li:last-child { border-bottom: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: clamp(0.85rem, 2.4vh, 1.35rem) 0;
  transition: color 0.4s var(--throw);
}

@media (max-width: 620px) { .row { grid-template-columns: 5.5rem 1fr auto; } }

.row__v { font-size: clamp(1.05rem, 2.2vw, 1.6rem); }

/* Label and value translate; the arrow holds. Shifting the whole row would
   carry the arrow past the section edge, and animating padding would lay the
   row out on every frame. */
.row__k, .row__v { transition: transform 0.5s var(--throw); }
a.row:hover { color: var(--madder); }
a.row:hover .row__k, a.row:hover .row__v { transform: translateX(0.7rem); }

.row__a { color: var(--thread-4); transition: color 0.4s var(--throw), transform 0.5s var(--throw); }
a.row:hover .row__a { color: var(--madder); transform: translate(0.2rem, -0.2rem); }

/* ── footer ────────────────────────────────────────────────────────────── */

.foot {
  padding: clamp(2rem, 6vh, 4rem) var(--gut) clamp(1.5rem, 4vh, 2.5rem);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1.2rem;
}

.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 2rem; }
.foot__note { max-width: 72ch; color: var(--thread-4); letter-spacing: 0.07em; }

[data-rise] { will-change: transform, opacity; }
