/* ==========================================================================
   THEME — That AI Guy Promo Page
   ==========================================================================
   1.  Font (Fredoka via Google Fonts)
   2.  Theme tokens — light / dark (via prefers-color-scheme)
   3.  Global type overrides
   3a. Background decorators (mobile only)
   4.  Hide default header
   5.  Promo page — global layout
   6.  Section: Intro (logo float + text wrap)
   7.  Section: Features (text left, phone + bubbles right)
   8.  Section: Roast (phones left, text right)
   9.  Section: Reviews / Slider
   10. Section: Sign-off
   11. Section: Download
   12. Bottom navigation — Liquid Glass
   13. Theme toggle button
========================================================================== */

/* ==========================================================================
   Imports
========================================================================== */
@import url("svg-variables.css");
@import url("stars.css");
@import url("slider.css");
@import url("reviews.css");
@import url("speech-bubbles.css");
@import url("codewall.css");
@import url("top-bg-fx.css");
@import url("iphone.css");
@import url("scissors.css");
@import url("qr.css");

/* ==========================================================================
   1. Font
========================================================================== */

/* Fredoka variable (300–700) loaded via Google Fonts in HTML <head> */


/* ==========================================================================
   2. Theme tokens
========================================================================== */


:root {
  --font-body: 'Trebuchet MS', 'Palatino', 'Baskerville', sans-serif;
  --font-heading: 'Gill Sans', Verdana, Arial, sans-serif;
  --font-brand: 'Fredoka', Verdana, Arial, sans-serif;
  --font-custom1: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  --font-custom2: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  --font-custom3: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


:root {
  /* Colour */
  --color-tg:                   #045ada;
  --color-bg:                   #ffffff;
  --color-surface:              #f2f4f7;
  --color-border:               #dde1ea;
  --color-text:                 #1d1f24;
  --color-text-muted:           #5a6375;
  --color-btn-primary-bg:       #a1b1ca;
  --color-btn-primary-text:     #1d1f24;
  --color-btn-secondary-bg:     #3e3b1b;
  --color-btn-secondary-text:   #a1b1ca;
  --color-focus:                #4a7fcb;
  --color-alert-info-bg:        #eaf2ff;
  --color-alert-info-text:      #1d3a6b;
  --color-alert-success-bg:     #e8f9ef;
  --color-alert-success-text:   #1a5c35;
  --color-alert-warning-bg:     #fff8e6;
  --color-alert-warning-text:   #6b4800;
  --color-alert-error-bg:       #ffeaea;
  --color-alert-error-text:     #6b1a1a;
  --shadow-sm:                  0 1px 3px rgb(0 0 0 / 0.08);
  --shadow-md:                  0 4px 12px rgb(0 0 0 / 0.1);
  --shadow-lg:                  0 8px 24px rgb(0 0 0 / 0.14);
  /* Stars */
  --color-star-active:          #a1b1ca;
  --color-star-inactive:        #5a6375;
  /* Navigation */
  --nav-glass-bg:               rgba(255, 255, 255, 0.40);
  --nav-glass-border:           rgba(255, 255, 255, 0.65);
  --nav-glass-shadow:           rgba(0, 0, 0, 0.14);
  --nav-glass-highlight:        rgba(255, 255, 255, 0.85);
  --nav-active-bg:              rgba(255, 255, 255, 0.45);
  --nav-active-glow:            rgba(200, 220, 255, 0.7);
  --nav-text:                   #1d1f24;
  --toggle-bg:                  rgba(0, 0, 0, 0.08);
  --toggle-border:              rgba(0, 0, 0, 0.12);
  --text-gradient:                radial-gradient(circle at 100% 30%, rgba(22, 65, 255, 0.8), rgba(31, 81, 196, 0.2) 80%), 
                                  radial-gradient(circle at 100% 40%, rgba(20, 114, 255, 0.8), rgba(60, 190, 246, 0.1) 50%), 
                                  radial-gradient(circle at 55% 300%, rgba(20,25,250,.87), rgba(70, 155, 230, 0.5) 80%), 
                                  radial-gradient(circle at 50% 50%, rgba(22, 5, 119, 0.87), rgba(25, 36, 111, 0.5) 80%), 
                                  radial-gradient(circle at 20% 100%, rgba(71, 175, 240, 0.95), rgba(200,222,255,.70) 90%);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Colour */
    --color-bg:                   #0b0d10;
    --color-tg:                   #3a7abf;
    --color-surface:              #1a1d28;
    --color-border:               #2c3044;
    --color-text:                 #a1b1ca;
    --color-text-muted:           #6b7a94;
    --color-btn-primary-bg:       #1d1f24;
    --color-btn-primary-text:     #a1b1ca;
    --color-btn-secondary-bg:     #ebe6b7;
    --color-btn-secondary-text:   #1d1f24;
    --color-focus:                #7aaff0;
    --color-alert-info-bg:        #1a2540;
    --color-alert-info-text:      #90b8f0;
    --color-alert-success-bg:     #152a1e;
    --color-alert-success-text:   #7fcfa0;
    --color-alert-warning-bg:     #2a2005;
    --color-alert-warning-text:   #d4a845;
    --color-alert-error-bg:       #2a0f0f;
    --color-alert-error-text:     #d48080;
    --shadow-sm:                  0 1px 3px rgb(0 0 0 / 0.3);
    --shadow-md:                  0 4px 12px rgb(0 0 0 / 0.4);
    --shadow-lg:                  0 8px 24px rgb(0 0 0 / 0.5);
    /* Stars */
    --color-star-active:          #a1b1ca;
    --color-star-inactive:        #6b7a94;
    /* Navigation */
    --nav-glass-bg:               rgba(15, 18, 28, 0.65);
    --nav-glass-border:           rgba(255, 255, 255, 0.12);
    --nav-glass-shadow:           rgba(0, 0, 0, 0.55);
    --nav-glass-highlight:        rgba(255, 255, 255, 0.10);
    --nav-active-bg:              rgba(255, 255, 255, 0.14);
    --nav-active-glow:            rgba(80, 140, 255, 0.50);
    --nav-text:                   #a1b1ca;
    --toggle-bg:                  rgba(255, 255, 255, 0.10);
    --toggle-border:              rgba(255, 255, 255, 0.15);
    --text-gradient:                radial-gradient(circle at 100% 30%, rgba(100, 150, 255, 0.95), rgba(150, 190, 255, 0.40) 80%),
                                    radial-gradient(circle at 100% 40%, rgba(80, 180, 255, 0.90), rgba(140, 220, 255, 0.30) 50%),
                                    radial-gradient(circle at 55% 300%, rgba(90, 120, 255, 0.90), rgba(120, 180, 255, 0.50) 80%),
                                    radial-gradient(circle at 50% 50%, rgba(140, 80, 255, 0.85), rgba(170, 140, 255, 0.50) 80%),
                                    radial-gradient(circle at 20% 100%, rgba(100, 210, 255, 0.95), rgba(200, 235, 255, 0.80) 90%);
  }
}


/* ==========================================================================
   3. Global type overrides
========================================================================== */

html {
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: var(--font-body);
  letter-spacing: var(--letter-space);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-body);
}

/* Mobile: fixed font sizes — base for all inherited elements */
body {
  font-size: var(--font-size-lg);
  /* Top padding creates the stage for the fixed logo circle peeking from top */
  padding-top: 5rem;
  /* Extra bottom padding so content clears the fixed nav */
  padding-bottom: calc(14rem + env(safe-area-inset-bottom, 0px));
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
}

h1 { font-size: var(--font-size-xl); }
h2,
h3,
h4 { font-size: var(--font-size-lg); }
h5,
h6 { font-size: var(--font-size-base); }

p {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-body);
  margin: 0;
}

/* Desktop: fluid font sizes — scale from mobile base → proportional max at 1280px.
Formula: clamp(mobile-rem, linear-interp(768px→1280px), max-rem)
Linear form: calc(b + m*vw) avoids mixed rem/px division in calc.
Exceptions (badges, reviews, stars) are pinned in their own stylesheets. */
@media (width >= 76.8rem) {
  body {
    /* 1.2rem → 2rem */
    font-size: clamp(var(--font-size-base), -1.77rem + 3.9vw, var(--font-size-lg));
  }

  h1 {
    /* 1.5rem → 2.5rem */
    font-size: clamp(var(--font-size-xl), -1.77rem + 3.9vw, var(--font-size-2xl));
  }

  h2,
  h3,
  h4 {
    /* 1.333rem → 2.2rem */
    font-size: clamp(var(--font-size-base), -1.77rem + 3.9vw, var(--font-size-xl));
  }

  h5,
  h6 {
    /* 1.25rem → 2rem */
    font-size: clamp(var(--font-size-base), -1.77rem + 3.9vw, var(--font-size-lg));
  }

  p {
    /* 1.2rem → 2rem */
    font-size: clamp(var(--font-size-base), -1.77rem + 3.9vw, var(--font-size-lg));
  }
}

.promo-text p {
  max-width: none; /* override global.css 65ch prose cap */
}

.promo-text p + p {
  margin-top: 3rem;
}

.promo-text p span {
  background: var(--text-gradient);
  background-clip: text;
  color: transparent;
  font-family: var(--font-custom1);
  font-size: 110%;
  letter-spacing: var(--letter-space-sm);
  line-height: 1;
  mix-blend-mode: plus-lighter;
}

.promo-text span > strong {
  font-family: var(--font-custom2);
  font-size: 130%;
  letter-spacing: 0.05rem;
}

.promo-text span > strong > span {
  font-size: 120%;
  font-family: var(--font-custom3);
}

.promo-text em {
  background-image: var(--thataiguySVG);
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: contain;
  color: var(--color-bg);
  display: inline-block;
  font-size: 0;
  height: 3.5rem;
  margin-bottom: -2.5rem;
  position: relative;
  top: -2.5rem;
  width: 7.5rem;
}

.promo-text em.taig-lg {
  height: 7rem;
  margin-bottom: -3.3rem;
  top: -3.3rem;
  width: 15rem;
}

.promo-text ul, 
.promo-ksps ul {
  filter: brightness(0.6);
  list-style: none;
}

@media (prefers-color-scheme: dark) {
  .promo-text ul, 
  .promo-ksps ul {
    filter: brightness(1);
  }
}

.promo-ksps ul li {
  margin-bottom: 0.33em;
  letter-spacing: var(--letter-space-sm);
  line-height: var(--line-height-body);
  font-size: var(--font-size-base);
}

/* h1 in promo-signature: visually matches the old <ul><li> — body text, not heading size */
.promo-signature h1 {
  filter: brightness(0.6);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-body);
  line-height: var(--line-height-body);
}

/* ==========================================================================
   3a. Background decorators (mobile only)
========================================================================== */

body::before,
body::after {
  background-image: url('../assets/bgs/wavegrid-bg.webp'), url('../assets/bgs/wavegrid-bgr.webp');
  background-position: left bottom, right bottom;
  background-repeat: no-repeat;
  background-size: 40% 100%;
  content: '';
  display: inline-block;
  height: 100vh;
  opacity: 0.33;
  position: fixed;
  width: 100%;
  z-index: -2;
}

body::after {
  transform: rotateY(180deg);
}

@media (prefers-color-scheme: dark) {
  body::before,
  body::after {
    filter: invert(1);
  }
}

/* Parallax drift — mobile only (desktop elements are display:none above).
   Both pseudo-elements are position:fixed so they are stationary by default.
   Keyframes run from -Xvh → 0 (element starts above viewport, drifts down to
   natural position at scroll bottom). Height is extended by the same Xvh so
   the bottom edge always reaches the viewport bottom — no gap at either end.
   Uses CSS individual `translate` so it composes with ::after's transform: rotateY(180deg). */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body::before {
      animation-name:            bg-parallax-slow;
      animation-timing-function: linear;
      animation-timeline:        scroll();
      height: 135vh; /* 100vh + 35vh drift */
    }
    body::after {
      animation-name:            bg-parallax-fast;
      animation-timing-function: linear;
      animation-timeline:        scroll();
      height: 180vh; /* 100vh + 80vh drift */
    }
  }
}

@keyframes bg-parallax-slow {
  from { translate: 0 -35vh; }
  to   { translate: 0 0; }
}

@keyframes bg-parallax-fast {
  from { translate: 0 -80vh; }
  to   { translate: 0 0; }
}


/* Dark mode: codewall base text — overrides hardcoded #1e2460 in codewall.css */
@media (prefers-color-scheme: dark) {
  .promo-codewall {
    color: #8090b8;
  }
}


/* ==========================================================================
   4. Hide default header
========================================================================== */

.site-header {
  display: none;
}


/* ==========================================================================
   5. Promo page — global layout
========================================================================== */

/* Section spacing */
.promo-section {
  margin-bottom: 3rem;
}

@media (width >= 76.8rem) {
  .promo-section {
    margin-bottom: 5rem;
  }
}

/* Section divider — subtle liquid-glass rule with centred speech emoji */
.section-divider {
  border: none;
  margin: 5rem var(--grid-gutter);
  opacity: 0.4;
  position: relative;
  text-align: center;
}

/* The horizontal rule line — fades out at edges, inset shadow for depth */
.section-divider::before {
  background: linear-gradient(to right,
    transparent,
    color-mix(in srgb, var(--color-text) 15%, transparent) 30%,
    color-mix(in srgb, var(--color-text) 15%, transparent) 70%,
    transparent);
  box-shadow: 0 1px 2px color-mix(in srgb, #000000 20%, transparent);
  content: '';
  display: block;
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
  top: 50%;
}

/* The emoji pill — bg matches page to cut the line, x-padding creates visual gap, inset shadow sinks it */
.section-divider::after {
  background: var(--color-bg);
  border-radius: 4rem;
  box-shadow:
    inset 0 2px 4px color-mix(in srgb, #000000 25%, transparent),
    inset 0 1px 2px color-mix(in srgb, #000000 15%, transparent);
  content: attr(data-emoji);
  display: inline-block;
  font-size: 2.16rem;
  line-height: 1;
  padding: 0.5rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   6. Section: Intro — logo centred behind two columns, shape-outside circles
========================================================================== */

.promo-intro {
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

/* Logo sits behind both columns, near the top */
/* Fluid: 12rem at 320px → 22rem at 768px, locked above */
.promo-logo {
  height: auto;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: clamp(12rem, calc(12rem + 10rem * (100vw - 32rem) / 44.8rem), 22rem);
  z-index: -1;
}

/* Two-column flex wrapper */
.promo-text-wrap {
  display: flex;
  gap: 2rem;
}

.promo-col-l,
.promo-col-r {
  flex: 1;
  min-width: 0;
}

/* Left column: float pushes text away from the centre (logo) on the right */
/* Fluid half-width: 6rem at 320px → 11rem at 768px, locked above */
.promo-col-l::before {
  content: '';
  float: right;
  height: clamp(12rem, calc(12rem + 10rem * (100vw - 32rem) / 44.8rem), 22rem);
  shape-outside: circle(clamp(6rem, calc(6rem + 5rem * (100vw - 32rem) / 44.8rem), 11rem) at 100% 50%);
  width: clamp(6rem, calc(6rem + 5rem * (100vw - 32rem) / 44.8rem), 11rem);
}

/* Right column: float pushes text away from the centre (logo) on the left */
/* Width = radius so the circle is never clipped by the float box */
.promo-col-r::before {
  content: '';
  float: left;
  height: clamp(12rem, calc(12rem + 10rem * (100vw - 32rem) / 44.8rem), 22rem);
  shape-outside: circle(clamp(8rem, calc(8rem + 5rem * (100vw - 32rem) / 44.8rem), 13rem) at 0% 50%);
  width: clamp(8rem, calc(8rem + 5rem * (100vw - 32rem) / 44.8rem), 13rem);
}

/* Full-width paragraph below the two columns */
.promo-signature {
  margin: 3rem auto 0;
  width: clamp(32rem, 90vw, 48rem);
}

.promo-signature h1 + p {
  margin: 1rem 0 0;
}


/* ==========================================================================
   6a. Section: Key Selling Points — word carousel
========================================================================== */

.promo-ksps {
  overflow-x: clip;
}

/* ==========================================================================
   6a. Section: Key Selling Points — word carousel
========================================================================== */
/* Hidden on mobile */
.marquee-strip {
  display: none;
}

/* Hidden on mobile */
.orbit-star {
  display: none;
}

/* ==========================================================================
   7. Section: Features — text left, phone + speech bubbles right
========================================================================== */

.promo-text {
  flex: 1;
  min-width: 0;
}


/* ==========================================================================
   9. Section: Reviews / Slider
========================================================================== */
/* reviews.css | slider.css */

/* ==========================================================================
   10. Section: Download
========================================================================== */
/* download-btn.css */


/* ==========================================================================
   12. Bottom navigation — Liquid Glass
========================================================================== */

/* Structure */
.bottom-nav {
  border-radius: 9999px;
  bottom: calc(3.66rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 2rem;
  left: 50%;
  padding: 0.6rem 0.9rem;
  position: fixed;
  transform: translateX(-50%);
  z-index: 100;
}

/* Glass appearance — applied via .glass modifier in HTML */
.bottom-nav.glass {
  backdrop-filter: blur(24px) saturate(200%);
  background: var(--nav-glass-bg);
  border: 1px solid var(--nav-glass-border);
  box-shadow:
    0 8px 32px var(--nav-glass-shadow),
    inset 0 1px 0 var(--nav-glass-highlight),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  align-items: center;
  border-radius: 9999px;
  color: var(--nav-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: bold;
  gap: 0.3rem;
  letter-spacing: 0.07em;
  padding: 0.75rem 1.65rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.bottom-nav-icon {
  height: 2.6rem;
  object-fit: contain;
  width: 2.6rem;
}

/* Privacy icon is black SVG — invert to white in dark mode */
@media (prefers-color-scheme: dark) {
  a[href="privacy.html"] .bottom-nav-icon {
    filter: invert(1);
  }
}

.bottom-nav-label {
  display: block;
}

/* Active state — glow */
.bottom-nav-item.is-active {
  background: var(--nav-active-bg);
  box-shadow:
    0 0 18px var(--nav-active-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  opacity: 1; /* override a:visited dim */
}

/* Hover */
@media (hover: hover) {
  .bottom-nav-item:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Press */
.bottom-nav-item:active {
  transform: scale(0.93);
}

/* Focus — matches active (scale + glow) */
.bottom-nav-item:focus-visible {
  background: var(--nav-active-bg);
  box-shadow:
    0 0 18px var(--nav-active-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  outline: none;
  transform: scale(0.93);
}

/* Desktop: 3× scale */
@media (width >= 76.8rem) {
  .bottom-nav {
    padding: 1rem 1.5rem;
  }

  .bottom-nav-item {
    font-size: 1.65rem;
    gap: 0.6rem;
    padding: 1.5rem 3.5rem;
  }

  .bottom-nav-icon {
    height: 5.25rem;
    width: 5.25rem;
  }
}

/* ==========================================================================
   13. Theme toggle button
========================================================================== */

/* Structure */
.theme-toggle {
  border-radius: 9999px;
  cursor: pointer;
  font-size: 1.1rem;
  height: 2.75rem;
  line-height: 1;
  bottom: 1.6rem;
  position: fixed;
  right: 2.2rem;
  transition: background-color 0.2s ease, transform 0.15s ease;
  width: 2.75rem;
  z-index: 100;
}

/* Glass appearance — applied via .glass modifier in HTML */
.theme-toggle.glass {
  backdrop-filter: blur(12px);
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
}

.theme-toggle.glass:hover {
  background: var(--nav-glass-bg);
}

.theme-toggle:active {
  transform: scale(0.93);
}

/* Focus — matches active */
.theme-toggle:focus-visible {
  background: var(--nav-glass-bg);
  outline: none;
  transform: scale(0.93);
}

@media (width >= 76.8rem) {
  .theme-toggle {
    bottom: 2rem;
    font-size: 2rem;
    height: 4.5rem;
    right: 2.5rem;
    width: 4.5rem;
  }
}


