/* ==========================================================================
   Homepage top half (nav, hero, upload studio) — redesign spec 2026-11-23.
   Loaded by public/index.html ONLY. Everything here is scoped to th-*
   classes or body.ta-home so the 60 other pages that share redesign.css
   are untouched. Fonts stay the site's (Newsreader / Sora).
   ========================================================================== */

body.ta-home {
  --th-canvas: #0e0d0b;
  --th-card: #161411;
  --th-control: #1c1916;
  --th-control-2: #1b1815;
  --th-stepbar: rgba(26, 23, 20, 0.7);
  --th-line: rgba(255, 255, 255, 0.08);
  --th-rim: inset 0 1px 0 rgba(255, 244, 224, 0.06);
  --th-gold: #e2c27d;
  --th-gold-hi: #ecd091;
  --th-gold-text: #dfc07d;
  --th-accent: #e5c682;
  --th-gold-tint: rgba(223, 192, 125, 0.15);
  --th-gold-border: rgba(223, 192, 125, 0.5);
  --th-on-gold: #14110e;
  --th-head: #f5f0e7;
  --th-body: #b9b0a3;
  --th-micro: #a59c8e;
  --th-micro-2: #b4ab9d;
  --th-good: #89c49b;
  --th-avoid: #d97c74;
}

/* Film grain over the page: 2.8 %, never interactive. */
body.ta-home::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.028;
  background-size: 200px 200px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   1. Nav: sticky on desktop; CTA is a ghost until the hero CTA scrolls away
   -------------------------------------------------------------------------- */

body.ta-home .th-nav {
  background-color: var(--th-canvas);
}
@media (min-width: 1101px) {
  /* Anchors and scrollIntoView land below the sticky bar */
  html:has(body.ta-home) {
    scroll-padding-top: 88px;
  }
  body.ta-home .th-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(14, 13, 11, 0.86);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--th-line);
  }
}

body.ta-home .th-navcta {
  background: transparent;
  border-color: rgba(223, 192, 125, 0.45);
  color: #ebd093;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
body.ta-home .th-navcta:hover {
  background: var(--th-gold-tint);
  border-color: var(--th-gold);
  color: var(--th-head);
}
body.ta-home .th-nav.is-scrolled .th-navcta,
body.ta-home .th-navcta.is-generate {
  background: var(--th-gold);
  border-color: var(--th-gold);
  color: var(--th-on-gold);
}
body.ta-home .th-nav.is-scrolled .th-navcta:hover,
body.ta-home .th-navcta.is-generate:hover {
  background: var(--th-gold-hi);
  border-color: var(--th-gold-hi);
}

/* --------------------------------------------------------------------------
   2. Hero
   -------------------------------------------------------------------------- */

body.ta-home .th-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--th-canvas);
  gap: 72px;
  padding-top: 88px;
  padding-bottom: 96px;
}

/* Ambient key light behind the portraits; its tint follows the style pill. */
.th-hero__glow {
  --glow-a: rgba(223, 192, 125, 0.2);
  --glow-b: rgba(180, 134, 66, 0.07);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle at 72% 50%,
    var(--glow-a) 0%,
    var(--glow-b) 30%,
    rgba(14, 13, 11, 0) 58%
  );
  /* Fade out before the hero's bottom edge so there is no seam with the
     upload section below. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 96%);
  transition: background 0.6s ease;
}
.th-hero[data-hero-style="dating"] .th-hero__glow {
  --glow-a: rgba(236, 160, 108, 0.2);
  --glow-b: rgba(196, 110, 66, 0.08);
}
.th-hero[data-hero-style="evening"] .th-hero__glow {
  --glow-a: rgba(214, 208, 192, 0.15);
  --glow-b: rgba(150, 156, 170, 0.06);
}

body.ta-home .th-hero .ta-eyebrow {
  color: var(--th-gold-text);
}
body.ta-home .th-hero .ta-h1 {
  font-size: 56px;
  line-height: 1.06;
  color: var(--th-head);
}
.th-accent {
  font-style: italic;
  color: var(--th-accent);
}
body.ta-home .th-hero .ta-lede {
  font-size: 15px;
  line-height: 1.7;
  color: var(--th-body);
}

body.ta-home .th-hero .ta-btn--gold,
body.ta-home .th-studio .ta-btn--gold {
  background: var(--th-gold);
  color: var(--th-on-gold);
}
body.ta-home .th-hero .ta-btn--gold:hover,
body.ta-home .th-studio .ta-btn--gold:hover {
  background: var(--th-gold-hi);
}
body.ta-home .th-hero .ta-btn--ghost {
  border-color: rgba(255, 244, 224, 0.18);
  color: var(--th-head);
}
body.ta-home .th-hero .ta-btn--ghost:hover {
  border-color: var(--th-gold-border);
  color: var(--th-head);
}

/* Trust grid (replaces the assurance line and the proof bar) */
.th-trust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 14px 32px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--th-micro-2);
}
.th-trust li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.th-trust svg {
  width: 30px;
  height: 30px;
  flex: none;
  padding: 7px;
  border-radius: 50%;
  background: var(--th-gold-tint);
  color: var(--th-gold-text);
  box-sizing: border-box;
}

/* ---- Showcase ---------------------------------------------------------- */

.th-show {
  min-width: 0;
}

.th-split {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.22fr;
  gap: 22px;
  align-items: center;
}

.th-before,
.th-after {
  margin: 0;
  position: relative;
}

.th-frame {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--th-control);
}
.th-before .th-frame {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--th-line);
}
.th-after .th-frame {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--th-gold-border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), var(--th-rim);
}
body.ta .th-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 0;
  max-width: none;
  display: block;
}
.th-before img {
  filter: saturate(0.88);
}

/* Crossfading results: only .is-on is visible. */
.th-after .th-frame img {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.th-after .th-frame img.is-on {
  opacity: 1;
}

/* Fanned card peeking out behind the result */
.th-peek {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 10px;
  overflow: hidden;
  transform: translate(16px, -10px) rotate(2.5deg);
  transform-origin: 50% 100%;
  opacity: 0.45;
  border: 1px solid var(--th-line);
  background: var(--th-control);
}
body.ta .th-peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
  max-width: none;
  border-radius: 0;
}

/* Frosted labels */
.th-glass {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(14, 13, 11, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 244, 224, 0.12);
  color: var(--th-head);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.th-hdbadge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(14, 13, 11, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--th-gold-border);
  color: var(--th-gold-text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.th-cap {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(14, 13, 11, 0.58);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 244, 224, 0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.th-cap__k {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--th-gold-text);
}
.th-cap__v {
  font-size: 13px;
  color: var(--th-head);
}

/* Gold arrow bridging the seam between the two cards */
.th-bridge {
  position: absolute;
  top: 50%;
  left: calc((100% - 22px) / 2.22 + 11px);
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: var(--th-gold);
  color: var(--th-on-gold);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(14, 13, 11, 0.7);
}
.th-bridge svg {
  width: 18px;
  height: 18px;
}

/* Compare-slider mode (reuses assets/compare.js + .ta-ba) */
body.ta-home .th-slider {
  --ratio: 0.8;
  /* Close to the split view's height, so switching views barely moves the page */
  width: min(100%, 340px);
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--th-gold-border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}
body.ta-home .th-slider img {
  object-position: 50% 22%;
}
.th-show[data-mode="split"] .th-slider,
.th-show[data-mode="slider"] .th-split {
  display: none;
}

/* Toolbar: style pills + view toggle */
.th-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px 20px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.th-pills,
.th-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.th-pill {
  font-family: var(--ta-sans);
  font-size: 13px;
  line-height: 1;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 224, 0.14);
  background: var(--th-control);
  color: var(--th-micro-2);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.th-pill:hover {
  border-color: var(--th-gold-border);
  color: var(--th-head);
}
.th-pill[aria-pressed="true"] {
  background: var(--th-gold-tint);
  border-color: var(--th-gold-border);
  color: var(--th-accent);
}
.th-pill:focus-visible,
.th-mode:focus-visible,
.th-usecase:focus-visible,
.th-sample:focus-visible {
  outline: 2px solid var(--th-gold-text);
  outline-offset: 2px;
}
.th-modes {
  gap: 0;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--th-line);
  background: var(--th-control-2);
}
.th-mode {
  font-family: var(--ta-sans);
  font-size: 12px;
  line-height: 1;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--th-micro);
  cursor: pointer;
}
.th-mode[aria-pressed="true"] {
  background: rgba(255, 244, 224, 0.08);
  color: var(--th-head);
}

/* --------------------------------------------------------------------------
   3. Upload studio card
   -------------------------------------------------------------------------- */

body.ta-home .th-flow {
  background: var(--th-canvas);
  border-top: 0;
  padding: 8px var(--ta-gutter) 88px;
}

.th-studio {
  background: var(--th-card);
  border: 1px solid var(--th-line);
  border-radius: 14px;
  box-shadow: var(--th-rim), 0 30px 70px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Stepper becomes the card's header bar */
body.ta-home .th-studio .ta-stepper {
  justify-content: flex-start;
  padding: 16px 32px;
  background: var(--th-stepbar);
  border-bottom: 1px solid var(--th-line);
  gap: 18px;
}
body.ta-home .th-studio .ta-stepper__step {
  color: var(--th-micro);
}
body.ta-home .th-studio .ta-stepper__step.is-active {
  color: var(--th-head);
}
body.ta-home .th-studio .ta-stepper__step.is-active .ta-stepper__dot {
  background: var(--th-gold);
  border-color: var(--th-gold);
  color: var(--th-on-gold);
}
body.ta-home .th-studio .ta-stepper__dot {
  border-color: rgba(255, 244, 224, 0.2);
}
body.ta-home .th-studio .ta-stepper__bar {
  width: 40px;
  background: rgba(255, 244, 224, 0.14);
}

body.ta-home .th-studio .ta-upload {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 44px;
  padding: 40px 32px 40px;
}

body.ta-home .th-studio .ta-h3 {
  color: var(--th-head);
}
.th-hint {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--th-body);
  min-height: 1.5em;
}

/* Use-case chips */
body.ta-home .th-studio .ta-usecase-row {
  margin-top: 22px;
}
body.ta-home .th-studio .ta-usecase-row > .ta-label {
  color: var(--th-micro);
}
body.ta-home .th-studio .ta-usecases {
  gap: 8px;
  margin-top: 12px;
}
body.ta-home .th-studio .th-usecase {
  gap: 7px;
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--th-control);
  border-color: rgba(255, 244, 224, 0.12);
  color: var(--th-micro-2);
}
.th-usecase svg {
  width: 15px;
  height: 15px;
  flex: none;
  opacity: 0.85;
}
body.ta-home .th-studio .th-usecase:hover {
  border-color: var(--th-gold-border);
  color: var(--th-head);
}
body.ta-home .th-studio .th-usecase.is-active,
body.ta-home .th-studio .th-usecase[aria-pressed="true"] {
  background: var(--th-gold-tint);
  border-color: var(--th-gold-border);
  color: var(--th-accent);
}

/* Drop zone with a spotlight behind the icon */
body.ta-home .th-studio .ta-drop {
  position: relative;
  margin-top: 22px;
  padding: 52px 32px 40px;
  border: 1.5px dashed rgba(223, 192, 125, 0.28);
  border-radius: 12px;
  background: radial-gradient(
      circle at 50% 30%,
      rgba(223, 192, 125, 0.1) 0%,
      rgba(223, 192, 125, 0.03) 28%,
      rgba(28, 25, 22, 0) 55%
    ),
    var(--th-control);
}
body.ta-home .th-studio .ta-drop:hover,
body.ta-home .th-studio .ta-drop:focus-visible,
body.ta-home .th-studio .ta-drop.is-dragover,
body.ta-home .th-studio .ta-drop.border-blue-400 {
  border-color: var(--th-gold);
  background-color: #211d19;
}
body.ta-home .th-studio .ta-drop__icon {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(223, 192, 125, 0.22), rgba(223, 192, 125, 0.06) 70%);
  box-shadow: 0 0 0 1px rgba(223, 192, 125, 0.25), 0 0 40px rgba(223, 192, 125, 0.18);
  color: var(--th-gold-text);
}
.ta-drop__icon svg {
  width: 24px;
  height: 24px;
}
body.ta-home .th-studio .ta-drop__title {
  color: var(--th-head);
}
body.ta-home .th-studio .ta-drop__hint {
  color: var(--th-micro);
}
body.ta-home .th-studio .ta-linkbtn {
  color: var(--th-gold-text);
}
.th-sample {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--th-gold-border);
  background: var(--th-gold-tint);
  color: var(--th-accent);
  font-family: var(--ta-sans);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.th-sample img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 15%;
}
.th-sample:hover {
  background: rgba(223, 192, 125, 0.24);
  color: var(--th-head);
}
.th-sample[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

body.ta-home .th-studio .ta-chosen {
  margin-top: 22px;
  background: var(--th-control);
  border-color: rgba(255, 244, 224, 0.12);
  border-radius: 12px;
}

/* Custom dark checkbox */
body.ta-home .th-studio .ta-consent {
  margin-top: 20px;
  align-items: center;
  color: var(--th-micro-2);
}
body.ta-home .th-studio .ta-consent input.studio-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 5px;
  border: 1px solid rgba(255, 244, 224, 0.24);
  background-color: var(--th-control-2);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  flex: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.studio-checkbox::before {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--th-on-gold);
  border-bottom: 2px solid var(--th-on-gold);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 0.12s ease;
}
body.ta-home .th-studio .ta-consent input.studio-checkbox:hover {
  border-color: var(--th-gold-border);
}
body.ta-home .th-studio .ta-consent input.studio-checkbox:focus-visible {
  outline: 2px solid var(--th-gold-text);
  outline-offset: 2px;
}
body.ta-home .th-studio .ta-consent input.studio-checkbox:checked {
  background-color: var(--th-gold-text);
  border-color: var(--th-gold-text);
}
.studio-checkbox:checked::before {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

/* Tips panel */
body.ta-home .th-studio .ta-tips {
  border-left: 1px solid var(--th-line);
  padding-left: 36px;
}
body.ta-home .th-studio .ta-tips .ta-eyebrow {
  color: var(--th-gold-text);
}
body.ta-home .th-studio .ta-tips__list {
  gap: 12px;
  margin-top: 18px;
  color: var(--th-micro-2);
}
body.ta-home .th-studio .ta-tips__list li {
  align-items: center;
  gap: 11px;
}
.th-tick {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.th-tick svg {
  width: 12px;
  height: 12px;
}
.th-tick--yes {
  background: rgba(137, 196, 155, 0.15);
  color: var(--th-good);
}
.th-tick--no {
  background: rgba(217, 124, 116, 0.15);
  color: var(--th-avoid);
}

.th-check {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--th-line);
}
.th-check__title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--th-micro);
  margin: 0;
}
.th-check__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.th-check__pair figure {
  margin: 0;
}
body.ta .th-check__pair img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 1px solid var(--th-line);
}
.th-check__pair figcaption {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--th-micro-2);
}
.th-check__pair .th-tick {
  width: 18px;
  height: 18px;
}
.th-check__pair .th-tick svg {
  width: 10px;
  height: 10px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  body.ta-home .th-hero {
    gap: 48px;
    padding-top: 56px;
    padding-bottom: 64px;
  }
  .th-show {
    max-width: 620px;
  }
  body.ta-home .th-studio .ta-upload {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  body.ta-home .th-studio .ta-tips {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--th-line);
    padding-top: 26px;
  }
  .th-check__pair {
    max-width: 340px;
  }
}

@media (max-width: 760px) {
  body.ta-home .th-hero {
    gap: 30px;
    padding-top: 32px;
    padding-bottom: 44px;
  }
  body.ta-home .th-hero .ta-h1 {
    font-size: 38px;
    line-height: 1.08;
  }
  .th-trust {
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    font-size: 12.5px;
  }
  .th-trust li {
    align-items: flex-start;
  }
  .th-trust svg {
    width: 26px;
    height: 26px;
    padding: 6px;
  }
  .th-split {
    gap: 14px;
  }
  .th-bridge {
    left: calc((100% - 14px) / 2.22 + 7px);
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
  }
  .th-bridge svg {
    width: 14px;
    height: 14px;
  }
  .th-peek {
    transform: translate(8px, -6px) rotate(2.5deg);
  }
  .th-glass {
    left: 8px;
    bottom: 8px;
    font-size: 11px;
    padding: 5px 9px;
  }
  .th-hdbadge {
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }
  .th-cap {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 8px 10px;
  }
  .th-cap__k {
    font-size: 9.5px;
  }
  .th-cap__v {
    font-size: 12px;
  }
  body.ta-home .th-flow {
    padding: 0 12px 56px;
  }
  body.ta-home .th-studio .ta-stepper {
    padding: 14px 18px;
    gap: 10px;
  }
  body.ta-home .th-studio .ta-stepper__bar {
    width: 16px;
  }
  /* The header bar already shows progress; name only the current step. */
  body.ta-home .th-studio .ta-stepper__step.is-active .ta-stepper__label {
    display: inline;
  }
  body.ta-home .th-studio .ta-progress {
    display: none;
  }
  body.ta-home .th-studio .ta-upload {
    padding: 28px 18px 30px;
  }
  body.ta-home .th-studio .ta-drop {
    padding: 36px 18px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .th-hero__glow,
  .th-after .th-frame img,
  .th-navcta,
  .studio-checkbox::before {
    transition: none !important;
  }
}

/* The preview pane sits in the padded flow section, outside the card. */
body.ta-home .th-flow > .ta-preview {
  padding-left: 0;
  padding-right: 0;
}
