/* Shared look for every page of the Defensa la llengua site. Colours and type
   are the app's "Trencadís" style (docs/visual-style.md, lib/resources/colors.dart
   and typography.dart). landing.css adds the home page and its demos. */

@font-face {
  font-family: 'Baloo 2';
  src: url('/Baloo2-ExtraBold.woff2') format('woff2');
  font-weight: 700 800;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/AtkinsonHyperlegible-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/AtkinsonHyperlegible-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Core tokens */
  --cobalt: #1D4E9E;
  --cobalt-deep: #143A78;
  --safra: #F2B233;
  --teula: #B4472F;
  --oliva: #5C7D2E;
  --mar: #13707A;
  --tinta: #18202F;
  --tinta-suau: #4A5568;
  --blanc: #FFFFFF;
  --fons: #F3F6FA;
  --vora: #C9D3E3;
  --cel: #BFE3F7;

  /* Ramp steps used for tints and rims */
  --blau-lightest: #DCE6F7;
  --blau-light: #8FAAD9;
  --groc-lightest: #FFF4D6;
  --groc-darkest: #B7801A;
  --groc-darker: #D89A1E;
  --verd-lightest: #E6F0D6;
  --verd-base: #6B8F3A;
  --verd-darkest: #3A521C;
  --vermell-lightest: #F6D9D1;
  --vermell-darkest: #7A2E1E;
  --mar-lightest: #D5EEF0;

  --display: 'Baloo 2', ui-rounded, system-ui, sans-serif;
  --text: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius-card: 18px;
  --radius-btn: 16px;
  --radius-panel: 24px;
  --shell: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fons);
  color: var(--tinta);
  font: 400 17px/1.6 var(--text);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}
p { margin: 0 0 1em; }
a { color: var(--cobalt); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tinta-suau);
  margin: 0 0 0.6rem;
}

/* ── Top bar, always on cobalt ───────────────────────────────────────────── */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 1.45rem/1 var(--display);
  color: var(--blanc);
  text-decoration: none;
}
.wordmark img { width: 36px; height: 36px; border-radius: 10px; display: block; }
.wordmark em { font-style: normal; color: var(--safra); }

.topnav { display: flex; gap: 22px; font-size: 0.95rem; font-weight: 700; }
.topnav a { color: rgba(255, 255, 255, 0.88); text-decoration: none; }
.topnav a:hover { color: var(--blanc); text-decoration: underline; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--cobalt);
  color: var(--blanc);
  font: 800 1.15rem/1 var(--display);
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:focus-visible { outline: 3px solid var(--safra); outline-offset: 3px; }
.btn-go { background: var(--oliva); }
.btn-ghost {
  background: var(--blanc);
  border: 1px solid var(--vora);
  color: var(--cobalt);
}
.btn-small { min-height: 44px; padding: 8px 18px; font-size: 1.02rem; }

/* ── Trencadís shards (TrencadisPainter) ─────────────────────────────────── */

.shards {
  position: absolute;
  pointer-events: none;
  width: clamp(200px, 32vw, 390px);
  height: auto;
}
.shards-top { top: 0; right: 0; }
.shards-bottom { bottom: 0; left: 0; width: clamp(64px, 9vw, 96px); }

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
  background: var(--fons);
  color: var(--tinta-suau);
  font-size: 0.9rem;
  padding: 30px 0 44px;
  border-top: 1px solid var(--vora);
}
footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: center;
  justify-content: space-between;
}
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--cobalt); }
footer p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 880px) {
  .topnav { gap: 16px; font-size: 0.88rem; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .shell { padding: 0 16px; }
  .wordmark { font-size: 1.25rem; }
  .topnav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}
