/* WhyCantI.ca — warm cinematic editorial */
:root {
  /* Tokens — Warm Editorial (default) */
  --bg: oklch(0.94 0.012 75);
  --bg-elev: oklch(0.96 0.010 75);
  --bg-deep: oklch(0.90 0.015 70);
  --ink: oklch(0.18 0.015 60);
  --ink-2: oklch(0.32 0.015 60);
  --ink-3: oklch(0.50 0.015 60);
  --ink-4: oklch(0.68 0.015 60);
  --line: oklch(0.86 0.012 70);
  --line-2: oklch(0.80 0.014 70);
  --accent: oklch(0.62 0.13 45);    /* muted ember */
  --accent-ink: oklch(0.30 0.10 45);
  --plum: oklch(0.42 0.04 340);
  --moss: oklch(0.50 0.06 145);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  --serif: "Instrument Serif", "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans: "Geist", "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1320px;
  --gutter: clamp(20px, 4vw, 48px);
}

[data-theme="dusk"] {
  --bg: oklch(0.22 0.018 60);
  --bg-elev: oklch(0.26 0.018 60);
  --bg-deep: oklch(0.18 0.018 60);
  --ink: oklch(0.94 0.010 75);
  --ink-2: oklch(0.82 0.012 70);
  --ink-3: oklch(0.65 0.012 70);
  --ink-4: oklch(0.48 0.014 65);
  --line: oklch(0.32 0.018 60);
  --line-2: oklch(0.40 0.018 60);
  --accent: oklch(0.72 0.14 55);
}

[data-theme="ivory"] {
  --bg: oklch(0.97 0.008 80);
  --bg-elev: oklch(0.99 0.005 80);
  --bg-deep: oklch(0.93 0.010 75);
  --line: oklch(0.88 0.010 75);
}

[data-theme="moss"] {
  --accent: oklch(0.55 0.10 150);
  --accent-ink: oklch(0.28 0.08 150);
}
[data-theme="plum"] {
  --accent: oklch(0.50 0.13 350);
  --accent-ink: oklch(0.28 0.10 350);
}
[data-theme="ink"] {
  --accent: oklch(0.30 0.02 60);
  --accent-ink: oklch(0.18 0.02 60);
}

[data-density="compact"] {
  --section-y: clamp(56px, 7vw, 96px);
}
[data-density="spacious"] {
  --section-y: clamp(96px, 13vw, 200px);
}
:root { --section-y: clamp(72px, 10vw, 144px); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { max-width: 100%; display: block; }

/* Type system */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 2px;
}
.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-style: normal;
}
.italic { font-style: italic; font-family: var(--serif); }

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8.4vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.display .it { font-style: italic; color: var(--accent-ink); }
.h1 { font-family: var(--serif); font-size: clamp(40px, 6vw, 88px); line-height: 0.98; letter-spacing: -0.022em; text-wrap: balance; }
.h2 { font-family: var(--serif); font-size: clamp(32px, 4.4vw, 64px); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.h3 { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 36px); line-height: 1.1; letter-spacing: -0.015em; }
.h4 { font-family: var(--sans); font-size: 18px; line-height: 1.3; letter-spacing: -0.005em; font-weight: 500; }

.lead {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 56ch;
  text-wrap: pretty;
}
.body { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.small { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.mono { font-family: var(--mono); }

/* Layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section-tight { padding: clamp(40px, 5vw, 80px) 0; }

.divider {
  height: 1px;
  background: var(--line);
}
.hairline { border-top: 1px solid var(--line); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), background .25s, color .25s, border-color .25s;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn .arr { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.btn:hover .arr { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-link {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  display: inline-flex; gap: 8px; align-items: center;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 4px;
}
.btn-link:hover { border-color: var(--ink); }

/* Cards */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Tag pills */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
}

/* Frame placeholder visual (striped, monospace label) */
.frame {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      oklch(from var(--bg-deep) calc(l - 0.02) c h) 0 1px,
      transparent 1px 9px),
    var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.frame .label {
  position: absolute; left: 12px; top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: oklch(from var(--bg) l c h / 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  backdrop-filter: blur(6px);
}
.frame .corner {
  position: absolute; right: 12px; top: 12px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
}
.frame .num {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
}

/* Tabular numerals for stats */
.tnum { font-variant-numeric: tabular-nums; }

/* Animations */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.35s; }

@keyframes drift {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes drawline {
  from { stroke-dashoffset: var(--len, 100); }
  to { stroke-dashoffset: 0; }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* Fine grain */
.grain::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 25% 30%, oklch(from var(--accent) l c h / 0.04), transparent 50%),
    radial-gradient(circle at 75% 70%, oklch(from var(--plum) l c h / 0.05), transparent 60%);
  mix-blend-mode: multiply;
}

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Form inputs */
.input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--bg);
}
.input::placeholder { color: var(--ink-4); }

/* Number-coded section header */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: minmax(0,1fr) minmax(0, 1.2fr); }
}

/* Subtle scroll bar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* Utility */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.spacer { height: 1px; background: var(--line); }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.grid { display: grid; gap: 24px; }

/* Underline-on-hover nav links */
.navlink {
  position: relative;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 0;
}
.navlink::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.navlink:hover::after, .navlink.active::after { transform: scaleX(1); }
.navlink.active { color: var(--ink); }

/* Dot-grid backdrop */
.dotgrid {
  background-image: radial-gradient(oklch(from var(--ink) l c h / 0.10) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* Aspect helpers */
.ar-16-10 { aspect-ratio: 16/10; }
.ar-4-5 { aspect-ratio: 4/5; }
.ar-1-1 { aspect-ratio: 1/1; }
.ar-3-2 { aspect-ratio: 3/2; }

/* Page transitions */
.page-enter { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
