/* ================================================================
   MAILZINE — Marketing Site
   High-end editorial design. Teal accent on white.
   Fonts: Oswald (display), Literata (body), Space Grotesk (UI)
   ================================================================ */

/* --- Fonts --- */
@font-face {
  font-family: 'Oswald';
  src: url('../fonts/Oswald.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('../fonts/Literata.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('../fonts/LiterataItalic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

/* --- Design tokens --- */
:root {
  --ink: #1a1a1e;
  --ink-light: #4a4a52;
  --ink-muted: #8a8a95;
  --teal: #1d6376;
  --teal-dark: #164e5e;
  --teal-light: #2a8199;
  --teal-wash: #e8f4f7;
  --teal-faint: #f2f9fb;
  --surface: #f8f9fa;
  --white: #ffffff;
  --border: #e2e4e8;
  --border-light: #f0f1f3;

  --font-display: 'Oswald', sans-serif;
  --font-body: 'Literata', Georgia, serif;
  --font-ui: 'Space Grotesk', system-ui, sans-serif;

  --container: 1200px;
  --container-narrow: 800px;
  --gutter: 24px;
  --section-pad: clamp(80px, 10vw, 140px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}


/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

::selection {
  background: var(--teal-wash);
  color: var(--teal-dark);
}


/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}


/* --- Shared section styles --- */
.section {
  padding: var(--section-pad) 0;
  position: relative;
}

.section-label {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 20px;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 24px;
}

.section-heading-large {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: 24px;
}

.section-lede {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink-light);
  max-width: 560px;
}


/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  padding: 14px 32px;
  border-radius: 4px;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(29, 99, 118, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-outline:hover {
  background: var(--teal);
  color: var(--white);
  transform: translateY(-1px);
}


/* --- Reveal animation --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ================================================================
   NAVIGATION
   ================================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: all 0.4s var(--ease-out);
}

.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 0;
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 28px;
  width: auto;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.83rem;
  color: var(--ink-light);
  transition: color 0.2s;
}
.nav-link:hover {
  color: var(--teal);
}

.nav-cta {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 10px 24px;
  background: var(--teal);
  color: var(--white);
  border-radius: 4px;
  transition: all 0.3s var(--ease-out);
}
.nav-cta:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}


/* ================================================================
   HERO — Scroll-driven magazine explosion
   ================================================================ */
.hero-wrapper {
  height: 137vh;
  position: relative;
  margin-bottom: -12vh;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow-x: hidden;
}

.hero-content {
  flex: 0 0 50%;
  max-width: 560px;
  padding-right: 48px;
  will-change: transform;
}

.hero-label {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 24px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin-bottom: 24px;
}

.hero-subhead {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-note {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.3px;
}

.hero-visual {
  flex: 0 0 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transform: translateZ(0);        /* promote to GPU layer */
}

.hero-magazine {
  width: 100%;
  max-width: 440px;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  /* Canvas needs explicit aspect ratio since it has no intrinsic src */
  aspect-ratio: 720 / 1295;
}

/* Mobile: static image replaces canvas animation */
.hero-magazine-mobile {
  display: none;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.6;
  transition: opacity 0.5s;
  will-change: opacity;
}

.scroll-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-hint-text {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.scroll-hint-arrow {
  color: var(--ink-muted);
  animation: scroll-bounce 2s var(--ease-in-out) infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}


/* ================================================================
   PROBLEM SECTION
   ================================================================ */
.section-problem {
  background: var(--white);
  padding-top: 0;
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.problem-intro {
  padding-top: 20px;
}

.problem-points {
  display: grid;
  gap: 40px;
}

.problem-point {
  position: relative;
  padding-left: 56px;
}

.problem-number {
  position: absolute;
  left: 0;
  top: 2px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--teal);
  letter-spacing: 1px;
}

.problem-point h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.problem-point p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-light);
}


/* ================================================================
   SOLUTION / HOW IT WORKS
   ================================================================ */
.section-solution {
  background: var(--surface);
}

.solution-intro {
  max-width: 600px;
  margin-bottom: 72px;
}

.steps {
  max-width: 680px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 32px;
  padding-bottom: 48px;
}
.step:last-child {
  padding-bottom: 0;
}

.step-marker {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.step-line {
  width: 1.5px;
  flex: 1;
  background: var(--border);
  margin-top: 12px;
}

.step-content h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  padding-top: 8px;
  line-height: 1.2;
}

.step-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-light);
  max-width: 520px;
}


/* ================================================================
   EXPERIENCE / FEATURES — Zig-zag with images
   ================================================================ */
.section-experience {
  background: var(--white);
}

.experience-intro {
  max-width: 600px;
  margin-bottom: 80px;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 80px;
}
.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row-left .feature-image { order: 1; }
.feature-row-left .feature-text { order: 2; }
.feature-row-right .feature-image { order: 2; }
.feature-row-right .feature-text { order: 1; }

.feature-image {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 3 / 2;
}

.feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.feature-row:hover .feature-image img {
  transform: scale(1.03);
}

/* Placeholder style for images before they load or if missing */
.feature-image img[src=""],
.feature-image img:not([src]) {
  display: none;
}
.feature-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--teal-faint) 0%, var(--surface) 50%, var(--teal-wash) 100%);
  z-index: -1;
}

.feature-text h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.feature-text p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-light);
  max-width: 440px;
}


/* ================================================================
   RITUAL — Weekly rhythm
   ================================================================ */
.section-ritual {
  background: var(--surface);
  text-align: center;
}

.ritual-content {
  max-width: 740px;
  margin: 0 auto;
}

.ritual-text {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--ink-light);
  margin-bottom: 56px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.ritual-qualities {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.ritual-quality {
  padding: 32px 16px;
  border-top: 2px solid var(--teal);
}

.ritual-quality-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 8px;
}

.ritual-quality p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-light);
}


/* ================================================================
   AUTHORS — Respect section
   ================================================================ */
.section-authors {
  background: var(--white);
}

.authors-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 80px;
  align-items: start;
}

.authors-intro .section-lede {
  margin-bottom: 32px;
}

.authors-commitments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.commitment {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.3s;
}
.commitment:hover {
  border-color: var(--teal);
}

.commitment h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.commitment p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-light);
}


/* ================================================================
   WAITLIST — CTA section
   ================================================================ */
.section-waitlist {
  background: var(--surface);
  text-align: center;
  padding: var(--section-pad) 0 calc(var(--section-pad) + 20px);
}

.waitlist-content {
  max-width: 620px;
  margin: 0 auto;
}

.waitlist-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin-bottom: 40px;
}

.waitlist-embed {
  max-width: 480px;
  margin: 0 auto;
}

/* --- EmailOctopus form overrides --- */
/* Temporarily disabled to test form submission
.waitlist-embed * {
  font-family: var(--font-ui) !important;
}
*/


/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  padding: 56px 0 40px;
  background: var(--white);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 40px;
}

.footer-logo {
  display: block;
  margin-bottom: 8px;
}

.footer-logo-img {
  height: 24px;
  width: auto;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--ink-muted);
  max-width: 260px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 32px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ink-light);
}
.footer-links a:hover {
  color: var(--teal);
}

.footer-legal {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--ink-muted);
}


/* ================================================================
   RESPONSIVE — Tablet
   ================================================================ */
@media (max-width: 1024px) {
  :root {
    --gutter: 20px;
  }

  .hero-sticky {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 40px;
    padding-top: 80px;
  }

  .hero-content {
    flex: none;
    max-width: 560px;
    padding-right: 0;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    flex: none;
    width: 100%;
  }

  .hero-magazine {
    max-width: 320px;
    margin: 0 auto;
  }

  .problem-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .authors-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .feature-row {
    gap: 40px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }
}


/* ================================================================
   RESPONSIVE — Mobile
   ================================================================ */
@media (max-width: 767px) {
  html {
    font-size: 16px;
  }

  :root {
    --section-pad: 64px;
    --gutter: 16px;
  }

  .hero-wrapper {
    height: 170vh;              /* short scroll — 14 frames play over ~70vh */
    margin-bottom: 0;
  }

  .hero-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 0;
    gap: 0;
    align-items: flex-start;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
  }

  .hero-visual {
    order: unset;
    flex: 1;                     /* canvas fills full container height */
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }

  .hero-magazine {
    display: block;             /* show canvas on mobile */
    max-width: 280px;
    width: 75%;
    margin: 0 auto;
  }

  .hero-magazine-mobile {
    display: none;              /* replaced by canvas animation */
  }

  .hero-headline {
    font-size: 2.2rem;
  }

  .hero-content {
    position: absolute;         /* overlay text on canvas */
    bottom: 32px;
    left: 16px;
    right: 16px;
    margin-top: 0;
    z-index: 1;                 /* above canvas GPU layer */
  }

  .hero-subhead {
    display: none;              /* canvas does the work on mobile — subhead redundant */
  }

  .scroll-hint {
    display: none;
  }

  .nav-link {
    display: none;
  }

  .problem-point {
    padding-left: 44px;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .feature-row-left .feature-image,
  .feature-row-right .feature-image {
    order: 1;
  }
  .feature-row-left .feature-text,
  .feature-row-right .feature-text {
    order: 2;
  }

  .feature-image {
    aspect-ratio: 4 / 3;
  }

  .ritual-qualities {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .authors-commitments {
    grid-template-columns: 1fr;
  }


  .footer-links {
    flex-direction: column;
    gap: 16px;
  }
}


/* ================================================================
   PRINT — Basic safety
   ================================================================ */
@media print {
  .nav, .scroll-hint, .hero-wrapper { display: none; }
}
