/* ═══════════════════════════════════════════════════════════════
   MALAKI TEES — cotton, ink & marigold
   Mobile-first. Breakpoints: 720px (tablet), 1040px (desktop).
   ═══════════════════════════════════════════════════════════════ */

:root {
  --cotton:   #f6f4ee;   /* page background — unbleached cotton   */
  --ink:      #182338;   /* deep print ink — text & tee outlines  */
  --ink-soft: #4b5468;   /* secondary text                        */
  --marigold: #efa00b;   /* screen-print accent                   */
  --stitch:   #d64545;   /* errors & small stitch details         */
  --thread:   #d8d3c6;   /* hairlines & borders                   */
  --paper:    #fffdf8;   /* cards / ticket                        */
  --tee-color:#f4f2ec;   /* current tee swatch (JS-driven)        */

  --font-display: 'Anton', sans-serif;
  --font-body:    'Karla', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --radius: 10px;
  --pad: clamp(16px, 4vw, 32px);
  --header-height: 50px;
}

.site-header {
    height: var(--header-height);
}

section[id] {
    scroll-margin-top: calc(var(--header-height) + 10px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--cotton);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); letter-spacing: .04em; }

/* ───────────────────────── header ───────────────────────── */

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--thread);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--cotton) 88%, transparent);
  backdrop-filter: blur(8px);
}
.brand {
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: .06em;
  color: var(--ink); text-decoration: none;
}
.brand-dot {
  display: inline-block; width: 8px; height: 8px; margin-left: 5px;
  background: var(--marigold); border-radius: 50%;
}
.header-tag { font-size: 11px; color: var(--ink-soft); }

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

.hero {
  position: relative;   /* ← anchors the video INSIDE the hero */
  overflow: hidden;      /* ← clips anything that tries to escape */
  padding: 0;            /* ← padding lives on .hero-inner instead */
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg,
      rgba(246,244,238,.55) 0%, rgba(246,244,238,.30) 55%, rgba(246,244,238,.65) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  padding: clamp(48px, 9vw, 110px) var(--pad) clamp(40px, 6vw, 80px);
  max-width: 1100px; margin: 0 auto;
}
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 11vw, 124px);
  line-height: .96; letter-spacing: .01em;
  text-transform: uppercase;
}
.ink-swipe {
  position: relative; display: inline-block; z-index: 0;
}
.ink-swipe::after {
  content: ""; position: absolute; z-index: -1;
  left: -2%; right: -3%; bottom: 6%; height: 38%;
  background: var(--marigold);
  transform: skew(-8deg) rotate(-1deg);
}
.hero-sub {
  max-width: 520px; margin-top: 22px;
  font-size: clamp(16px, 2vw, 18px); color: var(--ink-soft);
}
.hero-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ───────────────────────── buttons ───────────────────────── */

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 16px;
  padding: 14px 26px; border-radius: var(--radius);
  border: 2px solid var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
.btn-primary {
  background: var(--ink); color: var(--cotton);
  box-shadow: 4px 4px 0 var(--marigold);
}
.btn-primary:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--marigold); }
.btn-primary:active { transform: translate(0,0); box-shadow: 2px 2px 0 var(--marigold); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper); }
.btn-block { width: 100%; padding: 18px; font-size: 18px; }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }

/* ───────────────────────── how it works ───────────────────────── */

.how { border-block: 1px solid var(--thread); background: var(--paper); }
.how-steps {
  list-style: none; max-width: 1100px; margin: 0 auto;
  display: grid; gap: 28px;
  padding: clamp(36px, 5vw, 56px) var(--pad);
}
.how-steps h3 { font-size: 18px; margin: 8px 0 4px; }
.how-steps p  { color: var(--ink-soft); font-size: 15px; max-width: 34ch; }
.step-no {
  font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--marigold); padding: 3px 8px; border-radius: 4px;
}

/* ───────────────────────── builder layout ───────────────────────── */

.builder { max-width: 1100px; margin: 0 auto; padding: clamp(44px, 6vw, 72px) var(--pad); }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.5vw, 56px);
  letter-spacing: .01em; margin-bottom: 28px;
}
.builder-grid { display: grid; gap: 36px; }

/* ── mockup ── */

.mockup-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mockup-frame {
  position: relative; width: min(100%, 420px); aspect-ratio: 400/440;
  background:
    radial-gradient(circle at 30% 20%, #ffffff 0%, transparent 55%),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(24,35,56,.025) 14px 15px),
    var(--paper);
  border: 1px solid var(--thread); border-radius: var(--radius);
  overflow: hidden;
}
.tee-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tee-fill   { fill: var(--tee-color); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; transition: fill .25s ease; }
.tee-collar { fill: color-mix(in srgb, var(--tee-color) 82%, var(--ink)); stroke: var(--ink); stroke-width: 2.5; transition: fill .25s ease; }
.tee-seam   { stroke: var(--ink); stroke-width: 2; opacity: .35; }

.print-area {
  position: absolute;
  left: 33%; top: 24%; width: 34%; height: 42%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 40%, transparent);
  border-radius: 4px;
  transition: border-color .2s ease;
}
.print-area.has-art { border-color: transparent; }
.print-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--ink-soft); font-size: 9px; text-align: center; padding: 6px;
}
#printImage {
  max-width: calc(1% * var(--art-scale, 85));
  max-height: calc(1% * var(--art-scale, 85));
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(24,35,56,.25));
}

.mockup-tools { display: flex; align-items: center; gap: 18px; width: min(100%, 420px); }
.tool { display: flex; align-items: center; gap: 10px; font-size: 11px; flex: 1; color: var(--ink-soft); }
.tool input[type=range] { flex: 1; accent-color: var(--marigold); }
.tool-clear {
  background: none; border: 1px solid var(--thread); border-radius: 6px;
  padding: 6px 10px; font-size: 11px; cursor: pointer; color: var(--stitch);
}
.tool-clear:hover { border-color: var(--stitch); }
.mockup-note { font-size: 10px; color: var(--ink-soft); text-align: center; }

/* ── form ── */

.order-form fieldset {
  border: 1px solid var(--thread); border-radius: var(--radius);
  background: var(--paper);
  padding: 20px; margin-bottom: 20px;
}
.order-form legend {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; padding: 0 8px;
}

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--thread); border-radius: var(--radius);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-drag {
  border-color: var(--marigold);
  background: color-mix(in srgb, var(--marigold) 7%, var(--paper));
  outline: none;
}
.dz-title { font-weight: 700; }
.dz-title em { font-style: normal; color: var(--ink-soft); font-weight: 400; }
.dz-hint { font-size: 11px; color: var(--ink-soft); }
.dz-file { font-size: 12px; color: var(--ink); background: var(--cotton); padding: 4px 10px; border-radius: 4px; }

.opt-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--thread); }
.opt-row:last-child { border-bottom: none; }
.opt-label { font-size: 11px; color: var(--ink-soft); width: 52px; flex-shrink: 0; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: var(--sw); border: 2px solid var(--thread);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { border-color: var(--ink); box-shadow: 0 0 0 3px var(--marigold); }
.swatch:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

.size-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  min-width: 46px; padding: 9px 12px; cursor: pointer;
  font-family: var(--font-mono); font-weight: 600; font-size: 14px;
  background: var(--cotton); color: var(--ink);
  border: 2px solid var(--thread); border-radius: 8px;
  transition: all .12s ease;
}
.pill:hover { border-color: var(--ink); }
.pill.is-active { background: var(--ink); color: var(--cotton); border-color: var(--ink); }
.pill:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

.qty { display: inline-flex; align-items: stretch; border: 2px solid var(--thread); border-radius: 8px; overflow: hidden; }
.qty-btn { width: 42px; border: none; background: var(--cotton); font-size: 20px; cursor: pointer; color: var(--ink); }
.qty-btn:hover { background: var(--marigold); }
#qtyInput {
  width: 56px; border: none; text-align: center;
  font-family: var(--font-mono); font-size: 16px; background: var(--paper);
  -moz-appearance: textfield;
}
#qtyInput::-webkit-outer-spin-button, #qtyInput::-webkit-inner-spin-button { -webkit-appearance: none; }

.field-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
.field small { font-weight: 400; color: var(--ink-soft); }
.field input {
  font: 16px var(--font-body); color: var(--ink);
  padding: 12px 14px; background: var(--cotton);
  border: 2px solid var(--thread); border-radius: 8px;
  transition: border-color .15s ease;
}
.field input:focus { outline: none; border-color: var(--ink); }
.field input[aria-invalid="true"] { border-color: var(--stitch); }
.field-error { font-family: var(--font-mono); font-size: 11px; color: var(--stitch); min-height: 0; }
.field-error:empty { display: none; }

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ── job ticket ── */

.ticket {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 6px;
  padding: 22px 22px 18px;
  margin: 4px 0 20px;
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--ink) 12%, transparent);
}
.ticket-punch {
  position: absolute; top: -1.5px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 12px;
  background: var(--cotton);
  border: 1.5px solid var(--ink); border-top: none;
  border-radius: 0 0 20px 20px;
}
.ticket h3 { font-size: 13px; letter-spacing: .18em; margin-bottom: 14px; text-align: center; }
.ticket dl div { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--thread); }
.ticket dt { color: var(--ink-soft); }
.ticket .ticket-total { border-bottom: none; padding-top: 12px; font-weight: 600; font-size: 16px; }
.ticket-note { margin-top: 10px; font-size: 10px; text-align: center; color: var(--ink-soft); }

.form-error { color: var(--stitch); font-size: 13px; margin-bottom: 14px; text-align: center; }
.fine-print { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin-top: 14px; }

/* ── success panel ── */

.success { max-width: 560px; margin: 0 auto; padding: clamp(44px, 8vw, 90px) var(--pad); }
.ticket-big { text-align: center; padding: 34px 26px 28px; }
.ticket-big h3 { color: var(--ink); }
.success-code {
  font-size: clamp(24px, 6vw, 34px); font-weight: 600;
  background: var(--marigold); display: inline-block;
  padding: 6px 18px; border-radius: 6px; margin: 10px 0 16px;
}
.ticket-big p { color: var(--ink-soft); margin-bottom: 22px; }

.pill { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.1; }
.pill-price { font-size: 10px; font-weight: 400; opacity: .75; }
.pill-wide { min-width: 150px; padding-inline: 14px; }

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

.site-footer {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  padding: 30px var(--pad) 40px;
  border-top: 1px solid var(--thread);
  font-size: 11px; color: var(--ink-soft); text-align: center;
}

/* ═════════════════════ breakpoints ═════════════════════ */

@media (min-width: 720px) {
  .how-steps { grid-template-columns: repeat(3, 1fr); }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field.span2 { grid-column: span 2; }
  .site-footer { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 1040px) {
  .builder-grid { grid-template-columns: minmax(380px, 460px) 1fr; gap: 56px; align-items: start; }
  .mockup-col { position: sticky; top: 84px; }
}


/* ================= */
/* ── welcome modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: var(--pad);
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  backdrop-filter: blur(3px);
}
.modal-overlay[hidden] { display: none; }

.modal {
  width: min(100%, 420px);
  margin: 0;                      /* override .ticket's margin */
  padding: 30px 26px 24px;
  animation: modal-in .28s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes modal-in {
  from { transform: translateY(24px) scale(.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; cursor: pointer;
  background: none; border: 1px solid var(--thread); border-radius: 8px;
  color: var(--ink-soft); font-size: 14px;
}
.modal-close:hover { border-color: var(--ink); color: var(--ink); }

.modal-sub { font-size: 14.5px; color: var(--ink-soft); text-align: center; margin: 6px 0 20px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-guest {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--ink-soft);
  padding: 10px; margin-top: 2px;
}
.modal-guest:hover { color: var(--ink); text-decoration: underline; }

.modal-ticket-punch {
  position: absolute; top: -1.5px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 12px;
  background: #979ba1;
  border: 1.5px solid var(--ink); border-top: none;
  border-radius: 0 0 20px 20px;
}

.modal-view[hidden] { display: none; }
.modal-fields { margin-bottom: 16px; grid-template-columns: 1fr !important; }