/* Stage A adaptive hooks */

body.pref-motor,
body[data-pref-motor="true"] {
  --motor-target-min: 72px;
  --motor-font-scale: 1.28;
}

body.pref-motor button,
body.pref-motor .button-link,
body.pref-motor input,
body.pref-motor select,
body.pref-motor summary,
body[data-pref-motor="true"] button,
body[data-pref-motor="true"] .button-link,
body[data-pref-motor="true"] input,
body[data-pref-motor="true"] select,
body[data-pref-motor="true"] summary {
  min-height: var(--motor-target-min, 72px) !important;
  font-size: calc(1rem * var(--motor-font-scale, 1.28)) !important;
  padding-inline: 1.35rem !important;
  border-width: 3px !important;
  border-radius: 18px !important;
}

body.pref-motor .row,
body[data-pref-motor="true"] .row {
  gap: 1.35rem !important;
}

body.pref-motor .site-nav a,
body[data-pref-motor="true"] .site-nav a {
  padding: 0.9rem 1.15rem !important;
  font-size: 1.08rem !important;
}

body.pref-motor textarea,
body[data-pref-motor="true"] textarea {
  min-height: 12rem !important;
  font-size: 1.2rem !important;
  line-height: 1.75 !important;
  padding: 1.1rem 1.2rem !important;
  border-width: 3px !important;
  border-radius: 14px !important;
}

body.pref-motor .card,
body.pref-motor .dialog-card,
body[data-pref-motor="true"] .card,
body[data-pref-motor="true"] .dialog-card {
  border-width: 3px;
  box-shadow: none;
}

body.pref-motor :is(label, p, li, .status, .muted, h2, h3),
body[data-pref-motor="true"] :is(label, p, li, .status, .muted, h2, h3) {
  font-size: calc(1em * var(--motor-font-scale, 1.28));
}

body.pref-motor :is(.section-mode-option, .media-meta-item, .readiness-item),
body[data-pref-motor="true"] :is(.section-mode-option, .media-meta-item, .readiness-item) {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 3px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 65%, #fff);
}

body.pref-motor :is(button[aria-pressed="true"], .button-link[aria-current="page"]),
body[data-pref-motor="true"] :is(button[aria-pressed="true"], .button-link[aria-current="page"]) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, #fff);
  color: #07201c;
}

body.pref-motor :is(.site-main, .site-inner),
body[data-pref-motor="true"] :is(.site-main, .site-inner) {
  letter-spacing: 0.01em;
}

body.pref-motor .site-shell,
body[data-pref-motor="true"] .site-shell {
  outline: 5px solid color-mix(in srgb, var(--accent) 55%, #d9b26c);
  outline-offset: -5px;
}

body.pref-motor :is(.hero, .card),
body[data-pref-motor="true"] :is(.hero, .card) {
  background: color-mix(in srgb, var(--surface) 78%, #fff6dc);
}

body.pref-motor :is(button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .button-link:focus-visible),
body[data-pref-motor="true"] :is(button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .button-link:focus-visible) {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

body.pref-vision,
body[data-pref-vision="true"] {
  --bg: #0b0b0b;
  --surface: #111111;
  --surface-2: #1c1c1c;
  --text: #f7f7f7;
  --muted: #dddddd;
  --border: #f7f7f7;
  --accent: #00e6c3;
  --focus: #ffd400;
  color-scheme: dark;
}

body.pref-vision,
body[data-pref-vision="true"] {
  background: var(--bg);
}

body.pref-vision :is(.site-header, .site-footer, .hero, .card, .dialog-card, .readiness-panel, .media-meta-panel, .media-meta-item, .page-list li, .option-card),
body[data-pref-vision="true"] :is(.site-header, .site-footer, .hero, .card, .dialog-card, .readiness-panel, .media-meta-panel, .media-meta-item, .page-list li, .option-card) {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

body.pref-vision :is(input, select, textarea, progress),
body[data-pref-vision="true"] :is(input, select, textarea, progress) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

body.pref-vision button,
body[data-pref-vision="true"] button {
  background: #f3f3f3;
  color: #111;
  border-color: var(--border);
}

body.pref-vision button.secondary,
body.pref-vision button.ghost,
body[data-pref-vision="true"] button.secondary,
body[data-pref-vision="true"] button.ghost {
  background: var(--surface-2);
  color: var(--text);
}

body.pref-vision :is(.muted, .status, label, p, li, h1, h2, h3, strong, summary),
body[data-pref-vision="true"] :is(.muted, .status, label, p, li, h1, h2, h3, strong, summary) {
  color: var(--text);
}

body.pref-vision #autosave-status,
body.pref-vision #setup-summary,
body.pref-vision #section-progress-pill,
body.pref-vision .helper-panel .muted,
body[data-pref-vision="true"] #autosave-status,
body[data-pref-vision="true"] #setup-summary,
body[data-pref-vision="true"] #section-progress-pill,
body[data-pref-vision="true"] .helper-panel .muted {
  color: #1c1a16;
}

body.pref-vision .step-coach-card,
body[data-pref-vision="true"] .step-coach-card {
  background: var(--surface);
  border-color: var(--border);
}

body.pref-vision .step-coach-card .muted,
body[data-pref-vision="true"] .step-coach-card .muted {
  color: var(--text);
}

body.pref-vision a,
body[data-pref-vision="true"] a {
  color: #9ef8e6;
  text-underline-offset: 0.16em;
}

body.pref-vision .choice-card,
body[data-pref-vision="true"] .choice-card {
  background: var(--surface-2);
  border-color: var(--border);
}

body.pref-vision .option-card.is-selected,
body.pref-vision .option-card[aria-pressed="true"],
body[data-pref-vision="true"] .option-card.is-selected,
body[data-pref-vision="true"] .option-card[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 35%, #fff);
  color: #07201c;
  border-color: var(--accent);
}

body.pref-vision .option-card.is-selected .option-card-note,
body.pref-vision .option-card[aria-pressed="true"] .option-card-note,
body[data-pref-vision="true"] .option-card.is-selected .option-card-note,
body[data-pref-vision="true"] .option-card[aria-pressed="true"] .option-card-note {
  color: #16362f;
}

body.pref-vision .design-preview-surface,
body.pref-vision .design-preview-page,
body[data-pref-vision="true"] .design-preview-surface,
body[data-pref-vision="true"] .design-preview-page {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

body.pref-vision .design-preview-kicker,
body[data-pref-vision="true"] .design-preview-kicker {
  color: #9ef8e6;
}

body.pref-vision :is(button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible),
body[data-pref-vision="true"] :is(button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible) {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

body.pref-vision .grid,
body[data-pref-vision="true"] .grid {
  gap: 1.25rem;
}

@media (max-width: 540px) {
  .grid,
  .split,
  .row,
  .dialog-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .site-inner {
    width: min(100% - 1rem, 72rem);
  }

  .option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 320px) {
  .site-inner {
    width: calc(100% - 1rem);
  }

  .card,
  .dialog-card {
    padding: 0.85rem;
  }

  textarea {
    min-height: 7rem;
  }
}
