/* Home page layout. Loaded after /style.css, which supplies the colour variables and dark mode. No inline styles
   anywhere on the site: the CSP only allows stylesheets from this origin. */
:root {
  --surface: #ffffff;
  --tint: #e8eff9;
  --field: #8e8e96;
  --onaccent: #ffffff;
  --accent: var(--link);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1c1c1f;
    --tint: #14233b;
    --field: #6b6b73;
    --onaccent: #141416;
  }
}

.landing main { max-width: none; margin: 0; padding: 0; }
.landing h1, .landing h2, .landing h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.landing h2 { margin: 0 0 16px; padding: 0; border: 0; font-size: 2.5rem; line-height: 1.15; }
.landing h3 { margin: 0 0 8px; font-size: 1.4rem; line-height: 1.25; }
.landing p { margin: 0; }
.landing :focus-visible { outline: 3px solid #5b9be0; outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.band { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section { padding-top: 96px; padding-bottom: 96px; }
#updates { padding-bottom: 104px; }
.eyebrow { margin: 0 0 16px; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.intro { font-size: 1.15rem; color: var(--muted); max-width: 640px; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 24px; padding-bottom: 24px; }
.brand img { display: block; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.site-header nav a { padding: 10px 0; color: var(--muted); text-decoration: none; }
.site-header nav a.pill, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: var(--onaccent); font-weight: 600; text-decoration: none; }
.site-header nav a.pill { padding-top: 0; padding-bottom: 0; color: var(--onaccent); }
.button.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--field); }

/* Inner pages */
.page-head { padding-top: 40px; padding-bottom: 72px; }
.page-head h1 { margin: 0 0 20px; max-width: 760px; font-size: clamp(2.25rem, 5vw, 3.25rem); line-height: 1.1; letter-spacing: -0.02em; }
.page-head .lead { max-width: 640px; }
.site-header nav a[aria-current="page"] { color: var(--text); }

/* Articles (/learn/, /about/) */
.article { max-width: 720px; margin: 0 auto; padding: 16px 20px 72px; }
.article h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.12; letter-spacing: -0.02em; }
.article h2 { margin: 2em 0 0.5em; font-size: 1.6rem; line-height: 1.25; }
.article p, .article li { font-size: 1.1rem; line-height: 1.7; }
.article p { margin: 0 0 1em; }
.article .meta { margin: 0 0 32px; font-size: 0.95rem; color: var(--muted); }
.article .draft-note { padding: 12px 16px; border: 1px dashed var(--field); border-radius: 12px; font-size: 0.95rem; color: var(--muted); }
.card h2 { margin: 0 0 8px; font-size: 1.4rem; line-height: 1.25; }
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.card .card-date { margin: 0; font-size: 0.9rem; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px 64px; padding-top: 56px; padding-bottom: 104px; }
.hero-text { flex: 1 1 440px; min-width: 0; }
.hero h1 { margin: 0 0 24px; font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; }
.hero .lead { font-size: 1.25rem; line-height: 1.55; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.stage { flex: 0 1 380px; margin: 0 auto; box-sizing: border-box; padding: 40px 32px; background: linear-gradient(135deg, #172d50, #02050c); border-radius: 40px; display: flex; justify-content: center; }

/* Steps and cards */
.steps { display: flex; flex-wrap: wrap; gap: 40px 48px; margin-top: 56px; }
.step { flex: 1 1 260px; min-width: 0; }
.step p { color: var(--muted); }
.icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 20px; border-radius: 16px; background: var(--tint); color: var(--accent); }
.feature { display: flex; flex-wrap: wrap; align-items: center; gap: 56px 72px; }
.feature .stage { flex: 0 1 380px; }
.feature-text { flex: 1 1 400px; min-width: 0; }
.feature-text .intro { margin-bottom: 28px; }
.dots { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.dots li { position: relative; margin: 0; padding-left: 22px; }
.dots li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cards { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 40px; }
.card { flex: 1 1 280px; min-width: 0; box-sizing: border-box; padding: 32px; background: var(--surface); border: 1px solid var(--rule); border-radius: 24px; }
.card p { color: var(--muted); }

/* Languages */
.chips { margin: 36px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 12px; }
.chips li { margin: 0; padding: 10px 20px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg); }
.chips .chip-en { margin-left: 4px; color: var(--muted); }
.landing .chips-title { margin: 40px 0 0; font-size: 1.1rem; }
.chips-title + .chips { margin-top: 16px; }
.landing .chips-note { margin-top: 8px; max-width: 640px; color: var(--muted); }
.chips-note + .chips { margin-top: 16px; }

/* Privacy */
.facts { display: flex; flex-wrap: wrap; gap: 40px 48px; margin-top: 48px; }
.facts div { flex: 1 1 260px; min-width: 0; }
.facts p { color: var(--muted); }
.text-link { display: inline-block; margin-top: 40px; font-weight: 600; }

/* Updates sign-up: the Brevo form is a frame, so its inside cannot be styled from here. It stays a white card in
   both colour schemes (the frame cannot follow the dark theme). */
.updates { text-align: center; padding: 72px 32px; background: var(--tint); border-radius: 40px; }
.updates h2 { margin-left: auto; margin-right: auto; max-width: 640px; }
.updates .intro { margin: 0 auto 32px; max-width: 540px; }
.signup-frame { display: block; width: 100%; max-width: 540px; height: 520px; margin: 0 auto; border: 1px solid var(--rule); border-radius: 24px; background: #ffffff; }
.updates .note { margin: 20px auto 0; max-width: 540px; font-size: 0.9rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-top: 40px; padding-bottom: 64px; font-size: 0.95rem; color: var(--muted); }
.site-footer p { max-width: 520px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); }

/* Confirmation page */
.confirmed { max-width: 680px; margin: 0 auto; padding: 32px 16px 64px; }

/* Phone illustrations. Fixed light colours: they depict the app, not the page. */
.phone { --p-bg: #fbfaf7; --p-text: #1d1d1f; --p-muted: #5f5f66; --p-rule: #e2e0da; --p-accent: #246bc2; --p-field: #8e8e96;
  position: relative; flex: none; width: 300px; height: 620px; box-sizing: border-box; border: 8px solid #1d1d1f; border-radius: 46px; overflow: hidden;
  background: var(--p-bg); color: var(--p-text); font-size: 14px; line-height: 1.4; text-align: left; }
.phone svg { display: block; }
.ph-top { display: flex; align-items: center; justify-content: space-between; padding: 40px 20px 0; font-size: 13px; color: var(--p-muted); }
.ph-back { display: flex; align-items: center; gap: 4px; }
.ph-text { margin: 28px 20px 0; font-family: var(--serif); font-size: 17px; line-height: 1.7; }
.ph-mark { padding: 0 2px; border-radius: 4px; background: rgba(36, 107, 194, 0.18); }
.ph-sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 332px; box-sizing: border-box; padding: 10px 20px 0; background: #ffffff; border-top: 1px solid var(--p-rule); border-radius: 24px 24px 0 0; }
.ph-grab { width: 36px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: #c9c7c0; }
.ph-word-row { display: flex; align-items: baseline; justify-content: space-between; }
.ph-word { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.ph-langs { font-size: 12px; font-weight: 600; color: var(--p-accent); }
.ph-base { margin-top: 2px; font-size: 13px; color: var(--p-muted); }
.ph-meaning { margin-top: 8px; font-size: 18px; font-weight: 600; }
.ph-orig { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--p-rule); font-size: 12.5px; color: var(--p-muted); }
.ph-trans { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--p-rule); font-size: 14px; }
.ph-trans svg { flex: none; margin-top: 2px; }
.ph-actions { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; gap: 8px; }
.ph-btn { flex: 1; display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 12px; border: 1px solid var(--p-field); font-size: 14px; font-weight: 600; }
.ph-btn.primary { background: var(--p-accent); border-color: var(--p-accent); color: #ffffff; }
.ph-card { margin: 36px 20px 0; box-sizing: border-box; height: 300px; padding: 28px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #ffffff; border: 1px solid var(--p-rule); border-radius: 28px; }
.ph-card-word { font-family: var(--serif); font-size: 44px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.ph-card-pos { margin-top: 6px; font-size: 13px; color: var(--p-muted); }
.ph-card-meaning { margin-top: 18px; font-size: 22px; font-weight: 600; }
.ph-card-sentence { margin-top: 18px; font-family: var(--serif); font-size: 14px; line-height: 1.5; color: var(--p-muted); }
.ph-grade { position: absolute; left: 0; right: 0; bottom: 36px; display: flex; justify-content: center; gap: 56px; text-align: center; }
.ph-grade div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ph-round { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%; border: 1.5px solid var(--p-field); }
.ph-round.ok { background: var(--p-accent); border-color: var(--p-accent); }
.ph-grade strong { font-size: 13px; }
.ph-grade span { font-size: 12px; color: var(--p-muted); }

@media (max-width: 600px) {
  .signup-frame { height: 600px; }
}

@media (max-width: 480px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .section { padding-top: 64px; padding-bottom: 64px; }
  #updates { padding-bottom: 64px; }
  .landing h2 { font-size: 2rem; }
  /* The sign-up frame needs the full phone width: its security check is 300px wide and the form has its own padding. */
  #updates.wrap { padding-left: 0; padding-right: 0; }
  .updates { padding: 40px 0 32px; border-radius: 0; }
  .updates h2, .updates .intro, .updates .note { padding-left: 20px; padding-right: 20px; box-sizing: border-box; }
  .signup-frame { height: 620px; border-left: 0; border-right: 0; border-radius: 0; }
  .stage { padding: 28px 0; border-radius: 32px; }
}

/* Below 340px the form's own padding pushes the 300px security check past the frame. Give the form a 360px layout and
   scale it to fit (360 x 0.88 = 317px). */
@media (max-width: 340px) {
  .signup-frame { width: 360px; zoom: 0.88; }
}
