/* ==========================================================================
   POLARIS PICTURES — BASE
   Design tokens · Reset · Typography · Layout · Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette — sampled from the Polaris Pictures logo */
  --gold: #F2C230;
  --gold-light: #F8DA7A;
  --gold-soft: #E9C56A;
  --gold-deep: #9C7212;
  --ink: #0A0A0B;
  --ink-2: #111113;
  --ink-3: #18181B;
  --ink-4: #222226;
  --paper: #F3EFE6;
  --paper-2: #E9E3D6;
  --bone: #EEE9DF;
  --rec: #E5484D;

  /* Semantic colours (dark theme is the default) */
  --bg: var(--ink);
  --bg-raised: var(--ink-2);
  --bg-sunken: #060607;
  --fg: var(--bone);
  --fg-dim: rgba(238, 233, 223, .66);
  --fg-faint: rgba(238, 233, 223, .42);
  --line: rgba(238, 233, 223, .12);
  --line-strong: rgba(238, 233, 223, .26);
  --accent: var(--gold);
  --accent-ink: var(--ink);

  /* Typography */
  --serif: "Cormorant Garamond", "Cormorant", "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --logo: "Poppins", "Jost", "Futura", sans-serif;

  --fs-display: clamp(3.4rem, 1.2rem + 8.2vw, 10.75rem);
  --fs-mega: clamp(4.6rem, .5rem + 16vw, 19rem);
  --fs-h1: clamp(2.8rem, 1.3rem + 5vw, 6.75rem);
  --fs-h2: clamp(2.25rem, 1.2rem + 3.3vw, 4.75rem);
  --fs-h3: clamp(1.65rem, 1.15rem + 1.35vw, 2.6rem);
  --fs-h4: clamp(1.25rem, 1.05rem + .6vw, 1.65rem);
  --fs-lead: clamp(1.3rem, 1rem + 1vw, 2rem);
  --fs-body: clamp(1rem, .97rem + .15vw, 1.0625rem);
  --fs-small: .875rem;
  --fs-label: .6875rem;

  /* Space & layout */
  --gutter: clamp(1.25rem, .55rem + 2.9vw, 3.75rem);
  --section: clamp(6rem, 3.5rem + 9vw, 13rem);
  --section-sm: clamp(4rem, 2.5rem + 5vw, 7.5rem);
  --maxw: 1560px;
  --header-h: 92px;
  --radius: 3px;
  --radius-lg: 6px;

  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.76, 0, .24, 1);
  --ease-cine: cubic-bezier(.65, .05, .36, 1);
  --dur: .7s;

  color-scheme: dark;
}

/* Ivory "paper" sections — the classical counterpoint to the cinematic dark */
.theme-paper {
  --bg: var(--paper);
  --bg-raised: #EAE4D7;
  --bg-sunken: #E4DDCE;
  --fg: #141414;
  --fg-dim: rgba(20, 20, 20, .68);
  --fg-faint: rgba(20, 20, 20, .45);
  --line: rgba(20, 20, 20, .13);
  --line-strong: rgba(20, 20, 20, .3);
  --accent: var(--gold-deep);
  --accent-ink: var(--paper);
  background-color: var(--bg);
  color: var(--fg);
  color-scheme: light;
}

.theme-ink {
  --bg: var(--ink-2);
  background-color: var(--bg);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
  background: var(--ink);
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg, video, canvas, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; text-transform: inherit; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--gold); color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Lenis smooth scrolling */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
.display, .mega, .h1, .h2, .h3 {
  font-family: var(--serif);
  font-weight: 300;
  font-feature-settings: "liga" 1, "dlig" 1, "kern" 1;
  text-wrap: balance;
}

.mega {
  font-size: var(--fs-mega);
  line-height: .8;
  letter-spacing: -.04em;
}

.display {
  font-size: var(--fs-display);
  line-height: .9;
  letter-spacing: -.028em;
}

.h1 {
  font-size: var(--fs-h1);
  line-height: .96;
  letter-spacing: -.022em;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.02;
  letter-spacing: -.016em;
  font-weight: 400;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: 1.1;
  letter-spacing: -.01em;
  font-weight: 400;
}

.h4 {
  font-family: var(--sans);
  font-size: var(--fs-h4);
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -.005em;
}

.display em, .mega em, .h1 em, .h2 em, .h3 em, .lead em, .quote em {
  font-style: normal;
  font-weight: inherit;
  color: var(--accent);
}

.lead {
  font-family: var(--serif);
  font-size: var(--fs-lead);
  line-height: 1.32;
  font-weight: 400;
  letter-spacing: -.005em;
  text-wrap: pretty;
}

.body-lg { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); line-height: 1.75; }
.body-sm { font-size: var(--fs-small); line-height: 1.65; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .9em;
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.eyebrow--line::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: .55;
}

.eyebrow--star::before {
  content: "";
  width: .8em;
  height: .8em;
  background: var(--accent);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
}

.label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.prose { max-width: 68ch; color: var(--fg-dim); }
.prose > * + * { margin-top: 1.25em; }
.prose strong { color: var(--fg); font-weight: 500; }
.prose a { color: var(--fg); background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }

@media (max-width: 560px) { .hide-sm { display: none !important; } }

.text-dim { color: var(--fg-dim); }
.text-faint { color: var(--fg-faint); }
.text-gold { color: var(--accent); }
.italic { font-style: italic; }
.serif { font-family: var(--serif); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* Split-text masks (created by core.js) */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: .12em .08em .16em 0;
  margin: -.12em -.08em -.16em 0;
}
.w > .wi { display: inline-block; will-change: transform; }

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 1100px; }
.container--text { max-width: 820px; }

.section { position: relative; padding-block: var(--section); }
.section--sm { padding-block: var(--section-sm); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, .5rem + 1.6vw, 2.5rem);
}

.site-main { position: relative; z-index: 1; display: block; }

.hr { height: 1px; border: 0; background: var(--line); margin: 0; }

/* Sticky panels taller than the screen scroll normally instead (set by core.js) */
.is-unstuck { position: relative !important; top: auto !important; }

.stack > * + * { margin-top: var(--stack, 1.5rem); }

/* --------------------------------------------------------------------------
   5. Utilities & accessibility
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 100000;
  padding: .85rem 1.25rem;
  background: var(--gold);
  color: var(--ink);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Star glyph as a CSS mask, reusable anywhere */
:root {
  --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0 L53.2 42.4 L66 34 L57.6 46.8 L100 50 L57.6 53.2 L66 66 L53.2 57.6 L50 100 L46.8 57.6 L34 66 L42.4 53.2 L0 50 L42.4 46.8 L34 34 L46.8 42.4 Z'/%3E%3C/svg%3E");
}

.star-glyph {
  display: inline-block;
  width: .7em;
  height: .7em;
  background: var(--accent);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
  vertical-align: middle;
}

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