/* ==========================================================================
   Migos AI Video Generator — design system
   --------------------------------------------------------------------------
   One stylesheet, no framework. Every colour is a token declared in the two
   token blocks below (:root and :root[data-theme="dark"]); no rule anywhere
   else names a colour literal. Spacing is a strict 8px grid.

   Verified WCAG 2.1 contrast (computed with the standard relative-luminance
   formula, not eyeballed):

     LIGHT theme — deep slate ink on warm cream paper
       body text   #1C1C1E on #F5F0E8 ....... 15.00:1  (AA/AAA body)
       muted text  #554F49 on #F5F0E8 .......  6.71:1  (AA body)
       muted text  #554F49 on #E8E1D5 .......  5.30:1  (AA body)
       link/act.   #B03325 on #F5F0E8 .......  5.53:1  (AA body)
       link/act.   #B03325 on #FBF8F3 .......  5.92:1  (AA body)
       link/act.   #B03325 on #E8E1D5 .......  4.83:1  (AA body)
       success     #1F6B45 on #F5F0E8 .......  5.70:1  (AA body)
       btn label   #1C1C1E on #E85D4E .......  4.95:1  (AA body)
       btn hover   #1C1C1E on #F07A6C .......  6.24:1  (AA body)
       UI border   #6E6B64 on #F5F0E8 .......  4.69:1  (AA non-text)
       UI border   #6E6B64 on #E8E1D5 .......  4.09:1  (AA non-text)
       UI border   #6E6B64 on #D6CCBC .......  3.35:1  (AA non-text)

     DARK theme — warm cream ink on deep slate
       body text   #F5F0E8 on #1C1C1E ....... 15.00:1  (AA/AAA body)
       body text   #F5F0E8 on #26262A ....... 13.29:1  (AA/AAA body)
       muted text  #B5AEA2 on #1C1C1E .......  7.73:1  (AA body)
       muted text  #B5AEA2 on #34343A .......  5.62:1  (AA body)
       link/act.   #F07A6C on #1C1C1E .......  6.24:1  (AA body)
       link/act.   #F07A6C on #26262A .......  5.53:1  (AA body)
       success     #6FCF9B on #1C1C1E .......  8.97:1  (AA body)
       btn label   #1C1C1E on #E85D4E .......  4.95:1  (AA body)
       btn hover   #1C1C1E on #F07A6C .......  6.24:1  (AA body)
       UI border   #82828C on #1C1C1E .......  4.47:1  (AA non-text)
       UI border   #82828C on #26262A .......  3.96:1  (AA non-text)
       UI border   #82828C on #34343A .......  3.25:1  (AA non-text)

   Layout: mobile-first. Content column 1200px, page designed at 1440px.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Raw palette — the only place in this file where a colour literal appears. */
  --slate-950: #141416;
  --slate-900: #1C1C1E;
  --slate-800: #26262A;
  --slate-700: #34343A;
  --slate-500: #82828C;
  --stone-600: #4A4844;
  --stone-500: #554F49;
  --stone-400: #6E6B64;
  --cream-50: #FBF8F3;
  --cream-100: #F5F0E8;
  --cream-200: #E8E1D5;
  --cream-300: #D6CCBC;
  --cream-400: #B5AEA2;
  --coral-400: #F07A6C;
  --coral-500: #E85D4E;
  --coral-700: #B03325;
  --moss-400: #6FCF9B;
  --moss-700: #1F6B45;

  /* Semantic colour (light theme). */
  --bg: var(--cream-100);
  --bg-soft: var(--cream-200);
  --surface: var(--cream-50);
  --surface-2: var(--cream-200);
  --surface-strong: var(--slate-900);
  --ink: var(--slate-900);
  --ink-soft: var(--stone-600);
  --muted: var(--stone-500);
  --accent: var(--coral-500);
  --accent-hover: var(--coral-400);
  --accent-ink: var(--slate-900);
  --accent-text: var(--coral-700);
  --border: var(--stone-400);
  --border-strong: var(--slate-900);
  --success: var(--moss-700);
  --danger: var(--coral-700);
  --focus: var(--coral-700);
  --shadow-color: color-mix(in srgb, var(--slate-900) 14%, transparent);
  --scrim: color-mix(in srgb, var(--slate-900) 56%, transparent);
  --tint-accent: color-mix(in srgb, var(--accent) 12%, var(--bg));
  --tint-success: color-mix(in srgb, var(--success) 12%, var(--bg));
  --tint-danger: color-mix(in srgb, var(--danger) 12%, var(--bg));

  /* Space — 8px grid. */
  --space-half: 4px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;

  /* Radius — buttons read --radius-sm by contract. */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Type. Space Grotesk / Inter where installed; system faces otherwise, so
     the page never waits on a font request (the CSP allows none). */
  --font-display: "Space Grotesk", "Avenir Next", Avenir, "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: clamp(1.0625rem, 0.98rem + 0.22vw, 1.1875rem);
  --text-lg: clamp(1.1875rem, 1.08rem + 0.4vw, 1.4375rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --text-2xl: clamp(1.625rem, 1.35rem + 1.05vw, 2.25rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.6vw, 2.75rem);
  --text-4xl: clamp(2.25rem, 1.6rem + 2.9vw, 3.75rem);
  --text-5xl: clamp(2.75rem, 1.7rem + 4.6vw, 5rem);

  --leading-tight: 1.06;
  --leading-snug: 1.28;
  --leading-normal: 1.6;
  --tracking-tight: -0.022em;
  --tracking-snug: -0.012em;
  --tracking-wide: 0.08em;

  /* Layout. */
  --container: 1200px;
  --page: 1440px;
  --gutter: 24px;
  --measure: 68ch;

  /* Depth + motion. */
  --shadow-1: 0 1px 2px var(--shadow-color);
  --shadow-2: 0 10px 30px -18px var(--shadow-color);
  --shadow-3: 0 24px 60px -30px var(--shadow-color);
  --ring: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: var(--slate-900);
  --bg-soft: var(--slate-950);
  --surface: var(--slate-800);
  --surface-2: var(--slate-700);
  --surface-strong: var(--cream-100);
  --ink: var(--cream-100);
  --ink-soft: var(--cream-300);
  --muted: var(--cream-400);
  --accent: var(--coral-500);
  --accent-hover: var(--coral-400);
  --accent-ink: var(--slate-900);
  --accent-text: var(--coral-400);
  --border: var(--slate-500);
  --border-strong: var(--cream-100);
  --success: var(--moss-400);
  --danger: var(--coral-400);
  --focus: var(--coral-400);
  --shadow-color: color-mix(in srgb, var(--slate-950) 68%, transparent);
  --scrim: color-mix(in srgb, var(--slate-950) 72%, transparent);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    radial-gradient(50rem 34rem at -10% 8%, color-mix(in srgb, var(--ink) 5%, transparent), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: var(--space-6);
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 1440px) {
  :root {
    --gutter: 0px;
  }
}

main {
  display: block;
  padding-block: var(--space-8) var(--space-12);
}

.section {
  margin-block: var(--space-10);
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-text);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--text-sm);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.split {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: var(--space-8);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 200;
  padding: var(--space-1) var(--space-2);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top var(--dur) var(--ease);
}

.skip:focus {
  top: var(--space-2);
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-md);
}

p,
li {
  text-wrap: pretty;
}

p + p,
p + ul,
p + ol,
ul + p,
ol + p {
  margin-top: var(--space-2);
}

ul,
ol {
  padding-left: var(--space-3);
}

li + li {
  margin-top: var(--space-half);
}

strong,
b {
  font-weight: 700;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: var(--radius-xs);
}

pre {
  padding: var(--space-3);
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

pre code {
  padding: 0;
  background: none;
}

blockquote {
  margin-block: var(--space-4);
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-size: var(--text-lg);
}

/* Long-form reading: one comfortable measure, no matter the container. */
.prose,
.reading,
article {
  max-width: var(--measure);
}

.prose > * + *,
.reading > * + *,
article > * + * {
  margin-top: var(--space-3);
}

.prose h2,
.reading h2,
article h2 {
  margin-top: var(--space-8);
  font-size: var(--text-2xl);
}

.prose h3,
.reading h3,
article h3 {
  margin-top: var(--space-6);
}

/* --------------------------------------------------------------------------
   5. Header + navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

#site-nav,
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand b {
  font-weight: 700;
}

.brand span:not(.brand-mark) {
  color: var(--accent-text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-links a {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  padding-block: var(--space-half);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

#nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-2);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

@media (max-width: 860px) {
  #nav-toggle {
    display: inline-flex;
  }

  #site-nav .nav-links,
  .site-nav .nav-links {
    display: none;
  }

  #site-nav.nav-open .nav-links,
  .site-nav.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-basis: 100%;
    gap: 0;
    margin-top: var(--space-1);
    padding-top: var(--space-1);
    border-top: 1px solid var(--border);
  }

  #site-nav.nav-open .nav-links a,
  .site-nav.nav-open .nav-links a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    font-size: var(--text-base);
    border-bottom: 1px solid var(--border);
  }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

button,
.button,
[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 48px;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-1);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

button:hover:not(:disabled),
.button:hover,
[type="submit"]:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

button:active:not(:disabled),
.button:active,
[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-1);
}

button:disabled,
[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

/* Secondary: outlined. */
.secondary,
.button.secondary,
button.secondary,
[type="button"].secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: none;
}

.secondary:hover:not(:disabled),
.button.secondary:hover,
button.secondary:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: none;
}

.small-button {
  min-height: 40px;
  padding: var(--space-half) var(--space-2);
  font-size: var(--text-xs);
}

.link-button {
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--accent-text);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover:not(:disabled) {
  background: none;
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */

form {
  display: grid;
  gap: var(--space-3);
}

label,
.label {
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.field-note,
.hint {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

textarea {
  min-height: 128px;
  padding-block: var(--space-2);
  resize: vertical;
}

select {
  appearance: none;
  padding-right: var(--space-6);
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 22px center, right 16px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--focus);
  outline: none;
  box-shadow: var(--ring);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
}

/* File inputs, dressed as drop targets but still real, keyboardable inputs. */
input[type="file"] {
  width: 100%;
  min-height: 96px;
  padding: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

input[type="file"]:hover {
  border-color: var(--accent);
  background: var(--tint-accent);
}

input[type="file"]:focus-visible {
  border-color: var(--focus);
  box-shadow: var(--ring);
  outline: none;
}

input[type="file"]::file-selector-button {
  margin-right: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   8. Generator
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  padding-block: var(--space-6) var(--space-10);
}

.hero p {
  font-size: var(--text-md);
  color: var(--ink-soft);
  max-width: 56ch;
}

.hero .actions {
  margin-top: var(--space-4);
}

.hero-note {
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
}

#generate-form {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}

#generate-form .form-grid,
.form-grid {
  display: grid;
  gap: var(--space-3);
}

#generate-form .actions,
#generate-form button[type="submit"] {
  margin-top: var(--space-1);
}

#generate-button {
  width: 100%;
  min-height: 56px;
  font-size: var(--text-base);
}

@media (min-width: 760px) {
  #generate-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  /* Status, actions and the submit button always own the full width. */
  #generate-form > .field-wide,
  #generate-form > #job-status,
  #generate-form > .actions,
  #generate-form > button[type="submit"],
  #generate-form > .form-grid,
  #generate-form > .form-grid > .field-wide {
    grid-column: 1 / -1;
  }

  #generate-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #generate-button {
    width: auto;
    min-width: 240px;
  }
}

@media (min-width: 1040px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* --------------------------------------------------------------------------
   9. Job status
   -------------------------------------------------------------------------- */

#job-status,
.job-status {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
}

#job-status:empty,
.job-status:empty {
  display: none;
}

#job-status[data-state="busy"] {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  background: var(--tint-accent);
  border-color: var(--accent);
}

#job-status[data-state="busy"]::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top-color: var(--accent);
  border-radius: var(--radius-pill);
  animation: spin 900ms linear infinite;
}

#job-status[data-state="done"] {
  color: var(--success);
  background: var(--tint-success);
  border-color: var(--success);
}

#job-status[data-state="error"] {
  color: var(--danger);
  background: var(--tint-danger);
  border-color: var(--danger);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Live region for transient confirmation, if the shell renders one. */
.toast {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
}

/* --------------------------------------------------------------------------
   10. Results grid
   -------------------------------------------------------------------------- */

#results-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}

#results-list:empty,
#results-list:not(:has(li)) {
  display: none;
}

@media (min-width: 640px) {
  #results-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
  }
}

@media (min-width: 1024px) {
  #results-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Server-rendered rows and client-appended rows share one card look. */
#results-list > li {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

#results-list > li:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

#results-list a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}

#results-list img,
#results-list video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

#results-list .result-body {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
}

#results-list .result-topic {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
  color: var(--ink);
}

#results-list .result-meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--muted);
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.chip {
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* Card grids used by feature / guide sections. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

.card {
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.card h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-8) var(--space-6);
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

.footer-grid {
  display: grid;
  gap: var(--space-4);
}

.footer-grid nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}

.footer-grid nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-grid nav a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.footer-grid .brand {
  font-size: var(--text-base);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--muted);
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* --------------------------------------------------------------------------
   12. Consent banner
   -------------------------------------------------------------------------- */

#consent-banner,
.consent-banner {
  position: fixed;
  left: var(--space-2);
  right: var(--space-2);
  bottom: var(--space-2);
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  width: auto;
  max-width: min(760px, calc(100vw - 2 * var(--space-2)));
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
}

#consent-banner p,
.consent-banner p {
  flex: 1 1 22ch;
  margin: 0;
  color: var(--ink-soft);
}

#consent-banner a,
.consent-banner a {
  color: var(--accent-text);
}

#consent-banner .consent-actions,
.consent-banner .consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

#consent-banner button {
  min-height: 44px;
  padding: var(--space-half) var(--space-2);
  font-size: var(--text-xs);
}

body.has-consent-banner {
  padding-bottom: 128px;
}

/* --------------------------------------------------------------------------
   13. Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  button:hover:not(:disabled),
  .button:hover,
  #results-list > li:hover {
    transform: none;
  }
}
