/* Sampultu — the house neubrutalist system (hard borders, offset
   shadows, IBM Plex) wearing the app's own palette from lib/ui/theme.dart.
   Colour names match Tone.* in the app so the two stay in step. */
:root {
  --bg: #edecea;        /* Tone.bg — the light body */
  --panel: #000000;     /* Tone.dark — detail panel / app bar */
  --ink: #141414;       /* Tone.cardText */
  --card: #d9d9d9;      /* Tone.card */
  --chip: #e5e4e1;      /* Tone.chip */
  --pad: #2f2e2b;       /* Tone.padOn — the pressed pad */
  --pad-text: #edecea;  /* Tone.padOnText */
  --faint: #a9a7a4;     /* Tone.faint */
  --teal: #4fb3a9;      /* Tone.teal — accent, never a fill */
  --magenta: #ee2b8c;   /* Tone.magenta — waveforms */
  --magenta-dim: #6e2049;
  --white: #ffffff;

  --border-thick: 3px solid var(--ink);
  --shadow-hard: 6px 6px 0px var(--ink);
  --shadow-hard-hover: 2px 2px 0px var(--ink);
  --radius: 8px;
  --radius-lg: 16px;

  --font-mono: 'IBM Plex Mono', Menlo, monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Typography */
h1, h2, h3 { font-family: var(--font-sans); font-weight: 800; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 24px; }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 20px; }
h3 { font-size: 1.5rem; margin-bottom: 12px; }
p { font-size: 1.125rem; margin-bottom: 24px; opacity: 0.9; }

/* The app's mono readouts — times, sizes, slot numbers. */
.mono {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Components */
.neu-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 32px;
}

.neu-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--teal);
  color: var(--panel);
  font-family: var(--font-sans);
  font-weight: 700;
  text-decoration: none;
  border: var(--border-thick);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 12px 24px;
  transition: all 0.1s ease;
  cursor: pointer;
}
.neu-btn:hover { transform: translate(4px, 4px); box-shadow: var(--shadow-hard-hover); }

/* Header — the app bar: teal on black. */
.header {
  padding: 20px 0;
  border-bottom: var(--border-thick);
  background: var(--panel);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--bg);
}
.logo-box { width: 32px; height: 32px; border-radius: 6px; }

.badge {
  background: var(--teal);
  color: var(--panel);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
}

.nav { display: flex; align-items: center; gap: 24px; }
.nav a, .nav button {
  color: var(--teal);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav a:hover, .nav button:hover { text-decoration: underline; }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 48px; padding: 72px 24px; }
@media (min-width: 900px) {
  .hero { flex-direction: row; align-items: center; padding: 88px 24px 96px; }
}
.hero-content { flex: 1; }
.hero-title { font-size: clamp(2.5rem, 4.4vw, 3.5rem); max-width: 640px; }
.hero-subtitle { font-size: 1.25rem; max-width: 520px; }

.hero-image { flex: 1; display: flex; justify-content: center; }

/* The device panel: the icon's pad grid, drawn in CSS. */
.pad-panel {
  background: var(--panel);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  box-shadow: 16px 16px 0px rgba(20, 20, 20, 0.12);
  padding: 24px;
  width: 100%;
  max-width: 420px;
}
.pad-readout {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--teal);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.pad-readout span:last-child { color: var(--faint); }

/* Waveform glass — magenta bars on the panel's black. */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 72px;
  margin-bottom: 20px;
}
.waveform i {
  flex: 1;
  background: var(--magenta-dim);
  border-radius: 1px;
  display: block;
}
.waveform i.lit { background: var(--magenta); }

/* The pads live on the light plate, not on the panel's black — the volca is
   dark pads on a light grey plate, and so is the icon. An open pad is
   Tone.padOn, which only reads as *pressed* against something light. */
.pad-plate {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
}
.pad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad-grid div {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--card);
}
.pad-grid div.on { background: var(--pad); }
.pad-grid div.empty { background: none; border: 2px dashed var(--faint); }

/* Status strip — the app's StatusPanel: teal mono on black. */
/* Black on the light body needs no border to be an edge — but where two dark
   sections meet, --ink would be an invisible divider, so use the pad grey. */
.status-strip {
  background: var(--panel);
  padding: 28px 0;
}
.status-strip + .status-strip,
.status-strip + .footer,
.footer { border-top: 3px solid var(--pad); }
.status-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.status-item { min-width: 150px; }
.status-item .status-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 1px;
}
.status-item .status-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 4px;
}

/* Features */
.features { padding: 88px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}
.feature-card p:last-child { margin-bottom: 0; }
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.feature-icon .material-symbols-outlined { font-size: 26px; color: var(--ink); }

/* Section headings */
.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.55;
  margin-bottom: 8px;
}

/* Store buttons */
.cta-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.store-btn { min-height: 64px; min-width: 214px; }
.store-btn .btn-sub { font-size: 0.75rem; text-transform: uppercase; line-height: 1; }
.store-btn .btn-main { font-size: 1.25rem; line-height: 1; margin-top: 2px; }

/* Placeholder store buttons: the app has no listing yet, so these are not
   links. Swap the <span> for an <a href> and drop .is-pending at launch. */
.store-btn.is-pending {
  background: var(--chip);
  color: var(--ink);
  cursor: default;
  opacity: 0.85;
}
.store-btn.is-pending:hover { transform: none; box-shadow: var(--shadow-hard); }

/* Policy pages */
.policy { padding: 48px 24px; max-width: 820px; }
.policy-head { margin-bottom: 32px; }
.summary { font-size: 1.15rem; max-width: 640px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: var(--chip);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
}
.policy article section { margin-bottom: 32px; }
.policy article section:last-child { margin-bottom: 0; }
.policy article h2 { font-size: 1.4rem; margin-bottom: 12px; }
/* Support is the only policy page that needs a third level: one heading per
   symptom, so a reader scanning for their own problem can stop at the right one. */
.policy article h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.policy article h3:first-of-type { margin-top: 8px; }
.policy article p { font-size: 1rem; }
.policy article p:last-child { margin-bottom: 0; }
/* The reset zeroes padding, which would clip an <ol>'s numbers out of view —
   hence the explicit indent here rather than relying on the browser default. */
.policy article ul, .policy article ol { margin: 0 0 24px 20px; }
.policy article li { font-size: 1rem; margin-bottom: 8px; opacity: 0.9; }
a { color: inherit; }

/* Language toggle. The English copy is the default; Spanish is revealed by
   the toggle writing .lang-es onto <body>. Without these rules both
   translations render stacked and the toggle button does nothing. */
/* The English copy is the default; the toggle writes .lang-es onto <body>.
   Only ever hide, never set a display value — then each element keeps its own
   natural layout when shown (the footer's inline spans stay inline).
   Scoped under body on purpose: the toggle also sets <html lang="es">, and a
   bare [lang="es"] matches that too — which hides the entire document. */
body:not(.lang-es) [lang="es"] { display: none !important; }
body.lang-es [lang="en"] { display: none !important; }

/* Footer */
.footer {
  background: var(--panel);
  color: var(--bg);
  border-top: var(--border-thick);
  padding: 48px 0;
}
.footer-inner { display: flex; flex-direction: column; gap: 24px; justify-content: space-between; }
@media (min-width: 700px) {
  .footer-inner { flex-direction: row; align-items: flex-start; }
}
.footer-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--teal);
  margin-bottom: 8px;
}
.footer p { font-size: 0.9rem; opacity: 0.7; margin-bottom: 0; }
.footer a { color: inherit; }
.footer-right { display: flex; gap: 24px; }
.footer-right a {
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.8;
}
.footer-right a:hover { opacity: 1; text-decoration: underline; }
