/* Crooked Lid design system. Tokens and rules: DESIGN.md. Light only. */
[hidden] { display: none !important; }
:root {
  --paper: #F2F0EB; --surface: #E4E0D8; --tagc: #F7F4EE;
  --ink: #1C1915; --on-ink: #F2F0EB; --muted: #5E5952;
  --cran: #8F2D2A; --cranf: #6E2320;
  --gold: #8C6A2F; --goldl: #E0C27A; --goldf: #6F5420;
  --halo: #F4F1EA; --blush: #F6A9A4; --slab: rgba(28,25,21,.08);
  --rib: var(--cran); --ribf: var(--cranf); --ribc: var(--cranf); --ribl: transparent;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --hand: 'Caveat', cursive;
  --gut: 20px;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.5 var(--body); overflow-x: clip; }
body.has-sticky { padding-bottom: 96px; }
a { color: inherit; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible + span, .slot:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
code { font: 600 .95em var(--body); letter-spacing: .02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1180px; margin: 0; padding: 0 var(--gut); }

/* ---------- svg primitives ---------- */
.k { stroke: var(--ink); stroke-width: var(--sw, 3px); stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.k2 { stroke: var(--ink); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rib { fill: var(--rib); } .ribf { fill: var(--ribf); } .ribl { fill: var(--ribl); }
.crease { fill: none; stroke: var(--ribc); stroke-width: 2.5px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tt { font-family: var(--hand); font-weight: 700; fill: var(--ink); }
.ex, .hold { display: none; }
.sq .ey { display: none; } .sq .ex { display: inline; }
.holding .hold { display: inline; }
.ey { transform-box: fill-box; transform-origin: center; transition: transform 70ms; }
.bl .ey { transform: scaleY(.12); }
/* Gold is a metal: lit across most of the ribbon, darker only in the folds. Never used for text. */
.gold { --rib: var(--goldl); --ribf: var(--gold); --ribc: var(--goldf); --ribl: #F1DFAE; }

/* ---------- header ---------- */
.top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 0 var(--gut); }
.wordmark { font: 700 21px/1 var(--display); letter-spacing: -.025em; text-decoration: none; }
.nav { display: flex; gap: 16px; font-size: .875rem; font-weight: 600; }
.nav a { text-decoration: none; padding: 8px 0; }
.nav a:hover { text-decoration: underline; }
@media (max-width: 559px) {
  .nav a:not(:last-child) { display: none; }
  fieldset.plat legend { float: none; display: block; width: 100%; margin: 0 0 -4px; }
}

/* ---------- hero ---------- */
.scene { position: relative; }
.scene > svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero-hit { position: absolute; left: 48%; top: 12%; width: 52%; height: 85%; background: transparent; border: 0; padding: 0; cursor: pointer; border-radius: 2px; }
.hero-hit:focus-visible { outline: 2px dashed var(--ink); outline-offset: -4px; }
.tag { position: absolute; left: 4%; top: 52%; width: 156px; height: 100px; transform-origin: 78px 12px; rotate: -4deg; z-index: 2; }
.tag > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tag .hole { position: absolute; left: 76px; top: 10px; width: 4px; height: 4px; }
.tag label { position: absolute; left: 16px; right: 12px; display: flex; align-items: baseline; gap: 5px; color: var(--ink); font-family: var(--hand); cursor: text; }
.tag .l1 { top: 24px; font-size: 27px; font-weight: 700; }
.tag .l2 { top: 59px; font-size: 23px; font-weight: 600; }
/* The inputs keep a real font size of at least 16px (iOS zoom); only the drawing scales. */
.tag input { font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1.5px dashed rgba(28,25,21,.55); border-radius: 0; padding: 0; margin: 0; width: 100%; min-width: 0; line-height: 1.05; outline: none; }
.tag input::placeholder { color: rgba(28,25,21,.42); opacity: 1; }
.tag input:focus { border-bottom: 1.5px solid var(--ink); }
.tag.need input#toName { border-bottom: 2px solid var(--cran); }
.caret { position: absolute; top: 4px; width: 2px; height: 26px; background: var(--ink); animation: blink 1.05s steps(1) infinite; pointer-events: none; }
@keyframes blink { 50% { opacity: 0; } }
.tag-hint { position: absolute; left: 4%; top: calc(52% + 106px); width: 40%; max-width: 13rem; margin: 0; font-size: .875rem; line-height: 1.3; font-weight: 600; z-index: 2; }
.tag-hint::before { content: "\2191\00a0"; }
.tag.swing { animation: swing 1.1s cubic-bezier(.3,.7,.4,1); }
@keyframes swing { 0% { rotate: -16deg; } 28% { rotate: 8deg; } 52% { rotate: -7deg; } 74% { rotate: 2deg; } 100% { rotate: -4deg; } }

.copy { padding: 28px var(--gut) 0; }
@media (min-width: 560px) { .copy { padding-top: 40px; } }
h1 { font: 700 clamp(2.1rem, 6vw + .5rem, 4.25rem)/.98 var(--display); letter-spacing: -.03em; margin: 0 0 14px; max-width: 14ch; }
.lede { margin: 0 0 22px; max-width: 36ch; }
.cta { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; background: var(--ink); color: var(--on-ink); border: 0; border-radius: 2px; font: 600 17px/1 var(--body); text-decoration: none; cursor: pointer; }
.cta:hover { background: #000; }
.btn2 { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; background: transparent; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 2px; font: 600 15px/1 var(--body); cursor: pointer; white-space: nowrap; }
.btn2[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.btn2:disabled { opacity: .4; }

.buy { max-width: 30rem; }
.inside { margin: 0 0 6px; }
.plat { border: 0; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.plat legend { float: left; padding: 0; margin-right: 6px; color: var(--muted); }
.plat label { position: relative; cursor: pointer; padding: 10px 0; }
.plat input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plat label span { font-weight: 600; border-bottom: 2px solid transparent; padding-bottom: 1px; }
.plat input:checked + span { border-bottom-color: var(--ink); }
.plat label:hover span { border-bottom-color: rgba(28,25,21,.35); }
.plat .dot { color: var(--muted); }
.err { color: var(--cran); font-weight: 600; margin: 0 0 10px; }
.macnote { border-top: 1.5px solid var(--ink); padding-top: 12px; }
.macnote p { margin: 0 0 10px; }
.facts { list-style: none; margin: 14px 0 0; padding: 0; font-size: .875rem; color: var(--muted); }
.facts li { padding: 7px 0; border-top: 1px solid var(--surface); }
.facts li:first-child { border-top: 0; }
#factGuest { color: var(--ink); font-weight: 600; }
.closed p { margin: 0 0 10px; max-width: 36ch; }

.waitlist .row { display: flex; gap: 8px; max-width: 30rem; }
.waitlist input { flex: 1; min-width: 0; height: 44px; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--tagc); padding: 0 12px; font: 400 16px var(--body); color: var(--ink); }
.waitlist input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.msg { font-size: .875rem; margin: 8px 0 0; min-height: 1.3em; }
.msg.err { color: var(--cran); font-weight: 600; }

/* ---------- sticky selection bar ---------- */
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 10px; background: var(--paper); border-top: 1.5px solid var(--ink); padding: 8px var(--gut) calc(8px + env(safe-area-inset-bottom)); }
.sb-parcel { flex: 0 0 auto; width: 44px; height: 40px; overflow: visible; }
.sb-text { flex: 1; min-width: 0; font-size: .875rem; line-height: 1.3; }
.sb-text b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 600; overflow-wrap: anywhere; }
.sb-text > span { color: var(--muted); white-space: nowrap; }
@media (max-width: 559px) { .sb-plat-l { display: none; } }
.sb-btn { flex: 0 0 auto; width: auto; padding: 0 16px; height: 48px; font-size: 16px; }

/* ---------- sections ---------- */
section.s { padding-top: 72px; }
h2 { font: 700 clamp(1.6rem, 3vw + .6rem, 2.4rem)/1.05 var(--display); letter-spacing: -.02em; margin: 0 0 8px; max-width: 20ch; }
.note { margin: 0 0 20px; color: var(--muted); max-width: 42ch; }
.note.top-gap { margin-top: 20px; }

/* picker */
.shelf { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gut)); padding: 8px var(--gut) 6px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.slot { flex: 0 0 150px; scroll-snap-align: start; scroll-margin-left: var(--gut); cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 2px; touch-action: manipulation; }
.slot svg { display: block; width: 150px; height: auto; overflow: visible; border-bottom: 1px solid var(--ink); }
.slot .lab { padding: 10px 10px 4px 6px; }
.slot .nm { display: inline-block; font-weight: 600; font-size: 15px; line-height: 1.25; border-bottom: 2px solid transparent; }
.slot .st { display: block; font-size: 14px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.slot[aria-checked="true"] .nm { border-bottom-color: var(--ink); }
.slot[aria-checked="true"] .lab::after { content: "Chosen"; display: block; margin-top: 2px; font-weight: 600; font-size: 14px; }
.later { display: flex; align-items: flex-end; gap: 20px; margin-top: 22px; flex-wrap: wrap; }
.later .lt { font-size: 14px; color: var(--muted); flex-basis: 100%; margin-bottom: -8px; }
.mini { display: flex; align-items: flex-end; gap: 10px; }
.mini svg { width: 64px; height: auto; display: block; overflow: visible; }
.mini span { font-size: 14px; line-height: 1.3; padding-bottom: 4px; }
.mini b { display: block; font-weight: 600; }
#retired, #closesLine { margin: 16px 0 0; }

/* gold */
.goldrow { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.goldrow svg { width: 150px; height: auto; display: block; overflow: visible; border-bottom: 1px solid var(--ink); }
.goldcap { font-weight: 600; margin: 0 0 12px; min-height: 1.5em; }

/* how it works */
.steps { list-style: none; margin: 8px 0 0; padding: 0; max-width: 640px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 4px; padding: 16px 0; border-top: 1.5px solid var(--ink); counter-increment: s; }
.steps li:last-child { border-bottom: 1.5px solid var(--ink); }
.steps li::before { content: counter(s); font: 700 22px/1.1 var(--display); }
.steps b { font-weight: 600; }
#mac p { max-width: 42ch; }

/* faq */
.faq { max-width: 42rem; border-bottom: 1px solid var(--ink); }
.faq details { border-top: 1px solid var(--ink); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 28px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 700 20px/1 var(--display); }
.faq details[open] summary::after { content: "\2212"; }
.faq .a p { margin: 0 0 16px; max-width: 40rem; }

/* footer */
.foot { margin-top: 96px; padding: 24px 0 32px; border-top: 1px solid var(--ink); font-size: .875rem; }
.foot p { margin: 0 0 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; }

/* ---------- reading pages (legal, install) ---------- */
.page { padding: 24px var(--gut) 0; max-width: 44rem; }
.page h1 { font-size: clamp(2rem, 5vw + .5rem, 3rem); max-width: 18ch; }
.page h2 { font-size: clamp(1.3rem, 2vw + .6rem, 1.6rem); margin: 2em 0 .4em; max-width: none; }
.page h3 { font: 600 1.0625rem/1.3 var(--body); margin: 1.6em 0 .3em; }
.page li { margin-bottom: .4em; }
.page p, .page li { max-width: 40rem; }

/* install page */
.dl { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 4px; }
.dl .cta { width: auto; padding: 0 20px; }
.dl .cta[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.dl-note { font-size: .875rem; color: var(--muted); margin: 6px 0 0; }
.isteps { margin: 12px 0 0; padding-left: 1.3em; }
.isteps li { padding-left: 4px; margin-bottom: .7em; }
pre.cmd { background: var(--tagc); border: 1.5px solid var(--ink); border-radius: 2px; padding: 12px 14px; overflow-x: auto; font: 400 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 10px 0 16px; }
.mock { max-width: 25rem; margin: 14px 0 8px; border: 1.5px solid var(--ink); border-radius: 2px; background: #fff; box-shadow: 6px 6px 0 var(--slab); font-size: .9375rem; }
.mock .mbar { display: flex; justify-content: flex-end; padding: 6px 10px; border-bottom: 1px solid var(--surface); color: var(--muted); font-size: .8125rem; }
.mock .mbody { padding: 16px 18px 18px; }
.mock .mtitle { font: 700 1.25rem/1.2 var(--body); margin: 0 0 8px; }
.mock .mtext { margin: 0 0 12px; color: var(--muted); font-size: .875rem; }
.mock dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 14px; font-size: .875rem; }
.mock dt { color: var(--muted); } .mock dd { margin: 0; }
.mock .mlink { text-decoration: underline; font-weight: 600; }
.mock .mbtns { display: flex; justify-content: flex-end; gap: 8px; }
.mock .mbtn { border: 1.5px solid var(--surface); border-radius: 2px; padding: 6px 14px; font-weight: 600; font-size: .875rem; background: var(--paper); }
.hl { outline: 3px solid var(--cran); outline-offset: 3px; border-radius: 1px; }
.mock-cap { font-size: .875rem; color: var(--muted); margin: 0 0 20px; }
.callout { border-left: 3px solid var(--ink); padding: 2px 0 2px 14px; margin: 16px 0; }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  :root { --gut: 40px; }
  .hero { display: grid; grid-template-columns: minmax(0, 58%) minmax(0, 42%); align-items: start; }
  .scene { width: min(100%, calc(66vh * 1.25)); margin-top: 8px; }
  .tag { left: auto; right: 2%; top: 50%; }
  .tag-hint { left: auto; right: 2%; top: calc(50% + 106px); width: 156px; }
  .hero-hit { left: 0; }
  .copy { padding: 28px 40px 0 8px; }
  .lede { font-size: 1.1875rem; }
  .cta { max-width: 420px; }
  .sticky { left: auto; width: 520px; border-left: 1.5px solid var(--ink); }
  .shelf { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .tag.swing { animation: none; }
  .ey { transition: none; }
  .caret { animation: none; }
  html { scroll-behavior: auto; }
}
@media (min-width: 1024px) { h1 { font-size: clamp(2.6rem, 4.2vw, 3.6rem); max-width: 15ch; } }

/* arriving soon: words plus a shut lid, no new colours */
.slot[aria-disabled="true"] { cursor: default; }
.slot[aria-disabled="true"] .st { color: var(--ink); font-weight: 600; }

/* lost page */
.lostform { margin: 0 0 20px; max-width: 420px; }
.lostform label { display: block; margin: 0 0 6px; }
.lostform input { display: block; width: 100%; height: 48px; margin: 0 0 12px; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--tagc); padding: 0 12px; font: 400 16px var(--body); color: var(--ink); }
.lostform input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }

/* thanks page */
.codebig { margin: 4px 0 12px; }
.codebig code { display: inline-block; font: 700 clamp(1.7rem, 7vw, 2.6rem)/1.1 var(--display); letter-spacing: .04em; border-bottom: 2px solid var(--ink); padding-bottom: 4px; overflow-wrap: anywhere; }
.msgbox { display: block; width: 100%; max-width: 36rem; margin: 0 0 12px; padding: 10px 12px; background: var(--tagc); border: 1.5px solid var(--ink); border-radius: 2px; font: 400 16px/1.45 var(--body); color: var(--ink); resize: vertical; }

/* share and receive */
.sharegrid { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.sharegrid .btn2 { text-decoration: none; }
.share-main { max-width: 420px; }
.giftbox { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); margin: 20px 0 8px; padding: 4px 0 12px; }
.giftbox h2 { margin-top: .8em; }
.giftbox .dl { margin-top: 8px; }
#thSelf, .btn2 { text-decoration: none; }
