/* ==========================================================================
   Word Quip — wordquip.world
   Built on marketing/brand/tokens.css in the worldleturtle repo. Values that
   look arbitrary are not: the tile colours, the language accents and the
   animation durations are lifted from the shipped app. Check the brand kit
   before changing one.
   ========================================================================== */

/* --- Fonts. Self-hosted: no third-party request, no consent question ----- */
@font-face {
  font-family: "Nunito"; src: url("fonts/nunito-latin.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito"; src: url("fonts/nunito-latin-ext.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens ------------------------------------------------------------- */
:root {
  --ink: #05502B;
  --ink-deep: #033A1F;
  --paper: #FFF8E7;
  --cream: #FBE8B4;
  --green: #4CAF50;   /* the app's correct tile. A fill, never type */
  --teal: #2C7A66;
  --moss: #4A5D52;
  --rule: #EDE3D1;

  --correct: #4CAF50;
  --present: #FF9800;
  --absent:  #616161;
  --revealed:#2196F3;

  /* home_screen.dart, buildLanguageCard — top stop and 15%-darker bottom */
  --lang-en:#64B5F6; --lang-en-d:#1C92F2;
  --lang-es:#FFF176; --lang-es-d:#FFE92A;
  --lang-fr:#BA68C8; --lang-fr-d:#973DA7;
  --lang-de:#E57373; --lang-de-d:#D93232;
  --lang-it:#FFB74D; --lang-it-d:#FF9800;
  --lang-pt:#81C784; --lang-pt-d:#4DAE52;
  --lang-nl:#FF8A65; --lang-nl-d:#FF5018;
  --lang-pl:#F06292; --lang-pl-d:#E91C62;

  --bg: var(--paper);
  --surface: #FFFFFF;
  --surface-alt: var(--cream);
  --text: var(--ink);
  --muted: var(--moss);
  --line: var(--ink);
  --hairline: var(--rule);
  --shadow: var(--ink);
  --cta-bg: var(--ink);
  --cta-text: var(--cream);

  --display: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;
  --bw: 3px;
  --sticker: 0 4px 0 var(--shadow);
  --sticker-lift: 0 6px 0 var(--shadow);
  --sticker-press: 0 1px 0 var(--shadow);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --measure: 62ch;
  --pad: clamp(20px, 5vw, 64px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A3D22;
    --surface: #123D26;
    --surface-alt: #164A2D;
    --text: var(--paper);
    --muted: #B9C9BC;
    --line: #2F6B49;
    --hairline: #1E5334;
    --teal: #5FB89C;
    --cta-bg: var(--cream);
    --cta-text: var(--ink-deep);
    --shadow: #041F11;
  }
}
:root[data-theme="dark"] {
  --bg: #0A3D22; --surface: #123D26; --surface-alt: #164A2D;
  --text: var(--paper); --muted: #B9C9BC; --line: #2F6B49; --hairline: #1E5334;
  --teal: #5FB89C; --cta-bg: var(--cream); --cta-text: var(--ink-deep);
  --shadow: #041F11;
}

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  text-wrap: balance;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.5rem, 6.4vw, 4.1rem); font-weight: 900; letter-spacing: 0; }
h2 { font-size: clamp(1.95rem, 4.3vw, 2.7rem); font-weight: 900; letter-spacing: 0; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); line-height: 1.5; color: var(--muted); font-weight: 600; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: var(--pad); }
section { padding-block: clamp(56px, 9vw, 104px); }
.eyebrow {
  font-weight: 800; font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--muted); margin: 0 0 10px;
}
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink);
  color: var(--cream); padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 50;
}
.skip:focus { left: 0; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0.72em 1.35em;
  border: var(--bw) solid var(--line); border-radius: var(--r-pill);
  background: var(--cta-bg); color: var(--cta-text);
  font-family: var(--display); font-weight: 600; font-size: 1.02rem;
  text-decoration: none; box-shadow: var(--sticker);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sticker-lift); }
.btn:active { transform: translateY(3px); box-shadow: var(--sticker-press); }
/* No green button — nothing readable sits on #4CAF50. Outline instead. */
.btn--ghost { background: transparent; color: var(--text); }
.btn--sm { padding: 0.46em 0.9em; font-size: 0.9rem; box-shadow: var(--sticker); }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* --- Top bar — pinned, translucent over the page ------------------------ */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; block-size: 56px;
}
.topbar-links { display: flex; align-items: center; gap: 10px; }
.topbar-brand { display: inline-flex; align-items: center; }
.topbar-brand img { height: 40px; width: auto; display: block; }
.topbar .btn--sm { gap: 7px; }
.topbar .btn--sm svg { width: 18px; height: 18px; }
/* Below the bar, the fixed header would overlap the hero, so offset the body. */
body { padding-top: 56px; }
@media (max-width: 460px) {
  .topbar .btn--sm .label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .topbar .btn--sm { padding: 0.5em 0.62em; }
}

/* --- Hero --------------------------------------------------------------- */
.hero { padding-block: clamp(40px, 7vw, 84px) clamp(48px, 8vw, 96px); }
/* Mobile: one centered column — copy, then the live board. */
.hero .wrap {
  display: grid; gap: clamp(24px, 4vw, 36px);
  grid-template-columns: 1fr; justify-items: center; text-align: center;
}
.hero-copy { max-width: 640px; }
.hero-intro { max-width: 48ch; margin-inline: auto; }
.hero h1 { font-size: clamp(2.45rem, 6.1vw, 4rem); line-height: 1.08; }
.hero .btns { margin-top: 22px; justify-content: center; }
.hero-note { font-size: 0.92rem; color: var(--muted); margin-top: 14px; }

/* Right column: "Practice in 8 languages" label, the board, then the pills.
   Pills are one soft tint of each language's own colour. */
.hero-demo { display: grid; gap: clamp(12px, 2vw, 18px); justify-items: center; }
.hero-demo .eyebrow { margin: 0; }
.lang-pills {
  list-style: none; margin: 0; padding: 0; width: 100%;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.lang-pill {
  font-family: var(--display); font-weight: 800;
  font-size: 0.9rem; line-height: 1; white-space: nowrap;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--c) 20%, var(--surface));
  color: color-mix(in srgb, var(--c) 52%, var(--text));
}

/* Desktop: copy on the left, the live board on the right.
   The board column is sized to its natural width (auto) so tiles never wrap. */
@media (min-width: 1000px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr) 420px;
    column-gap: clamp(40px, 5vw, 80px);
    align-items: center; text-align: left;
  }
  .hero-copy { max-width: 34rem; }
  .hero-intro { margin-inline: 0; }
  .hero .btns { justify-content: flex-start; }
  .hero .demo .row { flex-wrap: nowrap; }
}

/* --- Tiles — the product's atom. White letters, exactly like the app ----- */
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.tile {
  inline-size: clamp(46px, 11vw, 62px); block-size: clamp(46px, 11vw, 62px);
  display: grid; place-items: center;
  border: var(--bw) solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1; text-transform: uppercase;
  box-shadow: var(--sticker);
}
.tile.correct  { background: var(--correct);  color: #fff; border-color: var(--ink); }
.tile.present  { background: var(--present);  color: #fff; border-color: var(--ink); }
.tile.absent   { background: var(--absent);   color: #fff; border-color: var(--ink); }
.tile.revealed { background: var(--revealed); color: #fff; border-color: var(--ink); }
.tile.ghost    { visibility: hidden; }   /* width-only spacer for short words */

/* letter_tile.dart flips in 500ms with a 100ms per-tile stagger */
@keyframes flip { 0%,100% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } }
.tile.flip { animation: flip 500ms var(--ease) both; }

.demo {
  background: var(--surface); border: var(--bw) solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sticker);
  padding: clamp(20px, 4vw, 32px);
}
.demo-cap { margin: 18px 0 0; font-weight: 800; color: var(--muted); font-size: 0.98rem; }
.demo-cap em { font-style: normal; color: var(--text); }

/* --- Cards -------------------------------------------------------------- */
.cards { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: var(--bw) solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sticker); padding: 24px;
}
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); }
.card-icon {
  display: inline-grid; place-items: center;
  inline-size: 48px; block-size: 48px; margin-bottom: 16px;
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--sticker); color: #fff;
}
.card-icon svg { width: 24px; height: 24px; stroke-width: 2.4; }
.card-icon.correct  { background: var(--correct); }
.card-icon.present  { background: var(--present); }
.card-icon.revealed { background: var(--revealed); }

/* --- Screenshots -------------------------------------------------------- */
.shots { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 860px) { .shots { grid-template-columns: 0.9fr 1.1fr; } }
.shots.flip-order > :first-child { order: 2; }
@media (max-width: 859px) { .shots.flip-order > :first-child { order: 0; } }
.frame {
  border-radius: 22px; box-shadow: var(--sticker);
  max-width: 320px; margin-inline: auto; line-height: 0;
}
.frame img {
  display: block; width: 100%;
  border: 5px solid var(--line); border-radius: 22px;
}
/* Text-led variant: the copy gets the wider column, the phone the narrower. */
@media (min-width: 860px) {
  .shots--text-first { grid-template-columns: 1.15fr 0.85fr; }
}

/* --- Language chips ----------------------------------------------------- */
.langs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.lang {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 9px;
  border: var(--bw) solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); box-shadow: 0 3px 0 var(--shadow);
  font-weight: 700; font-size: 0.95rem;
}
/* The accent is a swatch, never a text background: these are shade300 pastels
   and nothing readable sits on them. */
.lang i {
  display: block; inline-size: 20px; block-size: 20px; border-radius: 6px;
  border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.45);
  flex: none;
}
.lang b { font-weight: 800; }
.lang span { color: var(--muted); font-weight: 600; font-size: 0.88rem; }

/* --- Bands -------------------------------------------------------------- */
.band { background: var(--surface-alt); border-block: var(--bw) solid var(--line); }
.facts { display: grid; gap: 18px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.facts b { display: block; font-family: var(--display); font-size: 1.1rem; }
.facts p { margin: 2px 0 0; color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.check {
  flex: none; inline-size: 26px; block-size: 26px; border-radius: 8px;
  background: var(--green); border: 2px solid var(--ink);
  display: grid; place-items: center; margin-top: 2px;
}
.check svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 3.2; }

/* --- Footer ------------------------------------------------------------- */
footer {
  background: var(--ink); color: var(--cream);
  padding-block: clamp(44px, 7vw, 72px);
}
footer a { color: var(--cream); }
footer h2 { color: var(--paper); }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .foot-grid { grid-template-columns: 1.2fr 1fr; align-items: end; } }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-weight: 700; }
.foot-legal { margin: 26px 0 0; font-size: 0.88rem; opacity: 0.78; }
footer .btn { border-color: var(--cream); background: var(--cream); color: var(--ink-deep); box-shadow: 0 4px 0 #021A0E; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile.flip { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
