/* ------------------------------------------------------------------
   runout — base.css
   One stylesheet. Tokens first, then primitives, then sections.
   ------------------------------------------------------------------ */

/* 1. Fonts (self-hosted, Google Fonts origin) */
@font-face {
  font-family: "Archivo";
  src: url("archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("plexmono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* 2. Tokens */
:root {
  /* colour — palette sampled from the hero render */
  --field: #b8b5b5;            /* render studio grey: hero sits on this */
  --field-deep: #a5a2a1;       /* vignette edge of the same grey */
  --bone: #e9e6e2;             /* warm light for open sections */
  --paper: #f5f3f0;            /* lightest surface */
  --ink: #141415;
  --ink-70: rgba(20, 20, 21, 0.70);
  --ink-45: rgba(20, 20, 21, 0.45);
  --hairline: rgba(20, 20, 21, 0.28);
  --accent: #0000ff;
  --on-accent: #ffffff;

  /* type */
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  /* type scale — deliberately gappy */
  --t-micro: 0.6875rem;                      /* 11px — mono annotations */
  --t-small: 0.8125rem;                      /* 13px */
  --t-body: 1rem;
  --t-lead: clamp(1.125rem, 1.5vw, 1.375rem);
  --t-display: clamp(2.6rem, 6.5vw, 5.5rem);
  --t-mega: clamp(6.5rem, 21vw, 19rem);      /* numbers as furniture */

  /* space */
  --pad: clamp(20px, 4.5vw, 64px);
  --head-h: 3.5rem;

  color-scheme: light;
}

/* 3. Reset & primitives */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bone);
}
h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.mono {
  font-family: var(--mono);
  font-weight: 400;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.skip-link {
  position: absolute;
  left: var(--pad);
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 4. Header */
.site-head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1;
}
.wordmark img { height: 1.05rem; width: auto; }
.site-head nav { display: flex; gap: 1.75rem; align-items: center; }
.site-head a:not(.wordmark),
.site-head .cart-toggle {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-head a:not(.wordmark):hover, .cart-toggle:hover { color: var(--accent); }

/* 5. Hero */
.hero {
  position: relative;
  min-height: max(640px, 100svh);
  background:
    radial-gradient(120% 90% at 70% 40%, var(--field) 55%, var(--field-deep) 100%);
  overflow: clip;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1fr auto;
  padding: calc(var(--head-h) + var(--pad)) var(--pad) var(--pad);
  column-gap: 1rem;
}



/* film-grain so the flat grey doesn't band */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* frame ticks, drawing-sheet corners */
.hero .tick {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--ink-45);
  z-index: 3;
}
.tick--tl { top: calc(var(--head-h) + 14px); left: 14px; border-left-width: 1px; border-top-width: 1px; }
.tick--tr { top: calc(var(--head-h) + 14px); right: 14px; border-right-width: 1px; border-top-width: 1px; }
.tick--bl { bottom: 14px; left: 14px; border-left-width: 1px; border-bottom-width: 1px; }
.tick--br { bottom: 14px; right: 14px; border-right-width: 1px; border-bottom-width: 1px; }

.hero-render {
  grid-column: 5 / -1;
  grid-row: 1 / span 2;
  position: relative;
  z-index: 1;
  align-self: center;
  /* bleed off the right edge of the page */
  margin-right: calc(var(--pad) * -1 - 4vw);
  margin-left: -8%;
  animation: hero-img 900ms cubic-bezier(0.2, 0.6, 0.2, 1) 150ms both;
}
.hero-render img {
  width: 100%;
  /* dissolve the square png into the matching field */
  -webkit-mask-image: radial-gradient(78% 88% at 50% 46%, #000 58%, transparent 84%);
  mask-image: radial-gradient(78% 88% at 50% 46%, #000 58%, transparent 84%);
}

/* dimension callout — positioned against the product in the render */
.dim-x {
  position: absolute;
  left: 21%;
  right: 17.5%;
  top: 70%;
  height: 11px;
  border-left: 1px solid var(--ink-70);
  border-right: 1px solid var(--ink-70);
  animation: dim-draw 700ms cubic-bezier(0.6, 0, 0.2, 1) 1000ms both;
}
.dim-x::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--ink-70);
}
.dim-x span {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  color: var(--ink-70);
  background: transparent;
}

.hero-copy {
  grid-column: 1 / 8;
  grid-row: 1;
  z-index: 2;
  align-self: start;
  padding-top: clamp(0.5rem, 4vh, 3rem);
}
.hero-kicker {
  color: var(--ink-70);
  animation: rise 600ms ease-out 350ms both;
}
.hero-mega {
  font-weight: 800;
  font-size: var(--t-mega);
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin-left: -0.05em;      /* optical align to the kicker */
  animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) 450ms both;
}
.hero-mega .unit {
  font-size: 0.36em;
  font-weight: 800;
  letter-spacing: -0.02em;
  vertical-align: 0.06em;
  margin-left: 0.06em;
  color: var(--accent);
}
.hero-title {
  margin-top: clamp(1rem, 3vh, 2rem);
  font-size: var(--t-lead);
  font-weight: 400;
  line-height: 1.45;
  max-width: 26em;
  animation: rise 600ms ease-out 600ms both;
}
.hero-title strong { font-weight: 800; letter-spacing: -0.01em; }

.hero-buy {
  grid-column: 1 / 6;
  grid-row: 2;
  z-index: 2;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: rise 600ms ease-out 750ms both;
}
.price-row { display: flex; align-items: baseline; gap: 0.9rem; }
.price {
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
}
.price-note { color: var(--ink-70); }
.buy-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 2.2rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-weight: 600;
  font-size: var(--t-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0;
  transition: background-color 160ms ease;
}
.btn:hover { background: var(--ink); }
.ship-note { color: var(--ink-70); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-img {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes dim-draw {
  from { opacity: 0; transform: scaleX(0.2); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 899px) {
  .hero {
    grid-template-rows: auto auto auto;
    min-height: 100svh;
    row-gap: 0;
  }
  .hero-copy { grid-column: 1 / -1; grid-row: 1; }
  .hero-render {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
    margin: 2% -18% 4% -10%;
  }
  .hero-buy { grid-column: 1 / -1; grid-row: 3; }
}

/* 6. Footer */
.site-foot {
  border-top: 1px solid var(--hairline);
  padding: 2.5rem var(--pad) 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: baseline;
  background: var(--bone);
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* 7. Generic interior pages (stubs for now) */
.page-shell {
  max-width: 44rem;
  padding: calc(var(--head-h) + 4rem) var(--pad) 6rem;
  margin: 0 auto;
}
.page-shell h1 { font-weight: 800; font-size: var(--t-display); letter-spacing: -0.03em; line-height: 1; }

/* 8. Utilities */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 9. Home — the case (near-empty section, all air) */
.case {
  background: var(--paper);
  padding: clamp(7rem, 22vh, 15rem) var(--pad);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1rem;
  row-gap: 3.5rem;
}
.case-statement {
  grid-column: 1 / 10;
  font-size: var(--t-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  max-width: 14em;
}
.case-body {
  grid-column: 7 / 12;
  font-size: var(--t-lead);
  line-height: 1.55;
}
.case-body p { margin: 0 0 1.2em; }
.case-body p:last-child { margin-bottom: 0; }
@media (max-width: 899px) {
  .case-statement { grid-column: 1 / -1; }
  .case-body { grid-column: 1 / -1; }
}

/* 10. Home — spec table (the tight section) */
.specs {
  background: var(--bone);
  border-top: 1px solid var(--hairline);
  padding: 2.5rem var(--pad) 4rem;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1rem;
}
.specs-head {
  grid-column: 1 / 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}
.specs-title { margin: 0; font-weight: 600; color: var(--ink-70); }
.specs-index { color: var(--ink-45); }
.spec-table {
  grid-column: 4 / -1;
  width: 100%;
  border-collapse: collapse;
}
.spec-table th,
.spec-table td {
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px solid var(--hairline);
  padding: 0.55rem 0;
}
.spec-table tr:first-child th,
.spec-table tr:first-child td { border-top: 1px solid var(--hairline); }
.spec-table th {
  font-weight: 400;
  color: var(--ink-70);
  width: 38%;
  padding-right: 2rem;
}
.spec-table td {
  font-family: var(--mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 899px) {
  .specs { row-gap: 2rem; }
  .specs-head { grid-column: 1 / -1; flex-direction: row; align-items: baseline; }
  .spec-table { grid-column: 1 / -1; }
  .spec-table th { width: 45%; padding-right: 1rem; }
}

/* 11. Home — buy band (ink block) */
.buy-band {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3rem, 8vh, 5.5rem) var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2.5rem;
}
.buy-band-name {
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.buy-band-name .thin { font-weight: 400; }
.buy-band-action { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.buy-band .price-note, .buy-band .ship-note { color: rgba(245, 243, 240, 0.65); }
.buy-band .btn:hover { background: var(--paper); color: var(--ink); }

/* 12. Product page */
.product-top {
  background:
    radial-gradient(120% 90% at 60% 40%, var(--field) 55%, var(--field-deep) 100%);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1rem;
  align-items: center;
  min-height: 70vh;
  padding: calc(var(--head-h) + 2rem) var(--pad) 3rem;
}
.product-gallery { grid-column: 1 / 8; }
.gallery-main img { width: 100%; }
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 1rem; }
.gallery-thumb {
  padding: 2px;
  border: 1px solid transparent;
  opacity: 0.6;
}
.gallery-thumb.is-active { border-color: var(--ink); opacity: 1; }
.gallery-thumb img { display: block; width: 64px; height: auto; }
.product-info {
  grid-column: 8 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  padding-left: clamp(0rem, 2vw, 2rem);
}
.product-kicker { color: var(--ink-70); }
.product-title {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.btn-wide { align-self: stretch; }
.product-facts { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1rem; }
.facts-title { color: var(--ink-70); margin-top: 1rem; }
.facts-list { list-style: none; margin: 0; padding: 0; }
.facts-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--hairline); }
.product-facts p { max-width: 34em; }
@media (max-width: 899px) {
  .product-top { min-height: 0; }
  .product-gallery { grid-column: 1 / -1; margin: 0 calc(var(--pad) * -0.5); }
  .product-info { grid-column: 1 / -1; padding-left: 0; }
}

/* 13. Forms (contact) */
.page-kicker { color: var(--ink-45); margin-bottom: 1rem; }
.page-body { margin-top: 2rem; font-size: var(--t-lead); line-height: 1.55; }
.page-body p { margin: 0 0 1.2em; }
.page-shell form { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 2.5rem; }
.page-shell label { margin-top: 1rem; }
.page-shell input[type="email"],
.page-shell input[type="text"],
.page-shell input[type="password"],
.page-shell textarea {
  font: inherit;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--ink-45);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}
.page-shell input:focus-visible, .page-shell textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.page-shell form .btn { align-self: flex-start; margin-top: 1.5rem; }

/* 14. Cart drawer */
.cart-drawer { position: fixed; inset: 0; z-index: 50; }
.cart-drawer[aria-hidden="true"] { visibility: hidden; }
.drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(20, 20, 21, 0.35);
  opacity: 0;
  transition: opacity 240ms ease;
}
.drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--bone);
  border-left: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cart-drawer[aria-hidden="false"] .drawer-scrim { opacity: 1; }
.cart-drawer[aria-hidden="false"] .drawer-panel { transform: none; }
html.drawer-open { overflow: hidden; }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--hairline);
}
.drawer-close:hover { color: var(--accent); }
.drawer-empty { padding: 2.5rem 1.4rem; display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }
.drawer-lines { list-style: none; margin: 0; padding: 0 1.4rem; overflow-y: auto; flex: 1; }
.drawer-line {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hairline);
}
.line-img { background: var(--field); }
.line-info { flex: 1; }
.line-title { font-weight: 800; }
.line-qty { display: flex; gap: 0.9rem; align-items: center; margin-top: 0.4rem; }
.line-qty button { font-family: var(--mono); padding: 0 0.4rem; }
.line-qty button:hover { color: var(--accent); }
.drawer-foot {
  padding: 1.2rem 1.4rem 1.4rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.drawer-total { display: flex; justify-content: space-between; align-items: baseline; }
@media (prefers-reduced-motion: reduce) {
  .drawer-panel, .drawer-scrim { transition: none; }
}

/* 15. Landing-only: pre-order form band */
.buy-band { align-items: flex-start; }
.preorder-intro { display: flex; flex-direction: column; gap: 1.2rem; max-width: 26rem; }
.preorder-note { color: rgba(245, 243, 240, 0.75); line-height: 1.5; }
.preorder-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: min(30rem, 100%);
}
.field-row { display: flex; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.field-qty { flex: 0 0 7rem; }
.preorder-form label { color: rgba(245, 243, 240, 0.65); }
.preorder-form input[type="text"],
.preorder-form input[type="email"],
.preorder-form input[type="number"] {
  font: inherit;
  padding: 0.65rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(245, 243, 240, 0.35);
  border-radius: 0;
  color: var(--paper);
}
.preorder-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.preorder-form .btn { align-self: flex-start; margin-top: 0.4rem; }
.form-state { color: rgba(245, 243, 240, 0.75); min-height: 1.2em; }
@media (max-width: 640px) {
  .field-row { flex-direction: column; }
  .field-qty { flex: 1; }
}
.privacy-line { color: rgba(245, 243, 240, 0.45); }
