/* Hablavista website styles. Plain CSS, no build step. Colours, fonts and radii come from docs/design-tokens.json.
   Sizes are in rem, so the browser's text size setting and zoom scale everything. */

@font-face { font-family: "Fredoka"; src: url("/assets/fonts/Fredoka_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/assets/fonts/Fredoka_600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/Nunito_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/Nunito_700Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/Nunito_800ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  /* Light theme (design tokens). */
  --brand: #4B1D5C;
  --brand-strong: #2E0F39;
  --brand-tint: #F3E9F6;
  --accent: #FFB238;        /* mango: fill only, never text */
  --accent-strong: #A35400; /* mango-coloured text */
  --accent-tint: #FFF1D9;
  --ink: #1F1424;
  --muted: #5E5066;
  --surface: #FFFFFF;
  --background: #FBF8FC;
  --line: #E8DFEC;
  --on-brand: #FFFFFF;
  --mark-bubble: #4B1D5C;
  --mark-centre: #FFFFFF;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max: 68rem;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #C9A3D6;
    --brand-strong: #E6D3EE;
    --brand-tint: #3A1E45;
    --accent-strong: #FFC766;
    --accent-tint: #4A3510;
    --ink: #F5EEF7;
    --muted: #C3B5CA;
    --surface: #1A1020;
    --background: #120A16;
    --line: #3A2C42;
    --on-brand: #1A1020;
    --mark-bubble: #C9A3D6;
    --mark-centre: #1A1020;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem; /* body-lg: 17px */
  line-height: 1.6;
  color: var(--ink);
  background: var(--background);
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-underline-offset: 0.18em; }
a:hover { color: var(--brand-strong); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--display); font-weight: 600; line-height: 1.15; color: var(--ink);
  margin: 0 0 0.6em; overflow-wrap: break-word; hyphens: manual; text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.6rem); color: var(--brand); }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.skip {
  position: absolute; left: 1rem; top: -10rem;
  background: var(--brand); color: var(--on-brand); padding: 0.6rem 1rem; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 1rem; color: var(--on-brand); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 min(1.25rem, 5vw); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; min-height: 44px; }
.brand svg { width: min(2.4rem, 12vw); height: min(2.4rem, 12vw); flex: none; }
.wordmark { font-family: var(--display); font-size: min(1.6rem, 9vw); line-height: 1; white-space: nowrap; color: var(--ink); }
.wordmark b { font-weight: 600; color: var(--brand); }
.wordmark span { font-weight: 400; }
.mark-bubble { fill: var(--mark-bubble); }
.mark-centre { fill: var(--mark-centre); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.9rem; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 700;
}
.site-nav a:hover { background: var(--brand-tint); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--brand-tint); }

/* Sections */
main { display: block; }
.section { padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 0.95rem; font-weight: 800; color: var(--accent-strong); margin-bottom: 0.6rem; }
.lead { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem); color: var(--muted); max-width: 36em; }
.measure { max-width: 40em; }
.muted { color: var(--muted); }

.hero { padding: clamp(3rem, 2rem + 5vw, 6rem) 0 clamp(2.5rem, 2rem + 3vw, 4rem); }
.hero-grid { display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1.15fr 1fr; } }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.35rem; border-radius: var(--radius-md);
  font: 800 1rem/1.3 var(--sans); text-decoration: none; text-align: center; max-width: 100%;
  border: 2px solid var(--brand); cursor: pointer; overflow-wrap: anywhere;
}
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.btn-secondary { background: transparent; color: var(--brand); }
.btn-secondary:hover { background: var(--brand-tint); color: var(--brand); }
.btn[aria-pressed="true"] { background: var(--brand-tint); color: var(--ink); }

.badge {
  display: inline-block; font-weight: 800; font-size: 0.95rem; padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--accent-tint); color: var(--ink); border: 2px solid var(--accent);
}

/* Picture frame (4:3, radius-lg, on surface) */
.scene { margin: 0; }
.scene img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--accent-tint);
}
.scene figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.75rem; }

/* Steps: Hear it, See it, Say it */
.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.steps li { padding: 1.5rem; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.section.alt .steps li { background: var(--background); }
.step-icon {
  width: 3rem; height: 3rem; border-radius: 50%; background: var(--brand-tint); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 0.9rem;
}
.step-icon svg { width: 1.5rem; height: 1.5rem; }
.steps h3 { margin-bottom: 0.35em; }
.steps p:last-child { margin-bottom: 0; }

/* Sample word */
.sample { display: grid; gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .sample { grid-template-columns: 1.1fr 1fr; } }
.word-card { background: var(--background); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
.word { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 2rem + 2.5vw, 3.4rem); line-height: 1.1; margin: 0 0 0.2em; color: var(--ink); }
.word .article { font-weight: 400; color: var(--muted); }
.meaning { font-size: 1.2rem; margin-bottom: 0.25rem; }
.say { color: var(--muted); margin-bottom: 1.25rem; }
.hint { background: var(--accent-tint); border-left: 4px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.9rem 1.1rem; margin: 0 0 1.25rem; }
.hint p:last-child { margin-bottom: 0; }
.audio-status { min-height: 1.6em; color: var(--muted); font-size: 0.95rem; margin: 0.75rem 0 0; }

/* Cards */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.5rem; }
.section.alt .card { background: var(--background); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.intervals { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.intervals li { background: var(--brand-tint); border-radius: 999px; padding: 0.3rem 0.9rem; font-weight: 700; }

.list { padding-left: 1.2rem; margin: 0 0 1em; }
.list li { margin-bottom: 0.35em; }

/* Policy and support pages */
.policy { max-width: 46em; }
.policy h1 { font-size: clamp(2rem, 1.6rem + 2vw, 2.8rem); }
.policy h2 { margin-top: 2.2rem; font-size: 1.5rem; }
.policy table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: 1rem; }
.policy caption { text-align: left; caption-side: top; padding-bottom: 0.5rem; color: var(--muted); }
.policy th, .policy td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border: 1px solid var(--line); }
.policy th { background: var(--brand-tint); }
.table-scroll { overflow-x: auto; }
.meta { color: var(--muted); font-size: 1rem; }
.note { background: var(--brand-tint); border-left: 4px solid var(--brand); padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.5rem 0; }
.note p:last-child { margin-bottom: 0; }
.email { font-size: clamp(1.1rem, 1rem + 0.8vw, 1.45rem); font-weight: 800; overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2rem 0 2.5rem; font-size: 1rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 0.9rem; }
.made-by { color: var(--ink); font-weight: 700; margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.legal { margin: 0; max-width: 52em; }

/* Long email addresses and URLs wrap instead of forcing sideways scrolling at large text sizes. */
p a, li a { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .site-nav a { transition: background-color 0.15s ease, color 0.15s ease; }
}

[hidden] { display: none !important; }
