/* ==========================================================================
   FREE MY BOYS — design system  (spec §3)
   Booking room: concrete under a single overhead light, a height chart, paper
   placards. Grayscale; amber ONLY on primary actions, the $1, prices at the
   point of decision, and focus rings. Hard 2px corners. No gradients on type.
   ========================================================================== */

@font-face { font-family: 'Stencil'; src: url('/fonts/big-shoulders-stencil-latin.woff2') format('woff2-variations'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Mono'; src: url('/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Mono'; src: url('/fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #0f0f10;
  --bg-raised: #161618;
  --ink: #f2f2f0;
  --body: #adadab;
  --mute: #8d8d8b;
  --line: rgba(242, 242, 240, .2);
  --line-soft: rgba(242, 242, 240, .07);
  --name: #c9c9c6;
  --accent: #ffb000;
  --accent-ink: #111111;
  --paper: #e9e7e1;
  --paper-ink: #141414;
  --danger: #ff8a73;

  --radius: 2px;
  --gut: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --measure: 62ch;

  --f-display: 'Stencil', Impact, 'Arial Narrow', sans-serif;
  --f-text: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --ease: cubic-bezier(.76, 0, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font: 400 17px/1.55 var(--f-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* The room: one overhead light, a floor vignette, concrete grain. Fixed so it
   never repaints on scroll; pointer-events none so it can't eat clicks. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 58% at 68% -8%, rgba(255, 236, 200, .12), transparent 70%),
    radial-gradient(120% 90% at 50% 120%, rgba(0, 0, 0, .55), transparent 60%);
}
body::after {
  /* Concrete grain as a tiny pre-rendered tile: a live SVG feTurbulence filter
     blended over the whole viewport cost ~0.5s of paint on mid-range phones. */
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background: url('/img/grain.png') repeat;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--paper); color: var(--paper-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--paper-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* --- layout -------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 32px); }
.section { padding: clamp(72px, 10vw, 140px) 0; border-top: 1px solid var(--line-soft); }
.section__head { grid-column: 1 / span 5; }
.section__body { grid-column: 7 / span 6; }
@media (max-width: 860px) { .section__head, .section__body { grid-column: 1 / -1; } .section__body { margin-top: 28px; } }

/* --- type ---------------------------------------------------------------- */
.display { font: 900 clamp(64px, 11.2vw, 168px)/.84 var(--f-display); letter-spacing: -.012em; text-transform: uppercase; color: var(--ink); margin: 0; }
.h2 { font: 800 clamp(40px, 5vw, 72px)/.9 var(--f-display); text-transform: uppercase; letter-spacing: -.005em; color: var(--ink); margin: 0 0 20px; }
.h3 { font: 600 20px/1.3 var(--f-text); color: var(--ink); margin: 0 0 8px; }
.lede { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--body); max-width: 36ch; margin: 0; }
.lede strong, .body strong { color: var(--ink); font-weight: 600; }
.body { max-width: var(--measure); }
.body p { margin: 0 0 1em; }
.mono { font-family: var(--f-mono); font-weight: 600; letter-spacing: .04em; }
.fine { font-size: 14px; color: var(--mute); }
.amt { color: var(--accent); font-weight: 600; }

/* --- actions ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font: 600 16px/1 var(--f-text); letter-spacing: .005em;
  text-decoration: none; cursor: pointer; transition: transform .12s var(--ease), background-color .12s;
}
.btn:hover { background: #ffc233; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { background: #6b5a2a; color: #1b1b1b; cursor: progress; }
.btn--quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--quiet:hover { background: var(--line-soft); }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--mute); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-color: var(--ink); }

/* --- nav + footer -------------------------------------------------------- */
.nav { display: flex; align-items: baseline; gap: clamp(16px, 2.4vw, 36px); padding: 26px 0; font-size: 15px; font-weight: 500; }
.nav__logo { font: 900 26px/1 var(--f-display); letter-spacing: .02em; color: var(--ink); text-decoration: none; margin-right: 12px; white-space: nowrap; }
.nav__link { color: var(--mute); text-decoration: none; white-space: nowrap; }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--ink); }
.nav__sp { flex: 1; }
.nav__cta { color: var(--ink); text-decoration: none; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--ink); padding-bottom: 2px; }
@media (max-width: 720px) { .nav__link--wide { display: none; } }
/* Phones: "Start a shirt" already goes to /build, so the duplicate link goes. */
@media (max-width: 520px) { .nav__link--build { display: none; } }

.foot { border-top: 1px solid var(--line-soft); padding: 48px 0 56px; font-size: 14px; color: var(--mute); }
.foot__grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.foot__mark { font: 900 28px/1 var(--f-display); color: var(--ink); letter-spacing: .02em; margin-bottom: 12px; }
.foot__h { color: var(--ink); font-weight: 500; margin: 0 0 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { color: var(--mute); text-decoration: none; }
.foot a:hover { color: var(--ink); }
@media (max-width: 720px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__grid > :first-child { grid-column: 1 / -1; } }

/* --- booking-room objects ------------------------------------------------ */
.chart {
  position: absolute; inset: 0 0 0 auto; width: 48%; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); mask-image: linear-gradient(90deg, transparent, #000 22%);
  background:
    repeating-linear-gradient(180deg, transparent 0 calc(56px - 1.5px), var(--line) calc(56px - 1.5px) 56px),
    repeating-linear-gradient(180deg, transparent 0 calc(14px - 1px), var(--line-soft) calc(14px - 1px) 14px);
}
.chart__marks { position: absolute; right: 22px; top: 0; display: grid; grid-auto-rows: 56px; font: 600 13px/1 var(--f-mono); color: rgba(242, 242, 240, .5); text-align: right; }
.chart__marks span { transform: translateY(-7px); }

.placard {
  display: inline-block; min-width: 250px; background: var(--paper); color: var(--paper-ink);
  border-radius: var(--radius); padding: 12px 16px 14px; font: 600 12.5px/1.55 var(--f-mono); letter-spacing: .06em;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .5); transform: rotate(-1.2deg);
}
.placard__row { display: flex; justify-content: space-between; gap: 24px; }
.placard__name { font: 900 30px/1 var(--f-display); letter-spacing: .02em; margin: 6px 0 4px; text-transform: uppercase; }
.paper { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: 24px; }

/* A shirt: a photo mockup (Printful's own Bella+Canvas 3001 template, made by
   scripts/make-tee-mockups.mjs) with the real artwork (an <img> of /api/preview
   or a static render, 3:4) over Printful's 12x16 in print area, at true scale.
   .tee__canvas is the 1000x1000 template; .tee crops its empty margins to the
   shirt (x 130-870, y 10-990) so the shirt fills the column. Zero CLS. */
.tee { position: relative; aspect-ratio: 740 / 980; width: 100%; overflow: hidden; }
.tee__canvas { position: absolute; left: -17.5676%; top: -1.0204%; width: 135.1351%; aspect-ratio: 1; background: center / 100% 100% no-repeat; }
.tee--black .tee__canvas { background-image: url(/img/tee-black.webp); }
.tee--white .tee__canvas { background-image: url(/img/tee-white.webp); }
/* Print area on the template: 3000-px coords left 1006, top 530, 1010x1346. */
.tee__art { position: absolute; left: 33.533%; top: 17.667%; width: 33.667%; height: 44.867%; object-fit: contain; object-position: top; }

.facts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 15px; color: var(--mute); margin: 0; padding: 0; list-style: none; }
.facts li + li::before { content: '/'; color: var(--line); margin-right: 12px; }
/* On phones a wrapped line would start with a stray slash: stack instead. */
@media (max-width: 520px) { .facts { flex-direction: column; gap: 4px; } .facts li + li::before { content: none; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; counter-increment: step; }
.steps li::before { content: counter(step, decimal-leading-zero); font: 600 14px/1.8 var(--f-mono); color: var(--mute); }

.faq { border-top: 1px solid var(--line-soft); }
.faq details { border-bottom: 1px solid var(--line-soft); padding: 18px 0; }
.faq summary { cursor: pointer; color: var(--ink); font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--mute); font-family: var(--f-mono); }
.faq details[open] summary::after { content: '–'; }
.faq details > div { padding-top: 12px; max-width: var(--measure); }

.notice { border-left: 2px solid var(--mute); padding: 12px 16px; background: var(--bg-raised); color: var(--ink); }
.notice--error { border-left-color: var(--danger); }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 500; color: var(--mute); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); }

.orgs { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.orgs__item { display: grid; gap: 2px; }
.orgs__item a { color: var(--ink); font-weight: 600; }
.orgs__pending { color: var(--mute); }

/* --- forms (builder) ----------------------------------------------------- */
.field { display: grid; gap: 8px; margin: 0 0 26px; border: 0; padding: 0; min-width: 0; }
.field__label { color: var(--ink); font-weight: 500; font-size: 15px; padding: 0; }
.field__hint { font-size: 14px; color: var(--mute); margin: 0; }
.field__error { font-size: 14px; color: var(--danger); min-height: 0; margin: 0; }
.field__error:empty { display: none; }
.input {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-raised); color: var(--ink); font: 500 17px/1.3 var(--f-text);
}
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 2px var(--accent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input--name { font: 900 34px/1 var(--f-display); letter-spacing: .02em; text-transform: uppercase; min-height: 64px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 56px; justify-content: center; padding: 0 14px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 500; }
.choice input:checked + span { box-shadow: inset 0 0 0 2px var(--ink); background: var(--line-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch { width: 16px; height: 16px; border-radius: 1px; box-shadow: inset 0 0 0 1px var(--line); }
.swatch--black { background: #1b1b1d; }
.swatch--white { background: #ecebe7; }
.chip { min-height: 34px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; color: var(--body); font: 500 13px/1 var(--f-text); cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.summary { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 8px; font-size: 15px; }
.summary__row { display: flex; justify-content: space-between; }
.summary__row--total { color: var(--ink); font-weight: 600; font-size: 18px; padding-top: 6px; }
.summary__row--total .amt { font-size: 18px; }

/* --- 404 ------------------------------------------------------------------ */
.lost { border-top: 0; }
.lost .lede { margin: 28px 0 36px; }
.lost__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 0 0 28px; }

/* --- motion policy ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.builder { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); padding-top: 24px; padding-bottom: 96px; }
.builder__intro { margin: -8px 0 36px; }
.builder__free { display: flex; align-items: stretch; }
.builder__free-word { flex: none; width: 5.2ch; max-width: 55%; min-height: 64px; padding: 0 14px; font: 900 34px/1 var(--f-display); text-transform: uppercase; color: var(--mute); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--bg); }
.builder__free-word:focus { color: var(--ink); }
.builder__free .input--name { flex: 1; min-width: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.builder__chips { margin-top: 4px; }
.builder__form-error { margin: 18px 0 0; }
.builder__checkout { width: 100%; margin-top: 22px; min-height: 58px; font-size: 17px; }
.builder__secure { margin-top: 12px; }
.builder__sticky { position: sticky; top: 24px; }
.builder__status { text-align: center; margin-top: 14px; transition: opacity .2s; }
.builder__preview .tee__art { transition: opacity .18s ease-out; }
.builder__preview[data-loading] .tee__art { opacity: .45; }

/* Photo: one "Add a photo" control until used, then the frame and its options. */
.photo__add { justify-self: start; }
#photo-file:focus-visible + .photo__add { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo__editor { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.photo__add[hidden], .photo__editor[hidden], .photo__frame[hidden] { display: none; }
.photo__editor > :not(.photo__frame):not(.photo__restored) { grid-column: 2; }
.photo__frame, .photo__restored { grid-column: 1; grid-row: 1 / span 6; margin: 0; }
.photo__frame { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px var(--line); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.photo__frame[data-dragging] { cursor: grabbing; }
/* The frame takes the chosen shape's aspect (shared/crop.js SHAPE_SPECS). */
.photo__frame[data-shape="square"] { aspect-ratio: 1; }
.photo__frame[data-shape="wide"] { aspect-ratio: 4 / 3; }
.shape-icon { display: inline-block; width: 10px; height: 12.5px; box-shadow: inset 0 0 0 1.5px currentColor; }
.shape-icon--square { width: 12px; height: 12px; }
.shape-icon--wide { width: 14px; height: 10.5px; }
.photo__frame img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; transition: opacity .18s ease-out; }
.photo__frame::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.photo[data-busy] .photo__frame img { opacity: .45; }
/* Local stand-ins for the print filters; the preview on the shirt is the real one. */
.photo__frame[data-filter="bw"] img { filter: grayscale(1); }
.photo__frame[data-filter="stencil"] img { filter: grayscale(1) contrast(8); }
.photo__zoom { display: grid; gap: 6px; }
.photo__zoom input { width: 100%; margin: 0; accent-color: var(--name); }
.photo__drag { margin: 0 0 4px; }
.photo__frame[hidden] ~ .photo__zoom .photo__drag { display: none; }
.photo__status { margin: 0; }
.photo__status:empty { display: none; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ink); font-size: 15px; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--name); cursor: pointer; }
.check input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.check input:disabled, .check input:disabled + span, .check input[aria-disabled="true"], .check input[aria-disabled="true"] + span { cursor: progress; opacity: .6; }

@media (max-width: 900px) {
  .builder { grid-template-columns: 1fr; }
  .builder__preview { order: -1; }
  .builder__sticky { position: static; max-width: 420px; margin: 0 auto; }
}
/* Phones: six equal size tiles on one row instead of 3XL orphaned on a second. */
@media (max-width: 520px) {
  /* Ruling V2: the shirt stays <= ~360 px tall so the name field sits near the
     fold. A chest crop (template y 10-770, below the print area's bottom at 626)
     keeps the print at full column width; the hem fades into the page. */
  .builder__sticky { max-width: 360px; }
  .builder .tee { aspect-ratio: 740 / 760; -webkit-mask-image: linear-gradient(#000 86%, transparent); mask-image: linear-gradient(#000 86%, transparent); }
  .builder .tee__canvas { top: -1.3158%; }
  .builder #sizes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .builder #sizes .choice span { display: flex; min-width: 0; padding: 0; }
  .builder .input--name, .builder__free-word { font-size: 27px; } /* fits ~20 characters before the field scrolls */
  .photo__editor { grid-template-columns: minmax(0, 1fr); }
  .photo__editor > *, .photo__editor > :not(.photo__frame):not(.photo__restored) { grid-column: 1; grid-row: auto; }
  .photo__frame { width: min(100%, 240px); }
}
