/* ==========================================================================
   landing.css — The Companion landing page
   Warm-paper palette + landing-specific layout. Self-contained; does not
   depend on shared.css so it doesn't affect the app palette.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:            #fbf9f5;
  --surface:       #ffffff;
  --surface-soft:  #f6f3ee;
  --text:          #1e293b;
  --text-secondary:#64748b;
  --text-muted:    #94a3b8;
  --border:        #e6e0d2;
  --border-strong: #d3cab5;
  --accent:        #0f766e;
  --accent-strong: #115e59;
  --accent-soft:   #eaf6f3;
  --danger:        #ef4444;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display:  Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --r-3: 8px;
  --r-4: 10px;
  --r-5: 12px;
  --r-7: 16px;
  --shadow-btn:       0 2px 8px rgba(15, 118, 110, 0.18);
  --shadow-btn-hover: 0 4px 12px rgba(15, 118, 110, 0.26);
  --ring-soft:        0 0 0 3px rgba(15, 118, 110, 0.06);
  --t-fast: 0.18s;
  --t-med:  0.28s;
  --t-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --section-py: 96px;
  --gap-md: 24px;
  --container: 1120px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast) var(--t-ease); }
a:hover { color: var(--accent-strong); }
::selection { background: var(--accent-soft); color: var(--accent-strong); }

/* ── Container ─────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .container { padding: 0 20px; } }

/* ── Nav ───────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 249, 245, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: flex; align-items: flex-end; gap: 8px;
  font-family: var(--font-display); color: var(--text);
  text-decoration: none;
}
.nav-brand .the {
  font-size: 22px; font-weight: 400; letter-spacing: -0.01em;
  border-bottom: 1.2px solid var(--text);
  padding: 0 2px 2px 0; line-height: 1;
}
.nav-brand .companion {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--t-ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-lg { padding: 14px 22px; font-size: 15px; }

/* Nav login — sliding arrow reveal on hover */
.nav-login {
  position: relative; overflow: hidden;
  padding-right: 18px;
  transition: padding-right 0.32s var(--t-ease), background 0.18s var(--t-ease),
              box-shadow 0.18s var(--t-ease), transform 0.18s var(--t-ease);
}
.nav-login::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}
.nav-login-label,
.nav-login-icon {
  position: relative; display: inline-flex; align-items: center;
  transition: transform 0.32s var(--t-ease), opacity 0.2s var(--t-ease);
}
.nav-login-icon {
  width: 0; margin-left: 0;
  transform: translateX(-6px); opacity: 0; overflow: hidden;
}
.nav-login:hover { padding-right: 22px; background: var(--accent-strong); transform: translateY(-1px); box-shadow: var(--shadow-btn-hover); }
.nav-login:hover::before { transform: translateX(130%); }
.nav-login:hover .nav-login-label { transform: translateX(-2px); }
.nav-login:hover .nav-login-icon { width: 16px; margin-left: 8px; transform: translateX(0); opacity: 1; }
.nav-login:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .nav-login, .nav-login::before, .nav-login-label, .nav-login-icon { transition: none; }
}

/* ── Shared helpers ────────────────────────────────────────────────────── */
.section-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}

/* ── Scroll reveal (hidden only when JS is present to un-hide on scroll) ── */
.js .reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--t-ease), transform 0.6s var(--t-ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.lp-hero {
  position: relative; overflow: hidden;
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; text-align: center;
  padding: 40px 0 80px;
}
.lp-hero-glow {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  width: min(900px, 120vw); height: min(900px, 120vw);
  background: radial-gradient(closest-side, rgba(15, 118, 110, 0.10), rgba(15, 118, 110, 0.04) 45%, transparent 70%);
  pointer-events: none;
}
.lp-hero-inner { position: relative; max-width: 920px; margin: 0 auto; }
.lp-kicker {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 26px;
}
.lp-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 7vw, 84px); line-height: 1.02;
  letter-spacing: -0.03em; color: var(--text); margin: 0 auto 26px;
}
.lp-hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.lp-lead {
  font-size: clamp(17px, 1.9vw, 21px); line-height: 1.5;
  color: var(--text-secondary); max-width: 60ch; margin: 0 auto 34px;
}
.lp-cta { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; }
.lp-scroll-hint { font-size: 14px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.lp-arrow-down { display: inline-block; animation: lp-bob 1.8s ease-in-out infinite; }
@keyframes lp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ── Beats ─────────────────────────────────────────────────────────────── */
.lp-beat { padding: clamp(84px, 13vh, 150px) 0; }
.lp-h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08;
  letter-spacing: -0.025em; color: var(--text); margin: 14px 0 0;
}
.lp-h2 em { font-style: italic; font-weight: 400; color: var(--accent); }
.lp-beat-lead {
  font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6;
  color: var(--text-secondary); max-width: 56ch; margin: 26px 0 0;
}

/* 01 · material → trilha */
.mat-flow {
  margin: 50px auto 0; max-width: 860px;
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 28px; align-items: center;
}
@media (max-width: 760px) { .mat-flow { grid-template-columns: 1fr; gap: 18px; } }
.mat-sources { display: flex; flex-direction: column; gap: 12px; }
.mat-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-4); padding: 14px 18px;
  font-size: 14.5px; color: var(--text);
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 0 rgba(15,23,42,0.02);
}
.mat-chip .tick { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; }
.mat-arrow { color: var(--accent); font-size: 30px; line-height: 1; text-align: center; }
@media (max-width: 760px) { .mat-arrow { transform: rotate(90deg); } }
.mat-outline {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--r-5);
  padding: 20px 24px; box-shadow: 0 18px 50px -26px rgba(15,23,42,0.14);
}
.mat-outline-h { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.mat-outline ol { margin: 0; padding-left: 0; list-style: none; counter-reset: t; }
.mat-outline li {
  counter-increment: t; padding: 7px 0; font-size: 15px; color: var(--text);
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--surface-soft);
}
.mat-outline li:last-child { border-bottom: 0; }
.mat-outline li::before {
  content: counter(t, decimal-leading-zero); font-family: var(--font-display);
  font-size: 12px; font-weight: 700; color: var(--accent); min-width: 22px;
}

/* 02 · socratic turn */
.lp-turn { background: var(--surface-soft); }
.lp-turn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 920px) { .lp-turn-grid { grid-template-columns: 1fr; gap: 36px; } }
.lp-chat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-7); padding: 26px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), 0 18px 50px -20px rgba(15, 23, 42, 0.12);
  position: relative;
}
.lp-chat-head {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 18px;
}
.lp-chat-body { display: flex; flex-direction: column; gap: 14px; min-height: 230px; }

/* chat bubbles */
.js .lp-msg { opacity: 0; transform: translateY(8px); transition: opacity 0.3s var(--t-ease), transform 0.3s var(--t-ease); }
.lp-msg.shown { opacity: 1; transform: none; }
.lp-msg.you {
  align-self: flex-end; max-width: 82%;
  background: var(--accent-soft); color: var(--text);
  border: 1px solid #d6ebe6; border-bottom-right-radius: 6px;
  border-radius: 14px; padding: 11px 15px; line-height: 1.5;
}
.lp-msg.tutor {
  align-self: flex-start; max-width: 94%;
  font-family: var(--font-display); font-style: italic; font-size: 17.5px;
  color: var(--text); line-height: 1.5; padding: 2px 4px;
}
.lp-msg.tutor strong { font-style: normal; color: var(--text); }
.lp-msg.typing { font-style: normal; }
.dots { display: inline-flex; gap: 3px; padding: 6px 2px; }
.dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); animation: lp-dot 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lp-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* 03 · concept map */
.lp-map-beat { text-align: center; }
.lp-map-beat .lp-h2, .lp-map-beat .lp-beat-lead { margin-left: auto; margin-right: auto; }
.lp-map {
  margin: 50px auto 0; max-width: 860px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-5); padding: 28px;
  box-shadow: 0 18px 50px -24px rgba(15, 23, 42, 0.12);
  text-align: left;
}
.lp-map-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lp-map-head .label { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.lp-legend { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--text-secondary); }
.lp-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.lp-legend .dot.d-mastered { background: var(--accent); }
.lp-legend .dot.d-progress { background: var(--accent-soft); border: 1.5px solid var(--accent); }
.lp-legend .dot.d-gap { background: var(--surface-soft); border: 1.5px solid var(--border-strong); }

/* concept-map draw-in */
[data-conceptmap] svg { display: block; width: 100%; height: auto; }
[data-conceptmap] text { font-family: var(--font); }
.js [data-conceptmap] .cm-edge {
  opacity: 0; stroke-dasharray: 300; stroke-dashoffset: 300;
  transition: stroke-dashoffset 0.7s var(--t-ease), opacity 0.3s var(--t-ease);
  transition-delay: 0.35s;
}
.js [data-conceptmap] .cm-node { opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--t-ease), transform 0.5s var(--t-ease); }
.js [data-conceptmap] .cm-check { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 0.4s var(--t-ease); transition-delay: 0.8s; }
.js [data-conceptmap] .cm-pin { opacity: 0; transition: opacity 0.5s var(--t-ease); transition-delay: 1.15s; }
[data-conceptmap].cm-play .cm-edge { opacity: 1; stroke-dashoffset: 0; }
[data-conceptmap].cm-play .cm-node { opacity: 1; transform: none; }
[data-conceptmap].cm-play .cm-check { stroke-dashoffset: 0; }
[data-conceptmap].cm-play .cm-pin { opacity: 1; }
/* gentle node cascade (g-positions: 1=edges, 2..10=nodes, 11=pin) */
.cm-play .cm-node:nth-of-type(2)  { transition-delay: 0.04s; }
.cm-play .cm-node:nth-of-type(3)  { transition-delay: 0.10s; }
.cm-play .cm-node:nth-of-type(4)  { transition-delay: 0.16s; }
.cm-play .cm-node:nth-of-type(5)  { transition-delay: 0.22s; }
.cm-play .cm-node:nth-of-type(6)  { transition-delay: 0.28s; }
.cm-play .cm-node:nth-of-type(7)  { transition-delay: 0.34s; }
.cm-play .cm-node:nth-of-type(8)  { transition-delay: 0.40s; }
.cm-play .cm-node:nth-of-type(9)  { transition-delay: 0.46s; }
.cm-play .cm-node:nth-of-type(10) { transition-delay: 0.52s; }

/* ── Close ─────────────────────────────────────────────────────────────── */
.lp-close { text-align: center; padding: clamp(90px, 15vh, 170px) 0; background: var(--surface-soft); }
.lp-close h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 5vw, 58px); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 30px; color: var(--text); }
.lp-close h2 em { font-style: italic; font-weight: 400; color: var(--accent); }
.lp-fineprint { margin-top: 18px; font-size: 13px; color: var(--text-muted); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.lp-foot { padding: 40px 0; border-top: 1px solid var(--border); }
.lp-foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.foot-brand { display: flex; align-items: flex-end; gap: 6px; font-family: var(--font-display); color: var(--text); }
.foot-brand .the { font-weight: 400; border-bottom: 1px solid var(--text); line-height: 1; padding: 0 1px 1px 0; }
.foot-brand .companion { font-weight: 700; line-height: 1; letter-spacing: -0.015em; }

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .lp-msg { opacity: 1 !important; transform: none !important; transition: none !important; }
  [data-conceptmap] .cm-edge, [data-conceptmap] .cm-node, [data-conceptmap] .cm-check, [data-conceptmap] .cm-pin {
    opacity: 1 !important; stroke-dashoffset: 0 !important; transform: none !important; transition: none !important;
  }
  .lp-arrow-down, .dots span { animation: none !important; }
}
