/*
 * Anime Replay · Mystery Ticket — design tokens (brand v1, from the organizers' mockup)
 * Night-show navy, Anime Replay yellow, ember orange. Display: Chau Philomene One. Text: Work Sans.
 * The buyer page pins the dark ("show night") palette; the admin follows the system setting.
 */

@font-face { font-family: 'Chau Philomene One'; src: url('fonts/chau-philomene-one-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('fonts/work-sans-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('fonts/work-sans-var-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  /* Light (admin by day) */
  --color-bg-primary: #f4f2ec;
  --color-bg-secondary: #fffdf8;
  --color-bg-tertiary: #ebe7dd;
  --color-bg-inverse: #0b1430;
  --color-text-primary: #121a33;
  --color-text-secondary: #4a5370;
  --color-text-tertiary: #5c6481;
  --color-text-inverse: #eef1fb;
  --color-text-link: #0b6f63;
  --color-border-primary: #cfc9bb;
  --color-border-secondary: #e0dbcf;
  --color-border-focus: #c4127a;
  --color-accent-primary: #0e7d70;
  --color-accent-primary-hover: #0b6a5f;
  --color-accent-primary-active: #09584f;
  --color-on-accent: #ffffff;
  --color-accent-secondary: #c4127a;
  --color-gold: #8a5d00;
  --color-status-success: #1d7a3e;
  --color-status-warning: #8a5d00;
  --color-status-error: #b3261e;
  --color-status-info: #1f5fa8;
  --color-surface-overlay: rgb(18 26 51 / 0.45);
  --color-selection: rgb(196 18 122 / 0.18);
  --brand-navy: #021a3d;
  --brand-navy-2: #072a5c;
  --brand-yellow: #ffc400;
  --brand-bar: #e9b000;
  --brand-orange: #e8650a;
  --color-ticket-a: #2a3b68;
  --color-ticket-b: #1b244a;
  --color-ticket-c: #3c2753;
  --color-ticket-dot: rgb(255 255 255 / 0.05);

  --space-0: 0; --space-1: 2px; --space-2: 4px; --space-3: 6px; --space-4: 8px; --space-5: 12px;
  --space-6: 16px; --space-7: 24px; --space-8: 32px; --space-9: 48px; --space-10: 64px; --space-11: 96px; --space-12: 128px;

  --font-family-display: 'Chau Philomene One', 'Arial Narrow', sans-serif;
  --font-family-body: 'Work Sans', 'Avenir Next', 'Segoe UI', sans-serif;
  --font-family-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-size-xs: 0.8125rem;  /* 13 */
  --font-size-sm: 0.9375rem;  /* 15 */
  --font-size-base: 1rem;     /* 16 */
  --font-size-md: 1.125rem;   /* 18 */
  --font-size-lg: 1.375rem;   /* 22 */
  --font-size-xl: 1.75rem;    /* 28 */
  --font-size-2xl: clamp(2rem, 1.4rem + 2.6vw, 2.75rem);
  --font-size-3xl: clamp(2.375rem, 1.6rem + 3.6vw, 3.5rem);
  --font-size-4xl: clamp(4.5rem, 3rem + 8vw, 7rem);
  --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700;
  --line-height-tight: 1.12; --line-height-normal: 1.55; --line-height-relaxed: 1.7;
  --letter-spacing-tight: -0.02em; --letter-spacing-normal: 0; --letter-spacing-wide: 0.14em;

  --max-width-content: 38rem; --max-width-wide: 60rem; --max-width-page: 72rem;
  --border-radius-sm: 8px; --border-radius-md: 12px; --border-radius-lg: 20px; --border-radius-full: 999px;
  --shadow-sm: 0 1px 2px rgb(18 26 51 / 0.08);
  --shadow-md: 0 6px 18px -6px rgb(18 26 51 / 0.18);
  --shadow-lg: 0 24px 48px -16px rgb(18 26 51 / 0.28);
  --shadow-focus: 0 0 0 3px var(--color-bg-primary), 0 0 0 5px var(--color-border-focus);

  --duration-instant: 50ms; --duration-fast: 150ms; --duration-normal: 250ms; --duration-slow: 400ms; --duration-slower: 600ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --easing-default: var(--ease-out);
  --ease-reel: cubic-bezier(0.12, 0.8, 0.2, 1); /* long, decisive deceleration for the one reveal */

  color-scheme: light;
}

/* Dark ("show night") — the buyer page always, the admin when the system asks */
[data-theme="dark"] {
  --color-bg-primary: #021a3d;
  --color-bg-secondary: #0a2752;
  --color-bg-tertiary: #061f47;
  --color-bg-inverse: #f4f6ff;
  --color-text-primary: #f4f6ff;
  --color-text-secondary: #c3cde6;
  --color-text-tertiary: #98a6c8;
  --color-text-inverse: #021a3d;
  --color-text-link: #ffd24d;
  --color-border-primary: #36507f;
  --color-border-secondary: #1d3767;
  --color-border-focus: #8fd6ff;
  --color-accent-primary: #ffc400;
  --color-accent-primary-hover: #ffd24d;
  --color-accent-primary-active: #e9b000;
  --color-on-accent: #021a3d;
  --color-accent-secondary: #ff8a2b;
  --color-gold: #ffc400;
  --color-status-success: #7fe39d;
  --color-status-warning: #ffd24d;
  --color-status-error: #ffadb9;
  --color-status-info: #9cc4ff;
  --color-surface-overlay: rgb(3 7 18 / 0.7);
  --color-selection: rgb(255 196 0 / 0.3);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 8px 20px -8px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 30px 60px -20px rgb(0 0 0 / 0.75);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg-primary: #021a3d; --color-bg-secondary: #0a2752; --color-bg-tertiary: #061f47; --color-bg-inverse: #f4f6ff;
    --color-text-primary: #f4f6ff; --color-text-secondary: #c3cde6; --color-text-tertiary: #98a6c8; --color-text-inverse: #021a3d;
    --color-text-link: #ffd24d; --color-border-primary: #36507f; --color-border-secondary: #1d3767; --color-border-focus: #8fd6ff;
    --color-accent-primary: #ffc400; --color-accent-primary-hover: #ffd24d; --color-accent-primary-active: #e9b000; --color-on-accent: #021a3d;
    --color-accent-secondary: #ff8a2b; --color-gold: #ffc400; --color-status-success: #7fe39d; --color-status-warning: #ffd24d;
    --color-status-error: #ffadb9; --color-status-info: #9cc4ff; --color-surface-overlay: rgb(3 7 18 / 0.7);
    --color-selection: rgb(255 196 0 / 0.3);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4); --shadow-md: 0 8px 20px -8px rgb(0 0 0 / 0.6); --shadow-lg: 0 30px 60px -20px rgb(0 0 0 / 0.75);
    color-scheme: dark;
  }
}

/* Mobile baseline (mobile-native) */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
input, textarea, select { font-size: max(16px, 1rem); }
button, a, [role="button"] { touch-action: manipulation; }
button, [role="button"], .chip { user-select: none; -webkit-user-select: none; }
::selection { background: var(--color-selection); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
