/* ==========================================================
   Carson Willis · felt story board
   Palette is locked to felt sampled from the crowns: no tints in between.
   ========================================================== */

:root {
  --board: #1E2753;
  --board-deep: #151C3E;
  --pocket: #2A3570;
  --white: #F5EFE4;
  --sky: #7FB8E6;
  --pale: #A9D2EC;
  --lilac: #E0B3E6;
  --lime: #A6DD5A;
  --blush: #F2B4BA;
  --red: #C02A36;
  --butter: #F3E38A;
  --mint: #9FD9C6;
  --choc: #4A2B21;

  --ink: var(--white);
  --ink-soft: var(--pale);

  --display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, sans-serif;
  --stitch-font: "Caveat", "Bradley Hand", cursive;

  /* fibre grain laid over every felt surface */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .15 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
           url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='turbulence' baseFrequency='.55' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .24 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");

  --stitch-blanket: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' fill='none' stroke='%234A2B21' stroke-width='1.9' stroke-linecap='round'%3E%3Crect x='2' y='2' width='44' height='44' rx='5'/%3E%3Cpath d='M24 2v7M24 46v-7M2 24h7M46 24h-7M4.5 4.5l4.5 4.5M43.5 4.5L39 9M4.5 43.5L9 39M43.5 43.5L39 39'/%3E%3C/svg%3E");
  --stitch-run: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' fill='none' stroke='%234A2B21' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M15 2h6M15 34h6M2 15v6M34 15v6M2 9V6Q2 2 6 2h3M27 2h3q4 0 4 4v3M34 27v3q0 4-4 4h-3M9 34H6q-4 0-4-4v-3'/%3E%3C/svg%3E");
  --stitch-run-sky: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' fill='none' stroke='%237FB8E6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M15 2h6M15 34h6M2 15v6M34 15v6M2 9V6Q2 2 6 2h3M27 2h3q4 0 4 4v3M34 27v3q0 4-4 4h-3M9 34H6q-4 0-4-4v-3'/%3E%3C/svg%3E");
  --stitch-ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 46'%3E%3Ccircle cx='23' cy='23' r='16.5' fill='none' stroke='%234A2B21' stroke-width='2.2' stroke-dasharray='4 3.6' stroke-linecap='round'/%3E%3C/svg%3E");

  --lift: 0 1px 1px rgb(8 11 30 / .35), 0 8px 16px -6px rgb(8 11 30 / .55);
  --lift-high: 0 2px 2px rgb(8 11 30 / .3), 0 18px 28px -10px rgb(8 11 30 / .6);
  --press: cubic-bezier(.16, 1, .3, 1);

  --gutter: clamp(16px, 4vw, 48px);
  --measure: 62ch;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--sky) var(--board-deep); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--board);
  background-image: var(--grain);
  color: var(--ink);
  font: 500 1.0625rem/1.6 var(--body);
  overflow-x: clip;
  caret-color: var(--butter);
}
::selection { background: var(--butter); color: var(--choc); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.st { fill: none; stroke: var(--t, var(--choc)); stroke-width: 2.2; stroke-dasharray: 4 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--butter); color: var(--choc); padding: .5rem 1rem; border-radius: 10px; font-weight: 800; }
.skip:focus { top: 12px; }

/* ---------- thread: authored stitches drawn as border-images ---------- */
.felt-btn, .tray, .about-felt, .lb-inner, .sizes span { position: relative; }
.felt-btn::after, .tray::after, .about-felt::after, .lb-inner::after, .sizes input:checked + span::after {
  content: "";
  position: absolute; inset: var(--si, 5px);
  border: 12px solid transparent;
  border-image: var(--stitch, var(--stitch-run)) 12 / 12px round;
  pointer-events: none;
}
.about-felt { --stitch: var(--stitch-blanket); }
.about-felt::after { border-width: 16px; border-image: var(--stitch-blanket) 16 / 16px round; }
.tray, .lb-inner { --stitch: var(--stitch-run-sky); }

/* ---------- felt-letter headings ---------- */
.felt-letters {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: .01em;
  margin: 0;
  text-wrap: balance;
}
.felt-letters .w { display: inline-block; white-space: nowrap; }
.felt-letters .ch {
  display: inline-block;
  color: var(--c);
  transform: rotate(var(--r)) translateY(var(--y));
  filter: url(#fuzz) drop-shadow(0 2px 1px rgb(8 11 30 / .45)) drop-shadow(0 7px 7px rgb(8 11 30 / .35));
}
.felt-letters.pressing .ch { animation: press-on .7s var(--press) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes press-on {
  from { transform: rotate(calc(var(--r) * 3)) translateY(calc(var(--y) - 10px)) scale(1.12); }
  to   { transform: rotate(var(--r)) translateY(var(--y)) scale(1); }
}

/* ---------- felt buttons + links ---------- */
.felt-btn {
  --c: var(--butter);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: .7rem 1.6rem;
  background-color: var(--c); background-image: var(--grain);
  color: var(--choc);
  font: 400 1.25rem/1 var(--display);
  text-decoration: none;
  border: 0;
  border-radius: 18px 14px 20px 15px;
  box-shadow: var(--lift);
  transform: rotate(-1.2deg);
  cursor: pointer;
  transition: transform .35s var(--press), box-shadow .35s var(--press);
}
.felt-btn:hover { transform: rotate(0deg) translateY(-2px); box-shadow: var(--lift-high); }
.felt-btn:active { transform: rotate(0deg) translateY(2px); box-shadow: 0 1px 1px rgb(8 11 30 / .4); }
.felt-btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.felt-btn.big { font-size: 1.6rem; min-height: 64px; padding: 1rem 2.2rem; }

.felt-link {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 44px; padding: .4rem .2rem;
  background: none; border: 0;
  color: var(--ink);
  font: 800 1.05rem/1.2 var(--body);
  text-decoration: underline dashed var(--butter) 2px;
  text-underline-offset: .35em;
  cursor: pointer;
}
.felt-link:hover { color: var(--butter); }
.felt-link svg { width: 1.1em; height: 1.1em; }

/* ---------- header ---------- */
.top {
  display: grid; justify-items: center; gap: 14px;
  padding: clamp(26px, 3vw, 40px) var(--gutter) 0;
  max-width: 1320px; margin: 0 auto;
}

/* ---------- felt garland: CARSON'S FELTS strung between two crowns ---------- */
.garland { display: block; width: 100%; text-decoration: none; color: inherit; border-radius: 12px; }
.garland-row {
  --flag: clamp(30px, 4.1vw, 60px);
  --sag: clamp(14px, 2.4vw, 34px);
  display: grid; align-items: start;
  grid-template-columns: auto 7fr auto 5fr auto;
}
.g-crown { width: clamp(46px, 5.6vw, 78px); height: auto; filter: url(#fuzz) drop-shadow(0 3px 2px rgb(8 11 30 / .45)) drop-shadow(0 8px 10px rgb(8 11 30 / .35)); position: relative; z-index: 2; margin-top: calc(var(--flag) * -.35); }
.g-left { transform: rotate(-12deg); margin-right: -6px; }
.g-right { transform: rotate(12deg); margin-left: -6px; }
.g-knot { width: calc(var(--flag) * .62); margin: calc(var(--flag) * -.3) -6px 0; position: relative; z-index: 2; filter: url(#fuzz) drop-shadow(0 3px 3px rgb(8 11 30 / .45)); transform: rotate(14deg); }
.swag { position: relative; display: block; height: calc(var(--sag) + var(--flag) * 1.25); }
.string { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--sag) * 2); overflow: visible; }
.string path { fill: none; stroke: var(--white); stroke-width: 2.4; stroke-linecap: round; opacity: .9; }
.flag {
  position: absolute;
  left: calc(var(--t) * 100%);
  top: calc(var(--f) * var(--sag) - var(--flag) * .06);
  width: var(--flag);
  transform-origin: 50% 4%;
  transform: translateX(-50%) rotate(calc(var(--r) * -11deg));
  filter: url(#fuzz) drop-shadow(0 2px 1.5px rgb(8 11 30 / .45)) drop-shadow(0 7px 8px rgb(8 11 30 / .35));
}
.flag svg { display: block; width: 100%; height: auto; overflow: visible; }
.flag .pennant, .flag .fold { fill: var(--c); }
.flag .fold { filter: brightness(.93); }
.flag text { font: 400 38px/1 var(--display); fill: var(--letter); }
.flag .apos { font-size: 30px; }
.garland:hover .flag { animation: flag-swing 1.1s var(--press); animation-delay: calc(var(--t) * 260ms); }
@keyframes flag-swing {
  30% { transform: translateX(-50%) rotate(calc(var(--r) * -11deg + 9deg)); }
  65% { transform: translateX(-50%) rotate(calc(var(--r) * -11deg - 4deg)); }
}
@media (max-width: 699px) {
  .garland-row {
    --flag: clamp(30px, 10.5vw, 44px);
    --sag: 14px;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "cl s1 s1" "s2 s2 cr";
    row-gap: 6px;
  }
  .g-left { grid-area: cl; }
  .swag-1 { grid-area: s1; }
  .swag-2 { grid-area: s2; margin-left: 14%; }
  .g-right { grid-area: cr; }
  .g-knot { display: none; }
  .g-crown { width: 44px; }
}

.top ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.top nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .85rem;
  background-color: var(--c); background-image: var(--grain);
  color: var(--choc); text-decoration: none; font-weight: 800; font-size: .95rem;
  border-radius: 12px 10px 13px 9px;
  box-shadow: var(--lift);
  transition: transform .3s var(--press);
}
.top nav li:nth-child(odd) a { transform: rotate(-2deg); }
.top nav li:nth-child(even) a { transform: rotate(1.5deg); }
.top nav a:hover { transform: rotate(0) translateY(-2px); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; gap: 28px;
  max-width: 1320px; margin: 0 auto;
  padding: clamp(20px, 3.5vw, 44px) var(--gutter) clamp(48px, 8vw, 104px);
}
.hero h1 { font-size: clamp(2.9rem, 9.6vw, 5.75rem); max-width: 11ch; position: relative; z-index: 2; }
.hook { max-width: 30ch; margin: 0; font-size: clamp(1.15rem, 1.6vw, 1.35rem); font-weight: 700; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 1.25rem; }

.hero-crown { margin: 0; position: relative; z-index: 1; }
.hero-crown .tag { margin: .9rem 0 0 1rem; transform: rotate(1deg); transition: opacity .35s ease; }
.hero-crown .tag.swapping { opacity: 0; }

/* hero carousel: every crown stacked in one cell, the active one slides in on its ribbon */
.hero-slides { display: grid; }
.hero-slide {
  grid-area: 1 / 1;
  display: grid;
  opacity: 0;
  transform: translateX(32px) rotate(1deg) scale(.97);
  transition: opacity .9s var(--press), transform 1.2s var(--press);
  pointer-events: none;
}
.hero-slide.is-active { opacity: 1; transform: rotate(-2deg); pointer-events: auto; }
.hero-slide.is-leaving { opacity: 0; transform: translateX(-32px) rotate(-5deg) scale(.97); }
.hero-slide .mount { height: 100%; display: grid; place-items: center; }

.hero-controls { display: flex; align-items: center; gap: 14px; margin: .7rem 0 0 1rem; }
.hero-dots { display: flex; gap: 6px; }
.hero-dot {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; cursor: pointer;
}
.hero-dot::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  background-color: var(--c); background-image: var(--grain);
  box-shadow: var(--lift);
  transition: transform .4s var(--press);
}
.hero-dot:hover::before { transform: scale(1.15); }
.hero-dot[aria-current="true"]::before { width: 26px; height: 26px; background-image: var(--stitch-ring), var(--grain); background-size: cover, auto, auto; transform: rotate(-8deg); }
.hero-pause {
  width: 36px; height: 36px; display: grid; place-items: center;
  background-color: var(--pocket); background-image: var(--grain);
  color: var(--white);
  border: 0; border-radius: 50%; box-shadow: var(--lift); cursor: pointer;
}
.hero-pause svg { width: 16px; height: 16px; }
.hero-pause .i-play, .hero-pause[aria-pressed="true"] .i-pause { display: none; }
.hero-pause[aria-pressed="true"] .i-play { display: block; }

/* cut-out crown laid on a length of two-tone striped ribbon */
.mount {
  position: relative;
  display: block; width: 100%;
  padding: clamp(18px, 2.4vw, 34px) clamp(30px, 4vw, 56px);
  background: none; border: 0;
  cursor: zoom-in;
  filter: drop-shadow(0 2px 2px rgb(8 11 30 / .35)) drop-shadow(0 12px 14px rgb(8 11 30 / .4));
  transform: rotate(var(--tilt, 0deg));
  transition: transform .45s var(--press), filter .45s var(--press);
}
.ribbon {
  position: absolute; inset: 0;
  /* grosgrain ribs, then the two-tone stripe running along the ribbon */
  background-color: var(--white);
  background-image:
    repeating-linear-gradient(90deg, rgb(74 43 33 / .07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(180deg, var(--c) 0 var(--stripe, 16px), var(--white) var(--stripe, 16px) calc(var(--stripe, 16px) * 2)),
    var(--grain);
  /* swallowtail ribbon ends */
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--notch, 22px)) 50%, 100% 100%, 0 100%, var(--notch, 22px) 50%);
}
.mount img {
  position: relative;
  width: 100%;
  filter: drop-shadow(0 3px 2px rgb(74 43 33 / .35)) drop-shadow(0 8px 10px rgb(74 43 33 / .22));
}
.mount:hover { transform: rotate(0deg) translateY(-4px); filter: drop-shadow(0 3px 3px rgb(8 11 30 / .35)) drop-shadow(0 20px 22px rgb(8 11 30 / .45)); }
.mount:focus-visible { outline: 3px solid var(--butter); outline-offset: 4px; }
.hero-crown .mount { --stripe: 22px; --notch: 34px; padding: clamp(22px, 3vw, 44px) clamp(40px, 5vw, 72px); }
@media (max-width: 759px) {
  .mount { --stripe: 11px; --notch: 16px; }
  .hero-crown .mount { --stripe: 14px; --notch: 20px; }
}

.tag {
  display: inline-block;
  font: 700 1.45rem/1.15 var(--stitch-font);
  color: var(--butter);
}
.tag b { font-weight: 700; color: var(--white); margin-right: .35rem; }

.loose { position: absolute; width: clamp(44px, 6vw, 78px); pointer-events: none; filter: url(#fuzz) drop-shadow(0 4px 4px rgb(8 11 30 / .45)); }
.loose-1 { right: 6%; top: 2%; transform: rotate(14deg); }
.loose-2 { left: 48%; bottom: 2%; transform: rotate(-10deg); width: clamp(40px, 5vw, 64px); }
.loose-3 { left: 3%; bottom: 6%; transform: rotate(-22deg); width: clamp(30px, 3.6vw, 48px); }

@media (min-width: 960px) {
  .hero { grid-template-columns: 4fr 7fr; align-items: start; gap: 0 2vw; }
  .hero h1 { grid-column: 1 / -1; max-width: 15ch; }
  .hero-copy { grid-column: 1; grid-row: 2; padding-top: 2.5rem; }
  .hero-crown { grid-column: 2; grid-row: 2; margin-top: -7.25rem; margin-right: calc(var(--gutter) * -1); }
  .loose-1 { right: 3%; top: 6%; }
  .loose-2 { left: 30%; bottom: 8%; }
  .loose-3 { left: 2%; bottom: 4%; }
}
.loose-4 { width: clamp(52px, 6vw, 84px); right: 7%; bottom: 4%; transform: rotate(-12deg); }
@media (max-width: 959px) {
  .hero-crown { order: 1; }
  .hero-copy { order: 2; }
  .loose-4 { right: 3%; bottom: 1%; }
  .loose-3 { display: none; }
}

/* ---------- section scaffolding ---------- */
section { scroll-margin-top: 16px; }
.section-head { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.section-head h2 { font-size: clamp(2.4rem, 6vw, 4.25rem); }
.section-head p { max-width: var(--measure); margin: .9rem 0 0; color: var(--ink-soft); font-size: 1.1rem; }
.section-head strong { color: var(--white); font-weight: 800; }

/* ---------- crown wall ---------- */
.wall { position: relative; padding: clamp(32px, 5vw, 64px) 0 clamp(24px, 3vw, 40px); }
.wall-grid {
  list-style: none; margin: clamp(36px, 5vw, 56px) auto 0; padding: 0 var(--gutter);
  max-width: 1320px;
  display: grid; gap: 34px 0;
}
.wall-grid li { position: relative; }
.wall-grid li:nth-child(odd) { width: 96%; justify-self: start; }
.wall-grid li:nth-child(even) { width: 88%; justify-self: end; }
.wall-grid li:nth-child(3n) { width: 100%; }
.wall-grid figure { margin: 0; position: relative; }
.wall-grid .tag { margin: .75rem 0 0 .5rem; font-size: 1.35rem; }
.age {
  position: absolute; z-index: 3; top: -16px; left: -10px;
  width: 52px; height: 52px; display: grid; place-items: center;
  background-color: var(--c); background-image: var(--stitch-ring), var(--grain); background-size: cover, auto, auto;
  color: var(--choc); font: 400 1.6rem/1 var(--display);
  border-radius: 50%;
  box-shadow: var(--lift);
  transform: rotate(-10deg);
  filter: url(#fuzz);
}
.wall-grid li:nth-child(even) .age { left: auto; right: -8px; transform: rotate(9deg); }
.wall-grid li:nth-child(1) .age { color: var(--white); }
@media (min-width: 900px) {
  .wall-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0; }
  .wall-grid li, .wall-grid li:nth-child(n) { width: auto; justify-self: stretch; }
  .wall-grid li:nth-child(1) { grid-area: 1 / 1 / 2 / 8; z-index: 1; }
  .wall-grid li:nth-child(2) { grid-area: 1 / 8 / 2 / 13; margin: 120px 0 0 -36px; z-index: 2; }
  .wall-grid li:nth-child(3) { grid-area: 2 / 2 / 3 / 7; margin-top: 8px; z-index: 2; }
  .wall-grid li:nth-child(4) { grid-area: 2 / 6 / 3 / 13; margin: 110px 0 0 24px; z-index: 1; }
  .wall-grid li:nth-child(5) { grid-area: 3 / 1 / 4 / 6; margin-top: 24px; z-index: 2; }
  .wall-grid li:nth-child(6) { grid-area: 3 / 5 / 4 / 12; margin: 96px 0 0 36px; z-index: 1; }
}
.wl-1 { width: clamp(64px, 8vw, 110px); right: 6%; top: clamp(20px, 4vw, 56px); transform: rotate(-8deg); }
.wl-2 { width: clamp(56px, 7vw, 96px); left: 50%; top: 47%; transform: rotate(16deg); }
.wl-3 { width: clamp(44px, 5vw, 70px); right: 5%; bottom: 10%; transform: rotate(12deg); }
.wl-4 { width: clamp(60px, 7vw, 100px); left: 4%; top: 40%; transform: rotate(-14deg); }
.mk-1 { width: clamp(40px, 4.5vw, 64px); right: 12%; top: -14px; transform: rotate(18deg); }
.mk-2 { width: clamp(46px, 5vw, 72px); right: 4%; top: 22%; transform: rotate(-8deg); }
@media (max-width: 899px) {
  .wl-2, .wl-4, .mk-2 { display: none; }
  .wl-1 { top: 18px; right: 4%; }
}

/* ---------- make it yours ---------- */
.make { position: relative; padding: clamp(32px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); }
.board {
  max-width: 1320px; margin: clamp(28px, 4vw, 48px) auto 0; padding: 0 var(--gutter);
  display: grid; gap: 24px;
  grid-template-areas: "stage" "tray" "ideas" "controls";
}
.crown-stage { grid-area: stage; }
.crown-svg { width: 100%; height: auto; overflow: visible; touch-action: none; --crown: var(--sky); }
#crown-felt { transition: fill .4s var(--press); }
.crown-svg .piece { cursor: grab; outline: none; }
.crown-svg .piece:active { cursor: grabbing; }
.crown-svg .piece use { filter: drop-shadow(0 3px 2px rgb(8 11 30 / .35)); }
.crown-svg .piece:focus-visible use { filter: drop-shadow(0 0 0 var(--butter)) drop-shadow(0 0 4px var(--butter)); }
.crown-svg .piece.pressing > g { animation: piece-on .55s var(--press) both; }
@keyframes piece-on { from { transform: scale(1.25) rotate(-8deg); } to { transform: scale(1) rotate(0); } }
.patch-num { font: 400 64px/1 var(--display); fill: var(--red); }
.name-stitch { font: 700 52px/1 var(--stitch-font); fill: var(--choc); }
.name-stitch.empty { fill-opacity: .4; }
.stage-hint { margin: .5rem 0 0; text-align: center; color: var(--ink-soft); font-size: .98rem; }

.tray {
  grid-area: tray;
  background-color: var(--pocket); background-image: var(--grain);
  border-radius: 20px 16px 22px 18px;
  --si: 6px;
  padding: 22px 26px 24px;
  box-shadow: inset 0 3px 10px rgb(8 11 30 / .45);
}
.tray-label { margin: 0 0 .4rem; font: 700 1.35rem/1 var(--stitch-font); color: var(--butter); }
.tray-pieces { display: flex; flex-wrap: wrap; gap: 6px; }
.tray-pieces button {
  width: 64px; height: 64px; padding: 6px;
  background: none; border: 0; border-radius: 14px;
  cursor: pointer;
  transition: transform .3s var(--press), background-color .2s;
}
.tray-pieces button:hover { transform: translateY(-3px) rotate(-6deg); background-color: rgb(245 239 228 / .08); }
.tray-pieces button:active { transform: scale(.92); }
.tray-pieces svg { width: 100%; height: 100%; filter: url(#fuzz) drop-shadow(0 3px 3px rgb(8 11 30 / .5)); }

.ideas { grid-area: ideas; padding: 4px 4px 0; }
.idea-chips { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 12px; }
.idea-chips button {
  min-height: 40px; padding: .35rem 1rem;
  background-color: var(--c); background-image: var(--grain);
  color: var(--choc); font: 800 .95rem/1.2 var(--body);
  border: 0; border-radius: 999px;
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform .3s var(--press);
}
.idea-chips li:nth-child(odd) button { transform: rotate(-2deg); }
.idea-chips li:nth-child(even) button { transform: rotate(1.5deg); }
.idea-chips button:hover { transform: translateY(-2px) rotate(0); }
.idea-chips button:active { transform: scale(.95); }
.controls { grid-area: controls; display: grid; gap: 18px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend, .field > .label {
  display: block; margin: 0 0 .4rem; padding: 0;
  font: 700 1.4rem/1.1 var(--stitch-font); color: var(--butter);
}
.controls input[type="text"], .controls textarea {
  width: 100%;
  padding: .75rem 1rem;
  background-color: var(--white); background-image: var(--grain);
  color: var(--choc);
  font: 700 1.05rem/1.4 var(--body);
  border: 0; border-radius: 14px 11px 15px 12px;
  box-shadow: inset 0 2px 4px rgb(74 43 33 / .25);
  resize: vertical;
}
.controls input::placeholder, .controls textarea::placeholder { color: #74574b; }
.controls input:focus-visible, .controls textarea:focus-visible { outline: 3px solid var(--butter); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper output {
  min-width: 2.4ch; text-align: center;
  font: 400 2.2rem/1 var(--display); color: var(--white);
  font-variant-numeric: tabular-nums;
}
.step {
  width: 48px; height: 48px; display: grid; place-items: center;
  background-color: var(--white); background-image: var(--grain);
  color: var(--choc);
  border: 0; border-radius: 50%;
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform .25s var(--press);
}
.step svg { width: 22px; height: 22px; }
.step:hover { transform: translateY(-2px); }
.step:active { transform: translateY(1px) scale(.95); }
.step:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches label { position: relative; cursor: pointer; }
.swatches input, .sizes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatches span {
  display: block; width: 46px; height: 46px; border-radius: 50%;
  background-color: var(--c); background-image: var(--grain);
  box-shadow: var(--lift);
  transition: transform .3s var(--press);
}
.swatches input:checked + span { background-image: var(--stitch-ring), var(--grain); transform: scale(1.12) rotate(-6deg); }
.swatches input:focus-visible + span { box-shadow: 0 0 0 3px var(--board), 0 0 0 6px var(--butter); }

.sizes { display: flex; flex-wrap: wrap; gap: 10px; }
.sizes label { cursor: pointer; }
.sizes span {
  display: inline-flex; align-items: center; min-height: 44px; padding: .4rem 1rem;
  background-color: var(--pocket); background-image: var(--grain);
  color: var(--white); font-weight: 800;
  border-radius: 12px 10px 13px 9px;
  box-shadow: var(--lift);
  transition: transform .3s var(--press), background-color .2s;
}
.sizes input:checked + span { background-color: var(--mint); color: var(--choc); transform: rotate(-2deg); --si: 2px; }
.sizes span { padding-inline: 1.2rem; }
.sizes input:focus-visible + span { box-shadow: 0 0 0 3px var(--butter); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 4px; }
.fine { margin: 0; color: var(--ink-soft); font-size: .92rem; }

@media (min-width: 1000px) {
  .board {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: "stage controls" "tray controls" "ideas controls";
    grid-template-rows: auto auto 1fr;
    align-items: start; gap: 28px 48px;
  }
  .crown-stage { padding-top: 24px; }
}

/* ---------- about ---------- */
.about {
  max-width: 1320px; margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(40px, 7vw, 96px);
  display: grid; gap: 32px; align-items: center;
}
.about-felt {
  position: relative;
  max-width: 640px;
  padding: clamp(34px, 4.6vw, 52px);
  background-color: var(--lilac); background-image: var(--grain);
  color: var(--choc);
  border-radius: 26px 20px 30px 22px;
  --si: 10px;
  box-shadow: var(--lift-high);
  transform: rotate(-1.2deg);
}
.about-felt h2 { font-size: clamp(2.3rem, 5vw, 3.5rem); margin-bottom: .6rem; }
.about-felt h2 .ch { filter: url(#fuzz) drop-shadow(0 2px 1px rgb(74 43 33 / .35)); }
.about-felt p { margin: .8rem 0 0; font-size: 1.1rem; max-width: 52ch; }
.about-felt em { font-style: normal; font: 700 1.45rem/1 var(--stitch-font); padding-right: .15em; }
.pocket { width: min(100%, 420px); height: auto; justify-self: center; filter: drop-shadow(0 10px 14px rgb(8 11 30 / .45)); transform: rotate(3deg); }
@media (min-width: 900px) {
  .about { grid-template-columns: 1.4fr 1fr; }
}

/* ---------- say hi ---------- */
.hello {
  max-width: 900px; margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(64px, 10vw, 128px);
  text-align: center;
  display: grid; justify-items: center; gap: 18px;
}
.hello h2 { font-size: clamp(3rem, 9vw, 5.5rem); }
.hello p { max-width: 46ch; margin: 0; font-size: 1.15rem; color: var(--ink-soft); }
.hello .felt-btn { margin-top: 10px; }
.mail-plain { font: 700 1.4rem/1 var(--stitch-font); color: var(--butter) !important; }

.foot {
  padding: 28px var(--gutter) 36px;
  text-align: center; color: var(--ink-soft); font-size: .95rem;
  border-top: 2px dashed rgb(169 210 236 / .35);
}
.foot p { margin: 0; }

/* ---------- lightbox ---------- */
dialog {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0; border: 0;
  background: transparent; color: var(--ink);
  overflow: visible;
}
dialog::backdrop { background: rgb(13 17 40 / .82); }
dialog[open] .lb-inner { animation: lb-in .45s var(--press); }
@keyframes lb-in { from { transform: translateY(14px) rotate(-1deg) scale(.97); opacity: .4; } }
.lb-inner {
  position: relative;
  max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: clamp(24px, 3.4vw, 40px);
  background-color: var(--board); background-image: var(--grain);
  border-radius: 24px 20px 26px 22px;
  --si: 8px;
  box-shadow: var(--lift-high);
  display: grid; gap: 20px;
  padding-top: clamp(56px, 6vw, 64px);
}
.lb-photo { padding: 8px clamp(4px, 2vw, 24px) 0; }
.lb-photo img { width: 100%; filter: drop-shadow(0 10px 14px rgb(8 11 30 / .55)); }
.lb-info { display: grid; gap: 16px; align-items: start; }
.lb-info h3 { margin: 0; font: 400 clamp(1.8rem, 4vw, 2.6rem)/1.05 var(--display); color: var(--butter); }
.lb-info p { margin: .3rem 0 0; color: var(--ink-soft); max-width: 52ch; }
.closeup { display: flex; align-items: center; gap: 14px; }
.closeup-lens {
  flex: none;
  width: 168px; height: 168px; border-radius: 50%;
  background-repeat: no-repeat; background-size: 1600px auto;
  background-color: var(--white);
  box-shadow: 0 0 0 7px var(--white), 0 0 0 9px var(--choc), var(--lift-high);
}
.closeup-label { margin: 0 !important; font: 700 1.6rem/1 var(--stitch-font); color: var(--white) !important; transform: rotate(-4deg); }
.lb-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 46px; height: 46px; display: grid; place-items: center;
  background-color: var(--butter); background-image: var(--grain); color: var(--choc);
  border: 0; border-radius: 50%; box-shadow: var(--lift); cursor: pointer;
}
.lb-close svg { width: 20px; height: 20px; }
.lb-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lb-count { font: 700 1.3rem/1 var(--stitch-font); color: var(--ink-soft); }
@media (min-width: 820px) {
  .lb-info { grid-template-columns: 1fr auto; }
}

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

/* ---------- small screens ---------- */
@media (max-width: 959px) {
  .loose-1 { top: auto; bottom: 30%; right: 4%; }
}
@media (max-width: 759px) {
  .crown-stage { margin-inline: calc(var(--gutter) * -1 + 4px); }
  .hero-crown { margin-inline: -6px; }
}

@media (max-width: 999px) {
  .crown-stage {
    position: sticky; top: 0; z-index: 4;
    padding: 10px 4px 4px;
    background-color: var(--board); background-image: var(--grain);
    box-shadow: 0 14px 14px -12px rgb(8 11 30 / .7);
  }
  .stage-hint { font-size: .85rem; margin-top: 0; padding-bottom: 6px; }
}

@media (max-width: 420px) {
  .top nav a { padding: .3rem .65rem; font-size: .9rem; }
  .top ul { gap: .4rem; }
}
