/* Threadnest marketing site. Plain document flow, no scroll-jacking: bold
   colour blocks in the app's own palette, big product photography, two real
   click-driven moments (the outfit board, the sell/donate toggle). */

/* ---------------------------------------------------------------------- */
/* Tokens                                                                  */
/* ---------------------------------------------------------------------- */

:root {
  --canvas:      #FAF7F3;
  --surface:     #FFFFFF;
  --ink:         #2B2724;
  --ink-soft:    #7A7166;
  --accent:      #CE5A45;
  --accent-dark: #B8452E;
  --accent-ink:  #FAF7F3;

  --sage:        #7C8B72;
  --sage-dark:   #5E6C55;
  --teal:        #083E37;
  --teal-light:  #0F5A4F;
  --border:      #E8E2D9;

  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
  --font-text:    "Inter", "Work Sans", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Two radius families, not a soft gradient between them: sharp on every
     content tile (cards, viewers, panes), full pill on every control and
     tag. The contrast between the two is deliberate, not an oversight — a
     mid-range 20px "safe" radius on a card reads as generic in a way 12px
     or a true pill never does. */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow-1: 0 2px 8px rgba(43,39,36,0.08);
  --shadow-2: 0 16px 40px rgba(43,39,36,0.16);
  --shadow-3: 0 24px 60px rgba(43,39,36,0.24);

  --section-pad: clamp(3.5rem, 8vw, 7rem);
  --gutter: clamp(20px, 5vw, 64px);
  color-scheme: light;
}

/* ---------------------------------------------------------------------- */
/* Reset + base                                                           */
/* ---------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

/* Display type gets compressed leading and tightened tracking, full stop —
   at the body's inherited 1.6 line-height every h2 on the page read as a
   loose paragraph wearing a serif costume, not a stamped headline. */
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.08; letter-spacing: -0.01em; }
p { text-wrap: pretty; }

::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--sage); border-radius: 999px; border: 3px solid var(--canvas); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------------------------- */
/* Reveal-on-scroll utility (JS adds .is-in via IntersectionObserver)      */
/* ---------------------------------------------------------------------- */

/* Content is visible by default. The hidden/animated state only switches on
   once app.js has actually run (.js on <html>), so a JS failure, a blocked
   script or a disabled-JS visitor still gets the full page, not a blank one. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transform: none; }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(206,90,69,0.32); }

.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--canvas); }

.btn--cream { background: var(--canvas); color: var(--teal); }
.btn--cream:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.28); }

.btn--lg { padding: 18px 36px; font-size: 1.05rem; }
.btn--full { width: 100%; }

/* ---------------------------------------------------------------------- */
/* Nav                                                                     */
/* ---------------------------------------------------------------------- */

/* A floating pill, not a full-bleed bar: it sits clear of the viewport
   edge with its own border on all four sides, rather than reading as a
   strip of the page that happens to stay put. */
.nav {
  position: sticky;
  top: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 36px);
  width: min(1200px, calc(100% - 2 * var(--gutter)));
  margin: 14px auto 0;
  padding: 7px 7px 7px 22px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
}
.nav__mark { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.nav__mark img { width: 26px; height: 26px; }
.nav__mark span { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--ink); }

.nav__links { flex: 1; display: flex; gap: clamp(18px, 3vw, 32px); }
.nav__links a {
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 140ms ease-out;
}
.nav__links a:hover { color: var(--ink); }

.nav__cta {
  flex: none;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(206,90,69,0.28); }

@media (max-width: 640px) {
  .nav__links { display: none; }
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) var(--section-pad);
}
.hero__title {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 18ch;
}
/* The opening line assembles itself rather than just fading in: each word
   sits in an overflow-hidden mask and slides up into place on load, staggered
   by the inline transition-delay app.js sets per word. Plain text (no JS,
   reduced motion) is a perfectly good static headline on its own — nothing
   here depends on the animation actually running. */
.hero__title .word { display: inline-block; overflow: hidden; vertical-align: top; }
.hero__title .word__inner {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 640ms var(--ease), opacity 480ms ease-out;
}
.hero__title.is-revealed .word__inner { transform: translateY(0); opacity: 1; }

.hero__sub {
  margin-top: 1.3rem;
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  color: var(--ink-soft);
}
.hero__actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 14px; }

.hero__artwrap { position: relative; }
.hero__art {
  --art-tilt: 1.2deg;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  transform: translateY(var(--parallax-y, 0px)) rotate(var(--art-tilt));
}
.hero__art img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 2200 / 1222; }

/* A second, smaller swatch peeking off the corner — the tilt motif that
   recurs at Snap It and Style It, planted here too so it reads as one idea
   threaded through the page rather than a one-off. */
.hero__swatch {
  position: absolute;
  left: -30px;
  bottom: -26px;
  width: clamp(80px, 10vw, 122px);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 5px solid var(--canvas);
  box-shadow: var(--shadow-2);
  transform: rotate(-7deg);
  transition: transform 220ms var(--ease);
  z-index: 2;
}
.hero__swatch:hover { transform: rotate(-2deg) translateY(-2px); }
.hero__swatch img { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .hero__title { max-width: none; }
  .hero__artwrap { order: -1; }
  .hero__art { --art-tilt: 0.6deg; }
  .hero__swatch { display: none; }
}

/* ---------------------------------------------------------------------- */
/* Hero text link (replaces the second hero button — the nav already       */
/* carries "Get the app", so the hero only needs the one distinct action)  */
/* ---------------------------------------------------------------------- */

.hero__link {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in oklab, var(--ink) 30%, transparent);
  transition: text-decoration-color 160ms ease-out, color 160ms ease-out;
}
.hero__link:hover { color: var(--accent-dark); text-decoration-color: currentColor; }

/* ---------------------------------------------------------------------- */
/* Journey: four tiles, each one showing its section rather than           */
/* describing it — a still or a short loop crossfading through the        */
/* moment, tilted like the rest of the page's recurring pinned-board idea. */
/* ---------------------------------------------------------------------- */

.journey { padding: 0 var(--gutter) var(--section-pad); max-width: 1200px; margin: 0 auto; }
.journey__kicker {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}
.journey__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2.4vw, 24px);
}

.jtile {
  --tilt: 0deg;
  display: block;
  text-decoration: none;
  transform: rotate(var(--tilt));
  transition: transform 220ms var(--ease);
}
.journey__row .jtile:nth-child(1) { --tilt: -2deg; }
.journey__row .jtile:nth-child(2) { --tilt: 1.4deg; }
.journey__row .jtile:nth-child(3) { --tilt: -1.2deg; }
.journey__row .jtile:nth-child(4) { --tilt: 2deg; }
.jtile:hover { --tilt: 0deg; transform: rotate(0deg) translateY(-4px); }

.jtile__frame {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: box-shadow 220ms ease-out;
}
.jtile:hover .jtile__frame { box-shadow: var(--shadow-2); }

.jtile__img, .jtile__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.jtile__video { object-position: top center; }

/* A slow ambient crossfade between two (or three) stills — ombient motion
   that needs no JS, pauses cleanly under reduced motion, and never needs a
   frame to be "current": every layer already sits stacked and ready. */
.jtile__frame:not(.jtile__frame--x3) .jtile__img { animation: jfade2 9s ease-in-out infinite; }
.jtile__frame:not(.jtile__frame--x3) .jtile__img:nth-child(1) { animation-delay: 0s; }
.jtile__frame:not(.jtile__frame--x3) .jtile__img:nth-child(2) { animation-delay: -4.5s; }
@keyframes jfade2 {
  0%, 42% { opacity: 1; }
  50%, 92% { opacity: 0; }
  100% { opacity: 1; }
}

.jtile__frame--x3 .jtile__img { animation: jfade3 12s ease-in-out infinite; }
.jtile__frame--x3 .jtile__img:nth-child(1) { animation-delay: 0s; }
.jtile__frame--x3 .jtile__img:nth-child(2) { animation-delay: -4s; }
.jtile__frame--x3 .jtile__img:nth-child(3) { animation-delay: -8s; }
@keyframes jfade3 {
  0%, 26% { opacity: 1; }
  33%, 92% { opacity: 0; }
  100% { opacity: 1; }
}

.jtile__label {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  transition: color 160ms ease-out;
}
.jtile:hover .jtile__label { color: var(--accent-dark); }

@media (prefers-reduced-motion: reduce) {
  .jtile { --tilt: 0deg; }
  .jtile__img { animation: none !important; opacity: 0; }
  .jtile__img:first-child { opacity: 1; }
}

@media (max-width: 720px) {
  .journey__row { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
}

/* ---------------------------------------------------------------------- */
/* Capture: photograph it where it is, watch it land in the closet        */
/* ---------------------------------------------------------------------- */

.capture {
  padding: var(--section-pad) var(--gutter);
}
.capture__intro { max-width: 640px; margin: 0 auto; text-align: center; }
.capture__intro h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 600; }
.capture__intro p { margin-top: 0.9rem; font-size: 1.08rem; color: var(--ink-soft); }

.capture__stage {
  max-width: 1100px;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}

.capture__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 20px);
}

.snap {
  --tilt: 0deg;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow-1);
  -webkit-tap-highlight-color: transparent;
  transform: rotate(var(--tilt));
  transition: transform 220ms var(--ease), border-color 160ms ease-out, box-shadow 160ms ease-out;
}
/* A little handheld tilt per card, like snapshots dropped on a table rather
   than a tidy studio grid — straightens out once it's "captured". */
.capture__cards .snap:nth-child(1) { --tilt: -1.6deg; }
.capture__cards .snap:nth-child(2) { --tilt: 1.1deg; }
.capture__cards .snap:nth-child(3) { --tilt: -0.9deg; }
.snap.is-active,
.snap:hover { --tilt: 0deg; }

.snap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.snap__after { opacity: 0; transform: scale(1.03); transition: opacity 420ms var(--ease), transform 420ms var(--ease); }

/* Camera-viewfinder chrome on the "before" shot: corner focus brackets plus
   a zoom pill, so the raw photo visibly reads as "taken on a phone" rather
   than more styled photography. Fades away once the item is captured. */
.snap__viewfinder {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  transition: opacity 260ms ease-out;
}
.snap__viewfinder svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: color-mix(in oklab, var(--canvas) 92%, transparent);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.snap__zoom {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(20,17,14,0.4);
  color: var(--canvas);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  backdrop-filter: blur(2px);
}
.snap.is-active .snap__viewfinder { opacity: 0; }

.snap__flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease-out;
}
.snap.is-flashing .snap__flash { opacity: 0.92; transition: opacity 40ms ease-out; }

.snap__tag {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--canvas) 90%, transparent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.snap__hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--canvas);
  background: linear-gradient(to top, rgba(43,39,36,0.65), transparent);
  transition: opacity 220ms ease-out;
}
.snap:hover { transform: translateY(-3px) rotate(0deg); box-shadow: var(--shadow-2); }
.snap:active { transform: scale(0.98) rotate(0deg); }
.snap.is-active { border-color: var(--accent); box-shadow: var(--shadow-2); }
.snap.is-active .snap__after { opacity: 1; transform: scale(1); }
.snap.is-active .snap__hint { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .snap { --tilt: 0deg; }
}

.closetrail {
  background: color-mix(in oklab, var(--sage) 10%, var(--canvas));
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.5vw, 22px);
}
.closetrail__label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.closetrail__rail { display: flex; flex-direction: column; gap: 12px; }
.closetrail__hook {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-sm);
  border: 1.5px dashed color-mix(in oklab, var(--ink) 22%, transparent);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.closetrail__hook span {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: color-mix(in oklab, var(--ink) 45%, transparent);
  transition: opacity 200ms ease-out;
}
.closetrail__hook img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 380ms var(--ease), transform 380ms var(--ease);
}
.closetrail__hook.is-filled {
  border-style: solid;
  border-color: var(--accent);
}
.closetrail__hook.is-filled img { opacity: 1; transform: scale(1); }
.closetrail__hook.is-filled span { opacity: 0; }

@media (max-width: 780px) {
  .capture__stage { grid-template-columns: 1fr; }
  .capture__cards { grid-template-columns: repeat(3, 1fr); }
  .closetrail__rail { flex-direction: row; }
  .closetrail__hook { aspect-ratio: 1 / 1; flex: 1; }
}

/* ---------------------------------------------------------------------- */
/* Style it: interactive outfit builder                                   */
/* ---------------------------------------------------------------------- */

.styleit {
  background: var(--teal);
  color: var(--canvas);
  padding: var(--section-pad) var(--gutter);
}
.styleit__intro { max-width: 700px; margin: 0 auto; text-align: center; }
.styleit__intro h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 600; color: var(--canvas); }
.styleit__intro p { margin-top: 0.9rem; font-size: 1.08rem; color: color-mix(in oklab, var(--canvas) 74%, transparent); }

.styleit__stage {
  max-width: 1100px;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.viewer {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: color-mix(in oklab, var(--canvas) 8%, transparent);
  border: 1.5px solid color-mix(in oklab, var(--canvas) 20%, transparent);
  box-shadow: var(--shadow-2);
}
.viewer__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: opacity 240ms var(--ease);
}
.viewer__img.is-swapping { opacity: 0; }

.picks__label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--canvas) 65%, transparent);
  margin-bottom: 0.8rem;
}
.picks__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.4rem;
}
.pick {
  --tilt: 0deg;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  border: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transform: rotate(var(--tilt));
  transition: transform 220ms var(--ease), border-color 160ms ease-out;
}
/* The same handheld-tilt motif as the Snap It cards, so the two rows of
   thumbnails read as one recurring idea rather than two different systems. */
.picks__row .pick:nth-child(1) { --tilt: -1.3deg; }
.picks__row .pick:nth-child(2) { --tilt: 0.9deg; }
.picks__row .pick:nth-child(3) { --tilt: -0.7deg; }
.pick.is-active, .pick:hover { --tilt: 0deg; }

.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--canvas);
  background: linear-gradient(to top, rgba(8,25,22,0.75), transparent);
}
.pick:hover { transform: translateY(-3px) rotate(0deg); }
.pick.is-active { border-color: var(--accent); }
.pick:active { transform: scale(0.97) rotate(0deg); }

@media (prefers-reduced-motion: reduce) {
  .pick { --tilt: 0deg; }
}

#tryAll.is-active {
  background: var(--accent-dark);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--canvas) 55%, transparent);
}

@media (max-width: 780px) {
  .styleit__stage { grid-template-columns: 1fr; }
  .viewer { order: -1; max-width: 420px; margin: 0 auto; }
}

/* ---------------------------------------------------------------------- */
/* Assistant: ask your stylist, watch it think, watch the result land     */
/* ---------------------------------------------------------------------- */

.assistant { padding: var(--section-pad) var(--gutter); }
.assistant__intro { max-width: 680px; margin: 0 auto; text-align: center; }
.assistant__intro h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 600; }
.assistant__intro p { margin-top: 0.9rem; font-size: 1.08rem; color: var(--ink-soft); }

.assistant__stage {
  max-width: 1080px;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}

/* --- the chat panel --- */
.chat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.5vw, 24px);
  box-shadow: var(--shadow-1);
}
.chat__header { display: flex; align-items: center; gap: 12px; margin-bottom: 1.1rem; }
.chat__avatar {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--canvas);
  display: flex; align-items: center; justify-content: center;
}
.chat__avatar svg { width: 18px; height: 18px; }
.chat__name { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.chat__status { font-size: 0.78rem; color: var(--ink-soft); }
.chat__status::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sage-dark); margin-right: 5px;
}

.chat__thread { display: flex; flex-direction: column; gap: 10px; min-height: 132px; }
.bubble {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.bubble--assistant {
  align-self: flex-start;
  background: color-mix(in oklab, var(--teal) 7%, var(--canvas));
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.bubble--user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 4px;
}
.chat__cursor {
  display: inline-block;
  width: 2px; height: 1em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: currentColor;
  animation: blink 900ms step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.bubble--typing { display: flex; gap: 4px; align-items: center; padding: 12px 16px; }
.bubble--typing[hidden] { display: none; }
.bubble--typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: color-mix(in oklab, var(--ink) 40%, transparent);
  animation: bounce 1200ms ease-in-out infinite;
}
.bubble--typing span:nth-child(2) { animation-delay: 140ms; }
.bubble--typing span:nth-child(3) { animation-delay: 280ms; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.2rem; }
.chip-ask {
  cursor: pointer;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--canvas);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--ink);
  transition: border-color 140ms ease-out, background 140ms ease-out, transform 140ms var(--ease);
}
.chip-ask:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip-ask:active { transform: scale(0.97); }
.chip-ask.is-active { background: var(--ink); border-color: var(--ink); color: var(--canvas); }
.chip-ask--surprise { background: var(--teal); border-color: var(--teal); color: var(--canvas); }
.chip-ask--surprise:hover { border-color: var(--teal); opacity: 0.9; }

.nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1.2rem;
  padding: 10px;
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--sage) 10%, var(--canvas));
  text-decoration: none;
  transition: background 140ms ease-out;
}
.nudge:hover { background: color-mix(in oklab, var(--sage) 18%, var(--canvas)); }
.nudge img { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.nudge span { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.4; }
.nudge strong { color: var(--ink); }
.nudge em { font-style: normal; color: var(--accent-dark); font-weight: 600; }

/* --- the result viewer --- */
.assistant__viewer {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  background: var(--surface);
}
.assistant__viewer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 1;
  transform: scale(1);
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}
.assistant__viewer img.is-swapping { opacity: 0; transform: scale(0.97); }
.assistant__badge {
  position: absolute;
  top: 14px; left: 14px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--canvas) 92%, transparent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 1;
  transition: opacity 200ms ease-out;
}
.assistant__skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(100deg,
    color-mix(in oklab, var(--sage) 14%, var(--canvas)) 30%,
    color-mix(in oklab, var(--sage) 28%, var(--canvas)) 50%,
    color-mix(in oklab, var(--sage) 14%, var(--canvas)) 70%);
  background-size: 240% 100%;
  transition: opacity 200ms ease-out;
}
.assistant__viewer.is-thinking .assistant__skeleton { opacity: 1; animation: shimmer 1100ms ease-in-out infinite; }
.assistant__viewer.is-thinking .assistant__badge { opacity: 0; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -40% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chat__cursor { animation: none; }
  .bubble--typing span { animation: none; opacity: 0.8; }
  .assistant__viewer.is-thinking .assistant__skeleton { animation: none; opacity: 0.6; }
}

@media (max-width: 860px) {
  .assistant__stage { grid-template-columns: 1fr; }
  .assistant__viewer { max-width: 340px; margin: 0 auto; }
}

/* ---------------------------------------------------------------------- */
/* Handoff: sell / donate toggle                                          */
/* ---------------------------------------------------------------------- */

.handoff {
  padding: var(--section-pad) var(--gutter);
  background: color-mix(in oklab, var(--accent) 14%, var(--canvas));
  transition: background 420ms var(--ease);
}
.handoff[data-mode="donate"] { background: color-mix(in oklab, var(--sage) 18%, var(--canvas)); }

.handoff__intro { max-width: 640px; margin: 0 auto; text-align: center; }
.handoff__intro h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 600; }
.handoff__intro p { margin-top: 0.8rem; color: var(--ink-soft); font-size: 1.05rem; }

.handoff__toggle {
  position: relative;
  display: flex;
  width: fit-content;
  margin: clamp(1.8rem, 4vw, 2.6rem) auto;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 5px;
  box-shadow: var(--shadow-1);
}
.handoff__tab {
  position: relative;
  z-index: 2;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 200ms ease-out;
}
.handoff__tab.is-active { color: var(--canvas); }
.handoff__thumb {
  position: absolute;
  top: 5px; left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: transform 320ms var(--ease), background 320ms var(--ease);
}
.handoff__toggle[data-active="donate"] .handoff__thumb {
  transform: translateX(100%);
  background: var(--sage-dark);
}

.handoff__panes { max-width: 900px; margin: 0 auto; position: relative; }
.handoff__pane {
  display: none;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 44px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.handoff__pane.is-active { display: grid; }
.handoff__pane img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1400 / 1854; max-height: 340px; }
.handoff__pane-copy { padding: clamp(16px, 3vw, 32px) clamp(16px, 3vw, 40px) clamp(16px, 3vw, 32px) 0; }
.handoff__pane-copy h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 600; }
.handoff__pane-copy p { margin-top: 0.7rem; color: var(--ink-soft); }

@media (max-width: 620px) {
  .handoff__pane { grid-template-columns: 1fr; }
  .handoff__pane img { max-height: 260px; }
  .handoff__pane-copy { padding: 0 20px 24px; }
}

/* ---------------------------------------------------------------------- */
/* Close                                                                   */
/* ---------------------------------------------------------------------- */

.close {
  background: var(--ink);
  color: var(--canvas);
  padding: clamp(4rem, 10vw, 7rem) var(--gutter);
}
.close__inner { max-width: 640px; margin: 0 auto; text-align: center; }
.close__kicker { font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.close h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 600; color: var(--canvas); max-width: 18ch; margin: 0 auto 2.2rem; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 24px var(--gutter);
  background: var(--ink);
  color: color-mix(in oklab, var(--canvas) 55%, transparent);
  font-size: 0.85rem;
  border-top: 1px solid color-mix(in oklab, var(--canvas) 14%, transparent);
}
.foot a { text-decoration: none; color: inherit; }
.foot a:hover { color: var(--canvas); }
