/* Chopmatic — the house neubrutalist system (hard borders, offset shadows,
   IBM Plex) wearing the app's own panel from lib/ui/theme.dart. Colour names
   match Tone.* in the app so the two stay in step; --ground is the icon's
   blue, which the app itself does not use. */
:root {
  --ground: #c5dbee;      /* the icon's ground */
  --panel: #c6ccc8;       /* Tone.panel — the faceplate */
  --plate: #d8dcd7;       /* Tone.plate — a raised sub-plate */
  --well: #17110f;        /* Tone.well — the one dark area */
  --ink: #12100f;         /* Tone.ink */
  --ink-soft: #5c615e;    /* Tone.inkSoft */
  --cream: #f0ebdc;       /* Tone.cream — writing on the well */
  --well-text: rgba(240, 235, 220, 0.6); /* Tone.wellText */
  --lamp-off: #3a3f3c;    /* Tone.lampOff — an unlit lamp */
  --phosphor: #ff3b30;    /* Tone.phosphor — the playhead */

  /* The zone palette. Colour is structural: each one means a part of the app. */
  --orange: #ef7b24;      /* CHOP — and the site's accent */
  --teal: #17a0ae;        /* SEQUENCE */
  --green: #2f9e5c;       /* SONG */
  --purple: #7b4cbe;      /* STEMS */
  --yellow: #f2c230;      /* MIDI */
  --red: #e0342b;         /* OUTPUT */
  --blue: #2a5fc4;        /* the major tabs */

  --border-thick: 3px solid var(--ink);
  --shadow-hard: 6px 6px 0px var(--ink);
  --shadow-hard-hover: 2px 2px 0px var(--ink);
  --radius: 4px;          /* the app's controls are hard-edged; keep corners small */
  --radius-lg: 8px;

  --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(--ground);
  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 engraved labels — chop modes, tabs, switches. */
.mono {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Components */
.neu-card {
  background: var(--plate);
  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(--orange);
  color: var(--ink);
  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 well: cream lettering, orange links. */
.header {
  padding: 20px 0;
  border-bottom: 3px solid var(--orange);
  background: var(--well);
}
.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;
  letter-spacing: 1px;
  color: var(--cream);
}
.logo-box { width: 32px; height: 32px; border-radius: 6px; }

.nav { display: flex; align-items: center; gap: 24px; }
.nav a, .nav button {
  color: var(--orange);
  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; }

@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .nav { gap: 16px; flex-wrap: wrap; }
}

/* 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: 540px; }

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

/* The device: the app's faceplate, drawn in CSS — a dark well with the
   waveform and its cuts, over a plate of pads. */
.device {
  background: var(--panel);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  box-shadow: 16px 16px 0px rgba(18, 16, 15, 0.14);
  padding: 20px;
  width: 100%;
  max-width: 440px;
}
.device-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--orange);
  color: var(--ink);
  padding: 2px 8px;
  margin-bottom: 10px;
}
.well {
  background: var(--well);
  border: 2px solid #080607;   /* Tone.wellEdge */
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.well-readout {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--cream);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.well-readout span:last-child { color: var(--well-text); }

/* A waveform cut into slices: the bars, and an orange line at each cut. */
.waveform {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 72px;
}
.waveform i {
  flex: 1;
  background: var(--cream);
  opacity: 0.55;
  border-radius: 1px;
  display: block;
}
.waveform i.lit { opacity: 1; }
.waveform i.cut {
  flex: 0 0 2px;
  height: 100% !important;
  background: var(--orange);
  opacity: 1;
}
.waveform i.head {
  flex: 0 0 2px;
  height: 100% !important;
  background: var(--phosphor);
  opacity: 1;
}

.pad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad-grid div {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--plate);
  border: 2px solid var(--ink);
  position: relative;
}
/* Each pad carries a lamp; unlit lamps stay visible, as in the app. */
.pad-grid div::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lamp-off);
}
.pad-grid div.on { background: var(--orange); }
.pad-grid div.on::after { background: var(--phosphor); }

/* Status strip — the well again: cream on near-black. */
.status-strip {
  background: var(--well);
  padding: 56px 0;
  border-top: 3px solid var(--orange);
}
.status-strip h2 { color: var(--cream); max-width: 760px; }
.status-strip p { color: var(--cream); opacity: 0.78; max-width: 680px; }
.status-strip p:last-child { margin-bottom: 0; }
.status-strip .section-kicker { color: var(--orange); opacity: 1; }

/* 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(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.feature-icon .material-symbols-outlined { font-size: 26px; color: var(--ink); }
/* Zone colours, matching the app's tabs. */
.feature-icon.z-chop { background: var(--orange); }
.feature-icon.z-sequence { background: var(--teal); }
.feature-icon.z-song { background: var(--green); }
.feature-icon.z-stems { background: var(--purple); }
.feature-icon.z-midi { background: var(--yellow); }
.feature-icon.z-output { background: var(--red); }
.feature-icon.z-tabs { background: var(--blue); }
.feature-icon.z-sequence .material-symbols-outlined,
.feature-icon.z-song .material-symbols-outlined,
.feature-icon.z-stems .material-symbols-outlined,
.feature-icon.z-output .material-symbols-outlined,
.feature-icon.z-tabs .material-symbols-outlined { color: #fdfcf8; } /* Tone.onBlockLight */

/* 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.6;
  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 button: used for a store the app has not shipped to yet,
   so it is a <span>, not a link. Swap it for an <a href> and drop .is-pending
   once that listing goes live. */
.store-btn.is-pending {
  background: var(--plate);
  color: var(--ink);
  cursor: default;
  opacity: 0.9;
}
.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(--plate);
  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; }
.policy article h3 { font-size: 1.1rem; margin: 20px 0 8px; }
.policy article p { font-size: 1rem; }
.policy article p:last-child { margin-bottom: 0; }
.policy article ul, .policy article ol { margin: 0 0 24px 20px; }
.policy article li { font-size: 1rem; margin-bottom: 8px; opacity: 0.9; }
.policy article code { font-family: var(--font-mono); font-size: 0.92em; }
a { color: inherit; }

/* Language toggle. 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(--well);
  color: var(--cream);
  border-top: 3px solid var(--orange);
  padding: 48px 0;
}
.status-strip + .footer { border-top: 3px solid var(--lamp-off); }
.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(--orange);
  margin-bottom: 8px;
}
.footer p { font-size: 0.9rem; opacity: 0.7; margin-bottom: 0; }
.footer a { color: inherit; }
.footer-right { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-right a {
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.8;
}
.footer-right a:hover { opacity: 1; text-decoration: underline; }
