/* ==========================================================================
   Resly Landing Page — Styles
   ========================================================================== */

:root {
  --bg-light: #F7EFE6;
  --bg-tint: #F0E2D2;
  --bg-dark-1: #5C2E1E;
  --bg-dark-2: #3D1E12;
  --bg-dark-3: #1C0E08;
  --bg-dark-next-1: #7A4230;
  --bg-dark-next-2: #4F2A1B;
  --bg-dark-next-3: #2E160E;

  --card-white: #FFFFFF;
  --ink: #241F1B;
  --muted-light: rgba(36, 31, 27, 0.6);
  --muted-dark: rgba(255, 255, 255, 0.7);

  --accent: #C1613F;
  --accent-hover: #D97B54;
  --accent-link-hover: #A8472C;
  --icon-chip-bg: #F5E6DE;

  --badge-dark-bg: rgba(193, 97, 63, 0.14);
  --badge-dark-border: rgba(193, 97, 63, 0.35);
  --badge-dark-text: #E8A47A;

  --phone-bezel: #0B1220;
  --cta-text: #FFFFFF;

  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Keeps anchor/scrollIntoView targets from landing underneath the fixed
     site-nav bar — sized to comfortably clear the nav at any viewport. */
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--ink);
  background: var(--bg-light);
  /* Defensive guard: nothing in this layout should ever need to scroll
     sideways, so make sure a stray element can't cause it. */
  overflow-x: hidden;
}

img { max-width: 100%; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-link-hover);
}

/* ============ Site nav ============
   Fixed overlay bar, transparent over the hero from page load; gains a
   dark blurred backdrop once the hero has scrolled out of view. */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(24px, 4vw, 36px);
  padding: 12px clamp(20px, 6vw, 64px);
  background: transparent;
  transition: background 300ms ease, backdrop-filter 300ms ease;
  /* Safety net: if link labels ever get longer (translations, etc.) and
     stop fitting even at the mobile font/gap sizes below, this lets the
     bar scroll sideways instead of wrapping or breaking layout. */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav.is-scrolled {
  background: rgba(20, 11, 7, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 600;
  color: #F3EDE6;
  opacity: 0.85;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 200ms ease;
}

.site-nav a:hover {
  color: #F3EDE6;
  opacity: 1;
}

@media (max-width: 768px) {
  .site-nav {
    gap: 14px;
    padding: 12px 20px;
  }

  .site-nav a {
    font-size: 0.75rem;
  }
}

/* ============ Layout helpers ============ */

.section {
  padding: clamp(56px, 9vh, 96px) clamp(20px, 6vw, 64px);
  width: 100%;
}

.section-light { background: var(--bg-light); }
.section-tint { background: var(--bg-tint); }
.section-dark {
  background: linear-gradient(160deg, var(--bg-dark-next-1) 0%, var(--bg-dark-next-2) 50%, var(--bg-dark-next-3) 100%);
}

.section-inner {
  margin: 0 auto;
}

.max-1000 { max-width: 1000px; }
.max-1080 { max-width: 1080px; }
.max-1160 { max-width: 1160px; }
.max-640 { max-width: 640px; }
.max-560 { max-width: 560px; }

.center-text { text-align: center; }

.section-heading {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 clamp(32px, 5vh, 48px);
}
.section-dark .section-heading,
.section-heading.on-dark {
  color: #FFFFFF;
}
.section-heading.center { text-align: center; }

.section-heading-sm {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin: 16px 0 20px;
}

.body-copy {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted-dark);
  margin: 0;
}

/* ============ Badge / pill ============ */

.badge {
  display: inline-block;
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--badge-dark-bg);
  border: 1px solid var(--badge-dark-border);
  color: var(--badge-dark-text);
}

.badge-dark { margin-bottom: 4px; }

/* ============ Buttons ============ */

.btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-family);
}

.btn-primary {
  background: var(--accent);
  color: var(--cta-text);
  font-weight: 700;
  padding: 14px 28px;
  font-size: 1.03125rem;
  transition: transform 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

@media (hover: hover) {
  .btn-primary:hover {
    transform: scale(1.045);
    background: var(--accent-hover);
    box-shadow: 0 10px 24px -8px rgba(193, 97, 63, 0.55);
  }
}

/* ============ Hero ============ */

.hero {
  min-height: 100svh;
  padding: clamp(24px, 5vh, 56px) clamp(20px, 6vw, 64px);
  background: linear-gradient(160deg, var(--bg-dark-1) 0%, var(--bg-dark-2) 50%, var(--bg-dark-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  width: clamp(240px, 33vw, 360px);
  display: block;
  margin: 0 auto clamp(28px, 5vh, 48px);
}

.hero-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  justify-content: center;
}

.hero-text {
  flex: 1 1 380px;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.hero-text h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin: 0;
}

.subhead {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.5;
  color: var(--muted-dark);
  margin: 0;
}

.hero-phone {
  flex: 0 1 240px;
  display: flex;
  justify-content: center;
}

/* ============ Phone mockups ============
   Borderless device frame: no encasing bezel, no overlaid Dynamic Island or
   home indicator — the screenshots already bake in their own device chrome
   (status bar, Dynamic Island, home indicator) and their own rounded
   corners. The container's border-radius matches that baked-in corner
   radius exactly (measured from the source PNGs: ~176px / 1608px width =
   ~11% at every corner, consistent across every screenshot). A drop shadow
   stands in for physical depth. */

.phone-mockup {
  position: relative;
  /* Screenshots are ~2.17x taller than wide with a true CIRCULAR corner cut
     baked in (measured ~174-175px radius on a 1608px-wide / 3496px-tall
     source). A single border-radius percentage resolves independently per
     axis (% of width horizontally, % of height vertically), so on a box
     this much taller than wide a single value way overshoots vertically.
     Splitting horizontal/vertical to the measured ratio (~10.9% / ~5%)
     reproduces the same circular curve as the image, sized very slightly
     larger so the frame never clips into the screenshot's rounded corner. */
  border-radius: 11% / 5.1%;
  overflow: hidden;
  width: 100%;
  max-width: 230px;
  box-shadow: 0 40px 70px -25px rgba(0, 0, 0, 0.6);
}

.phone-secondary {
  max-width: 230px;
  box-shadow: 0 30px 60px -20px rgba(36, 31, 27, 0.35);
}

.phone-showcase {
  max-width: 220px;
  box-shadow: 0 20px 40px -18px rgba(36, 31, 27, 0.3);
}

.phone-screen img {
  width: 100%;
  display: block;
}

/* ============ Hero screenshot carousel ============ */

.hero-carousel {
  position: relative;
  aspect-ratio: 201 / 437; /* actual screenshot dimensions: 1608 x 3496 */
  background: var(--bg-light);
  perspective: 1200px;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  pointer-events: none;
  backface-visibility: hidden;
  transform-origin: center center;
  opacity: 0;
  z-index: 1;
  transition: transform 650ms cubic-bezier(.65, 0, .35, 1), opacity 650ms cubic-bezier(.65, 0, .35, 1);
}

.carousel-slide.is-active {
  opacity: 1;
  z-index: 2;
}

/* ============ Problem stats ============ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.stat-card {
  background: var(--card-white);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(36, 31, 27, 0.07);
}

.stat-number {
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-sub {
  font-size: 0.90625rem;
  line-height: 1.4;
  color: var(--muted-light);
  margin: 0;
}

/* ============ How It Works ============ */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: clamp(40px, 6vh, 64px);
}

.step-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.icon-chip {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--icon-chip-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-label {
  font-size: 1.03125rem;
  font-weight: 700;
  margin: 0;
  max-width: 240px;
}

.secondary-phone-wrap {
  display: flex;
  justify-content: center;
  max-width: 230px;
  margin: 0 auto;
}

/* ============ Showcase ============ */

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 28px;
}

.showcase-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: transform 220ms ease;
}

@media (hover: hover) {
  .showcase-card:hover {
    transform: translateY(-8px);
  }
}

.showcase-caption {
  font-size: 0.90625rem;
  color: var(--muted-light);
  text-align: center;
  margin: 0;
}

/* ============ Quotes ============ */

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.quote-card {
  background: var(--card-white);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(36, 31, 27, 0.07);
}

.quote-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  font-style: italic;
  margin: 0 0 16px;
}

.quote-name {
  font-size: 0.84375rem;
  font-weight: 700;
  margin: 0 0 2px;
}

.quote-sub {
  font-size: 0.78125rem;
  color: var(--muted-light);
  margin: 0;
}

.waitlist-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: fit-content;
  margin: clamp(40px, 6vh, 64px) auto 0;
  padding: 14px 26px;
  background: #FFFFFF;
  border-radius: 100px;
  box-shadow: 0 1px 3px rgba(36, 31, 27, 0.07);
}

.waitlist-pill-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 100px;
  background: #4C9A6A;
  animation: waitlist-pill-pulse 1.8s ease-out infinite;
}

@keyframes waitlist-pill-pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 154, 106, 0.5); }
  100% { box-shadow: 0 0 0 8px rgba(76, 154, 106, 0); }
}

.waitlist-pill-count {
  font-size: 22px;
  font-weight: 800;
  color: #241F1B;
}

.waitlist-pill-label {
  font-size: 0.90625rem;
  font-weight: 600;
  color: rgba(36, 31, 27, 0.6);
}

/* ============ Waitlist ============ */

.subhead-sm {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.5;
  color: var(--muted-light);
  margin: -24px 0 32px;
}

.waitlist-card {
  width: 100%;
  max-width: 560px;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(36, 31, 27, 0.08);
  box-sizing: border-box;
  margin: 0 auto;
}

.waitlist-footnote {
  font-size: 0.875rem;
  color: var(--muted-light);
  margin-top: 20px;
}

/* ============ Footer ============ */

.footer {
  padding: 40px 20px 48px;
  background: var(--bg-light);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  display: block;
}

.footer-line {
  font-size: 0.875rem;
  color: var(--muted-light);
  margin: 0;
  max-width: 420px;
}

.footer-email {
  font-size: 0.84375rem;
  font-weight: 600;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--muted-light);
  margin: 4px 0 0;
}

/* ============ Sticky mobile CTA ============ */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(247, 239, 230, 0), rgba(247, 239, 230, 0.96) 40%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.sticky-cta.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.btn-sticky {
  width: 100%;
  max-width: 340px;
  text-align: center;
  padding: 13px 20px;
  font-size: 0.96875rem;
  box-shadow: 0 12px 28px -10px rgba(193, 97, 63, 0.5);
}

@media (min-width: 760px) {
  .sticky-cta { display: none; }
}

@media (max-width: 759px) {
  /* Extra clearance so the footer's copyright line doesn't end up
     permanently hidden behind the fixed sticky "Join Waitlist" bar. */
  .footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============ Scroll fade-in ============ */

.fade-section {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 380ms ease, transform 380ms ease;
}

.fade-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Placeholder images (until real assets are dropped in) ============
   .placeholder-img is just a marker class the <head> error-listener looks for —
   it carries no visual styling so a successfully-loaded real image renders plain. */

/* Fallback box rendered by JS when an image 404s */
.img-placeholder-box {
  width: 100%;
  background: var(--icon-chip-bg);
  color: var(--accent-link-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 12px;
  line-height: 1.35;
  box-sizing: border-box;
}

.hero-logo.img-placeholder-box {
  width: clamp(240px, 33vw, 360px);
  aspect-ratio: auto;
  height: auto;
  min-height: 48px;
  border-radius: 8px;
}

.footer-logo.img-placeholder-box {
  width: 28px;
  height: 28px;
  aspect-ratio: auto;
  font-size: 0.5rem;
  padding: 0;
  border-radius: 6px;
}

.phone-screen .img-placeholder-box {
  aspect-ratio: 9 / 19.5;
}
