/* ============================================================
   today.css — the live erikchristensen.ca, inside ec-2025 (production's "today" mode, inc/today.php).
   Copied from christensen-digital/erikchristensen.ca @ 98a2f79 → style.css; only the :root block and the
   signal's pulse changed, from literals to the brand tokens. Retires when production switches to the new site.
   ============================================================ */
/* ============================================================
   Erik Christensen — design system + page styles
   Type:  Hedvig Letters Serif (display) · Schibsted Grotesk (text)
   Color: cool paper · graphite ink · one ignition signal
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ── */
:root {
  /* Every brand value comes from the theme's token sheet (assets/canon/tokens.css, the same values the live
     site's /ec.css publishes); the names the page uses below are aliases. Not tokens: --ink-faint,
     --signal-bright, --steel (page values the live site carries; build_theme.py names the last two too). */

  /* surfaces */
  --paper:       var(--ec-bg);
  --surface:     var(--ec-surface);
  --surf-2:      var(--ec-panel);

  /* ink */
  --ink:         var(--ec-text);
  --ink-dim:     var(--ec-text-2);
  --ink-faint:   #646970;

  /* signal — ignition */
  --signal:        var(--ec-accent-ui);
  --signal-deep:   var(--ec-accent-text);
  --signal-bright: #e9692a;
  --signal-soft:   color-mix(in srgb, var(--ec-accent-ui) 10%, transparent);

  /* structure */
  --steel:       #95a0aa;
  --line:        color-mix(in srgb, var(--ec-text) 13%, transparent);
  --line-strong: color-mix(in srgb, var(--ec-text) 26%, transparent);
  --line-faint:  color-mix(in srgb, var(--ec-text) 5%, transparent);

  /* type */
  --font-display: var(--ec-type-family-display);
  --font-text:    var(--ec-type-family-ui);

  /* fluid scale */
  --t-label: var(--ec-type-scale-label);
  --t-meta:  var(--ec-type-scale-meta);
  --t-body:  var(--ec-type-scale-body);
  --t-lead:  var(--ec-type-scale-lead);
  --t-h3:    var(--ec-type-scale-h3);
  --t-h2:    var(--ec-type-scale-h2);
  --t-h1:    var(--ec-type-scale-h1);

  /* space */
  --bay:   var(--ec-space-bay);
  --pad:   var(--ec-space-pad);
  --maxw:  var(--ec-space-maxw);

  --grid:  var(--ec-space-grid);
  --radius: var(--ec-radius-md);
  --ease:   var(--ec-motion-ease);

  --z-bg: 0; --z-content: 2; --z-overlay: 50;
}

/* ── Base ── */
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.62;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* faint paper grid */
body::before {
  content: '';
  position: fixed;
  inset: -2px;
  z-index: var(--z-bg);
  pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--line-faint) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-faint) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  -webkit-mask-image: radial-gradient(ellipse 130% 100% at 50% -10%, #000 45%, transparent 92%);
          mask-image: radial-gradient(ellipse 130% 100% at 50% -10%, #000 45%, transparent 92%);
}

main, header, footer { position: relative; z-index: var(--z-content); }

::selection { background: var(--signal); color: var(--paper); }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--signal-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Page shell ── */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 1rem + 4vw, 4rem) var(--pad) var(--bay);
}

/* ── Typographic primitives ── */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.label {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.2rem;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), gap .22s var(--ease), transform .22s var(--ease);
}
.btn .tick { transition: transform .22s var(--ease); }

.btn--signal { background: var(--signal-deep); color: var(--paper); }
.btn--signal:hover { gap: 0.7rem; transform: translateY(-1px); }
.btn--signal:hover .tick { transform: translate(2px, -2px); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); gap: 0.7rem; }
.btn--ghost:hover .tick { transform: translate(2px, -2px); }

/* ── Index (link rows) ── */
.index { list-style: none; }
.index__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.35rem clamp(0.75rem, 2vw, 1.5rem);
  padding: clamp(1rem, 2vw, 1.4rem) 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: color .2s var(--ease);
}
.index li:last-child .index__row { border-bottom: 1px solid var(--line); }
.index__row:hover { color: var(--signal-deep); }

.index__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-h3);
  line-height: 1.1;
  letter-spacing: -0.005em;
}
.index__desc {
  grid-column: 1 / -1;
  color: var(--ink-dim);
  font-size: var(--t-meta);
  line-height: 1.55;
  max-width: 54ch;
}
.index__row:hover .index__desc { color: var(--ink-dim); }
.index__arrow {
  align-self: center;
  font-size: 1.05em;
  color: var(--steel);
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.index__row:hover .index__arrow { color: var(--signal); transform: translate(3px, -3px); }

/* ── In-flight (soft) index — not yet linkable ── */
.index--soft .index__row { cursor: default; }
.index--soft .index__row:hover { color: inherit; }
.index--soft .index__name { color: var(--ink-dim); }
.index--soft .index__desc { color: var(--ink-faint); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  margin-left: 0.55rem;
  font-family: var(--font-text);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink-faint);
  border: 1px solid var(--line);
  vertical-align: middle;
  position: relative;
  top: -0.12em;
}

/* ── Inline link ── */
.link {
  color: var(--signal-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--signal-soft);
  transition: border-color .2s var(--ease);
}
.link:hover { border-bottom-color: var(--signal-deep); }

/* ── Footer / colophon ── */
.colophon {
  margin-top: var(--bay);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.3rem;
  font-size: var(--t-meta);
  color: var(--ink-faint);
}
.colophon a { color: var(--ink-dim); text-decoration: none; transition: color .2s var(--ease); }
.colophon a:hover { color: var(--signal-deep); }
.colophon .sep { color: var(--steel); }
.colophon .spacer { flex: 1 1 2rem; }

/* ── Content blocks ── */
.block + .block { margin-top: var(--bay); }
.block__h {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.1rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: clamp(0.85rem, 2vw, 1.4rem);
}
.block__label {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: clamp(0.85rem, 2vw, 1.4rem);
}
.block__line {
  color: var(--ink-dim);
  font-size: var(--t-lead);
  line-height: 1.45;
  max-width: 46ch;
  text-wrap: pretty;
  margin-bottom: clamp(1.4rem, 3vw, 2rem);
}

/* ── Connect cluster ── */
.connect__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem 2rem;
}
.connect__social { display: flex; flex-wrap: wrap; gap: 0.9rem 1.4rem; }
.social {
  font-size: var(--t-meta);
  color: var(--ink-dim);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color .2s var(--ease);
}
.social:hover { color: var(--signal-deep); }

/* ── Masthead ── */
.mast { padding-block: clamp(0.5rem, 2vw, 1.25rem) var(--bay); }
.mast__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-bottom: clamp(1.5rem, 4vw, 2.75rem);
}
.mast__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: default;
}
.mast__mark .wave {
  display: inline-block;
  transform-origin: 70% 80%;
  transition: transform .2s var(--ease);
}
.mast__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--t-meta);
  color: var(--ink-faint);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ec-accent-ui) 50%, transparent);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ec-accent-ui) 45%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ec-accent-ui) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ec-accent-ui) 0%, transparent); }
}
.mast__name {
  font-size: var(--t-h1);
  line-height: 1.0;
  color: var(--ink);
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.mast__role {
  margin-top: clamp(1.2rem, 2.5vw, 1.8rem);
  font-size: var(--t-lead);
  line-height: 1.45;
  color: var(--ink-dim);
  max-width: 38ch;
  text-wrap: pretty;
}
.mast__role .link { white-space: nowrap; }
.mast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

/* ── Easter-egg helpers ── */
@keyframes wavehand {
  0%,100% { transform: rotate(0); }
  20% { transform: rotate(16deg); } 40% { transform: rotate(-10deg); }
  60% { transform: rotate(14deg); } 80% { transform: rotate(-6deg); }
}
.is-waving .wave { animation: wavehand .8s var(--ease); }
.liftoff { animation: liftoff .7s cubic-bezier(.4,0,.6,1) forwards; }
@keyframes liftoff {
  30% { transform: translateY(6px) scale(.92); }
  100% { transform: translateY(-180px) scale(.6); opacity: 0; }
}
.ec-rocket {
  position: fixed; left: 0; bottom: 8%;
  font-size: 2.4rem; z-index: var(--z-overlay);
  pointer-events: none; will-change: transform;
}

/* ── Motion ── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
[data-rise] { opacity: 0; animation: rise 0.7s var(--ease) forwards; animation-delay: var(--d, 0s); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
  [data-rise] { opacity: 1; transform: none; }
}

/* ============================================================
   Subpages (blog) — back link, page head, post list, prose
   ============================================================ */

/* ── Back link ── */
.subhead { padding-block: clamp(0.5rem, 2vw, 1.25rem) 0; }
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--t-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color .2s var(--ease), gap .2s var(--ease);
}
.backlink:hover { color: var(--signal-deep); gap: 0.7rem; }
.backlink__arr { transition: transform .2s var(--ease); }
.backlink:hover .backlink__arr { transform: translateX(-3px); }

/* ── Page head ── */
.pagehead { margin-block: clamp(1.5rem, 4vw, 2.75rem) var(--bay); }
.pagehead__h {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-h1);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.pagehead__lead {
  margin-top: clamp(0.8rem, 2vw, 1.2rem);
  font-size: var(--t-lead);
  line-height: 1.45;
  color: var(--ink-dim);
  max-width: 34ch;
  text-wrap: pretty;
}
.pagehead .postmeta { display: block; margin-top: clamp(0.8rem, 2vw, 1.1rem); }

/* ── Post meta label ── */
.postmeta {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--t-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.index__meta { color: var(--ink-faint); }

/* internal post rows: arrow shifts horizontally, not diagonally */
.index--posts .index__row:hover .index__arrow { transform: translateX(3px); }

/* ── "More" link ── */
.more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 600;
  font-size: var(--t-meta);
  color: var(--signal-deep);
  text-decoration: none;
  transition: gap .2s var(--ease);
}
.more:hover { gap: 0.65rem; }

/* ── Prose (article body) ── */
.prose {
  max-width: 64ch;
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1.7;
}
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose hr { margin-top: 1.25em; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-h3);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 1.9em;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  color: var(--ink);
  margin-top: 1.5em;
}
.prose a {
  color: var(--signal-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--signal-soft);
  transition: border-color .2s var(--ease);
}
.prose a:hover { border-bottom-color: var(--signal-deep); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote {
  padding-left: 1.1rem;
  border-left: 2px solid var(--signal);
  color: var(--ink-dim);
  font-style: italic;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.12em 0.4em;
  border-radius: 3px;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; font-size: 0.85rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); }

/* ── Article footer ── */
.post-foot {
  margin-top: var(--bay);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
