/* ==========================================================================
   Better Video Publishing — site styling.

   ALL styling lives here: the served CSP is `style-src 'self'` with no
   'unsafe-inline', so an inline <style> block or a style="" attribute would be
   dropped by the browser and the page would render unstyled. No CSS framework
   and no external subresources of any kind — system fonts, inline SVG, and a
   single same-origin stylesheet, so the site issues zero third-party requests.

   Colour follows the visitor's OS setting via prefers-color-scheme, with DARK
   as the base palette and the LIGHT palette applied under
   `prefers-color-scheme: light`. There is no manual theme toggle: persisting
   one across pages would need JavaScript / storage, which this site does not use.

   The responsive bar (375 / 768 / 1280px): no horizontal scrolling, nothing
   clipped or overlapping, interactive targets >= 44x44px (--target-min), and
   navigation that ADAPTS (the hamburger menu below) rather than merely shrinks.
   ========================================================================== */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --max: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 14px;
  /* Minimum size of any interactive target — the 44px platform bar, kept as a token. */
  --target-min: 44px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- palettes: DARK is the base ---------- */
body {
  --bg:        #0a0a0c;
  --bg-elev:   #101014;
  --bg-sunk:   #08080a;
  --ink:       #f4f2ee;
  --ink-soft:  #a8a5a0;
  --ink-faint: #6c6a67;
  --line:      #232329;
  --line-soft: #18181d;
  --accent:    #ff4d5e;
  --glow-a:    #ff4d5e;
  --glow-b:    #6e5cff;
  --glow-c:    #17c9b0;
  --grain:     .045;
  --shadow:    0 1px 2px rgba(0,0,0,.5), 0 12px 40px -12px rgba(0,0,0,.7);
}

/* ---------- light palette applied under the OS light setting ---------- */
@media (prefers-color-scheme: light) {
  body {
    --bg:        #fbfaf8;
    --bg-elev:   #ffffff;
    --bg-sunk:   #f3f1ed;
    --ink:       #14131a;
    --ink-soft:  #5d5a63;
    --ink-faint: #85828b;
    --line:      #e3e0da;
    --line-soft: #eeece7;
    --accent:    #c8192e;
    --glow-a:    #ff8a96;
    --glow-b:    #a99bff;
    --glow-c:    #6fe0d0;
    --grain:     .03;
    --shadow:    0 1px 2px rgba(20,19,26,.06), 0 12px 40px -14px rgba(20,19,26,.18);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .5s var(--ease), color .5s var(--ease);
  /* A long URL/token in copy must wrap, never widen the page past the viewport. */
  overflow-x: hidden;
  overflow-wrap: break-word;
}

/* film grain — inline SVG data URI (CSP img-src permits data:) */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

.vh {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type ---------- */
h1, h2 { margin: 0; font-weight: 560; letter-spacing: -0.032em; line-height: 1.06; }
p { margin: 0 0 1.1em; }
a { color: inherit; }

.lede { font-size: clamp(1.06rem, 1.7vw, 1.22rem); color: var(--ink-soft); max-width: 62ch; }

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--line-soft);
  transition: background .5s var(--ease);
}

.nav { display: flex; align-items: center; gap: .75rem; min-height: 68px; }

.brand {
  display: flex; align-items: center; gap: .62rem;
  text-decoration: none; font-weight: 580; letter-spacing: -0.025em;
  font-size: 1.02rem; margin-right: auto; white-space: nowrap;
  min-height: var(--target-min); padding-right: .5rem;
}
.mark { width: 24px; height: 24px; flex: none; display: block; }
/* The logo's accent arc, styled from CSS (not a var() presentation attribute) so it tracks the palette. */
.mark-arc { stroke: var(--accent); }

.nav-links { display: flex; gap: .15rem; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--ink-soft);
  font-size: .89rem; font-weight: 500;
  padding: 0 .8rem; border-radius: 9px;
  min-height: var(--target-min);
  display: inline-flex; align-items: center;
  position: relative;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--line-soft); }
.nav-links a::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: 9px;
  height: 2px; border-radius: 2px; background: transparent;
}

/* Active-page indicator — driven by aria-current="page" so it survives across real pages and is
   announced to assistive tech (the mockup's :target mechanism is gone with the single-document layout). */
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { background: var(--accent); }

/* icon buttons — real 44px targets */
.iconbtn {
  width: var(--target-min); height: var(--target-min); flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.iconbtn:hover { color: var(--ink); border-color: var(--ink-faint); }
#menu:focus-visible ~ header .burger { outline: 2px solid var(--accent); outline-offset: 2px; }

.burger { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(4.5rem, 12vw, 9rem) 0 clamp(3.5rem, 8vw, 6rem); overflow: hidden; }

.aurora {
  position: absolute; z-index: 0; pointer-events: none;
  width: min(1000px, 130vw); aspect-ratio: 1;
  top: -46%; left: 50%; translate: -50% 0;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--glow-a) 42%, transparent), transparent 72%) 32% 40% / 62% 62% no-repeat,
    radial-gradient(closest-side, color-mix(in srgb, var(--glow-b) 40%, transparent), transparent 72%) 68% 34% / 58% 58% no-repeat,
    radial-gradient(closest-side, color-mix(in srgb, var(--glow-c) 32%, transparent), transparent 72%) 50% 70% / 54% 54% no-repeat;
  filter: blur(58px);
  opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(-2%, 0, 0) scale(1); }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.07); }
  100% { transform: translate3d(-1%, -2%, 0) scale(1.02); }
}

.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 82px 82px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 22%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 22%, #000 30%, transparent 78%);
  opacity: .8;
}

.hero .wrap { position: relative; z-index: 1; }

h1.display {
  font-size: clamp(2.7rem, 8.2vw, 6.2rem);
  letter-spacing: -0.045em;
  max-width: 16ch;
  margin-bottom: 1.7rem;
}

/* ---------- sections ---------- */
section.band { padding: clamp(3.5rem, 8vw, 6.5rem) 0; border-top: 1px solid var(--line-soft); }
/* ---------- prose ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin: 2.6rem 0 1rem; }
.prose p, .prose li { color: var(--ink-soft); font-size: .98rem; }
.prose strong { color: var(--ink); font-weight: 560; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose a { color: var(--accent); text-underline-offset: 3px; }

/* padding-block only: a `padding` shorthand here would zero .wrap's gutter and misalign the heading. */
.page-head { padding-block: clamp(3rem, 7vw, 5rem) clamp(1.6rem, 3vw, 2.4rem); }
.page-head h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); margin-bottom: .9rem; }
.page-head .meta { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.page-head .meta strong { color: var(--ink); font-weight: 560; }

/* Inner-page content column (replaces the mockup's inline padding-bottom). */
.page-body { padding-bottom: clamp(3rem, 7vw, 5.5rem); }

.contact-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.8rem, 4vw, 2.8rem); background: var(--bg-elev);
  box-shadow: var(--shadow);
}
.mailto-line { margin: 0; }
.card-eyebrow {
  font-size: .78rem; line-height: 1.4; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin-bottom: .7rem;
}
.mailto {
  font-size: clamp(1.15rem, 3.4vw, 2rem); font-weight: 560; letter-spacing: -0.03em;
  text-decoration: none; display: inline-flex; align-items: center; gap: .6rem;
  color: var(--ink); min-height: var(--target-min); word-break: break-word;
}
.mailto:hover { color: var(--accent); }

/* Permissions table on /privacy. Two columns at every width: the scope names wrap anywhere, so the table
   always fits the content column and the page never scrolls sideways. */
.perms { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .94rem; }
.perms th, .perms td { text-align: left; vertical-align: top; padding: .8rem .9rem .8rem 0; border-bottom: 1px solid var(--line-soft); }
.perms th { font-size: .74rem; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-faint); font-weight: 600; }
.perms td { color: var(--ink-soft); }
.perms th:first-child, .perms td:first-child { width: 38%; }
.perms code { font-family: var(--font-mono); font-size: .84rem; color: var(--ink); overflow-wrap: anywhere; }
/* Phones and small tablets: give the scope column half the width and a smaller face, so even "yt-analytics.readonly" fits on one
   line instead of breaking mid-word. */
@media (max-width: 600px) {
  .perms th:first-child, .perms td:first-child { width: 50%; padding-right: .6rem; }
  .perms code { font-size: .72rem; }
}


/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line-soft); padding: 1.6rem 0; background: var(--bg-sunk); }
.legal {
  margin: 0;
  display: flex; flex-wrap: wrap; gap: 0 .5rem; align-items: center;
  font-size: .84rem; color: var(--ink-faint);
}
.legal .dot { opacity: .5; }
/* Standalone footer links, so both axes meet the 44px target bar. */
.legal a {
  color: var(--ink-soft); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--target-min); min-width: var(--target-min);
}
.legal a:hover { color: var(--ink); }
/* Each separator travels with the link after it, so a wrapped line starts with "· Privacy Policy" instead of
   ending on a stranded dot. */
.legal .group { white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; }

/* ---------- mobile: the hamburger menu is the "navigation adapts" case ---------- */
@media (max-width: 820px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--line);
    padding: .4rem var(--gutter) .9rem;
  }
  #menu:checked ~ header .nav-links { display: flex; }
  .nav-links a { font-size: 1rem; padding: 0 .2rem; border-radius: 0; }
  .nav-links a::after { display: none; }
  .burger { display: grid; }
  header { position: relative; }
}

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