/* =========================================================================
   bryanzane.com — shared editorial layer (v1)

   SOURCE OF TRUTH for the cross-page design system: tokens, base reset,
   nav chrome, footer chrome, buttons, and (later) the motion utilities.
   Loaded by /, /easyagent/, and /llmbench/ BEFORE each page's own
   stylesheet, so page CSS may override anything here.

   Rules of the layer:
   - Tokens only — no literal colors in component rules, so easyagent's
     body[data-profile] theming (incl. Frampton's dark inversion) keeps
     cascading over everything below.
   - Nothing page-specific. If only one page needs it, it does not belong
     here.
   - llmbench (separate repo) references this file absolutely as
     /shared/editorial.css — deploy this repo first when tokens change.
   ========================================================================= */

:root {
  /* Off-white bases */
  --bg-paper: #FAFAF7;
  --bg-paper-2: #F3F2EC;
  --bg-paper-3: #ECEAE1;
  --bg-ink: #0E1220;
  --bg-ink-2: #141A2E;

  /* Absolute ends of the scale (photo/dark chrome only) */
  --paper-0: #FFFFFF;
  --ink-abs: #000000;
  --scrim-rgb: 0, 0, 0;

  /* Ink + supporting neutrals */
  --ink-900: #0B0F1A;
  --ink-700: #1F2638;
  --ink-500: #4A5165;
  --ink-400: #6B7285;
  --ink-300: #9198A8;
  --ink-200: #C7CBD4;
  --ink-100: #E7E6DF;
  --rule:    rgba(12, 16, 28, 0.12);
  --rule-2:  rgba(12, 16, 28, 0.06);

  /* Voltage Blues */
  --blue-900: #0B1E4D;
  --blue-800: #142A6B;
  --blue-700: #1B3A8A;
  --blue-600: #2A4FB3;
  --blue-500: #3A66D1;
  --blue-400: #5A84E6;
  --blue-300: #8FAEF2;
  --blue-200: #C8D6F5;
  --blue-100: #E6EDFB;

  /* Orange — EasyAgent / Strauss accents */
  --orange-900: #5C1F00;
  --orange-700: #B33C00;
  --orange-500: #FF5500;
  --orange-300: #FF8C5A;
  --orange-200: #FFD5C2;
  --orange-100: #FFE7DA;
  --accent-lime: #9BD400;

  /* Type stacks */
  --serif: "Source Serif 4", "GT Sectra", "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Inter Tight", "Söhne", Inter, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", "Berkeley Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* Horizontal page gutter; the main page widens it to 56px on desktop. */
  --page-gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-paper);
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--blue-200); color: var(--blue-900); }

.pf-serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; }
.pf-mono  { font-family: var(--mono); font-feature-settings: "ss01","ss02"; letter-spacing: 0; }

/* ─────────────────────────────────────── SKIP LINK + FOCUS ─── */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-250%);
  transition: transform 0.15s ease;
  padding: 10px 16px;
  background: var(--blue-700);
  color: var(--bg-paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus-visible { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* ───────────────────────────────────────────── NAV ─── */
/* Base nav: sticky, blurred paper — the subpage treatment. */
.ed-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg-paper) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.ed-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px var(--page-gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.ed-nav-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-900);
  flex-shrink: 0;
}
.ed-nav-mark {
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
}
.ed-nav-vol {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.ed-nav-links { display: flex; gap: 24px; }
.ed-nav-links a,
.ed-nav-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-700);
  text-decoration: none;
  transition: color 0.15s;
}
.ed-nav-links a:hover,
.ed-nav-link:hover { color: var(--blue-700); }

/* Overlay nav variant: fixed, transparent, difference-blended — the main
   page's photo-hero treatment. Text is literal white on purpose:
   mix-blend-mode: difference inverts it against whatever scrolls under. */
.ed-nav--overlay {
  position: fixed;
  left: 0;
  right: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  mix-blend-mode: difference;
}
.ed-nav--overlay .ed-nav-brand { color: #fff; }
.ed-nav--overlay .ed-nav-mark,
.ed-nav--overlay .ed-nav-vol { color: #fff; }
.ed-nav--overlay .ed-nav-links { gap: 28px; }
.ed-nav--overlay .ed-nav-links a { color: #fff; }
.ed-nav--overlay .ed-nav-links a:hover { color: var(--blue-300); }
.ed-nav--overlay .ed-nav-links a:focus-visible { outline-color: currentColor; }

/* ───────────────────────────────────────── SECTION LABEL ─── */
.section-label {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* ───────────────────────────────────────────── BUTTONS ─── */
.ed-cta {
  background: var(--blue-700);
  color: var(--bg-paper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 22px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.ed-cta:hover { background: var(--blue-800); }
.ed-cta-secondary {
  appearance: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 20px;
  border: 1px solid currentColor;
}
.ed-cta-ghost {
  appearance: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  color: var(--ink-500);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ed-cta-ghost:hover { color: var(--ink-900); border-color: var(--ink-400); }

/* ───────────────────────────────────────────── FOOTER ─── */
.ed-footer {
  border-top: 1px solid var(--rule);
}
.ed-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px var(--page-gutter) 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px 28px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-400);
  text-transform: uppercase;
}
.ed-footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.ed-footer-links a {
  color: var(--ink-500);
  text-decoration: none;
  transition: color 0.15s;
}
.ed-footer-links a:hover { color: var(--blue-700); }
.ed-footer-heart { color: var(--blue-700); font-size: 12px; letter-spacing: 0; }

/* Compact variant for pages with a fixed bottom composer: own padding
   clears the overlay so the line stays readable when fully scrolled. */
.ed-footer--compact .ed-footer-inner {
  padding-top: 18px;
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
}

@media (max-width: 560px) {
  .ed-footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ───────────────────────────────────────── HOVER MICRO ─── */
/* Underline draw-in on chrome links (no layout shift). */
.ed-nav-links a,
.ed-nav-link,
.ed-footer-links a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.15s;
}
.ed-nav-links a:hover,
.ed-nav-link:hover,
.ed-footer-links a:hover { background-size: 100% 1px; }

/* ─────────────────────────────────────── SCROLL REVEALS ─── */
/* Hidden states only exist under html.js, so no-JS sees everything.
   motion.js adds .is-inview on intersection. Reveals are animations,
   not transitions, so they never clobber a component's own
   transition property (e.g. work-row hover). */
@keyframes ed-reveal-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ed-reveal-slide {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ed-reveal-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

html.js [data-reveal="rise"],
html.js [data-reveal="rule"],
html.js [data-reveal="cascade"] > * { opacity: 0; }

html.js [data-reveal="rise"].is-inview {
  animation: ed-reveal-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
html.js [data-reveal="rule"].is-inview {
  animation: ed-reveal-slide 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
html.js [data-reveal="cascade"].is-inview > * {
  animation: ed-reveal-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* Dotted leaders draw in alongside their cascade row. */
html.js [data-reveal="cascade"] > * .dots {
  transform: scaleX(0);
  transform-origin: left;
}
html.js [data-reveal="cascade"].is-inview > * .dots {
  animation: ed-reveal-draw 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms + 180ms);
}

/* ─────────────────────────────── CROSS-DOCUMENT TRANSITIONS ─── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: 0.22s; }
::view-transition-new(root) { animation-duration: 0.26s; }

/* ─────────────────────────────────────── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal="rise"],
  html.js [data-reveal="rule"],
  html.js [data-reveal="cascade"] > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  html.js [data-reveal="cascade"] > * .dots {
    transform: none !important;
    animation: none !important;
  }
  .ed-nav-links a,
  .ed-nav-link,
  .ed-footer-links a { transition: color 0.15s; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
