/* Type and tokens follow merch.rayzhu.co (tech-merch/website/app/manifesto-preview/page.module.css). */
@font-face {
  font-family: "Kaisei Decol";
  src: url("/fonts/kaisei-decol-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Archivo Manifesto";
  src: url("/fonts/archivo-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #0a0a0a;
  --quiet: #555;
  --rule: #e2e2e2;
  --plate: #f2f2f0;
  --alert: #a3241b;
  --serif: "Kaisei Decol", Georgia, serif;
  --sans: "Archivo Manifesto", Arial, sans-serif;

  --mx: clamp(16px, 8.33vw, 160px);
  --corner: clamp(16px, 2.2vw, 40px);
  --display: clamp(38px, 4.4vw, 84px);
  --body: clamp(16px, 1.2vw, 21px);
  --small: clamp(12px, 0.8vw, 14px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--body) / 1.5 var(--sans);
}
h1, p, figure, dl, dd, fieldset { margin: 0; }
h1 { font-weight: 400; }
fieldset { padding: 0; border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
::selection { background: #a7bdd3; color: #111; }
[hidden] { display: none !important; }

.arrow { flex: none; width: 0.72em; height: 0.72em; fill: none; stroke: currentColor; stroke-width: 1.3; }

/* ---------- Bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0 var(--corner) 0 var(--mx);
  background: linear-gradient(var(--paper) calc(100% - 12px), rgb(255 255 255 / 0%));
}
.folio {
  justify-self: start;
  font: 400 clamp(12px, 1.04vw, 18px) / 44px var(--serif);
  letter-spacing: 0.55em;
  color: var(--quiet);
}
.folio:hover { color: var(--ink); }
.bar-title {
  font: 500 12px / 1 var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.account {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--quiet);
  min-width: 0;
}
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Product ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  column-gap: clamp(40px, 6vw, 120px);
  align-items: start;
  padding: clamp(12px, 3svh, 40px) var(--mx) 0;
}

/* Photographs stack down the left while the buy box stays in view on the right. */
.gallery { display: grid; gap: 12px; }
.gallery img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--plate); }

.buy {
  position: sticky;
  top: 92px;
  max-width: 30em;
  padding-top: clamp(8px, 2vw, 40px);
}
.label {
  font: 500 clamp(11px, 0.68vw, 13px) / 1 var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--quiet);
}
.buy h1 {
  margin-top: 20px;
  font: 400 var(--display) / 1.04 var(--serif);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.lede { margin-top: 24px; text-wrap: pretty; }
#drop-description { white-space: pre-line; }

.terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.price { font-weight: 500; }
.terms-sep { color: var(--quiet); }

/* ---------- Steps ---------- */

.panel { display: grid; gap: 16px; margin-top: 36px; }
.panel[data-step="loading"] { min-height: 132px; }
.panel-note { font-size: 15px; line-height: 1.5; color: var(--quiet); }
.panel-note strong { color: var(--ink); font-weight: 500; word-break: break-all; }
.panel-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

.field { display: grid; gap: 8px; }
.field-label {
  font: 500 11px / 1 var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font-size: 16px;
}
.field input::placeholder { color: #6b6b6b; }
.field input[name="code"] { font: 400 24px / 1 var(--serif); letter-spacing: 0.3em; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  justify-self: start;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  font: 500 15px / 1 var(--sans);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.button:hover:not(:disabled) { background: var(--paper); color: var(--ink); }
.button:disabled { cursor: progress; opacity: 0.6; }
.button-wide { justify-self: stretch; }

.text-button {
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  cursor: pointer;
}
.account .text-button { font-size: 13px; }

.sizes { display: grid; gap: 12px; }
.sizes legend { padding: 0; margin-bottom: 12px; }
.size-options { display: flex; flex-wrap: wrap; gap: 8px; }
.size-options label { position: relative; }
.size-options input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.size-options span {
  display: grid;
  place-items: center;
  min-width: 56px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  font-size: 15px;
  transition: border-color 0.2s;
}
.size-options label:hover span { border-color: var(--ink); }
.size-options input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.size-options input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.owned { font: 400 clamp(28px, 2.4vw, 44px) / 1.12 var(--serif); text-wrap: balance; }
.message { min-height: 1.5em; margin-top: 16px; font-size: 15px; }
.message.is-error { color: var(--alert); }

/* ---------- Details ---------- */

.details { padding: clamp(72px, 9vw, 150px) var(--mx) clamp(56px, 7vw, 110px); }
.details dl > div {
  display: grid;
  grid-template-columns: minmax(0, 520fr) minmax(0, 984fr);
  column-gap: clamp(32px, 5vw, 96px);
  padding-block: 22px;
  border-top: 1px solid var(--rule);
}
.details dl > div:last-child { border-bottom: 1px solid var(--rule); }
.details dt { font: 500 clamp(17px, 1.3vw, 24px) / 1.3 var(--sans); letter-spacing: -0.01em; }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: 32px var(--mx);
  border-top: 1px solid var(--rule);
  color: var(--quiet);
  font-size: 13px;
}
.footer-wordmark { width: 118px; }
.footer-note { margin-right: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-link { display: inline-flex; align-items: center; gap: 6px; }
.panel-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-link:hover { color: var(--ink); }

/* ---------- Thank-you page ---------- */

.thanks {
  display: grid;
  align-content: center;
  min-height: calc(100svh - 76px - 98px);
  padding: 40px var(--mx) 80px;
}
.thanks h1 { margin-top: 20px; font: 400 clamp(64px, 10vw, 180px) / 1 var(--serif); letter-spacing: -0.02em; }
.thanks .lede { max-width: 32em; }
.thanks .button { margin-top: 36px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .bar { min-height: 64px; }
  .product { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  /* A swipeable row, each photo nearly full width so the next one peeks in. */
  .gallery {
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    gap: 8px;
    margin-inline: calc(-1 * var(--mx));
    padding-inline: var(--mx);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--mx);
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery img { scroll-snap-align: start; }
  .buy { position: static; max-width: none; padding-top: 0; }
  .details dl > div { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
}

@media (max-width: 620px) {
  .bar { grid-template-columns: auto 1fr; column-gap: 16px; padding-inline: var(--mx); }
  .bar-title { display: none; }
  .folio { font-size: 11px; letter-spacing: 0.35em; }
  .account { gap: 12px; }
  .account-email { max-width: 42vw; }
  .footer-note { width: 100%; order: 3; }
}

/* ---------- Policies ---------- */

.policies { max-width: calc(36em + 2 * var(--mx)); padding: clamp(12px, 3svh, 40px) var(--mx) clamp(56px, 7vw, 110px); }
.policies h1 { margin-top: 20px; font: 400 clamp(34px, 3.4vw, 60px) / 1.06 var(--serif); text-wrap: balance; }
.policies section { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule); }
.policies h2 { margin: 0 0 10px; font: 500 clamp(17px, 1.3vw, 22px) / 1.3 var(--sans); }
.policies p { text-wrap: pretty; }
.policies p + p { margin-top: 0.8em; }
.policies a:not(.button) { text-decoration: underline; text-underline-offset: 4px; }
.policies .button { margin-top: 48px; }
