/* ======================================================================
   Linguease — landing page
   Builds on the design system tokens in colors_and_type.css.
   Rules (don't break):
   - British spelling, sentence case, no emoji, no exclamation marks.
   - Page background #FAF5F2, body ink #434446 (never pure black).
   - Instrument Serif for display + expressive; Roboto light for body.
   - Flat, warm, analog. One shadow only (banner). No gradients.
   - Primary button = off-black 52px, radius 10, Roboto 16 medium.
   - Terracotta is reserved — hero background + destructive only.
   ====================================================================== */

/* ---------- Fonts (same TTFs the iOS app ships) ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-VariableFont_wdth_wght.ttf") format("truetype-variations"),
       url("../fonts/Roboto-VariableFont_wdth_wght.ttf") format("truetype");
  font-weight: 100 900; font-stretch: 75% 125%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-Italic-VariableFont_wdth_wght.ttf") format("truetype-variations"),
       url("../fonts/Roboto-Italic-VariableFont_wdth_wght.ttf") format("truetype");
  font-weight: 100 900; font-stretch: 75% 125%; font-style: italic; font-display: swap;
}

/* ---------- Tokens (mirrored from design system) ---------- */
:root {
  --c-off-black:      #434446;
  --c-mid-off-black:  #515356;
  --c-dark-grey:      #918B87;
  --c-mid-grey:       #C4BEBB;
  --c-mid-light-grey: #EDE7E4;
  --c-light-grey:     #F2EBE6;
  --c-extra-light-grey:#FAF5F2;
  --c-terracotta:     #DC624F;
  --c-deep-terracotta:#C84D3A;
  --c-peach-text:     #FFC4BA;
  --c-bright-blue:    #5D94EE;
  --c-yellow:         #FFC66F;

  --ff-serif: "Instrument Serif", Georgia, serif;
  --ff-sans:  "Roboto", -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  --shadow-banner: 0 12px 24px rgba(0, 0, 0, 0.05);
  --hairline: rgba(0,0,0,0.05);
}

/* ---------- Resets ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--c-extra-light-grey);
  color: var(--c-off-black);
  font-family: var(--ff-sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 96px 0;
}
.section--tight { padding: 64px 0; }
@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section--tight { padding: 48px 0; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--c-extra-light-grey) 92%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--ff-serif); font-size: 22px; color: var(--c-off-black);
  letter-spacing: -0.01em;
}
.brand__mark { width: 28px; height: 28px; }
.brand__mark svg { width: 100%; height: 100%; }

.nav { display: flex; align-items: center; gap: 24px; }
.nav a {
  font-size: 14px; color: var(--c-dark-grey); font-weight: 300;
}
.nav a:hover { color: var(--c-off-black); }

/* ---------- Primary button (10px radius, Roboto 16 medium, off-black) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 22px;
  border-radius: 10px;
  font-family: var(--ff-sans); font-weight: 500; font-size: 16px;
  background: var(--c-off-black); color: #fff;
  transition: background 150ms ease-out;
  white-space: nowrap;
}
.btn:hover { background: var(--c-mid-off-black); }
.btn:active { background: var(--c-mid-off-black); }

.btn--ghost {
  background: transparent; color: var(--c-off-black);
  box-shadow: inset 0 0 0 1px rgba(67,68,70,0.18);
}
.btn--ghost:hover { background: rgba(67,68,70,0.04); }

.btn--small { height: 40px; padding: 0 16px; font-size: 14px; }

.btn--on-terracotta {
  background: #fff; color: var(--c-off-black);
}
.btn--on-terracotta:hover { background: var(--c-light-grey); }

/* ---------- Hero (terracotta page, matches WelcomeView) ---------- */
.hero {
  background: var(--c-terracotta);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero__inner {
  padding: 84px 0 88px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px; align-items: center;
}
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; padding: 56px 0 64px; }
}
.hero__eyebrow {
  font-family: var(--ff-sans); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--c-peach-text); margin-bottom: 24px;
}
.hero__title {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02; letter-spacing: -0.015em;
  color: var(--c-extra-light-grey);
  margin: 0 0 18px;
}
.hero__title em {
  font-style: italic; color: #fff;
}
.hero__sub {
  font-family: var(--ff-sans); font-weight: 300; font-size: 18px; line-height: 1.5;
  color: color-mix(in srgb, #fff 85%, transparent);
  max-width: 460px;
  margin: 0 0 28px;
}
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Apple's official App Store badge. Per guidelines: leave clear space, don't recolour. */
.app-store-badge {
  display: inline-block;
  height: 52px;
  transition: opacity 150ms ease-out;
}
.app-store-badge img {
  height: 100%; width: auto;
  display: block;
}
.app-store-badge:hover { opacity: 0.85; }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 28px;
}
.hero__meta--top {
  margin-top: 0;
  margin-bottom: 18px;
}
.hero__btn--ghost {
  background: transparent; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}
.hero__btn--ghost:hover {
  background: rgba(255,255,255,0.08);
}

/* Hero visual: phone frame with looping intervention video + floating widget */
.hero__stage {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  min-height: 460px;
}
.hero__widget {
  position: absolute;
  bottom: -12px; left: -8px;
  transform: rotate(-6deg);
  z-index: 2;
}
.hero__widget .widget-tile {
  width: 140px; height: 140px;
  border-radius: 22px;
  background: var(--c-yellow);
  color: #5D4520;
  box-shadow: 0 20px 40px rgba(0,0,0,0.22), 0 2px 4px rgba(0,0,0,0.08);
}
.hero__widget .widget-tile__content { padding: 18px; justify-content: flex-end; }
.hero__widget .widget-tile__word { font-size: 28px; color: #5D4520; }
.hero__widget .widget-tile__translation { font-size: 16px; color: #9C7336; }
.hero__widget .widget-tile__phonetic { font-size: 11px; color: #9C7336; margin-top: 6px; }
@media (max-width: 900px) {
  .hero__stage { min-height: auto; padding-top: 16px; }
  .hero__widget { bottom: -24px; left: 4vw; transform: rotate(-6deg) scale(0.85); }
}

/* Phone frame — matches iOS phone bezel 4.6px off-black stroke from the design system */
.phone-frame {
  position: relative;
  width: 300px;
  aspect-ratio: 9 / 19.5;
  border-radius: 46px;
  background: #000;
  padding: 10px;
  box-shadow: 0 26px 60px rgba(0,0,0,0.28), 0 4px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}
.phone-frame--md { width: 280px; }
.phone-frame__video {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 38px;
  display: block;
  background: var(--c-extra-light-grey);
}
.phone-frame__notch {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 28px;
  background: #000;
  border-radius: 18px;
  z-index: 2;
}
@media (max-width: 420px) {
  .phone-frame { width: 240px; }
  .phone-frame__notch { width: 80px; height: 22px; top: 12px; }
}

.hero__stage .widget-stack { position: relative; width: 320px; height: 420px; }
.widget-stack__tile {
  position: absolute;
  transition: background 560ms ease-out, color 560ms ease-out, transform 420ms ease-out;
  will-change: background, color;
  box-shadow: 0 18px 38px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.08);
}
.widget-stack__tile--medium {
  top: 0; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 300px; height: 140px; border-radius: 34px;
}
.widget-stack__tile--small-a {
  bottom: 20px; left: -10px; transform: rotate(-8deg);
  width: 150px; height: 150px; border-radius: 26px;
}
.widget-stack__tile--small-b {
  bottom: 60px; right: -10px; transform: rotate(7deg);
  width: 150px; height: 150px; border-radius: 26px;
}
.widget-tile__content {
  padding: 22px;
  display: flex; flex-direction: column; justify-content: center; height: 100%;
  font-family: var(--ff-serif);
}
.widget-tile__word {
  font-size: 38px; line-height: 1.0; letter-spacing: -0.01em;
}
.widget-tile--medium .widget-tile__word { font-size: 56px; }
.widget-tile__translation {
  font-style: italic; margin-top: 4px; line-height: 1.1;
  font-size: 20px;
}
.widget-tile--medium .widget-tile__translation { font-size: 30px; }
.widget-tile__phonetic {
  margin-top: 10px;
  font-family: var(--ff-sans); font-weight: 300; font-size: 12px;
}

/* ---------- Section header ---------- */
.eyebrow {
  font-family: var(--ff-sans); font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--c-mid-grey);
  margin-bottom: 16px;
}
.display {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.1; letter-spacing: -0.01em;
  color: var(--c-off-black);
  margin: 0;
}
.display em { font-style: italic; }
.lede {
  font-family: var(--ff-sans); font-weight: 300; font-size: 18px; line-height: 1.5;
  color: var(--c-dark-grey);
  max-width: 520px;
  margin: 16px 0 0;
}

/* ---------- How it works (3 steps) ---------- */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--c-light-grey);
  border-radius: 12px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 280px;
}
.step__num {
  font-family: var(--ff-serif); font-size: 30px; line-height: 1;
  color: var(--c-off-black);
}
.step__stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 120px;
}
.step__title {
  font-family: var(--ff-serif); font-weight: 400; font-size: 24px;
  line-height: 1.15; color: var(--c-off-black); margin: 0;
}
.step__body {
  font-family: var(--ff-sans); font-weight: 300; font-size: 15px;
  color: var(--c-dark-grey); line-height: 1.5; margin: 0;
}

/* ---------- Widget theme showcase ---------- */
.showcase {
  background: var(--c-mid-light-grey);
  overflow: hidden;
}
.showcase .theme-strip { margin-top: 64px; padding-bottom: 64px; }
.showcase__header { margin-bottom: 48px; }

/* The widget-stack when used as feature media — center it with room */
.feature__media--plain .widget-stack {
  position: relative; width: 320px; height: 420px;
}
.theme-strip {
  display: flex; gap: 16px;
  animation: scroll 60s linear infinite;
  width: max-content;
}
.theme-strip:hover { animation-play-state: paused; }
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.theme-tile {
  width: 160px; height: 160px; border-radius: 19px;
  padding: 18px; font-family: var(--ff-serif);
  flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.theme-tile__word {
  font-size: 30px; line-height: 1; letter-spacing: -0.01em;
}
.theme-tile__translation {
  font-style: italic; font-size: 18px; line-height: 1.1; margin-top: 4px;
}

/* ---------- Interventions (two-column alternating) ---------- */
.feature-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center;
}
.feature-row + .feature-row { margin-top: 96px; }
.feature-row--flip { direction: rtl; }
.feature-row--flip > * { direction: ltr; }
@media (max-width: 860px) {
  .feature-row { grid-template-columns: 1fr; gap: 32px; direction: ltr; }
}

.feature__media {
  background: var(--c-light-grey);
  border-radius: 18px;
  padding: 48px;
  display: flex; align-items: center; justify-content: center;
  min-height: 360px;
}
.feature__media--plain {
  background: transparent;
  padding: 0;
}

/* ---------- Features grid (Siri / languages / own words / colours) ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 48px;
}
@media (max-width: 720px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--c-light-grey);
  border-radius: 12px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.feature-card__glyph {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--c-mid-light-grey);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-off-black);
}
.feature-card__glyph--dark {
  background: var(--c-off-black);
  color: var(--c-extra-light-grey);
}
.feature-card__glyph svg { width: 22px; height: 22px; }
.feature-card__title {
  font-family: var(--ff-serif); font-weight: 400; font-size: 24px;
  line-height: 1.15; color: var(--c-off-black); margin: 0;
}
.feature-card__body {
  font-family: var(--ff-sans); font-weight: 300; font-size: 15px;
  color: var(--c-dark-grey); line-height: 1.5; margin: 0;
}
.feature-card__body em { font-family: var(--ff-serif); font-style: italic; color: var(--c-off-black); font-size: 17px; }

.lang-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.lang-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  background: var(--c-extra-light-grey);
  font-family: var(--ff-sans); font-size: 13px; font-weight: 400;
  color: var(--c-off-black);
}

/* Mock intervention gate */
.intervention-mock {
  width: 260px;
  background: var(--c-extra-light-grey);
  border-radius: 28px;
  padding: 24px;
  border: 4.6px solid var(--c-off-black);
  font-family: var(--ff-serif);
  box-shadow: var(--shadow-banner);
}
.intervention-mock__title {
  font-size: 22px; line-height: 1.15; color: var(--c-off-black);
  margin: 0 0 16px;
}
.intervention-mock__slot {
  font-family: var(--ff-sans); font-size: 12px; font-weight: 300;
  color: var(--c-dark-grey); margin-bottom: 6px;
}
.intervention-mock__word {
  font-size: 32px; color: var(--c-off-black); letter-spacing: -0.01em;
}
.intervention-mock__source {
  font-style: italic; font-size: 18px; color: var(--c-mid-grey); margin-top: 2px;
}
.intervention-mock__input {
  margin-top: 20px; height: 44px; border-radius: 10px;
  background: var(--c-light-grey);
  display: flex; align-items: center; padding: 0 14px;
  font-family: var(--ff-sans); font-size: 14px; color: var(--c-mid-grey);
  font-weight: 300;
}
.intervention-mock__btn {
  margin-top: 16px; height: 44px; border-radius: 10px;
  background: var(--c-off-black); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-sans); font-weight: 500; font-size: 14px;
}

/* ---------- List / tick bullets ---------- */
.tick-list { list-style: none; padding: 0; margin: 24px 0 0; }
.tick-list li {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px; color: var(--c-off-black); font-weight: 300;
  line-height: 1.5;
}
.tick-list li:last-child { border-bottom: 0; }
.tick-list .tick {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 3px;
  color: var(--c-off-black);
}

/* ---------- FAQ ---------- */
.faq {
  background: var(--c-light-grey);
  border-radius: 12px;
  padding: 8px 24px;
  margin-top: 48px;
}
.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 20px 0;
}
.faq details:last-child { border-bottom: 0; }
.faq summary {
  font-family: var(--ff-sans); font-weight: 500; font-size: 16px;
  color: var(--c-off-black);
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 14px; height: 14px;
  border-right: 1.5px solid var(--c-dark-grey);
  border-bottom: 1.5px solid var(--c-dark-grey);
  transform: rotate(45deg); transition: transform 180ms ease-out;
  flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq p {
  margin: 12px 0 0;
  font-size: 15px; color: var(--c-dark-grey); font-weight: 300;
  line-height: 1.6;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--c-off-black);
  color: #fff;
  border-radius: 12px;
  padding: 64px 48px;
  margin: 96px auto;
  max-width: 1072px;
  text-align: center;
}
@media (max-width: 720px) {
  .cta-band { padding: 48px 24px; margin: 48px 16px; }
}
.cta-band .display { color: #fff; }
.cta-band__sub {
  font-family: var(--ff-sans); font-weight: 300; font-size: 17px;
  color: color-mix(in srgb, #fff 70%, transparent);
  max-width: 520px; margin: 16px auto 32px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--hairline);
  font-size: 13px; color: var(--c-dark-grey);
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: space-between; align-items: center;
}
.site-footer a { color: var(--c-dark-grey); }
.site-footer a:hover { color: var(--c-off-black); }
.site-footer__links { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- Quiet, warm-pink intervention-badge ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  background: var(--c-light-grey);
  font-family: var(--ff-sans); font-size: 12px; font-weight: 500;
  color: var(--c-off-black);
  letter-spacing: 0.02em;
}
.pill--light {
  background: rgba(255,255,255,0.14); color: #fff;
}
.pill--eyebrow {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Utilities */
.stack > * + * { margin-top: 16px; }
.muted { color: var(--c-dark-grey); }
.center { text-align: center; }
.max-lead { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ======================================================================
   Mobile header + overflow guard
   The nav had no small-screen handling: at 375px it measured 347px wide,
   collided with the wordmark and pushed the document to 481px, so the
   whole page scrolled sideways. Most paid traffic is mobile, so this
   matters more than it looks.
   ====================================================================== */
html, body { overflow-x: hidden; }

@media (max-width: 720px) {
  .site-header__inner { height: 58px; gap: 12px; }
  .brand { font-size: 20px; }
  .brand__mark { width: 24px; height: 24px; }
  /* Section links go — the page is short and there is a CTA at the end. */
  .nav a:not(.btn) { display: none; }
  .nav { gap: 0; flex-shrink: 0; }
  .nav .btn--small { height: 38px; padding: 0 14px; font-size: 14px; }
}

@media (max-width: 380px) {
  .nav .btn--small { padding: 0 12px; font-size: 13px; }
}
