/* System layer: semantic role tokens, interaction states and page-level motion.
   Loaded after site.css, cards.css, content.css and effects.css so it can name the roles those files use.
   Rule of thumb: components read role tokens (--r-card, --dur-component, --ink-on-dark), never raw hex or ms. */

/* ============ ROLE TOKENS ============ */
:root {
  /* extra primitives used by the footer badge, the statement band and gold accents */
  --choc-900: #3b1d12;
  --cream-200: #fff1dc;
  --gold-300: #ffc65c;
  --ink-on-dark: #fff5ec;

  /* radius roles: each nesting level steps down by its padding */
  --r-control: var(--r-pill);
  --r-card: 30px 30px 30px 10px;
  --r-panel: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-xs);
  --r-media: 22px 22px 22px 6px;
  --r-chip: 14px 14px 14px 4px;

  /* motion roles */
  --dur-micro: var(--t-fast);
  --dur-component: var(--t-med);
  --dur-page: 460ms;
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* extra depth */
  --glow-primary: 0 10px 30px -10px rgba(200, 40, 30, .55);
  --glow-accent: 0 10px 30px -10px rgba(242, 165, 22, .6);
  --focus-ring: var(--ring);
}

/* ============ PAGE-LEVEL MOTION ============ */
/* Cross-page fade where the browser supports view transitions; plain navigation elsewhere. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-page); animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ============ TYPOGRAPHY DETAILS ============ */
h1, h2, h3, .lead { text-wrap: balance; }
p, li { text-wrap: pretty; }
.stall-price, .profile-price, .stat-row dd, .hm-price, .rv-score { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
::selection { background: var(--gold-300); color: var(--choc-900); }
html { scrollbar-color: var(--saddle-500) transparent; accent-color: var(--ember-500); }

/* ============ INTERACTION STATES ============ */
/* disabled */
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: saturate(.6); pointer-events: none; }
:where(input, select, textarea):disabled { opacity: .55; cursor: not-allowed; background: var(--surface-tint); }

/* pressed / selected toggles */
.btn[aria-pressed="true"]:not(.btn-brass) { background: var(--grad-primary); color: #fff; box-shadow: var(--glow-primary); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--grad-primary); color: #fff; box-shadow: var(--glow-primary); }

/* directional icons answer the pointer */
.btn .arr, .link-arrow .arr { display: inline-block; transition: transform var(--dur-micro) var(--ease-out); }
.btn:hover .arr, .link-arrow:hover .arr { transform: translateX(4px); }

/* success state for buttons */
.btn.is-done { background: var(--ok); color: #fff; box-shadow: 0 10px 24px -10px rgba(91, 127, 74, .7); }

/* form validity: soft, not shouting */
:where(input, select, textarea):user-invalid { background: var(--ivory-200); box-shadow: 0 0 0 2px rgba(210, 59, 42, .4); }
.field-error { animation: err-in var(--dur-component) var(--ease-out); }
@keyframes err-in { from { opacity: 0; transform: translateY(-4px); } }

/* every interactive element gets the same visible focus, instantly */
:where(a, button, summary, select, input, textarea, [tabindex]):focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); transition: none; }

/* ============ STATEMENT BAND + FOOTER BADGE USE ROLE TOKENS ============ */
.manifesto, .manifesto-text { color: var(--ink-on-dark); }
.manifesto-text .w.gold.on { color: var(--gold-300); }
.site-footer .foot-tag { background: var(--cream-200); color: var(--choc-900); }

/* ============ SMALL SCREENS: bigger targets, lighter decoration ============ */
@media (max-width: 640px) {
  .btn { min-height: 48px; }
  .tab, .chip { min-height: 44px; }
  .reel-card { width: 62vw; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .btn .arr, .link-arrow .arr, .field-error { transition: none; animation: none; }
}

/* ============ TOUCH TARGETS AND READABLE SMALL TEXT ============ */
/* Every tap target is at least 44px on phones and tablets (Apple and Google guidance), and no text is below 13px. */
@media (max-width: 1023px), (pointer: coarse) {
  .logo { display: inline-flex; align-items: center; min-height: 44px; }
  .crumbs a, .link-arrow, .footer-links a, .site-footer a:not(.btn):not(.logo) { display: inline-flex; align-items: center; min-height: 44px; }
  .crumbs { row-gap: 0; }
  .heart { width: 44px; height: 44px; }
  .pager a, .pager button, .pager span { min-width: 44px; min-height: 44px; }
  .menu-btn, .more-btn, .scroll-cue { min-width: 44px; min-height: 44px; }
  .tab, .chip, .btn-sm { min-height: 44px; }
  summary { min-height: 44px; }
  .tags a, .tags .chip { min-height: 44px; display: inline-flex; align-items: center; }
}
.stall-no, .color-tag, .pill, .spec dt, .field-label, .field-hint, .post-meta, .tag-who span, .hm-eye, small { font-size: max(.8125rem, 13px); }
.req { font-size: inherit; }
.field label, .reel-card span, .search-bar label { font-size: max(.8125rem, 13px); }
@media (max-width: 1023px), (pointer: coarse) {
  .crumbs a, .footer-links a { min-width: 44px; }
  .crumbs a { justify-content: center; }
}
@media (max-width: 1023px), (pointer: coarse) {
  .toc a { display: flex; align-items: center; min-height: 44px; }
  /* in-sentence links: larger touch area without changing the layout */
  .checkbox-row a, .empty a, .field-hint a, .prose p a, .prose li a, .faq-a a { padding-block: 12px; margin-block: -12px; }
}
.draft-tag { font-size: max(.8125rem, 13px); }

/* the hidden attribute must always win, even over components that set their own display */
[hidden] { display: none !important; }

/* the scroll cue would sit on top of the intro text on small inner-page banners */
@media (max-width: 760px) { .ph-full .scroll-cue { display: none; } }
