/* vakana.mg — site styles
   ------------------------------------------------------------------
   Cappuccino palette (cream + espresso), warm serif body, Caveat for
   the rare handwritten label (chapter pendants, signatures).
   No web-fonts CDN call. If `Caveat.woff2` isn't dropped into
   ./fonts/, the stack falls through to system cursive — acceptable
   degradation. Body falls through to Charter / Iowan / Cambria.
   ------------------------------------------------------------------
   Theming is via CSS custom properties on :root, overridden under
   [data-theme="dark"]. The toggle script just flips that attribute.
*/

/* ---- self-hosted accent font (optional) ----------------------------- */
@font-face {
  font-family: 'Caveat';
  src: url('./fonts/Caveat.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---- palette --------------------------------------------------------- */
:root {
  --bg:           #f5ead5;        /* cappuccino cream */
  --surface:      #ebe0c9;
  --surface-mute: rgba(43, 29, 20, 0.06);
  --ink:          #2b1d14;        /* espresso */
  --ink-mute:     #6b513c;
  --ink-faint:    #a89378;
  --primary:      #8b5e3c;
  --on-primary:   #fff8ec;
  --border:       #d6c5a7;
  --border-strong:#bba47e;
  --gold:         #c9a368;
  --paper-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 12px 32px -16px rgba(43,29,20,0.18);

  --serif: 'Charter', 'Bitstream Charter', 'Iowan Old Style',
           'Sitka Text', Cambria, 'Palatino Linotype', Palatino,
           'URW Palladio L', Georgia, serif;
  --hand:  'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Bradley Hand',
           cursive;
  --sans:  system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
           sans-serif;

  --measure: 36rem;               /* the comfortable line-length */
}

[data-theme="dark"] {
  --bg:           #1c1310;
  --surface:      #2a1f1a;
  --surface-mute: rgba(235, 224, 201, 0.07);
  --ink:          #ebe0c9;
  --ink-mute:     #a89378;
  --ink-faint:    #6b513c;
  --primary:      #c9a368;
  --on-primary:   #1c1310;
  --border:       #3d2e25;
  --border-strong:#5a4536;
  --gold:         #c9a368;
  --paper-shadow: 0 1px 0 rgba(0,0,0,0.20), 0 16px 40px -16px rgba(0,0,0,0.6);
}

/* honor the system if the user hasn't explicitly chosen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #1c1310;
    --surface:      #2a1f1a;
    --surface-mute: rgba(235, 224, 201, 0.07);
    --ink:          #ebe0c9;
    --ink-mute:     #a89378;
    --ink-faint:    #6b513c;
    --primary:      #c9a368;
    --on-primary:   #1c1310;
    --border:       #3d2e25;
    --border-strong:#5a4536;
    --gold:         #c9a368;
    --paper-shadow: 0 1px 0 rgba(0,0,0,0.20), 0 16px 40px -16px rgba(0,0,0,0.6);
  }
}

/* ---- reset & base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  font-feature-settings: 'kern', 'liga', 'onum';
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 280ms ease, color 280ms ease;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--primary); color: var(--primary); }

::selection { background: var(--primary); color: var(--on-primary); }

img, svg { max-width: 100%; height: auto; display: block; }

/* ---- layout ---------------------------------------------------------- */
.wrap { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: var(--measure); margin-left: auto; margin-right: auto; }

/* ---- header --------------------------------------------------------- */
.site-head {
  padding: 1.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--ink); }
.brand .tld { color: var(--ink-faint); font-style: italic; }

.head-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.head-nav a { color: var(--ink-mute); text-decoration: none; }
.head-nav a:hover { color: var(--primary); }

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-mute);
  border-radius: 999px;
  width: 2rem; height: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 200ms ease, color 200ms ease;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--primary); }

/* ---- hero ----------------------------------------------------------- */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero-mg {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

/* The hero wordmark SVG sits inside .hero-mg and inherits its color via
   fill="currentColor". Sized by height so the 3:1 aspect stays clean. */
.hero-logo {
  display: block;
  height: clamp(64px, 8vw, 128px);
  width: auto;
  margin: 0 auto;
  color: var(--ink);
}
.hero-en {
  font-family: var(--hand);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--ink-mute);
  margin: 0.25rem 0 1.5rem;
  font-weight: 400;
}
.hero-line {
  font-size: 1.1rem;
  color: var(--ink-mute);
  max-width: 30rem;
  margin: 0 auto;
}

/* the chain centerpiece */
.chain-stage {
  margin: 2.5rem auto 0;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  color: var(--border-strong);
  padding: 0 1rem;
}
.chain-stage::-webkit-scrollbar { display: none; }
.chain-stage svg { max-width: 100%; height: auto; }

/* chain reveal animation — connector first, then beads, sequential */
.chain-stage .vk-thread {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: draw 1200ms ease-out 200ms forwards;
}
.chain-stage .vk-bead {
  opacity: 0;
  transform-box: fill-box;       /* `center` = bead's own center, not SVG root */
  transform-origin: center;
  animation: pop 380ms cubic-bezier(.18,.89,.32,1.28) forwards;
  animation-delay: calc(900ms + var(--i, 0) * 95ms);
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop  { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .chain-stage .vk-thread, .chain-stage .vk-bead { animation: none; opacity: 1; stroke-dashoffset: 0; transform: none; }
}

/* ---- sections ------------------------------------------------------- */
section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
section:first-of-type { border-top: none; }

.s-eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.4rem;
  text-align: center;
}
.s-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 400;
  margin: 0 0 0.1rem;
  text-align: center;
  color: var(--ink);
}
.s-sub {
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--ink-mute);
  text-align: center;
  margin: 0 0 2rem;
}
.s-body p {
  margin: 0 0 1rem;
  hyphens: auto;
}
.s-body p:last-child { margin-bottom: 0; }

/* small dropcap on the first paragraph of each section body */
.s-body.has-dropcap > p:first-child::first-letter {
  font-style: italic;
  font-size: 3.4rem;
  line-height: 0.9;
  float: left;
  padding: 0.35rem 0.55rem 0 0;
  color: var(--primary);
  font-weight: 500;
}

/* ---- the eight shapes display (grammar gallery) --------------------- */
.bead-gallery {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin: 2rem auto 0;
  max-width: 30rem;
  color: var(--ink);
}
.bead-gallery > div {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.bead-gallery svg { width: 64%; height: 64%; }
@media (max-width: 520px) {
  .bead-gallery { grid-template-columns: repeat(4, 1fr); max-width: 18rem; }
}

/* ---- composer ------------------------------------------------------- */
.composer {
  margin: 2rem auto 0;
  max-width: 34rem;
  padding: 1.75rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--paper-shadow);
}
.composer-preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px;
  margin-bottom: 1.25rem;
}
.composer-preview svg { width: 80px; height: 80px; transition: transform 200ms ease; }
.composer-preview:hover svg { transform: rotate(-2deg) scale(1.04); }

.composer-row { margin-bottom: 1rem; }
.composer-row:last-child { margin-bottom: 0; }
.composer-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
  display: block;
}
.swatches {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.swatch {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
  width: 2.4rem; height: 2.4rem;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease, transform 100ms ease;
}
.swatch:hover { border-color: var(--border-strong); }
.swatch:active { transform: scale(0.94); }
.swatch[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--surface-mute);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.swatch svg { width: 100%; height: 100%; pointer-events: none; }

.mood-swatch {
  width: 2rem; height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform 100ms ease, box-shadow 160ms ease;
}
.mood-swatch:hover { transform: scale(1.06); }
.mood-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}

.glyph-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  outline: none;
  transition: border-color 160ms ease;
}
.glyph-input:focus { border-color: var(--primary); }

.composer-meta {
  margin-top: 1.25rem;
  text-align: center;
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--ink-mute);
}
.composer-hint {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ---- calendar mini ------------------------------------------------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: 22rem;
  margin: 2rem auto 0;
}
.cal > div {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface-mute);
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 3px;
  font-family: var(--sans);
  font-size: 0.65rem;
  color: var(--ink-faint);
  position: relative;
}
.cal .d1 { background: rgba(139, 94, 60, 0.22); color: var(--ink-mute); }
.cal .d2 { background: rgba(139, 94, 60, 0.42); color: var(--on-primary); }
.cal .d3 { background: rgba(139, 94, 60, 0.65); color: var(--on-primary); }
.cal .today { box-shadow: 0 0 0 2px var(--primary) inset; border-radius: 4px; }
.cal .bell::before {
  content: '';
  position: absolute; top: 4px; left: 4px;
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--primary);
}

/* ---- closing / CTA -------------------------------------------------- */
.closing { text-align: center; padding: 5rem 0; }

/* the year, closed — the page's visual climax */
.closing-loop {
  display: flex;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--border-strong);
  opacity: 0;
  animation: fadeUp 900ms ease-out 200ms forwards;
}
.closing-loop svg {
  width: clamp(180px, 26vw, 280px);
  height: auto;
  filter: drop-shadow(0 4px 14px rgba(43, 29, 20, 0.10));
}
.closing-loop-caption {
  text-align: center;
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--ink-mute);
  margin: 0 0 2.5rem;
  opacity: 0;
  animation: fadeUp 900ms ease-out 500ms forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .closing-loop, .closing-loop-caption { opacity: 1; animation: none; }
}

.closing-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 auto 2rem;
  max-width: 32rem;
}
.closing-quote .verb { color: var(--primary); }

.cta {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: background 200ms ease, transform 100ms ease;
}
.cta:hover { background: var(--primary); color: var(--on-primary); }
.cta:active { transform: scale(0.97); }

/* ---- footer --------------------------------------------------------- */
.site-foot {
  margin-top: auto;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-align: center;
}
.foot-loop {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--border-strong);
}
.foot-loop svg { width: 64px; height: 64px; opacity: 0.55; }   /* quiet echo of the closing loop */
.foot-line { margin: 0.3rem 0; }
.foot-line .dot { margin: 0 0.5rem; color: var(--border-strong); }
.foot-line a { color: inherit; text-decoration-color: var(--border); }

/* ---- coming-soon page ---------------------------------------------- */
.cs-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.cs-bead {
  margin-bottom: 2rem;
  width: 180px;
  height: 180px;
  display: flex; align-items: center; justify-content: center;
  animation: floatY 5s ease-in-out infinite;
}
.cs-bead svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 14px rgba(43,29,20,0.18)); }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .cs-bead { animation: none; }
}
.cs-mg {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

/* The coming-soon wordmark SVG — same pattern as .hero-logo, slightly
   smaller to keep the page restrained. */
.cs-logo {
  display: block;
  height: clamp(54px, 6.5vw, 96px);
  width: auto;
  margin: 0 auto;
  color: var(--ink);
}
.cs-en {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--ink-mute);
  margin: 0 0 2rem;
}
.cs-line {
  color: var(--ink-mute);
  max-width: 24rem;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}
.cs-mail {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}
.cs-mail:hover { color: var(--primary); border-color: var(--primary); }
.cs-mail .arrow { margin-left: 0.35rem; transition: transform 200ms ease; display: inline-block; }
.cs-mail:hover .arrow { transform: translateX(3px); }

/* ---- coming-soon page (restructured: prose + chain + glimpse) ------ */
.cs-head {
  text-align: center;
  margin-bottom: 2.5rem;
}
.cs-prose {
  max-width: 36rem;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  text-align: left;
}
.cs-prose > p {
  margin: 0 0 1.4rem;
}
.cs-prose .cs-coming {
  margin: 2rem 0 0;
  text-align: center;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink-mute);
}
.cs-chain {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.75rem auto;
  color: var(--border-strong);
  overflow-x: auto;
  scrollbar-width: none;
}
.cs-chain::-webkit-scrollbar { display: none; }
.cs-chain svg { max-width: 100%; height: auto; }

@media (min-width: 900px) {
  .cs-prose { max-width: 40rem; font-size: 1.1rem; }
  .cs-stage { padding: 4rem 2rem; }
}

/* ---- coming-soon glimpse — three beaded days ----------------------- */
.cs-glimpse {
  margin: 2.5rem auto 2rem;
  padding: 1.25rem 1.4rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 30rem;
  box-shadow: var(--paper-shadow);
}
.cs-week {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cs-day {
  display: grid;
  grid-template-columns: 28px 22px 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 6px 0;
}
.cs-day + .cs-day { border-top: 1px dashed var(--border); }
.cs-day-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.cs-day-bead {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-day-bead svg { width: 18px; height: 18px; }
.cs-day-note {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-mute);
  font-size: 0.98rem;
}
.cs-glimpse-caption {
  margin: 0.8rem 0 0;
  text-align: center;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--ink-faint);
}

/* ---- in-progress page (logo + Malagasy line, max restraint) -------- */
.ip-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

/* Outer wrapper handles the fade-up entry; inner SVG runs the breath.
   Keeping the two transforms on different elements avoids a fight. */
.ip-logo-wrap {
  margin: 0 0 2rem;
  opacity: 0;
  transform: translateY(8px);
  animation: ip-enter 1100ms ease-out 150ms forwards;
}
.ip-logo {
  display: block;
  height: clamp(80px, 11vw, 160px);
  width: auto;
  color: var(--ink);
  animation: ip-breath 7s ease-in-out 1.5s infinite;
}

.ip-line {
  font-family: var(--hand);
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  color: var(--ink-mute);
  font-style: italic;
  margin: 0;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(8px);
  animation: ip-enter 1100ms ease-out 700ms forwards;
}

.ip-gloss {
  font-family: var(--serif);
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-style: italic;
  margin: 0.6rem 0 0;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  animation: ip-enter 1100ms ease-out 1100ms forwards;
}

@keyframes ip-enter {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ip-breath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .ip-logo-wrap, .ip-line, .ip-gloss { opacity: 1; transform: none; animation: none; }
  .ip-logo { animation: none; }
}

/* ---- 404 page ------------------------------------------------------- */
.nf {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
}
.nf-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 18rem;
  margin-bottom: 2rem;
}
.nf-cal > div {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface-mute);
  position: relative;
}
.nf-cal .has-bead {
  display: flex; align-items: center; justify-content: center;
  opacity: 0.45;
}
.nf-cal .has-bead svg { width: 60%; height: 60%; }
.nf-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0 0 0.5rem;
  max-width: 24rem;
}
.nf-link {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

/* ---- prose links ---------------------------------------------------- */
.s-body a { text-underline-offset: 3px; text-decoration-color: var(--border-strong); }

/* ---- responsive padding tweaks ------------------------------------- */
@media (max-width: 540px) {
  .composer { padding: 1.25rem 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  section { padding: 3rem 0; }
}

/* ---- desktop scale-up ---------------------------------------------- */
/* The page was sized for phone reading; on desktop the visual elements
   (chain, composer, gallery, calendar, closing loop) get to breathe and
   fill the horizontal real estate. Prose text columns stay around 36rem
   — that's deliberate typography (45–75 chars per line), not under-use
   of the screen. */
@media (min-width: 900px) {
  body { font-size: 19px; }

  .wrap { max-width: 76rem; padding: 0 2.5rem; }

  section { padding: 5.5rem 0; }
  .hero   { padding: 5rem 0 3.5rem; }

  /* Hero & example chains: capped at roughly their native rendered
     width so the SVG doesn't upscale and balloon each bead. Hero
     renders ~620px native at size=56 / 7 beads; example renders ~410px
     at size=44 / 6 beads. */
  .hero .chain-stage { max-width: min(94vw, 640px); margin: 2.5rem auto 0; }
  #example-thread    { max-width: min(94vw, 460px); margin: 2rem auto 0; }

  /* Bead gallery: modest 30rem cap so the row stays restrained. */
  .bead-gallery {
    max-width: 30rem;
    gap: 0.55rem;
  }
  .bead-gallery svg { width: 60%; height: 60%; }

  /* Composer: two-column on desktop. Preview sticky on the left,
     controls flow on the right. Meta + hint span both. */
  .composer {
    max-width: 50rem;
    padding: 2.25rem 2.25rem;
    display: grid;
    grid-template-columns: 180px 1fr;
    grid-template-areas:
      "preview controls"
      "meta    meta"
      "hint    hint";
    column-gap: 2rem;
    row-gap: 1.25rem;
    align-items: start;
  }
  .composer-preview {
    grid-area: preview;
    margin-bottom: 0;
    min-height: 150px;
    position: sticky;
    top: 1.5rem;
  }
  .composer-preview svg { width: 132px; height: 132px; }
  .composer-controls { grid-area: controls; }
  .composer-meta { grid-area: meta; margin-top: 0.5rem; }
  .composer-hint { grid-area: hint; }

  /* Calendar: bigger, more legible */
  .cal {
    max-width: 32rem;
    gap: 6px;
  }
  .cal > div { font-size: 0.78rem; padding: 5px; }

  /* Closing CTA: bigger on desktop */
  .closing-quote { font-size: 1.85rem; max-width: 36rem; }
  .closing { padding: 6rem 0; }
}

@media (min-width: 1400px) {
  body { font-size: 20px; }
  .wrap { max-width: 84rem; }
  /* On very wide screens, give the chain a touch more presence but
     still keep it modest — `auto` lets it center at native render size
     when smaller than the cap. */
  .hero .chain-stage { max-width: min(92vw, 720px); }
  #example-thread    { max-width: min(92vw, 540px); }
}
