/* Landing page — plain CSS, no framework. Tokens come from theme-tokens.css.
   Sections mirror documentation/Landing Page.md. Placeholders (photos, final
   SVGs, verified numbers, waitlist backend) are marked with TODO comments. */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-foreground);
  background-color: var(--color-background);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Grainy paper overlay — a tiled SVG noise, low opacity, fixed behind everything.
   Reads in both themes because it's just luminance noise over the paper token. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 4.5rem 0;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 1.75rem;
}

a {
  color: var(--color-primary);
}

.serif {
  font-family: var(--font-serif);
}

.muted {
  color: var(--color-muted);
}

/* --- highlighter swipe (matches the app's .hl) --- */
.hl {
  background-image: linear-gradient(transparent 45%, var(--color-highlight) 45%);
  padding: 0 0.1em;
}

/* --- hand-drawn underline: a wavy stroke under a word (aria-hidden by nature) --- */
.underline-hand {
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 100% 0.4em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12' viewBox='0 0 120 12'%3E%3Cpath d='M2 7 C 20 2, 40 11, 60 6 S 100 2, 118 7' fill='none' stroke='%231f3a5f' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .underline-hand {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12' viewBox='0 0 120 12'%3E%3Cpath d='M2 7 C 20 2, 40 11, 60 6 S 100 2, 118 7' fill='none' stroke='%236fa3d6' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* --- buttons (pill, like the app) --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background-color 0.15s;
}
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-ghost {
  background: transparent;
  color: var(--color-foreground);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background-color: var(--color-surface-hover);
}

/* --- header --- */
header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background-color: color-mix(in srgb, var(--color-background) 82%, transparent);
  border-bottom: 1px solid var(--color-border);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--color-foreground);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.icon-btn {
  display: inline-flex;
  padding: 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--color-foreground);
}
/* show the right theme glyph per mode */
.theme-toggle .moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .moon {
  display: inline;
}
:root[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

/* --- hero --- */
.hero {
  text-align: center;
  padding-top: 3.5rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 0 0 1rem;
}
.hero p.sub {
  max-width: 40rem;
  margin: 0 auto 2rem;
  font-size: 1.15rem;
  color: var(--color-muted);
}
.hero-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-photo {
  margin-top: 3rem;
  display: block;
  width: 100%;
  /* height:auto is required — the width/height attributes (there for CLS) otherwise
     act as presentational hints and pin the height, which would defeat aspect-ratio */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  /* the source is square and shot top-down; bias the crop upward so the marker pens
     (top-right) survive the banner crop instead of being cut off */
  object-position: center 28%;
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* --- section heading helper --- */
.section-head {
  text-align: center;
}
.section-head p {
  color: var(--color-muted);
  max-width: 38rem;
  margin: -0.75rem auto 2.25rem;
}

/* --- Mark → Scan → Study flow (square tiles + separate, flip-able arrows) --- */
.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.flow-tile {
  width: min(15rem, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1rem;
}
.flow-tile .step {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}
.flow-tile .title {
  font-weight: 700;
  font-size: 1.15rem;
}
.flow-arrow {
  color: var(--color-muted);
  font-size: 1.5rem;
  line-height: 1;
}
.flow-caption {
  text-align: center;
  color: var(--color-muted);
  margin-top: 1.5rem;
}
@media (min-width: 820px) {
  .flow {
    flex-direction: row;
    justify-content: center;
  }
  .flow-arrow {
    transform: rotate(-90deg); /* down-glyph now points right */
  }
}

/* --- feature blocks (analog time) --- */
.features {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}
.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}
.feature p {
  margin: 0;
  color: var(--color-muted);
}

/* --- vocabulary diagram --- */
/* mobile: diagram, message centered below. wide: side by side. */
.vocab-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.diagram {
  display: block;
  width: 100%;
  max-width: 26rem;
}
.diagram-msg {
  text-align: center;
  max-width: 34rem;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
}
@media (min-width: 760px) {
  .vocab-layout {
    flex-direction: row;
    justify-content: center;
    gap: 3rem;
  }
  .diagram {
    flex: 0 0 24rem;
  }
  .diagram-msg {
    text-align: left;
    max-width: 20rem;
  }
}

/* --- pricing --- */
.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.billing-toggle button {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font: inherit;
  cursor: pointer;
}
.billing-toggle button.active {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
  border-color: var(--color-primary);
}
.plans {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 780px) {
  .plans {
    grid-template-columns: repeat(3, 1fr);
  }
}
.plan {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background-color: var(--color-surface);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.plan.featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.plan .name {
  font-weight: 700;
  font-size: 1.15rem;
}
.plan .price {
  font-size: 1.9rem;
  font-weight: 700;
}
.plan .price small {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-muted);
}
.plan .save {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-highlight-foreground);
  background-color: var(--color-highlight);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.plan ul {
  margin: 0.25rem 0 1rem;
  padding-left: 1.1rem;
  color: var(--color-muted);
}
.plan .btn {
  margin-top: auto;
  justify-content: center;
}

/* --- FAQ (native accordion) --- */
.faq {
  max-width: 44rem;
  margin: 0 auto;
}
.faq details {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  float: right;
  color: var(--color-muted);
}
.faq details[open] summary::after {
  content: "–";
}
.faq details p {
  color: var(--color-muted);
  margin: 0.75rem 0 0;
}

/* --- waitlist form --- */
.waitlist {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.waitlist input {
  font: inherit;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-foreground);
  min-width: min(20rem, 80vw);
}

/* --- legal / prose pages (impressum, privacy, terms, contact) --- */
.legal {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 0 4rem;
}
.back-home {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.9rem;
}
.legal h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.4rem;
}
.legal .updated {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}
.legal h2 {
  font-size: 1.2rem;
  margin: 2.25rem 0 0.6rem;
}
.legal p,
.legal li {
  color: var(--color-foreground);
}
.legal a {
  color: var(--color-primary);
}
/* draft banner + unfilled fields, so nothing placeholder ships unnoticed */
.legal .draft {
  border: 1px dashed var(--color-border);
  background-color: var(--color-surface);
  border-radius: 0.75rem;
  padding: 0.85rem 1.1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.legal .todo {
  color: var(--color-muted);
  font-style: italic;
}

/* --- footer --- */
footer.site {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
footer.site .footer-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
footer.site nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
footer.site a {
  color: var(--color-muted);
  text-decoration: none;
}
footer.site a:hover {
  color: var(--color-foreground);
}
