/* Shared TrendRemaker tokens, adapted from MemeVideoGenerate public/styles.css. */

:root {
  color-scheme: dark;

  /* Core surfaces and text */
  --color-bg: #0b0c10;
  --color-surface: #13151b;
  --color-surface-subtle: #1a1d25;
  --color-surface-hover: #242833;
  --color-surface-inset: #0e1014;
  --color-text: #f8f7f3;
  --color-text-secondary: #a1a4af;
  --color-text-muted: #a1a4af;
  --color-text-inverse: #20100b;
  --color-placeholder: #a1a4af;

  /* Main action: coral */
  --color-accent: #ff795c;
  --color-accent-hover: #ff927b;
  --color-accent-pressed: #ff795c;
  --color-accent-soft: #ff927b19;
  --color-accent-text: #ff927b;
  --color-link: #ff927b;
  --color-link-hover: #ffad9c;
  --color-selection-bg: #ff795c;
  --color-selection-text: #20100b;

  /* Decorative borders may be subtle. Input/control boundaries use control. */
  --color-border: #292d36;
  --color-border-subtle: #20242c;
  --color-border-control: #697082;
  --color-border-hover: #8b92a2;
  --color-border-active: #ff795c;
  --color-focus: #caf295;
  --color-focus-halo: #0b0c10;

  /* Status colors: always pair with a label and icon. */
  --color-success: #a0eab6;
  --color-success-bg: #14281d;
  --color-success-border: #3d6b4e;
  --color-warning: #ffda8c;
  --color-warning-bg: #292111;
  --color-warning-border: #755a24;
  --color-danger: #ffbab1;
  --color-danger-hover: #ffd5d0;
  --color-danger-bg: #311b1b;
  --color-danger-border: #804646;
  --color-info: #b0d8ff;
  --color-info-bg: #172637;
  --color-info-border: #446787;
  --color-disabled-bg: #252524;
  --color-disabled-text: #a6a49e;
  --color-disabled-border: #444441;

  /* Canvas colors are independent of the site theme. */
  --color-canvas: #f0f3ef;
  --color-canvas-dark: #222925;
  --color-checker-light: #ffffff;
  --color-checker-dark: #e5ebe7;
  --color-markup-red: #d92f3e;
  --color-markup-blue: #2563eb;
  --color-markup-yellow: #f5c542;
  --color-markup-outline: #18251f;
  --color-overlay: rgb(0 0 0 / 60%);
  --color-skeleton: #232323;
  --color-skeleton-highlight: #303030;

  /* Typography */
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
  --font-editorial: Georgia, "Times New Roman", serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-body: 0.9375rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.25rem;
  --font-size-hero: clamp(2rem, 4vw, 3.5rem);
  --line-height-tight: 1.15;
  --line-height-heading: 1.3;
  --line-height-body: 1.6;
  --line-height-label: 1.4;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --letter-spacing-heading: -0.04em;
  --letter-spacing-label: 0;

  /* Spacing */
  --space-0: 0;
  --space-0-5: 0.125rem;
  --space-1: 0.25rem;
  --space-1-5: 0.375rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Geometry */
  --radius-xs: 0.25rem;
  --radius-sm: 0.6875rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.375rem;
  --radius-pill: 999px;
  --border-width: 1px;
  --focus-width: 2px;
  --focus-offset: 3px;
  --control-height: 3rem;
  --control-height-compact: 2.5rem;
  --touch-target-min: 2.75rem;
  --icon-sm: 1rem;
  --icon-md: 1.25rem;
  --icon-lg: 1.5rem;
  --checker-size: 0.75rem;

  /* Layout: center canvas takes all remaining width. */
  --public-content-max: 78rem;
  --public-reading-max: 46rem;
  --public-gutter: clamp(1rem, 3vw, 2rem);
  --app-header-height: 4rem;
  --app-nav-width: 13.5rem;
  --app-nav-rail-width: 4.5rem;
  --app-form-width: 20rem;
  --app-form-width-wide: 21.25rem;
  --app-inspector-width: 17rem;
  --app-panel-gap: 1rem;
  --app-preview-min-height: 28rem;
  --modal-width-sm: 28rem;
  --modal-width-md: 40rem;
  --drawer-width: min(26rem, calc(100vw - 1rem));
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 18%);
  --shadow-sm: 0 3px 12px rgb(0 0 0 / 25%);
  --shadow-md: 0 16px 42px rgb(0 0 0 / 34%);
  --shadow-lg: 0 24px 70px rgb(0 0 0 / 48%);
  --shadow-focus: 0 0 0 2px var(--color-focus-halo),
    0 0 0 4px var(--color-focus);

  /* Motion: no animation is needed for core usability. */
  --motion-fast: 100ms;
  --motion-normal: 160ms;
  --motion-slow: 220ms;
  --motion-loading: 1200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0, 0, 0, 1);
  --ease-exit: cubic-bezier(0.3, 0, 1, 1);

  /* Stacking: portals must use this order consistently. */
  --z-base: 0;
  --z-sticky: 20;
  --z-popover: 30;
  --z-drawer: 40;
  --z-modal: 50;
  --z-toast: 60;
}

:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #f8f6f1;
  --color-text-inverse: #ffffff;
  --color-accent: #b83b23;
  --color-selection-bg: #b83b23;
  --color-selection-text: #ffffff;
  --color-surface: #fffdf9;
  --color-surface-subtle: #f1ede5;
  --color-surface-hover: #e8e2d7;
  --color-surface-inset: #f5f0e8;
  --color-text: #222326;
  --color-text-secondary: #535762;
  --color-text-muted: #535762;
  --color-placeholder: #666a74;
  --color-accent-hover: #a2311a;
  --color-accent-pressed: #8f2a17;
  --color-accent-soft: #ff927b19;
  --color-accent-text: #b83b23;
  --color-link: #b83b23;
  --color-link-hover: #8f2a17;
  --color-border: #d8d2c8;
  --color-border-subtle: #ebe5db;
  --color-border-control: #827b70;
  --color-border-hover: #645a4f;
  --color-border-active: #b83b23;
  --color-focus: #326015;
  --color-focus-halo: #f8f6f1;
  --color-success: #246338;
  --color-success-bg: #e9f6ec;
  --color-success-border: #7daa88;
  --color-warning: #755000;
  --color-warning-bg: #fff6df;
  --color-warning-border: #b99a4b;
  --color-danger: #a12d25;
  --color-danger-hover: #7e211b;
  --color-danger-bg: #fff0ed;
  --color-danger-border: #c48c84;
  --color-info: #225a8e;
  --color-info-bg: #edf5ff;
  --color-info-border: #7d9dbc;
  --color-disabled-bg: #edf0e6;
  --color-disabled-text: #6b7163;
  --color-disabled-border: #d1d6c8;
  --color-skeleton: #e6eadf;
  --color-skeleton-highlight: #f4f6ef;
  --shadow-xs: 0 1px 2px rgb(20 30 10 / 5%);
  --shadow-sm: 0 3px 12px rgb(20 30 10 / 7%);
  --shadow-md: 0 16px 42px rgb(20 30 10 / 10%);
  --shadow-lg: 0 24px 70px rgb(20 30 10 / 15%);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-normal: 0ms;
    --motion-slow: 0ms;
    --motion-loading: 0ms;
  }
}

/* Use outline + text labels in forced-color mode; do not rely on shadows. */
@media (forced-colors: active) {
  :root, :root[data-theme="light"] {
    --color-bg: Canvas;
    --color-surface: Canvas;
    --color-surface-subtle: Canvas;
    --color-text: CanvasText;
    --color-text-secondary: CanvasText;
    --color-text-muted: CanvasText;
    --color-border-control: ButtonText;
    --color-focus: Highlight;
    --color-link: LinkText;
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-focus: none;
  }
}
