/* ═══════════════════════════════════════════════════
   LearnEnglish.co — Opus Landing Page Styles
   ═══════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────── */
:root {
  /* Palette — warm, premium, inspired by original */
  --ink:         #1e2d3d;
  --ink-soft:    #5a6a7e;
  --ink-muted:   #8b9aaa;
  --bg:          #faf8f5;
  --bg-warm:     #fff8f2;
  --surface:     rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --border:      rgba(30, 45, 61, 0.08);
  --border-strong: rgba(30, 45, 61, 0.14);

  /* Accent — the original coral */
  --coral:       #FF6B6B;
  --coral-deep:  #e55a5a;
  --coral-glow:  rgba(255, 107, 107, 0.15);
  --coral-soft:  #ffe4e1;

  /* Secondary — warm teal */
  --teal:        #0d9488;
  --teal-soft:   #d5f0ec;

  /* Gold for warmth */
  --gold:        #f0a830;
  --gold-soft:   #fff3dc;

  /* Shadows */
  --shadow-sm:   0 2px 12px rgba(30, 45, 61, 0.06);
  --shadow-md:   0 8px 32px rgba(30, 45, 61, 0.08);
  --shadow-lg:   0 20px 60px rgba(30, 45, 61, 0.10);
  --shadow-glow: 0 8px 40px rgba(255, 107, 107, 0.18);

  /* Radii */
  --r-sm:  12px;
  --r-md:  20px;
  --r-lg:  28px;
  --r-xl:  36px;
  --r-pill: 999px;

  /* Type */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'Poppins', system-ui, sans-serif;

  /* Layout */
  --max-w: 1160px;
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }

/* ── Ambient Background ─────────────────────────── */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orb-drift 20s ease-in-out infinite alternate;
}

.bg-orb--coral {
  width: 400px;
  height: 400px;
  background: var(--coral-glow);
  top: -5%;
  right: -5%;
  animation-delay: 0s;
}

.bg-orb--teal {
  width: 350px;
  height: 350px;
  background: rgba(13, 148, 136, 0.10);
  bottom: 10%;
  left: -8%;
  animation-delay: -7s;
}

.bg-orb--gold {
  width: 300px;
  height: 300px;
  background: rgba(240, 168, 48, 0.10);
  top: 50%;
  left: 40%;
  animation-delay: -14s;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.08); }
  100% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ── Container ──────────────────────────────────── */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}

/* ── Navigation ─────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 252, 248, 0.75);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 18px 18px 36px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.nav-bar:hover {
  box-shadow: var(--shadow-md);
}

.logo {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo em {
  font-style: italic;
  color: var(--coral);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  margin-bottom: 28px;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 18ch;
  margin: 0 auto;
}

.hero h1 .highlight {
  color: var(--coral);
}

.hero-sub {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 20px auto 0;
  font-style: italic;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--coral);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 32px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--coral-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 48px rgba(255, 107, 107, 0.28);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  padding: 16px 28px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-strong);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--coral);
  background: var(--coral-glow);
}

.hero-note {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-top: 18px;
}

/* ── Imagine Section (Persona Cards) ─────────────── */
.imagine {
  padding: 40px 0 60px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 14px;
  max-width: 20ch;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 36px;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.persona-card {
  position: relative;
  background: var(--surface-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.persona-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  transition: opacity 0.3s ease;
}

.persona-card:nth-child(1)::before { background: var(--coral); }
.persona-card:nth-child(2)::before { background: var(--teal); }
.persona-card:nth-child(3)::before { background: var(--gold); }

.persona-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 107, 107, 0.2);
}

.persona-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
}

.persona-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}

/* ── Why Section ─────────────────────────────────── */
.why {
  padding: 50px 0;
}

.why-panel {
  background:
    linear-gradient(135deg, var(--coral-soft) 0%, var(--teal-soft) 50%, var(--gold-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-md);
}

.why-panel .section-title {
  text-align: center;
  max-width: none;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 360px));
  justify-content: center;
  align-items: start;
  gap: 24px;
  margin: 32px auto 0;
}

.why-item {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
}

.why-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--coral);
  margin-bottom: 14px;
}

.why-item h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}

.why-item p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 28ch;
  margin-left: auto;
  margin-right: auto;
}

/* ── Form Section ────────────────────────────────── */
.form-section {
  padding: 60px 0 80px;
}

.form-layout {
  display: grid;
  grid-template-columns: 0.45fr 0.55fr;
  gap: 32px;
  align-items: start;
}

.form-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.form-intro p {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

.form-promises {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.form-promises li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.form-promises li::before {
  content: '✓';
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
}

.form-shell {
  background: var(--surface-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  min-height: 480px;
}

.form-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-shell-header p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.form-shell-header small {
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.btn-open-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--coral);
  padding: 8px 16px;
  border: 1.5px solid var(--coral);
  border-radius: var(--r-pill);
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-open-form:hover {
  background: var(--coral);
  color: #fff;
}

.btn-open-form[aria-disabled="true"] {
  display: none;
}

/* Tally placeholder — shown when URL not configured */
.tally-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.04), rgba(13, 148, 136, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 60px 32px;
  min-height: 360px;
  gap: 16px;
}

.tally-placeholder strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ink);
}

.tally-placeholder p {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin: 0;
  max-width: 36ch;
  line-height: 1.6;
}

.tally-placeholder code {
  background: rgba(30, 45, 61, 0.06);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
}

/* Tally iframe */
#tally-frame {
  display: none;
  width: 100%;
  height: 600px;
  border: 0;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.5);
}

/* Fullscreen mode for the form shell */
.form-shell.is-fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
  background: var(--bg);
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.form-shell.is-fullscreen #tally-frame {
  flex: 1;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

/* ── Footer ──────────────────────────────────────── */
.footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
}

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

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  margin: 0;
}

.footer-brand em {
  color: var(--coral);
  font-style: italic;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.footer-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0;
}

/* ── Reveal Animation ────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].visible {
  opacity: 1;
  transform: none;
}

/* Stagger children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal-stagger].visible > * {
  opacity: 1;
  transform: none;
}

[data-reveal-stagger].visible > *:nth-child(1) { transition-delay: 0ms; }
[data-reveal-stagger].visible > *:nth-child(2) { transition-delay: 120ms; }
[data-reveal-stagger].visible > *:nth-child(3) { transition-delay: 240ms; }

/* ── Reduced Motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal], [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
  }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
  .persona-grid,
  .why-grid {
    grid-template-columns: 1fr;
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .hero { padding: 56px 0 40px; }
  .imagine { padding: 32px 0 48px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .nav { padding: 12px 0; }

  .nav-bar { padding: 8px 8px 8px 18px; }
  .nav-bar { padding: 14px 14px 14px 24px; border-radius: var(--r-lg); }
  .logo { font-size: 1.8rem; }
  .nav-cta { font-size: 0.82rem; padding: 8px 16px; }

  .hero h1 { font-size: clamp(2.2rem, 10vw, 3.2rem); }
  .hero-sub { font-size: 1rem; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary, .btn-secondary {
    justify-content: center;
    width: 100%;
  }

  .persona-card { padding: 24px 22px; }

  .why-panel { padding: 32px 24px; }

  .form-shell { padding: 18px; }
  .form-shell-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .section-title {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  #tally-frame { height: 600px; }
  
  .form-shell.is-fullscreen {
    padding: 16px;
  }
}
