/* ==========================================================================
   Stitch: landing page
   Built on the scrollcraft engine (vendor/scrollcraft): this file themes its
   tokens and styles the page's own markup. The engine's devices are untouched.
   Brand: "The Twisted Skein" (Stitch Branding Presentation, concept 03).
   ========================================================================== */

:root {
  /* Brand */
  --brown: #9A643E;
  --cocoa: #6B4327;
  --cocoa-deep: #4E2F1B;
  --tan: #CF9669;
  --marigold: #E98945;
  --paper: #FFF7EC;
  --cream: #FFF0D8;
  --sand: #F5E2C8;
  --card: #FFFCF6;
  --ink: #231F20;
  --ink-2: #6E5D51;
  --night: #22160F;
  --line: rgba(154, 100, 62, 0.18);
  --line-strong: rgba(154, 100, 62, 0.32);
  --dye-flat: #A86B42;   /* the live yarn colour; main.js keeps it in sync with the 3D thread */

  /* Engine tokens: six colours, two faces */
  --sc-canvas: #FFF0D8;
  --sc-surface: #FFFCF6;
  --sc-ink: #231F20;
  --sc-ink-soft: #6E5D51;
  --sc-accent: #6B4327;
  --sc-accent-ink: #FFF0D8;
  --sc-font-display: "Italiana", "Didot", "Bodoni 72", serif;
  --sc-font-text: "Figtree", "Avenir Next", system-ui, sans-serif;
  --sc-shadow-color: 25 45% 16%;

  --gutter: clamp(18px, 4vw, 56px);
  --max: 1320px;
  --header-h: 76px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --pill: 999px;
  --ease: cubic-bezier(.2, .8, .25, 1);
}

/* ---------- Base ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
body { font-size: 17px; line-height: 1.6; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .07; mix-blend-mode: multiply;
  background-image: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .12 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--cocoa); color: var(--cream); padding: 10px 16px; border-radius: var(--pill);
  text-decoration: none; font-weight: 600; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }
.midnight :focus-visible, .mission :focus-visible { outline-color: var(--cream); }

/* ---------- The yarn stage (fixed, above the page) ---------- */
.stage {
  position: fixed; left: 0; top: 0; z-index: 4;
  width: 100%; height: 100lvh;
  pointer-events: none;
  opacity: 0; transition: opacity .8s var(--ease);
}
.has-stage .stage { opacity: 1; }
/* Anything that sits above the thread, so the thread passes underneath it. */
.over-thread { position: relative; z-index: 5; }
/* Pinned stages are their own layer. These two sit above the thread (it weaves
   under the phone and the makes); the others stay below it. */
.substance, .community { --sc-z-stage: 6; }

/* ---------- Type ---------- */
.display-2 {
  font-family: var(--sc-font-display); font-weight: 400;
  font-size: clamp(42px, 5vw, 78px); line-height: .98; letter-spacing: -0.01em;
  color: var(--cocoa); text-wrap: balance;
}
.lede { font-size: clamp(17px, 1.3vw, 19px); color: var(--ink-2); max-width: 44ch; text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 28px; border-radius: var(--pill);
  font-weight: 600; font-size: 16px; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color .18s var(--ease), transform .14s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-sm { height: 42px; padding: 0 20px; font-size: 15px; }
.btn-primary { background: var(--cocoa); color: var(--cream); }
@media (hover: hover) { .btn-primary:hover { background: var(--cocoa-deep); } }

/* ---------- Header: the logo and one action ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(255, 247, 236, 0.86);
  -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brown); }
.brand-mark { height: 34px; width: auto; aspect-ratio: 196.7 / 208.4; }
.brand-word { height: 26px; width: auto; aspect-ratio: 376 / 149.7; }

/* ==========================================================================
   1 · Hero
   ========================================================================== */
.hero {
  position: relative; overflow: clip;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 2vh) 0 clamp(32px, 6vh, 64px);
  background: var(--cream);
}
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); display: grid; gap: clamp(28px, 5vh, 60px); }
.hero-mast {
  --wm-w: min(62vw, calc((100svh - 440px) * 2.51), 980px);
  --wm-h: calc(var(--wm-w) * .398);
  display: flex; justify-content: center; align-items: flex-start;
  gap: calc(var(--wm-w) * .035);
}
.hero-wordmark { width: var(--wm-w); height: var(--wm-h); color: var(--brown); flex: none; }
.hero-ball { position: relative; flex: none; width: calc(var(--wm-h) * .8); aspect-ratio: 1; margin-top: calc(var(--wm-h) * .175); }
.ball-fallback { display: none; width: 100%; height: 100%; object-fit: contain; }
.no-webgl .ball-fallback { display: block; }

.hero-foot { display: grid; justify-items: center; text-align: center; gap: 16px; }
.hero-title {
  font-family: var(--sc-font-display); font-weight: 400;
  font-size: clamp(40px, 4.4vw, 70px); line-height: 1; letter-spacing: -0.01em;
  color: var(--cocoa);
}
.hero-lede { color: var(--ink-2); max-width: 46ch; font-size: clamp(17px, 1.25vw, 19px); text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 10px; }

/* Near plane: knitting on a needle, slightly out of focus, passing faster than the page. */
.hero-needle {
  position: absolute; z-index: 5;
  left: -3vw; bottom: -10vh;
  width: min(30vw, 440px); max-width: none; height: auto;
  rotate: 16deg;
  filter: blur(1.4px) drop-shadow(0 28px 36px rgba(78, 47, 27, .28));
  pointer-events: none;
}

.yarn-picker { display: flex; align-items: center; gap: 12px; }
.yarn-picker[hidden] { display: none; }
.yarn-label { font-size: 14px; color: var(--ink-2); }
.yarn-chips { display: flex; gap: 8px; }
.chip-dye {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--chip);
  box-shadow: inset 0 0 0 1px rgba(35, 31, 32, 0.12);
  transition: box-shadow .2s var(--ease), transform .15s var(--ease);
}
@media (hover: hover) { .chip-dye:hover { transform: scale(1.08); } }
.chip-dye[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(35, 31, 32, 0.12), 0 0 0 3px var(--cream), 0 0 0 4.5px var(--cocoa); }

/* One orchestrated entrance. */
.js .hero-wordmark, .js .hero-foot > * { opacity: 0; transform: translateY(14px); }
.js .is-loaded .hero-wordmark, .js .is-loaded .hero-foot > * { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.js .is-loaded .hero-foot > :nth-child(1) { transition-delay: .25s; }
.js .is-loaded .hero-foot > :nth-child(2) { transition-delay: .32s; }
.js .is-loaded .hero-foot > :nth-child(3) { transition-delay: .39s; }

/* ==========================================================================
   2 · Midnight
   ========================================================================== */
.midnight { color: var(--cream); }
.midnight-stage {
  display: flex; align-items: center;
  background:
    radial-gradient(70% 60% at 24% 50%, rgba(201, 132, 77, .16), transparent 70%),
    var(--night);
}
.midnight-copy { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); display: grid; gap: 20px; }
.midnight-time {
  font-family: var(--sc-font-display); font-weight: 400;
  font-size: clamp(72px, 10vw, 160px); line-height: .9; letter-spacing: -0.01em;
  color: var(--cream); margin-bottom: 8px;
}
.midnight-line { font-size: clamp(20px, 1.9vw, 28px); font-weight: 500; line-height: 1.4; letter-spacing: .005em; color: #E8CDAE; max-width: 30ch; }
.midnight-line-last { color: var(--cream); }

/* ==========================================================================
   3 · The turn
   ========================================================================== */
.turn { position: relative; padding-block: clamp(110px, 13vw, 180px); }
.turn-ground { position: absolute; inset: 0; background: var(--cream); }
.turn-grid {
  position: relative; width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
  display: grid; gap: 56px; align-items: center;
}
@media (min-width: 900px) { .turn-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8vw; } }
.turn-copy { display: grid; gap: 28px; justify-items: start; }
.ask {
  max-width: 34ch; padding: 14px 18px; border-radius: 20px 20px 20px 6px;
  background: var(--cocoa); color: var(--cream); font-size: 16px; line-height: 1.45;
}
.knit-reply { display: grid; gap: 14px; }
.knit-by { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--brown); }
.knit-by svg { width: 22px; height: 22px; color: var(--brown); }
.answer {
  font-family: var(--sc-font-display); font-weight: 400;
  font-size: clamp(32px, 3.4vw, 54px); line-height: 1.08; letter-spacing: -0.005em;
  color: var(--cocoa); max-width: 19ch; text-wrap: pretty;
}
.turn-note { color: var(--ink-2); max-width: 44ch; }
.turn-photo { overflow: hidden; aspect-ratio: 4 / 5; max-height: 72vh; border-radius: 50% 50% var(--r-lg) var(--r-lg) / 40% 40% var(--r-lg) var(--r-lg); background: var(--sand); }
.turn-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; }

/* ==========================================================================
   4 · What it does
   ========================================================================== */
.substance-stage { display: flex; align-items: center; }
.substance-grid {
  width: 100%; max-width: var(--max); margin-inline: auto; padding: var(--header-h) var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8vw; align-items: center;
}
.substance-copy { display: grid; gap: clamp(24px, 4vh, 44px); max-width: 540px; }
.features { display: grid; gap: 4px; }
.feature {
  width: 100%; text-align: left; display: grid; gap: 6px;
  padding: 12px 0 14px; border-top: 1px solid var(--line);
  opacity: .42; transition: opacity .35s var(--ease);
}
.feature[aria-current="true"] { opacity: 1; }
@media (hover: hover) { .feature:hover { opacity: .8; } .feature[aria-current="true"]:hover { opacity: 1; } }
.feature-title { font-family: var(--sc-font-display); font-size: clamp(26px, 2.2vw, 34px); line-height: 1.05; color: var(--cocoa); }
.feature-body { color: var(--ink-2); font-size: 16px; max-width: 44ch; }


/* Phone (the app, dressed in the new brand) */
.phone-wrap { display: grid; place-items: center; }
.phone {
  --pw: 340px;
  position: relative;
  width: var(--pw); height: calc(var(--pw) * 2.06);
  padding: 11px; border-radius: 54px;
  background: var(--ink);
  box-shadow: 0 60px 100px -50px rgba(78, 47, 27, .6), inset 0 0 0 2px #3B3334;
}
.phone-notch {
  position: absolute; top: 22px; left: 50%; z-index: 5; transform: translateX(-50%);
  width: 96px; height: 28px; border-radius: 20px; background: var(--ink);
}
.screen {
  position: absolute; inset: 11px; overflow: hidden;
  border-radius: 44px; background: #FFFBF4;
  padding: 0 16px 24px;
  font-size: 13px; line-height: 1.4; color: var(--ink);
}
.status { display: flex; justify-content: space-between; align-items: center; height: 50px; padding: 4px 14px 0 22px; font-weight: 600; font-size: 14px; }
.status-icons { width: 62px; height: 11px; background:
  linear-gradient(var(--ink), var(--ink)) 0 100% / 3px 4px no-repeat,
  linear-gradient(var(--ink), var(--ink)) 5px 100% / 3px 6px no-repeat,
  linear-gradient(var(--ink), var(--ink)) 10px 100% / 3px 8px no-repeat,
  linear-gradient(var(--ink), var(--ink)) 15px 100% / 3px 11px no-repeat,
  linear-gradient(var(--ink), var(--ink)) 38px 50% / 20px 10px no-repeat;
  border-radius: 2px; opacity: .9; }
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.app-bar-left { justify-content: flex-start; }
.app-bar-title { display: block; font-weight: 700; font-size: 16px; color: var(--ink); }
.app-bar-sub { display: block; font-size: 12px; color: var(--ink-2); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--cocoa); }
.icon-btn svg, .composer-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.app-card { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 14px; }
.app-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.app-title-lg { font-family: var(--display); font-weight: 400; font-size: 26px; margin-top: 6px; color: var(--cocoa); }
.app-meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.app-meta strong { color: var(--cocoa); font-variant-numeric: tabular-nums; }
.app-body { color: var(--ink-2); margin-top: 4px; }
.app-progress { height: 5px; border-radius: 5px; background: var(--sand); margin-top: 10px; overflow: hidden; }
.app-progress span { display: block; height: 100%; background: var(--cocoa); border-radius: inherit; transition: width .45s var(--ease); }
.app-section-title { font-weight: 700; font-size: 13px; margin: 14px 2px 8px; }

.track-hero { height: 104px; border-radius: 18px; overflow: hidden; margin-bottom: 10px; background: var(--sand); }
.track-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.counter { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.counter-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--sand); color: var(--cocoa); font-size: 22px; font-weight: 600; line-height: 1;
  transition: transform .15s var(--ease), background-color .2s var(--ease);
}
.counter-btn:active { transform: scale(.9); }
.counter-btn-main { background: var(--cocoa); color: var(--cream); }
.counter-num { font-family: var(--display); font-size: 46px; line-height: 1; color: var(--cocoa); font-variant-numeric: tabular-nums; }
.need-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.need { background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line); padding: 8px 10px; display: grid; }
.need span { font-size: 11px; color: var(--ink-2); }
.need strong { font-size: 14px; }
.steps { display: grid; gap: 6px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; color: var(--ink-2); transition: background-color .3s var(--ease), color .3s var(--ease); }
.steps li.is-now { background: var(--cream); color: var(--ink); }
.step-n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--sand); color: var(--cocoa); }
.steps li.is-now .step-n { background: var(--cocoa); color: var(--cream); }

.knit-badge { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--cream); color: var(--brown); }
.knit-badge svg { width: 22px; height: 22px; }
.chat { display: grid; gap: 12px; }
.bubble { border-radius: 18px; padding: 11px 13px; }
.bubble-me { background: var(--cocoa); color: var(--cream); margin-left: 44px; border-bottom-right-radius: 6px; }
.bubble-knit { background: var(--card); box-shadow: 0 0 0 1px var(--line); margin-right: 18px; border-bottom-left-radius: 6px; display: grid; gap: 10px; }
.answer-table { background: var(--cream); border-radius: 12px; padding: 10px 12px; }
.answer-head { font-weight: 700; color: var(--cocoa); font-size: 12.5px; margin-bottom: 6px; }
.answer-table dl { display: grid; gap: 5px; }
.answer-table dl div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.answer-table dt { color: var(--ink-2); }
.answer-table dd { font-weight: 600; text-align: right; }
.answer-note { font-size: 12px; color: var(--ink-2); padding-left: 10px; border-left: 2px solid var(--tan); }
.composer {
  position: absolute; left: 16px; right: 16px; bottom: 86px;
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 6px 0 16px; border-radius: var(--pill);
  background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--ink-2);
}
.composer-send { width: 32px; height: 32px; border-radius: 50%; background: var(--cocoa); color: var(--cream); display: grid; place-items: center; }

.learn-media { position: relative; height: 150px; border-radius: 75px 75px 18px 18px / 60px 60px 18px 18px; overflow: hidden; margin-bottom: 12px; }
.learn-media img { width: 100%; height: 100%; object-fit: cover; }
.learn-play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 252, 246, .92); color: var(--cocoa); }
.learn-play svg { width: 18px; height: 18px; fill: currentColor; }
.learn-dur { position: absolute; left: 12px; bottom: 10px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--pill); background: rgba(35, 31, 32, .55); color: var(--card); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: var(--pill); background: var(--sand); color: var(--cocoa); font-size: 11px; font-weight: 700; }
.tag-sm { height: 18px; padding: 0 8px; font-size: 10px; }
.guide-steps { display: grid; gap: 8px; margin-top: 12px; }
.guide-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--ink-2); }
.guide-steps li.is-now { box-shadow: 0 0 0 1.5px var(--cocoa); color: var(--ink); }
.guide-steps li.is-done { opacity: .7; }
.step-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--sand); color: var(--cocoa); }
.guide-steps li.is-now .step-dot { background: var(--cocoa); color: var(--cream); }
.guide-steps li.is-done .step-dot { background: var(--tan); color: var(--card); }

.post { background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line); padding: 12px; margin-bottom: 10px; }
.post-head { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--av); color: var(--avc); font-weight: 700; font-size: 13px; }
.post-who { display: flex; align-items: center; gap: 6px; }
.post-time { margin-left: auto; font-size: 11px; color: var(--ink-2); }
.post-text { margin-top: 8px; }
.post-img { margin-top: 10px; width: 100%; height: 112px; object-fit: cover; border-radius: 12px; }
.post-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); box-shadow: 0 0 0 4px rgba(233, 137, 69, .2); }
.post-pattern { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border-radius: 12px; background: var(--cream); }
.post-pattern img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.post-pattern > span { display: grid; font-size: 12px; color: var(--ink-2); }
.post-pattern strong { color: var(--ink); font-size: 13px; }

/* Playground screen */
.icon-btn-ghost { background: none; }
.pattern-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.pattern-pick img { width: 46px; height: 46px; object-fit: contain; mix-blend-mode: multiply; }
.pattern-pick > span { display: grid; font-size: 12px; color: var(--ink-2); }
.pattern-pick strong { font-size: 14px; color: var(--ink); }
.measure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.measure { background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line); padding: 8px 12px; display: grid; }
.measure span { font-size: 11px; color: var(--ink-2); }
.measure strong { font-size: 15px; }
.fit-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.fit-chips span { padding: 5px 10px; border-radius: 999px; background: var(--sand); color: var(--cocoa); font-size: 11.5px; font-weight: 600; }
.fit-chips .is-on { background: var(--cocoa); color: var(--cream); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.result-grid div { background: var(--cream); border-radius: 14px; padding: 10px 12px; display: grid; }
.result-grid strong { font-weight: 700; font-size: 18px; line-height: 1.2; color: var(--cocoa); font-variant-numeric: tabular-nums; }
.result-grid span { font-size: 11px; color: var(--ink-2); }

.phone-wrap { display: grid; place-items: center; }
/* The phone keeps its real proportions and is scaled as one object to fit the screen. */
.substance .phone-box { width: calc(340px * var(--phone-scale, 1)); height: calc(700px * var(--phone-scale, 1)); }
.substance .phone { transform: scale(var(--phone-scale, 1)); transform-origin: top left; }
.screen { opacity: 0; transition: opacity .45s var(--ease); }
.screen.is-active { opacity: 1; }

/* ==========================================================================
   5 · Never knit alone
   ========================================================================== */
.community-stage { display: flex; align-items: center; }
.rail { display: flex; align-items: center; gap: clamp(18px, 2vw, 28px); padding: var(--header-h) var(--gutter) 0 max(var(--gutter), 7vw); width: max-content; }
.rail-lead { flex: none; width: min(440px, 78vw); display: grid; gap: 22px; padding-right: clamp(20px, 4vw, 64px); }
.make { flex: none; width: clamp(230px, 21vw, 310px); display: grid; gap: 4px; }
.make-img { overflow: hidden; aspect-ratio: 4 / 5; border-radius: var(--r-lg); background: var(--sand); margin-bottom: 12px; }
.make-arch .make-img { border-radius: 50% 50% var(--r-lg) var(--r-lg) / 40% 40% var(--r-lg) var(--r-lg); }
.make-img img { width: 100%; height: 100%; object-fit: cover; }
.make-cutout .make-img img { object-fit: contain; padding: 12%; mix-blend-mode: multiply; }
.make h3 { font-size: 17px; font-weight: 600; color: var(--ink); }
.make p { font-size: 14.5px; color: var(--ink-2); }
.rail-note { flex: none; width: min(320px, 70vw); padding-left: clamp(12px, 3vw, 48px); font-family: var(--sc-font-display); font-size: clamp(30px, 2.6vw, 40px); line-height: 1.08; color: var(--cocoa); }

/* ==========================================================================
   6 · Why we're making Stitch
   ========================================================================== */
.mission { background: var(--cocoa); color: var(--cream); padding-block: clamp(110px, 13vw, 180px); }
.mission-grid { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); display: grid; gap: 64px; align-items: center; }
@media (min-width: 900px) { .mission-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8vw; } }
.mission-kicker { font-family: var(--sc-font-text); font-weight: 600; font-size: 15px; letter-spacing: .02em; color: #E8C9A6; }
.manifesto { margin-top: 22px; font-family: var(--sc-font-display); font-size: clamp(32px, 3.3vw, 52px); line-height: 1.1; text-wrap: pretty; }
.values { display: grid; gap: 22px; margin-top: 52px; }
.values li { padding-top: 16px; border-top: 1px solid rgba(255, 240, 216, 0.24); }
.values h3 { font-size: 17px; font-weight: 600; }
.values p { margin-top: 6px; font-size: 15.5px; color: #EBD3B8; }
.mission-figure { overflow: hidden; aspect-ratio: 3 / 4; max-height: 680px; border-radius: 50% 50% var(--r-xl) var(--r-xl) / 37.5% 37.5% var(--r-xl) var(--r-xl); }
.mission-figure img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   7 · The end: the thread becomes the S
   ========================================================================== */
.close-stage { display: grid; grid-template-rows: 1fr auto; background: var(--cream); }
.close-grid {
  width: 100%; max-width: var(--max); margin-inline: auto; padding: var(--header-h) var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8vw; align-items: center;
}
.close-lockup { justify-self: center; display: grid; justify-items: center; gap: clamp(16px, 3vh, 28px); }
.close-mark { height: min(38vh, 330px); width: auto; aspect-ratio: 196.7 / 208.4; color: var(--dye-flat); transition: color .45s var(--ease); overflow: visible; }
.close-word { height: min(8vh, 76px); width: auto; aspect-ratio: 376 / 149.7; color: var(--brown); }
.s-draw { fill: none; stroke: #fff; stroke-width: 62; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; }
.s-draw-full { fill: #fff; opacity: 0; }
.close-copy { display: grid; gap: 18px; justify-items: start; }
.close-title { font-family: var(--sc-font-display); font-weight: 400; font-size: clamp(46px, 5.2vw, 86px); line-height: .98; color: var(--cocoa); }
.close-lede { color: var(--ink-2); font-size: clamp(17px, 1.3vw, 19px); }
.waitlist { width: 100%; max-width: 500px; display: grid; gap: 12px; margin-top: 10px; }
.waitlist-trap { position: absolute; left: -9999px; }
.waitlist-row { display: flex; flex-wrap: wrap; gap: 8px; }
.waitlist-input {
  flex: 1 1 150px; min-width: 0; height: 54px; padding: 0 22px;
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: var(--pill);
  font-size: 16px; /* under 16px, iPhones zoom the page when the field is focused */
  transition: border-color .18s var(--ease);
}
.waitlist-input::placeholder { color: var(--ink-2); opacity: 1; }
.waitlist-input:focus { border-color: var(--cocoa); }
.waitlist-row .btn { flex: none; }
.waitlist-row .btn:disabled { opacity: .6; cursor: default; }
.waitlist-note { font-size: 14px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.waitlist-note a { color: var(--cocoa); text-underline-offset: 3px; }
.waitlist.is-done .waitlist-row { display: none; }
.waitlist.is-done .waitlist-note { font-size: clamp(17px, 1.3vw, 19px); font-weight: 600; color: var(--cocoa); }
.close-foot {
  width: 100%; max-width: var(--max); margin-inline: auto; padding: 18px var(--gutter) 22px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px;
  font-size: 14px; color: var(--ink-2);
}
.close-foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.close-foot a { text-decoration: none; }
@media (hover: hover) { .close-foot a:hover { color: var(--cocoa); text-decoration: underline; text-underline-offset: 3px; } }

/* ==========================================================================
   Phones and small screens
   ========================================================================== */
/* Feature step pills: phones only (the full list is visible on wider screens). */
.feature-steps { display: none; }

@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .site-header { padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
  .brand-word { height: 21px; }
  .brand-mark { height: 28px; }
  .site-header .btn-sm { height: 40px; padding: 0 16px; font-size: 14.5px; }

  /* Hero: fills the first screen, wordmark and ball up top, copy below. */
  .hero { min-height: 100svh; justify-content: center; padding: calc(var(--header-h) + 28px) 0 clamp(56px, 12svh, 96px); }
  .hero-inner { gap: clamp(22px, 4svh, 40px); }
  .hero-mast { --wm-w: 66vw; justify-content: flex-start; }
  .hero-foot { justify-items: start; text-align: left; gap: 14px; }
  .hero-title { font-size: clamp(36px, 10.4vw, 52px); }
  .hero-lede { font-size: 16.5px; text-wrap: pretty; }
  .hero-actions { justify-content: flex-start; gap: 16px 18px; margin-top: 6px; }
  .hero-actions .btn { height: 52px; }
  .hero-needle { left: auto; right: -30px; bottom: -40px; width: min(36vw, 200px); rotate: -16deg; filter: drop-shadow(0 18px 24px rgba(78, 47, 27, .25)); }

  /* Bigger touch targets without bigger chips. */
  .chip-dye { position: relative; }
  .chip-dye::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
  .yarn-chips { gap: 12px; }

  .midnight-copy { padding-right: 44px; gap: 16px; }
  .midnight-time { font-size: clamp(60px, 19vw, 96px); }
  .midnight-line { font-size: clamp(18px, 5vw, 22px); }

  .turn { padding-block: 88px 96px; }
  .turn-grid { gap: 40px; }
  .turn-copy { gap: 22px; }
  .ask { font-size: 15px; }
  .answer { font-size: clamp(28px, 7.6vw, 36px); }
  .turn-photo { max-height: none; width: min(100%, 420px); }

  /* What it does: heading, step pills, the current thing, then the phone, scaled to fit. */
  .substance-grid { grid-template-columns: 1fr; row-gap: 14px; align-content: center; justify-items: start; padding: calc(var(--header-h) + 10px) 34px 12px var(--gutter); }
  .substance-copy { gap: 12px; }
  .substance .display-2 { font-size: clamp(26px, 7.4vw, 36px); }
  .features { min-height: 104px; }
  .feature { display: none; border-top: 0; padding: 0; gap: 4px; }
  .feature[aria-current="true"] { display: grid; }
  .feature-title { font-size: clamp(22px, 6vw, 26px); }
  .feature-body { font-size: 14.5px; line-height: 1.5; }
  .feature-steps { display: flex; gap: 6px; flex-wrap: wrap; }
  .feature-step {
    height: 32px; padding: 0 13px; border-radius: var(--pill);
    background: var(--sand); color: var(--cocoa); font-size: 13px; font-weight: 600;
    transition: background-color .2s var(--ease), color .2s var(--ease);
  }
  .feature-step[aria-current="true"] { background: var(--cocoa); color: var(--cream); }
  .phone-wrap { justify-self: center; }

  .community-stage { align-items: center; }
  .rail { gap: 16px; padding-top: var(--header-h); }
  .rail-lead { width: 78vw; gap: 16px; }
  .rail-lead .display-2 { font-size: clamp(38px, 11vw, 48px); }
  .rail-lead .lede { font-size: 16px; }
  .make { width: min(62vw, 300px); }
  .make h3 { font-size: 16px; }
  .make p { font-size: 14px; }
  .rail-note { font-size: 28px; width: 64vw; }

  .mission { padding-block: 88px 96px; }
  .mission-grid { gap: 48px; }
  .manifesto { font-size: clamp(28px, 7.6vw, 36px); }
  .values { margin-top: 40px; gap: 18px; }
  .mission-figure { max-height: 72svh; }

  /* The end: everything on one screen, including the footer line. */
  .close-grid { grid-template-columns: 1fr; row-gap: clamp(14px, 2.6svh, 26px); align-content: center; justify-items: center; text-align: center; padding: calc(var(--header-h) + 6px) var(--gutter) 0; }
  .close-lockup { gap: clamp(10px, 2svh, 18px); }
  .close-copy { justify-items: center; gap: 12px; }
  .close-mark { height: clamp(110px, 22svh, 200px); }
  .close-word { height: clamp(32px, 5.4svh, 52px); }
  .close-title { font-size: clamp(34px, 10vw, 46px); }
  .close-lede { font-size: 16px; }
  .waitlist { max-width: 420px; gap: 8px; margin-top: 4px; }
  .waitlist-input { height: 52px; padding: 0 18px; }
  .waitlist-row .btn { height: 52px; padding: 0 18px; font-size: 15px; }
  .waitlist-note { font-size: 13px; }
  .close-foot { justify-content: center; text-align: center; gap: 4px 16px; padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom)); font-size: 13px; }
  .close-foot nav { justify-content: center; gap: 0 4px; }
  .close-foot a { display: inline-block; padding: 8px 6px; }
}

/* Short phones (iPhone SE, small Androids): tighten the pinned screens. */
@media (max-width: 860px) and (max-height: 700px) {
  .midnight-time { font-size: clamp(52px, 16vw, 72px); }
  .substance .display-2 { font-size: 24px; }
  .features { min-height: 96px; }
  .feature-body { font-size: 14px; }
  .close-mark { height: 17svh; }
  .close-word { height: 30px; }
  .close-title { font-size: 32px; }
  .close-lede { font-size: 15px; }
  .waitlist-input, .waitlist-row .btn { height: 48px; }
}

/* Phones held sideways: wide but very short, so go back to two columns. */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .hero-mast { --wm-w: min(52vw, calc((100svh - 150px) * 2.51)); }
  .midnight-time { font-size: 56px; }
  .midnight-line { font-size: 17px; }
  .substance-grid { grid-template-columns: minmax(0, 1fr) auto; column-gap: 6vw; padding-top: calc(var(--header-h) + 6px); }
  .substance .display-2 { font-size: 26px; }
  .feature-steps { display: none; }
  .feature { display: grid; opacity: .42; padding: 6px 0 8px; }
  .feature[aria-current="true"] { opacity: 1; }
  .feature-body { display: none; }
  .feature[aria-current="true"] .feature-body { display: block; }
  .features { min-height: 0; }
  .close-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 6vw; }
  .close-mark { height: 34svh; }
  .close-word { height: 9svh; }
  .close-title { font-size: 34px; }
  .rail-lead { width: 46vw; }
  .make { width: 30vw; }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero-wordmark, .js .hero-foot > * { opacity: 1; transform: none; }
}
