/* ── Local fonts — see /fonts. New York only has a Regular weight, so
   headline text relies on the browser's synthetic bold if a heavier
   weight is requested. ── */
@font-face {
  font-family: "SF Pro Text";
  src: url("fonts/SF-Pro-Text-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Text";
  src: url("fonts/SF-Pro-Text-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "New York";
  src: url("fonts/NewYorkLargeRegular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

/* ── Font tokens — swap these to change the typeface everywhere ── */
:root {
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-headline: "New York", ui-serif, Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  font-family: var(--font);
  padding: 48px 24px;
}

/* #graphics-root (the JS mount point) holds the actual page sections.
   No flex gap — each section owns its own vertical padding/margins. */
#graphics-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: calc(100vh - 96px); /* viewport minus body's top+bottom padding */
}

/* ── Masonry band — full-bleed imagery strip across the top ~35% ── */
.masonry-band {
  position: relative;
  /* Full-bleed: opt out of #graphics-root's `align-items: center`, then
     pull each side out past the body padding. `calc(50% - 50vw)` resolves
     to exactly -(body side padding) whatever that padding is, so this
     adapts across breakpoints on its own. */
  align-self: stretch;
  width: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  /* Flush to the very top, past body's 48px top padding. */
  margin-top: -48px;
  height: 35vh;
  min-height: 240px;
  overflow: hidden;
}

.masonry-grid {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px;
}

.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Each column rides up a different amount so the tile tops don't line up —
   the clipped band + these offsets read as staggered masonry. Deliberately
   irregular values (not a single modulo) so no run of columns repeats. */
.masonry-col:nth-child(3n+1) { margin-top: -6px; }
.masonry-col:nth-child(3n+2) { margin-top: -58px; }
.masonry-col:nth-child(3n)   { margin-top: -30px; }
.masonry-col:nth-child(4)    { margin-top: -44px; }
.masonry-col:nth-child(5)    { margin-top: -16px; }
.masonry-col:nth-child(6)    { margin-top: -66px; }

.masonry-item {
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, #f1e3d3 0%, #e2cdb6 100%);
}

/* ── Tile heights ──────────────────────────────────────────────────────────
   Three per-column "profiles" (A: cols 1,4,7 / B: cols 2,5,8 / C: cols 3,6,9),
   each a different sequence of aspect ratios running from 1:1 (short) to 3:5
   (tall). The sequences are phase-shifted against each other so heights
   interlock diagonally instead of banding into flat rows — every tile differs
   in height from the one above it and the ones beside it. object-fit: cover
   crops each photo to whatever ratio it lands on. */

/* Profile A — cols 1, 4, 7 (the fall-through default) */
.masonry-item                { aspect-ratio: 3 / 5; }
.masonry-item:nth-child(2)   { aspect-ratio: 1 / 1; }
.masonry-item:nth-child(3)   { aspect-ratio: 3 / 4; }
.masonry-item:nth-child(4)   { aspect-ratio: 4 / 5; }

/* Profile B — cols 2, 5, 8 */
.masonry-col:nth-child(3n+2) .masonry-item              { aspect-ratio: 3 / 4; }
.masonry-col:nth-child(3n+2) .masonry-item:nth-child(2) { aspect-ratio: 3 / 5; }
.masonry-col:nth-child(3n+2) .masonry-item:nth-child(3) { aspect-ratio: 1 / 1; }
.masonry-col:nth-child(3n+2) .masonry-item:nth-child(4) { aspect-ratio: 5 / 6; }

/* Profile C — cols 3, 6, 9 */
.masonry-col:nth-child(3n) .masonry-item              { aspect-ratio: 1 / 1; }
.masonry-col:nth-child(3n) .masonry-item:nth-child(2) { aspect-ratio: 4 / 5; }
.masonry-col:nth-child(3n) .masonry-item:nth-child(3) { aspect-ratio: 3 / 5; }
.masonry-col:nth-child(3n) .masonry-item:nth-child(4) { aspect-ratio: 3 / 4; }

.masonry-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Blends the clipped bottom edge of the band into the page. */
.masonry-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 88%);
  pointer-events: none;
}

/* ── Signup section — centered headline + body + email/CTA, under the band.
   Capped at 800px on desktop; on mobile the body's 32px padding is the
   left/right gutter (same as the hero). ── */
.signup-section {
  width: 100%;
  max-width: 800px;
  padding: 96px 0; /* 64px 0 on mobile — see media query */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* One flat treatment for the whole line — same muted, regular-weight look
   the "By Asha Mode × Fynd" credit had. */
.signup-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 19, 16, 0.4);
}

/* Same treatment, but sitting below the form instead of above the headline. */
.signup-eyebrow--footer {
  margin-top: 24px;
  margin-bottom: 0;
}

/* Plain italic invitation line directly under the CTA. */
.signup-footer-note {
  margin-top: 32px;
  max-width: 480px;
  font-family: var(--font);
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
  color: rgba(26, 19, 16, 0.6);
}

.signup-heading {
  font-family: var(--font-headline);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  color: #1a1310;
  margin-bottom: 40px;
}

.signup-body-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
  max-width: 800px;
}

.signup-body {
  font-size: 20px;
  line-height: 1.55;
  color: #1a1310;
}

/* Sign-off — avatar + name, closes the note above the form. */
.signup-signature {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.signup-signature-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.signup-signature-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.signup-signature-name {
  font-family: var(--font);
  font-size: 15.3px; /* ~10% smaller than .signup-body's 17px */
  font-style: italic;
  color: #1a1310;
}

.signup-signature-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b8622f;
  margin-top: 3px;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 480px;
}

.signup-email {
  flex: 1;
  min-width: 0;
  padding: 15px 20px;
  border-radius: 100px;
  border: 1px solid rgba(26, 19, 16, 0.15);
  background: #fff;
  color: #1a1310;
  font-family: var(--font);
  font-size: 15px;
}

.signup-email:focus {
  outline: none;
  border-color: #ff4db6;
  box-shadow: 0 0 0 3px rgba(255, 77, 182, 0.15);
}

.signup-submit {
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* Compound selector so these win over `.hero-cta`, which is defined later
   in the file. SF Pro regular, all caps, wide tracking. */
.signup-submit.hero-cta {
  font-family: var(--font);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ── Hero section — just the phone mockup, centered on a full-bleed pink
   gradient that fades out downward. ── */
.hero {
  /* Full-bleed out of the centered #graphics-root (same trick as the
     masonry band) so the gradient spans the viewport. */
  align-self: stretch;
  width: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 77, 182, 0.10) 0%, rgba(255, 77, 182, 0.05) 100%);
}

/* Chat-section headline — same treatment as .signup-heading. */
.hero-heading {
  font-family: var(--font-headline);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  color: #1a1310;
  text-align: center;
  padding: 32px 32px 0;
  margin-bottom: 32px;
}

/* Subtitle under the chat-section heading — cycles with the chat sets. */
.hero-subtitle {
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.5;
  color: rgba(26, 19, 16, 0.6);
  text-align: center;
  padding: 0 32px;
  margin-bottom: 40px;
  max-width: 620px;
}

.hero-phone {
  flex-shrink: 0;
}

/* ── Graphic container ── */
.graphic {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .hero-cta — shared pill button style (used by the signup CTA). */
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 100px;
  background: linear-gradient(250deg, #ff4db6 -4.34%, #ff6867 121.86%);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(255, 77, 182, 0.35);
}

@media (max-width: 1000px) {
  body {
    padding: 32px;
  }

  #graphics-root {
    min-height: calc(100vh - 64px);
  }

  .masonry-band {
    margin-top: -32px; /* mobile body top padding */
    height: 20vh; /* 35vh on desktop, 20vh here */
    min-height: 140px;
  }

  /* Fewer, larger tiles on narrow screens: show the first 3 of the 6
     columns so the band reads calmer on a phone. */
  .masonry-col:nth-child(n + 4) {
    display: none;
  }

  /* Left/right gutter here is the body's 32px mobile padding. */
  .signup-heading,
  .hero-heading {
    font-size: 40px;
  }

  .signup-body,
  .hero-subtitle {
    font-size: 16px;
  }

  .signup-form {
    max-width: 100%;
  }

  .chat-messages {
    padding-top: 8px;
  }

  .signup-section {
    padding: 64px 0;
  }
}

/* ── Chat UI — no bezel / status bar / background; the content floats on
   the section gradient. Authored at SCREEN_W × SCREEN_H (render.js); `zoom`
   scales it to the column: capped at 600px on desktop, otherwise the
   viewport minus a 32px gutter each side (matching the signup section's
   width model). Keep the 402 divisor === SCREEN_W. Fixed height +
   overflow: hidden keeps the section height constant across sets. ── */
.phone-screen {
  position: relative;
  overflow: hidden;
  transition: height 420ms ease;
  color: #000;
  font-family: var(--font);
  zoom: calc(min(600px, 100vw - 64px, (100svh - 260px) * 402 / 620) / 402px);
}

/* ── Chat messages ── */
/* Intro reveal states (opacity/transform/filter) are set inline from
   REVEAL_MS / REVEAL_Y / REVEAL_BLUR in render.js. */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 26px;
  /* No side padding here so the AI reply sits flush to the box's left
     edge; the user side gets its gutter back via .msg-row-user.
     padding-top: 24px desktop / 8px mobile (see media query). */
  padding: 24px 0 0;
}

.msg-row-user {
  display: flex;
  justify-content: flex-end;
  padding-right: 22px;
}

.user-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 80%;
}

.user-attachment {
  width: 128px;
  aspect-ratio: 1 / 1; /* per-set override via set.attachmentRatio (render.js) */
  border-radius: 12px;
  flex-shrink: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.bubble {
  font-size: 16px;
  line-height: 1.35;
  border-radius: 20px;
  padding: 14px 18px;
}

.bubble-user {
  background: #FF4DB64D;
  color: #000;
  border-bottom-right-radius: 6px;
}

.msg-ai-body {
  position: relative;
}

.msg-ai-text {
  font-size: 16px;
  line-height: 1.42;
  color: #000;
}

/* ── Typing indicator — overlays the reply text's spot, no layout shift ── */
.typing-dots {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.typing-dots.is-visible {
  opacity: 1;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8e8e93;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1;   }
}

/* ── Outfit strip — bleeds to the box's left/right edges; SCREEN_H is sized
   so it ends just inside the box's bottom for the tallest set. ── */
.outfit-strip {
  display: flex;
  gap: 3px;
  height: 230px;
  margin-top: 22px;
}

.outfit-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Small label above an outfit image — set per slot via `outfitTitles` in
   config.js; hidden when a set doesn't provide one. */
.outfit-tile-title {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-tile {
  flex: 1;
  border-radius: 12px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.outfit-placeholder {
  background: linear-gradient(160deg, #f1e3d3 0%, #e2cdb6 100%);
}

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