/* =========================================================================
   TIINA HERO — Tilted phone simulation (production)
   Source: dev iterations finalized at _dev-hero-variants/tt7tilt1-light.html
   Used by:  landing/index.html (homepage hero), landing/families/index.html
   Archive:  _archive/2026-05-26-pre-tilt-hero/ has the prior hero
   ========================================================================= */

/* ===== Body + nav blend with the cream that matches live tiina.ai ===== */
body { background: #FDF8F3; }
.site-nav {
  /* Solid cream so the nav reads as part of the page, not a floating bar */
  background: #FDF8F3;
  border-bottom: none;
  box-shadow: none;
  /* Match .section.hero.hero-tilt: side padding lives on the wrapper, not on the inner */
  padding: 0 32px;
}
/* Faint line + shadow appears only after the user scrolls past the hero
   (the .scrolled class is toggled by the existing IntersectionObserver in landing/index.html) */
.site-nav.scrolled {
  background: rgba(253, 248, 243, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(45, 52, 54, 0.08);
}
/* Nav inner: same max-width as hero .section-inner, no internal pad.
   Logo's LEFT edge → tracks H1's LEFT edge. nav-cta RIGHT edge → tracks phone RIGHT edge. */
.site-nav .nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 0;
  box-sizing: border-box;
}

/* ===== Hero section background ===== */
.section.hero.hero-tilt {
  background:
    radial-gradient(circle 460px at 78% 50%, rgba(232, 196, 184, 0.28), transparent 65%),
    #FDF8F3;
  padding: 72px 32px 96px;
  position: relative;
}
.section.hero.hero-tilt::before { display: none !important; }

/* ===== Float-wrap container — phone right, text wraps around ===== */
.section.hero.hero-tilt .section-inner.hv-hero-grid {
  max-width: 1280px;
  display: block;
}
.section.hero.hero-tilt .section-inner.hv-hero-grid::after {
  content: "";
  display: table;
  clear: both;
}

/* ===== Phone column (floated right) ===== */
.hero-tilt .te-stage {
  float: right;
  margin: 0 0 24px 56px;
  width: 280px;
  position: relative;
}
.hero-tilt .hv-phone-wrap {
  transform: rotate(4deg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.hero-tilt .hv-phone-wrap:hover {
  transform: rotate(4deg) translateY(-4px);
}
.hero-tilt .hv-phone-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130%;
  height: 90%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(232, 196, 184, 0.55), rgba(232, 196, 184, 0));
  filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}

/* ===== Phone device frame ===== */
.hero-tilt .hv-device {
  position: relative;
  z-index: 1;
  width: clamp(240px, 52vw, 280px);
  aspect-ratio: 9 / 18;
  background: #1b1b1d;
  border-radius: 48px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 36px 80px rgba(45, 30, 22, 0.3);
  /* iOS system font for all in-phone content — matches real RN app */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}
.hero-tilt .hv-device, .hero-tilt .hv-device * {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Settings gear icon — matches ConversationScreen.tsx SettingsIcon, top:8 right:16 */
.hero-tilt .hv-settings {
  position: absolute;
  top: 34px;
  right: 12px;
  width: 24px;
  height: 24px;
  z-index: 9;
  color: #4A5568;
}
.hero-tilt .hv-settings svg { display: block; }
.hero-tilt .hv-screen {
  position: absolute;
  inset: 8px;
  background: var(--cream);
  border-radius: 40px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hero-tilt .hv-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 22px;
  background: #000;
  border-radius: 14px;
  z-index: 10;
}

/* ===== iOS status bar inside phone ===== */
.hero-tilt .hv-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px 2px;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
}
.hero-tilt .hv-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--charcoal);
}
.hero-tilt .hv-status-icons svg { display: block; }

/* ===== Orb ===== */
.hero-tilt .hv-orb-area {
  display: flex;
  justify-content: center;
  padding: 8px 0 6px;
  flex: none;
}
.hero-tilt .hv-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  /* Wave Rim: canvas draws the flat peach disc + coral rim. No bg/anim. */
  background: transparent;
  opacity: 1;
}
.hero-tilt .hv-orb canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== Transcript ===== */
.hero-tilt .hv-transcript {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 4px 16px 8px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
  transition: opacity 0.22s ease;
}
.hero-tilt .hv-transcript.hv-dissolving { opacity: 0; }
.hero-tilt .hv-msg { padding: 8px 0; }
/* Speaker label — TranscriptMessage.tsx: fontSize 14, fontWeight 600, color textSecondary */
.hero-tilt .hv-spk {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #4A5568;
  letter-spacing: -0.005em;
}
/* Tiina label uses tiinaPresence color in the real app — bump to coral for legibility on cream */
.hero-tilt .hv-spk-tiina { color: var(--coral); }
/* Message body — fontSize 18 (UX-13 minimum), lineHeight 26, color textPrimary */
.hero-tilt .hv-text {
  font-size: 17px;
  line-height: 1.45;
  color: var(--charcoal);
  text-align: left;
}

/* ===== Photo thumbnail (rendered when scenario step has type: 'photo') ===== */
.hero-tilt .hv-photo-thumb {
  width: 180px;
  max-width: 100%;
  height: 132px;
  margin: 6px 0 4px;
  border-radius: 8px;
  overflow: hidden;
  display: block;
  box-shadow: 0 2px 8px rgba(45, 30, 22, 0.15);
}
.hero-tilt .hv-photo-thumb svg { width: 100%; height: 100%; display: block; }

/* ===== In-phone controls — visually scaled-down from RN app for simulation density ===== */
/* The real app uses 56h buttons for touch-target compliance; the simulation is non-interactive,
   so we shrink to give the transcript more room while keeping proportions + colors faithful. */
.hero-tilt .hv-controls {
  flex: none;
  padding: 6px 16px 12px;
}
.hero-tilt .hv-hangup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border-radius: 14px;
  background: #2D3436;   /* charcoal — matches the app Hang Up button */
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  border: none;
}
.hero-tilt .hv-share {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 22px;
  margin-top: 10px;
  border-radius: 14px;
  background: transparent;
  border: 2px solid var(--coral);
  color: var(--coral);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  box-sizing: border-box;
}

/* Camera icon — matches the View-composed CameraIcon in ConversationScreen.tsx */
.hero-tilt .hv-camera-icon {
  position: relative;
  width: 24px;
  height: 20px;
  display: inline-block;
  flex: none;
}
.hero-tilt .hv-camera-icon .cam-body {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 16px;
  background: var(--coral);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-tilt .hv-camera-icon .cam-lens {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--cream);
  background: transparent;
  box-sizing: border-box;
}
.hero-tilt .hv-camera-icon .cam-finder {
  position: absolute;
  top: 0;
  left: 5px;
  width: 7px;
  height: 4px;
  background: var(--coral);
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
}
/* ===== Editorial caption + decorative rule beneath phone ===== */
.hero-tilt .te-rule {
  width: 60px;
  height: 1px;
  background: var(--coral-dark);
  opacity: 0.55;
  margin: 24px auto 0;
}
.hero-tilt .te-caption {
  /* Per UX spec: bold only, no italic emphasis — easier on older eyes */
  font-family: 'Libre Baskerville', Georgia, serif;
  font-style: normal;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--gray, #6B7280);
  text-align: center;
  max-width: 240px;
  margin: 14px auto 0;
  transition: opacity .45s ease;
}
.hero-tilt .te-caption.is-out { opacity: 0; }
.hero-tilt .te-caption-tag {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin-bottom: 6px;
}

/* ===== Story scenario dots (clickable) ===== */
.hero-tilt .story-dots {
  display: flex;
  justify-content: center;
  gap: 0; /* buttons carry the spacing — 28px boxes keep the same visual dot rhythm */
  margin-top: 9px;
  pointer-events: auto;
}
/* 28px button = WCAG touch target; the visible dot is drawn inside via ::before */
.hero-tilt .story-dot {
  width: 28px;
  height: 28px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-tilt .story-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(168, 93, 64, 0.25);
  transition: background 0.25s ease, width 0.3s ease, border-radius 0.3s ease;
}
.hero-tilt .story-dot:hover::before { background: rgba(168, 93, 64, 0.5); }
.hero-tilt .story-dot.active::before {
  background: var(--coral-dark);
  width: 24px;
  border-radius: 4px;
}
.hero-tilt .story-dot:focus-visible {
  outline: 2px solid var(--coral-dark);
  outline-offset: 3px;
}

/* ===== Hero copy typography (overrides default .hero h1 / .subheadline sizing) ===== */
.hero-tilt .hv-copy h1,
.hero-tilt .hv-copy .hv-headline {
  font-size: clamp(42px, 3.9vw, 56px);
  line-height: 1.13;
  letter-spacing: -0.026em;
  font-weight: 700;
  margin: 0 0 32px;
  max-width: 100%;
}
.hero-tilt .hv-copy h1 .line,
.hero-tilt .hv-copy .hv-headline .line { display: block; }
.hero-tilt .hv-copy .eyebrow { margin: 0 0 26px; }
/* The eyebrow IS the page's <h1>; it must not pick up any heading typography,
   so every property the h1 rules (here and in styles.css) set is re-declared. */
.hero-tilt .hv-copy h1.eyebrow {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--coral);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.7;
  margin: 0 0 26px;
  max-width: 100%;
}
@media (max-width: 767px) {
  .hero-tilt .hv-copy h1.eyebrow { font-size: 13px; }
}
.hero-tilt .hv-copy .subheadline {
  font-size: 21px;
  line-height: 1.55;
  color: var(--charcoal);
  opacity: 0.78;
  margin: 0 0 40px;
  max-width: 720px;
}
.hero-tilt .hv-copy .hero-button-row { margin: 0; }
.hero-tilt .hv-copy .friction-text {
  color: var(--coral-dark);
  font-weight: 600;
  margin: 22px 0 0;
}

/* When the phone is hovered, the "Hear a sample call" button is the ONLY thing left bright.
   It swaps from secondary (outlined coral) to primary (filled coral) and pulses for attention. */
#hero-sample-btn.hv-sample-attn {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  animation: hv-sample-attn 1.4s ease-in-out infinite;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
@keyframes hv-sample-attn {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(198, 123, 92, 0.45);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 12px rgba(198, 123, 92, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #hero-sample-btn.hv-sample-attn { animation: none; }
}

/* Spotlight: when hovering the phone sim, dim everything except phone + sample-call button.
   .hv-spotlight is a fixed-position dim layer injected by hero-tilt.js.
   body.hv-spotlight-on is toggled in parallel so we can elevate the phone + button via z-index. */
.hv-spotlight {
  position: fixed;
  inset: 0;
  background: rgba(45, 52, 54, 0);
  pointer-events: none;
  /* Sits above the sticky nav (.site-nav is z-index 50) so the dim covers the whole page */
  z-index: 60;
  transition: background 0.35s ease;
}
/* Heavy charcoal filter — phone + CTA stay bright above; everything else dims */
.hv-spotlight.active { background: rgba(35, 41, 43, 0.78); }

/* Phone (the proof) AND sample button (the next action) cut through the dim.
   Nav, body copy, sections below all sit under the overlay. */
body.hv-spotlight-on .hero-tilt .te-stage,
body.hv-spotlight-on #hero-sample-btn {
  position: relative;
  z-index: 70;
}

/* The whole stage is a click target for the sample call (wired in hero-tilt.js) */
.hero-tilt .te-stage { cursor: pointer; }

/* Mobile: spotlight + sample-button pulse are desktop-only.
   On the stacked layout, the phone is below the text — dimming the page doesn't make sense. */
@media (max-width: 880px) {
  .hv-spotlight,
  .hv-spotlight.active { display: none; background: transparent; }
  #hero-sample-btn.hv-sample-attn { animation: none; }
  /* No sideways/skew tilt on mobile hover — only a shadow lift on the device */
  .hero-tilt .hv-phone-wrap,
  .hero-tilt .hv-phone-wrap:hover { transform: none; }
  .hero-tilt .hv-device {
    transition: box-shadow 0.35s ease;
  }
  .hero-tilt .hv-phone-wrap:hover .hv-device {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 44px 90px rgba(45, 30, 22, 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hv-spotlight { transition: none; }
}

/* ===== Mobile: drop the float and put the text on top =====
   Selector specificity must match the base rule (5 classes) so display: flex wins */
@media (max-width: 880px) {
  .section.hero.hero-tilt { padding-top: 78px; }
  .section.hero.hero-tilt .section-inner.hv-hero-grid {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 32px;
    text-align: left;
  }
  /* The desktop clearfix becomes an empty flex item here. In a reversed column
     it creates a phantom 32px gap above the copy, so remove it when stacked. */
  .section.hero.hero-tilt .section-inner.hv-hero-grid::after { display: none; }
  /* Phone stays centered horizontally — it's the sim, not the copy */
  .hero-tilt .te-stage {
    float: none;
    margin: 0 auto;
    width: auto;
    perspective: none;
  }
  .hero-tilt .hv-phone-wrap { transform: none; }
  /* Copy column: keep left-aligned on mobile (eyebrow, h1, subhead, CTAs, friction text) */
  .hero-tilt .hv-copy {
    text-align: left;
    width: 100%;
  }
  .hero-tilt .hv-copy .subheadline { margin-left: 0; margin-right: 0; max-width: 100%; }
  /* CTA cluster stays left-aligned, matching the headline/sub above and the desktop layout */
  .hero-tilt .hero-button-row { justify-content: flex-start; }
  .hero-tilt .hv-copy .friction-text { text-align: left; }
  /* Phone interior text stays left-aligned — matches real React Native app */
  .hero-tilt .hv-transcript,
  .hero-tilt .hv-msg,
  .hero-tilt .hv-spk,
  .hero-tilt .hv-text { text-align: left; }
}

/* Match the press/manual mobile rhythm from the bottom of the 64px nav to the
   first hero line. */
@media (max-width: 767px) {
  .section.hero.hero-tilt { padding-top: 43px; }
}

/* Phones: tighten the top so the CTA sits in the first fold.
   These match the base selectors' specificity to actually win. */
@media (max-width: 600px) {
  .section.hero.hero-tilt { padding-bottom: 56px; }
  .hero-tilt .hv-copy .eyebrow,
  .hero-tilt .hv-copy h1.eyebrow { margin: 0 0 12px; }
  .hero-tilt .hv-copy h1:not(.eyebrow),
  .hero-tilt .hv-copy .hv-headline { font-size: 30px; line-height: 1.18; margin: 0 0 16px; }
  .hero-tilt .hv-copy .subheadline { font-size: 17px; margin: 0 0 22px; }
}
