/* beadline.app — the craft table on the web (docs/22 §5). Materials from docs/07; one key
   light top-left; a running stitch on every edge that would otherwise be a hairline. */

@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(fonts/Baloo2-ExtraBold.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url(fonts/Nunito-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/Nunito-Bold.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url(fonts/Nunito-ExtraBold.woff2) format("woff2"); }

:root {
  --linen: #F1E8D6; --linen-deep: #E4D6BD;
  --cream: #F4E9D2; --plum: #6E4F78; --plum-deep: #4E3558; --honey: #E4A93B; --honey-lit: #F3C45C; --honey-deep: #B8862C;
  --velvet: #3A2340; --leather: #6B4632; --wood: #D9BE8C; --thread: #EFE3CB; --brass: #C9A227;
  --ink: #2B1E3F; --ink-soft: #6B5C78; --heart: #C8433F; --sky: #4F86D4;
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 62ch; --pad: clamp(1.1rem, 4vw, 2.5rem); --radius: 22px;
  --shadow: 3px 5px 10px rgba(43, 30, 63, .22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); font-family: var(--body); font-weight: 600; font-size: 1.0625rem; line-height: 1.55;
  background: var(--linen) url(tex/linen-512.webp) center top / 512px 512px repeat;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-color: rgba(43,30,63,.35); text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-color: var(--honey-deep); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cream); padding: .5rem .9rem; border-radius: 12px; z-index: 50; }
.skip:focus { left: 8px; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -.005em; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; max-width: var(--measure); text-wrap: pretty; }
.lead { font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 700; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.num { font-variant-numeric: tabular-nums; font-family: var(--display); }

.wrap { width: min(100% - 2 * var(--pad), 1120px); margin-inline: auto; }
section { padding-block: clamp(3rem, 8vw, 6rem); }
.eyebrow { font-family: var(--body); font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .6rem; }

/* --- materials ------------------------------------------------------------------ */
.felt { position: relative; border-radius: var(--radius); box-shadow: var(--shadow); }
.felt::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tile) center / 512px 512px repeat; opacity: .55; pointer-events: none; }
.felt > * { position: relative; }
.felt.cream { background: var(--cream); --tile: url(tex/felt-cream-512.webp); color: var(--ink); }
.felt.plum { background: var(--plum); --tile: url(tex/felt-plum-512.webp); color: var(--cream); }
.felt.plum a { text-decoration-color: rgba(244,233,210,.5); }
.felt.honey { background: var(--honey); --tile: url(tex/felt-honey-256.webp); color: var(--ink); }
.felt.velvet { background: var(--velvet); --tile: url(tex/velvet-256.webp); color: var(--cream); }
/* the running stitch: an SVG rect a stitch in from the edge, thread over a soft ink line */
.stitch { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.stitch rect { x: 9px; y: 9px; width: calc(100% - 18px); height: calc(100% - 18px); rx: calc(var(--radius) - 9px); fill: none;
  stroke: var(--thread); stroke-width: 2.2; stroke-dasharray: 11 6; stroke-linecap: round; }
.stitch rect.under { stroke: rgba(43,30,63,.28); stroke-width: 2.6; transform: translate(.8px, 1.2px); }
.felt.plum .stitch rect { stroke: var(--thread); }
.felt.cream .stitch rect { stroke: var(--thread); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
.felt.cream .stitch rect.under { stroke: rgba(43,30,63,.22); }
/* the stitch that draws itself as it scrolls in */
.draw .stitch rect:not(.under) { stroke-dasharray: 11 6; }
@media (prefers-reduced-motion: no-preference) {
  .draw .stitch rect:not(.under) { stroke-dasharray: 2000; stroke-dashoffset: 2000; transition: stroke-dashoffset 1.6s ease-out; }
  .draw.in .stitch rect:not(.under) { stroke-dasharray: 11 6; stroke-dashoffset: 0; transition: none; }
}

.tag { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem .6rem; border-radius: 999px; font-family: var(--display); font-weight: 800; line-height: 1;
  background: var(--plum) url(tex/felt-plum-256.webp) center / 256px; color: var(--cream); box-shadow: 2px 3px 6px rgba(43,30,63,.25); border: 2px dashed rgba(239,227,203,.7); }
.tag.wood { background: var(--wood) url(tex/wood-256.webp) center / 256px; color: var(--ink); border-color: rgba(43,30,63,.25); }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .95rem 1.6rem; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 1.1rem; line-height: 1;
  text-decoration: none; color: var(--ink); background: var(--honey) url(tex/felt-honey-256.webp) center / 256px; box-shadow: var(--shadow); border: 2px dashed rgba(239,227,203,.8); transition: transform .15s ease, box-shadow .15s ease; }
.pill:hover { transform: translateY(-1px); box-shadow: 4px 7px 14px rgba(43,30,63,.26); }
.pill.quiet { background: var(--cream) url(tex/felt-cream-256.webp) center / 256px; }

/* --- the hero: the table --------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(2.5rem, 7vw, 5rem) min(max(7rem, 33vw), 15rem); display: grid; align-content: start; overflow: hidden; }
@media (min-width: 560px) and (max-width: 899px) { .hero { padding-bottom: min(33vw, 15rem); } }
@media (min-width: 900px) { .hero { padding-bottom: 3rem; } }
.hero .wrap { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.wordmark { width: min(78vw, 560px); height: auto; filter: drop-shadow(2px 4px 4px rgba(43,30,63,.18)); }
.hero h1 { font-family: var(--body); font-weight: 700; font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.35; color: var(--ink); max-width: 30ch; margin-top: .4rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; margin-top: .4rem; }
.hero .facts { display: flex; flex-wrap: wrap; gap: .45rem .9rem; margin: .2rem 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-weight: 700; font-size: .95rem; }
.hero .facts li::before { content: "●"; color: var(--brass); margin-right: .45rem; font-size: .6rem; vertical-align: .2em; }
.pica-bust { position: absolute; right: -2%; bottom: -2px; width: clamp(150px, 36vw, 520px); pointer-events: none; filter: drop-shadow(-3px 3px 6px rgba(43,30,63,.22)); }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } .hero-text { max-width: 640px; } }

/* the board: two cords on cream felt, drawn as the app draws them — a shadow line, the
   thread, a tick per slot — beads sized by their body and placed by their centre */
.board { --d: 40px; --pitch: 46px; --row: 58px; padding: 16px 16px; display: grid; gap: 6px; justify-self: start; width: max-content; margin-top: 1.2rem; }
@media (min-width: 560px) { .board { --d: 52px; --pitch: 60px; --row: 72px; padding: 22px 28px; gap: 8px; } }
@media (min-width: 900px) { .board { --d: 64px; --pitch: 74px; --row: 88px; padding: 26px 34px; gap: 10px; } .cord::after { height: 5px; } }
.cord { position: relative; height: var(--row); width: calc(6 * var(--pitch) + 24px); }
.cord::before, .cord::after { content: ""; position: absolute; top: 50%; left: 50%; height: 5px; width: calc(var(--cap) * var(--pitch) + 16px); transform: translate(-50%, -50%); border-radius: 3px; }
.cord::before { background: rgba(78, 53, 88, .18); margin-top: 2px; }
.cord::after { height: 4px; background: var(--thread); box-shadow: 0 1px 0 rgba(43, 30, 63, .12); }
.slots { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); height: 12px; width: calc(var(--cap) * var(--pitch)); z-index: 1;
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--pitch) / 2 - 1px), rgba(43, 30, 63, .28) 0 calc(var(--pitch) / 2 + 1px), transparent 0 var(--pitch)); }
.bead { position: absolute; width: calc(var(--d) * 1.1); height: auto; z-index: 2; top: 50%; left: calc(50% + (var(--slot) - var(--cap) / 2 + .5) * var(--pitch)); transform: translate(-50%, -50%); }
/* the run's three beads belong to the board: cord A's row centre is --ya, cord B's --yb */
.board { --ya: calc(16px + var(--row) / 2); --yb: calc(16px + var(--row) * 1.5 + 6px); }
@media (min-width: 560px) { .board { --ya: calc(22px + var(--row) / 2); --yb: calc(22px + var(--row) * 1.5 + 8px); } }
@media (min-width: 900px) { .board { --ya: calc(26px + var(--row) / 2); --yb: calc(26px + var(--row) * 1.5 + 10px); } }
.bead.run { top: var(--yb); left: calc(50% + (var(--k) - 2 + .5) * var(--pitch)); }
@media (prefers-reduced-motion: no-preference) {
  .bead.run { animation: slide 1.7s cubic-bezier(.45, 0, .2, 1) 1.2s both; }
  .bead.run[style*="--k: 1"] { animation-delay: 1.3s; } .bead.run[style*="--k: 2"] { animation-delay: 1.4s; }
  @keyframes slide {
    0%   { top: var(--ya); left: calc(50% + (var(--k) - 3 + .5) * var(--pitch)); }
    22%  { top: calc(var(--ya) - 22px); left: calc(50% + (var(--k) - 3 + .5) * var(--pitch)); }
    78%  { top: calc(var(--yb) - 22px); left: calc(50% + (var(--k) - 2 + .5) * var(--pitch)); }
    100% { top: var(--yb); left: calc(50% + (var(--k) - 2 + .5) * var(--pitch)); }
  }
  .glow { animation: close .9s ease-out 3.1s both; }
  @keyframes close { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.96); } 50% { opacity: 1; } 100% { opacity: .85; transform: translate(-50%, -50%) scale(1); } }
}
.glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: calc(var(--cap) * var(--pitch) + var(--d) * .5); height: calc(var(--d) * 1.5); border-radius: 999px; border: 3px dashed var(--honey-lit); box-shadow: 0 0 0 4px rgba(243, 196, 92, .28), 0 0 18px rgba(243, 196, 92, .45); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .glow { opacity: .85; } }

/* --- the trailer ------------------------------------------------------------------ */
.trailer { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 800px) { .trailer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.phone { position: relative; width: min(78vw, 300px); margin-inline: auto; padding: 14px; border-radius: 44px; background: var(--velvet) url(tex/velvet-256.webp) center / 256px; box-shadow: var(--shadow); }
.phone::after { content: ""; position: absolute; inset: 7px; border-radius: 38px; border: 2px dashed rgba(239,227,203,.5); pointer-events: none; }
.phone video, .phone img { border-radius: 30px; width: 100%; aspect-ratio: 886 / 1920; object-fit: cover; background: #000; }

/* --- how it plays --------------------------------------------------------------- */
.cards { display: grid; gap: 1.2rem; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { padding: 1.4rem 1.4rem 1.5rem; display: grid; gap: .6rem; align-content: start; }
.card .num { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--wood) url(tex/wood-256.webp) center / 256px; box-shadow: 1px 2px 3px rgba(43,30,63,.28); font-size: 1.25rem; }
.card p { margin: 0; }
.card svg.diagram { width: 100%; height: auto; margin-top: .3rem; }
.plum-mat { padding: clamp(1.4rem, 3.5vw, 2.4rem); }

/* --- the Thread ------------------------------------------------------------------- */
.thread { position: relative; margin-top: 1.4rem; }
.strip { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1.2rem .5rem 1.6rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.place { flex: 0 0 min(76vw, 300px); scroll-snap-align: center; position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--cream); }
.place img { width: 100%; height: auto; aspect-ratio: 480 / 298; object-fit: cover; }
.place .name { position: absolute; left: 12px; bottom: 12px; }
.strip::before, .strip::after { content: ""; flex: 0 0 var(--pad); }
.thread .line { position: absolute; left: 0; right: 0; top: calc(50% - 10px); height: 6px; border-radius: 3px; background: linear-gradient(#f7eed9, #cdbc9b); box-shadow: 0 2px 0 rgba(80,60,30,.3); z-index: -1; }

/* --- made by hand ------------------------------------------------------------------ */
.table { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 820px) { .table { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } }
.photo { margin: 0; padding: 10px; }
.photo picture, .photo img { border-radius: calc(var(--radius) - 8px); overflow: hidden; }
.objects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; align-items: end; padding: 1.4rem; margin-top: 1.4rem; }
@media (min-width: 820px) { .objects { grid-template-columns: repeat(8, 1fr); } }
.objects img { width: 100%; height: auto; filter: drop-shadow(2px 3px 4px rgba(43,30,63,.25)); }
.objects figcaption { text-align: center; font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-top: .35rem; }
.objects figure { margin: 0; }

/* --- facts ---------------------------------------------------------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.tags .tag { font-size: 1rem; padding: .7rem 1.1rem .75rem; }

/* --- pica ------------------------------------------------------------------------- */
.heads { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: 1.5rem 0; }
.heads figure { margin: 0; width: clamp(70px, 11vw, 120px); text-align: center; }
.heads img { width: 100%; aspect-ratio: 1; height: auto; object-fit: contain; border-radius: 50%; background: var(--cream) url(tex/felt-cream-256.webp) center / 256px; box-shadow: var(--shadow); padding: 8px; }
.heads figcaption { font-size: .78rem; font-weight: 700; color: var(--ink-soft); margin-top: .35rem; }

/* --- screenshots ------------------------------------------------------------------ */
.shots { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .6rem .2rem 1.4rem; }
.shots picture, .shots img { flex: 0 0 min(64vw, 240px); scroll-snap-align: start; border-radius: 22px; box-shadow: var(--shadow); }
.shots img { width: 100%; }

/* --- footer -------------------------------------------------------------------------- */
footer { padding: 2.5rem 0 3rem; }
footer .wrap { display: grid; gap: 1.2rem; }
footer nav { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; font-weight: 800; }
footer nav a { text-decoration: none; }
footer nav a:hover { text-decoration: underline; }
footer .made { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; color: var(--ink-soft); font-size: .9rem; }

/* --- document pages (support, privacy, terms, press) --------------------------------- */
.doc { padding-block: clamp(2rem, 6vw, 4rem); }
.doc .wrap { width: min(100% - 2 * var(--pad), 760px); }
.doc-head { display: flex; align-items: center; gap: 1rem; justify-content: space-between; margin-bottom: 2rem; }
.doc-head .wordmark { width: 180px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: .3rem; }
.doc h2 { font-size: 1.35rem; margin: 2.2rem 0 .7rem; padding-bottom: .35rem; border-bottom: 2px dashed rgba(43,30,63,.25); }
.doc h3 { margin: 1.4rem 0 .4rem; }
.doc ul { padding-left: 1.2rem; } .doc li { margin-bottom: .4rem; max-width: var(--measure); }
.doc .updated { color: var(--ink-soft); font-size: .9rem; margin-bottom: 1.6rem; }
.doc details { margin-bottom: .7rem; padding: .9rem 1.1rem; }
.doc details summary { cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.doc details summary::-webkit-details-marker { display: none; }
.doc details summary::after { content: "+"; font-family: var(--display); color: var(--honey-deep); }
.doc details[open] summary::after { content: "–"; }
.doc details p { margin-top: .7rem; margin-bottom: 0; }
.kit { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kit a { display: block; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: var(--cream); text-decoration: none; }
.kit a img { width: 100%; height: 150px; object-fit: contain; background: var(--cream) url(tex/felt-cream-256.webp) center / 256px; padding: 10px; }
.kit a span { display: block; padding: .5rem .7rem; font-size: .85rem; font-weight: 700; }
.facts-table { border-collapse: collapse; width: 100%; }
.facts-table th { text-align: left; padding: .45rem .8rem .45rem 0; vertical-align: top; white-space: nowrap; color: var(--ink-soft); font-weight: 800; }
.facts-table td { padding: .45rem 0; border-bottom: 1px dashed rgba(43,30,63,.2); }
