/* OpenFlix design tokens. Every color, size, and motion value lives here. */

/* Geist (Vercel, OFL) - UI/body type. Fraunces (Undercase Type, OFL) - display/serif accents. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/fraunces-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/fraunces-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --font-feature-ui: "ss01", "tnum";
  --font-feature-display: "ss01", "onum", "kern";

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.375rem;
  --text-4xl: clamp(2.75rem, 5.4vw, 4.5rem);
  --text-5xl: clamp(3.75rem, 8.5vw, 7rem);
  --text-6xl: clamp(4.5rem, 10vw, 8.75rem);

  --leading-body: 1.55;
  --leading-heading: 1.04;
  --leading-ui: 1.28;
  --tracking-display: -0.018em;
  --tracking-tight: -0.011em;
  --tracking-wide: 0.095em;
  --tracking-eyebrow: 0.16em;

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* Space scale: 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Premium streaming palette: near-black charcoal, warm neutral scale,
     one saturated red accent (used sparingly), and sematic pairs. */
  --color-bg: oklch(0.082 0.009 60);
  --color-bg-deep: oklch(0.048 0.008 60);
  --color-surface: oklch(0.12 0.01 60);
  --color-surface-2: oklch(0.165 0.011 60);
  --color-surface-raised: oklch(0.2 0.012 60);
  --color-surface-active: oklch(0.24 0.013 60);
  --color-border: oklch(0.28 0.012 60 / 0.62);
  --color-border-strong: oklch(0.38 0.02 60);
  --color-border-soft: oklch(0.24 0.01 60 / 0.5);
  --color-text: oklch(0.982 0.008 86);
  --color-text-muted: oklch(0.795 0.014 82);
  --color-text-subtle: oklch(0.698 0.012 82);
  --color-text-faint: oklch(0.58 0.01 80);
  --color-primary: oklch(0.62 0.215 25);
  --color-primary-hover: oklch(0.685 0.22 25);
  --color-primary-active: oklch(0.555 0.2 25);
  --color-primary-subtle: oklch(0.62 0.215 25 / 0.16);
  --color-primary-soft: oklch(0.62 0.215 25 / 0.32);
  --color-on-primary: oklch(0.99 0.01 90);
  --color-danger: oklch(0.62 0.23 20);
  --color-danger-hover: oklch(0.68 0.24 20);
  --color-danger-subtle: oklch(0.62 0.23 20 / 0.14);
  --color-success: oklch(0.7 0.16 160);
  --color-success-subtle: oklch(0.7 0.16 160 / 0.13);
  --color-warning: oklch(0.8 0.14 80);
  --color-warning-subtle: oklch(0.8 0.14 80 / 0.13);
  --color-info: oklch(0.72 0.11 220);
  --color-info-subtle: oklch(0.72 0.11 220 / 0.13);
  --color-focus: oklch(0.76 0.2 24);
  --color-scrim: oklch(0.07 0.008 65);
  --color-overlay: oklch(0.095 0.008 65 / 0.86);

  /* Backdrop overlays for hero/detials artwork. */
  --scrim-left: linear-gradient(90deg, oklch(0.05 0.008 60 / 0.96) 0%, oklch(0.05 0.008 60 / 0.84) 34%, oklch(0.05 0.008 60 / 0.42) 62%, oklch(0.05 0.008 60 / 0.18) 100%);
  --scrim-bottom: linear-gradient(180deg, transparent 0%, oklch(0.05 0.008 60 / 0.55) 52%, var(--color-bg) 100%);
  --scrim-card: linear-gradient(180deg, transparent 30%, oklch(0.04 0.008 60 / 0.92) 100%);

  /* Depth: layered, hue-matched shadows. Poster/card shadows are lifted by
     three stacked planes so artwork reads as a physical object on a shelf. */
  --shadow-sm: 0 1px 1px oklch(0.04 0.01 65 / 0.28), 0 2px 4px -2px oklch(0.03 0.01 60 / 0.35);
  --shadow-md: 0 16px 36px -20px oklch(0.03 0.01 60 / 0.9), 0 4px 12px -6px oklch(0.03 0.01 60 / 0.55);
  --shadow-lg: 0 40px 88px -36px oklch(0.02 0.01 55 / 0.95), 0 12px 32px -16px oklch(0.02 0.01 55 / 0.65);
  --shadow-poster:
    0 2px 4px oklch(0.02 0.008 55 / 0.5),
    0 14px 26px -12px oklch(0.02 0.008 55 / 0.66),
    0 38px 64px -32px oklch(0.02 0.008 55 / 0.86);
  --shadow-poster-lift:
    0 6px 10px oklch(0.02 0.008 55 / 0.5),
    0 26px 44px -16px oklch(0.02 0.008 55 / 0.74),
    0 60px 92px -36px oklch(0.02 0.008 55 / 0.92);
  --shadow-focus-primary: 0 0 0 4px oklch(0.62 0.215 25 / 0.28);
  --shadow-inset-hairline: inset 0 0 0 1px oklch(1 0 0 / 0.06);
  --shine-edge: linear-gradient(150deg, oklch(1 0 0 / 0.14) 0%, oklch(1 0 0 / 0.02) 34%, oklch(0 0 0 / 0.22) 100%);
  --shine-poster: linear-gradient(115deg, transparent 30%, oklch(1 0 0 / 0.16) 50%, transparent 70%);

  /* 3D stage: perspective values used by layered artwork scenes. */
  --perspective-near: 900px;
  --perspective-far: 1600px;
  --tilt-max: 9deg;
  --lift-max: -10px;

  /* Layout */
  --page-max: 1560px;
  --page-gutter: clamp(1rem, 3.4vw, 3.75rem);
  --header-h: 4.5rem;
  --bottom-nav-h: 4.25rem;
  --measure: 66ch;
  --measure-narrow: 46ch;

  /* Motion */
  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 260ms;
  --duration-overlay: 320ms;
  --duration-hero: 780ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-soft-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layers */
  --z-base: 1;
  --z-sticky: 20;
  --z-header: 30;
  --z-menu: 40;
  --z-overlay: 60;
  --z-modal: 70;
  --z-toast: 80;
}

[data-reduce-motion="true"] {
  --duration-fast: 0.01ms;
  --duration-base: 0.01ms;
  --duration-slow: 0.01ms;
  --duration-overlay: 0.01ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0.01ms;
    --duration-base: 0.01ms;
    --duration-slow: 0.01ms;
    --duration-overlay: 0.01ms;
  }
}

/* Account-level preference from Settings, alongside the OS-level query. */
html[data-reduce-motion='true'] {
  --duration-fast: 0.01ms;
  --duration-base: 0.01ms;
  --duration-slow: 0.01ms;
  --duration-overlay: 0.01ms;
}
