/* itsmecaleb.com — hand-built from the Claude Design canvas export.
   Source of truth: this repo. See reference/canvas-export.html for the original. */

/* ---------- fonts (latin only; 2 files, was 12) ---------- */
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("assets/jetbrains-mono-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url("assets/newsreader-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  --bg: #101113;
  --panel: #16181a;
  --ink: #e2e4e3;
  --ink-bright: #f1f3f2;
  --prose: #d4d8d6;
  --prose-dim: #9aa09d;
  --accent: #8fbf9f;
  --live: #a6d8b0;
  --link: #a9c9a4;
  --warn: #c07d74;

  /* Recession ladder. Every step clears WCAG 4.5:1 on --bg; the hierarchy
     comes from size and weight, not from near-invisible grey. (item 12) */
  --dim-1: #8f9593;   /* 6.20:1 */
  --dim-2: #7f8583;   /* 5.02:1 */
  --dim-3: #777d7b;   /* 4.50:1 */

  --hair: rgba(226,228,227,.08);
  --hair-soft: rgba(226,228,227,.05);
  --gutter: clamp(20px, 5vw, 170px);
  --edge: clamp(20px, 4vw, 28px);
  --label-col: 150px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* clip, not hidden: `overflow-x: hidden` forces overflow-y to `auto`, which
     makes body a scroll container and silently kills `position: sticky` on
     every descendant (it broke the hero pin). `clip` does the same guard
     without creating one. Older engines just ignore it — there is no
     horizontal overflow to catch anyway; this is belt and braces. */
  overflow-x: clip;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { color: #f5e2bd; }
input { font: inherit; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--live);
  outline-offset: 3px;
  border-radius: 2px;
}

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

@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
@keyframes pulse { 0%,100%{opacity:.35; transform:scale(1)} 50%{opacity:1; transform:scale(1.25)} }
@keyframes rise  { from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:translateY(0)} }
@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }

/* ---------- shell ---------- */
.shell { position: relative; min-height: 100vh; min-height: 100dvh; }
.grid-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.bloom {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(143,191,159,.08), transparent 55%),
    radial-gradient(80% 60% at 90% 110%, rgba(120,150,170,.06), transparent 60%);
}
.content { position: relative; z-index: 2; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px var(--edge);
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim-2);
  border-bottom: 1px solid var(--hair);
  background: rgba(20,17,14,.72);
  backdrop-filter: blur(8px);
}
.site-header .id-group,
.site-header .session-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-header .session-group { gap: 18px; }
.site-header .name { color: var(--ink); }
.site-header .role { color: var(--dim-3); }
.site-header .uptime { color: var(--dim-3); }

.live-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--live); box-shadow: 0 0 8px var(--live);
  animation: pulse 2.4s ease-in-out infinite;
}
.live-dot.sm { width: 5px; height: 5px; box-shadow: 0 0 6px var(--live); }

/* ---------- shared section frame ---------- */
.band { max-width: 1240px; padding-inline: var(--edge) var(--gutter); }
.split {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  gap: 16px;
}
.section-label {
  font-size: 10.5px; letter-spacing: .16em; color: var(--dim-2);
  padding-top: 6px; margin: 0; font-weight: 400; text-transform: uppercase;
}

/* ---------- hero ---------- */
/* Unpinned baseline (phones, short viewports). The pin lives further down,
   behind a media query, because a sticky box taller than the viewport hides
   its own bottom half. */
.hero-stage { position: relative; }
.hero { padding-block: 104px 0; min-height: 118vh; }
@supports (min-height: 100dvh) { .hero { min-height: 118dvh; } }
.hero .eyebrow { font-size: 11.5px; letter-spacing: .16em; color: var(--dim-2); margin-bottom: 26px; }
.hero h1 {
  font-family: Newsreader, Georgia, serif; font-weight: 300;
  font-size: clamp(38px, 6.4vw, 84px); line-height: 1.04; letter-spacing: -.02em;
  margin: 0 0 8px; color: var(--ink-bright); text-wrap: pretty; max-width: 15ch;
}
.hero .lede {
  font-family: Newsreader, Georgia, serif; font-weight: 300;
  font-size: clamp(17px, 1.7vw, 23px); line-height: 1.55;
  color: #a8adab; max-width: 46ch; margin: 0 0 56px;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr);
  gap: 26px; align-items: start; max-width: 1120px;
}

/* SYS.STATUS panel */
.panel { border: 1px solid rgba(226,228,227,.10); border-radius: 3px; background: rgba(24,26,28,.55); }
.panel-head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--hair);
  font-size: 10.5px; letter-spacing: .16em; color: var(--dim-2);
}
.status-row {
  display: grid; grid-template-columns: var(--label-col) 1fr auto; gap: 16px;
  align-items: baseline; padding: 11px 16px;
  border-bottom: 1px solid var(--hair-soft); font-size: 13px;
}
.status-row .k { font-size: 10.5px; letter-spacing: .14em; color: var(--dim-2); }
.status-row .v { letter-spacing: .02em; }
.status-row .t { font-size: 10.5px; color: var(--dim-3); }
.status-row[data-state="standby"] .v { color: var(--dim-3); }
.status-row[data-state="sync"] .v { color: var(--dim-2); }

/* CRT */
.crt-frame {
  position: relative; border: 1px solid rgba(226,228,227,.14); border-radius: 8px;
  padding: 12px 12px 10px; background: linear-gradient(#1b1e20, #151719);
  box-shadow: 0 30px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(226,228,227,.06);
}
.crt-screen {
  position: relative; overflow: hidden; border-radius: 3px; background: #0b0c0d;
  box-shadow: inset 0 0 60px rgba(0,0,0,.9); aspect-ratio: 4/3;
  padding: 16px 16px 56px; font-size: 11px; line-height: 1.85; color: var(--dim-1);
}
.crt-scanlines {
  position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background: repeating-linear-gradient(to bottom, rgba(226,228,227,.035) 0 1px, transparent 1px 3px);
}
.crt-beam {
  position: absolute; left: 0; right: 0; height: 64px; top: -10%; pointer-events: none;
  background: linear-gradient(rgba(166,216,176,0), rgba(166,216,176,.09), rgba(166,216,176,0));
}
.crt-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crt-meter { position: absolute; left: 16px; right: 16px; bottom: 16px; }
.crt-meter .cap {
  display: flex; justify-content: space-between;
  font-size: 9.5px; letter-spacing: .16em; color: var(--dim-3); margin-bottom: 6px;
}
.crt-meter .track { height: 3px; background: var(--hair); }
.crt-meter .fill { height: 3px; width: 0%; background: var(--live); box-shadow: 0 0 10px rgba(166,216,176,.5); }
.crt-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 4px 0; font-size: 9.5px; letter-spacing: .18em; color: var(--dim-3);
}
.crt-foot .pwr { display: flex; align-items: center; gap: 6px; }

/* ---------- who ---------- */
.who { padding-block: 0 120px; }
.who .prose { max-width: 58ch; }
.who .prose p { font-family: Newsreader, Georgia, serif; text-wrap: pretty; }
.who .prose p:first-child { font-size: 21px; line-height: 1.62; color: var(--prose); margin: 0 0 20px; }
.who .prose p + p { font-size: 18px; line-height: 1.7; color: var(--prose-dim); margin: 0 0 18px; }
.who .prose p:last-child { margin-bottom: 0; }

/* ---------- ticker ---------- */
.ticker-band {
  border-block: 1px solid var(--hair);
  background: rgba(22,24,26,.6);
}
.ticker-inner {
  max-width: 1240px; padding: 20px var(--edge);
  display: flex; align-items: center; gap: 20px; overflow: hidden;
}
.ticker-inner .tag { flex: none; font-size: 10.5px; letter-spacing: .16em; color: var(--live); }
.ticker-view { flex: 1; overflow: hidden; min-width: 0; }
.ticker-track {
  display: inline-flex; white-space: nowrap; font-size: 12.5px; color: var(--dim-1);
  will-change: transform;
  animation: marquee var(--marquee-dur, 40s) linear infinite;
}
.ticker-track > span { padding-right: 0; }
.ticker-band:hover .ticker-track { animation-play-state: paused; }

/* ---------- build log ---------- */
.buildlog { padding-block: 96px; padding-inline: var(--edge); }
.log-row {
  display: grid; grid-template-columns: 120px 90px minmax(0, 1fr); gap: 16px;
  align-items: baseline; padding: 14px 0; border-bottom: 1px solid rgba(226,228,227,.06);
}
.log-row:hover { background: rgba(143,191,159,.05); }
.log-row .date { font-size: 11.5px; color: var(--dim-2); }
.log-row .status { font-size: 10px; letter-spacing: .12em; }
.log-row .text { font-size: 14px; color: #c3c8c6; line-height: 1.5; }
.log-row .status[data-s="SHIPPED"] { color: var(--live); }
.log-row .status[data-s="PATCHED"] { color: var(--link); }
.log-row .status[data-s="KILLED"]  { color: var(--warn); }
.log-row .status[data-s="WROTE"]   { color: var(--dim-1); }
.log-empty {
  font-size: 13px; color: var(--dim-2); line-height: 1.6;
  border-left: 1px solid rgba(143,191,159,.35); padding-left: 14px;
}

/* ---------- terminal ---------- */
.terminal-sec { padding-block: 0 96px; }
.terminal {
  max-width: 760px; border: 1px solid rgba(226,228,227,.12); border-radius: 3px;
  background: rgba(9,10,11,.75); box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.terminal-head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--hair);
  font-size: 10.5px; letter-spacing: .16em; color: var(--dim-2);
}
.terminal-head .conn { color: var(--live); }
.terminal-body {
  padding: 16px; min-height: 340px; max-height: 60vh; overflow-y: auto;
  font-size: 13px; line-height: 1.65; cursor: text;
  overscroll-behavior: contain;
}
.terminal-body .line { white-space: pre-wrap; animation: rise .18s ease-out; }
.terminal-prompt { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.terminal-prompt .caret { color: var(--accent); }
.terminal-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--ink-bright); font-size: 13px; caret-color: var(--accent);
}

/* ---------- elsewhere ---------- */
.elsewhere { padding-block: 0 120px; }
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair);
}
.tile {
  display: block; padding: 20px; background: var(--panel); color: #c3c8c6;
  min-height: 88px;
}
a.tile:hover { background: #1f1a15; color: var(--ink-bright); }
.tile .k { font-size: 10.5px; letter-spacing: .16em; color: var(--dim-2); margin-bottom: 8px; }
.tile .v { font-size: 14px; }
.tile .v.pending { color: var(--dim-3); }

/* ---------- cat ---------- */
.cat {
  position: fixed; right: 18px; bottom: 0; z-index: 6;
  width: 132px; height: 117px; pointer-events: none; opacity: .9;
}
.cat svg { width: 100%; height: 100%; }

/* ---------- footer ---------- */
/* ---------- writing index (item 31) ---------- */
.site-nav { display: flex; gap: 18px; flex: none; }
.site-nav a { color: var(--dim-2); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.home-link { color: var(--ink); text-decoration: none; }
.home-link:hover { color: var(--ink-bright); }

.writing-sec { padding-block: 72px 96px; }
.writing-title {
  font-family: 'Newsreader', Georgia, serif; font-weight: 300;
  font-size: clamp(38px, 7vw, 64px); line-height: 1.04;
  color: var(--ink-bright); margin: 0 0 18px; letter-spacing: -.01em;
}
.writing-sec .lede {
  font-size: 15px; line-height: 1.65; color: var(--prose-dim);
  max-width: 54ch; margin: 0 0 48px;
}
.writing-list { border-top: 1px solid var(--hair); }
.writing-row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 20px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--hair-soft);
  text-decoration: none;
}
.writing-row:hover { background: rgba(143,191,159,.05); }
.writing-row .date { font-size: 11.5px; color: var(--dim-2); }
.writing-row .title { font-size: 16px; color: var(--prose); line-height: 1.45; }
.writing-row:hover .title { color: var(--ink-bright); }
.writing-row .out { font-size: 12px; color: var(--dim-3); }
.writing-list .log-empty { border-bottom: 1px solid var(--hair-soft); }

@media (max-width: 640px) {
  /* Date rides above the title rather than squeezing a 92px column (item 23). */
  .writing-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px 0; }
  .writing-row .date { grid-column: 1 / -1; }
  .writing-sec { padding-block: 48px 72px; }
}

.site-footer {
  border-top: 1px solid var(--hair); padding: 22px var(--edge);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 10.5px; letter-spacing: .14em; color: var(--dim-3);
}

/* =======================================================================
   Responsive. The canvas export had zero media queries (item 21); these
   breakpoints are the fix for items 22-27.
   ======================================================================= */

@media (max-width: 900px) {
  :root { --gutter: var(--edge); }

  /* Label column stops holding 150px while content crushes (item 23). */
  .split { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .section-label { padding-top: 0; }

  .hero { padding-block: 72px 0; min-height: auto; }
  .hero .lede { margin-bottom: 40px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .status-row { grid-template-columns: minmax(0, 1fr) auto; }
  .status-row .k { grid-column: 1 / -1; }

  /* Hero no longer reserves 118vh, so WHO needs its own breathing room. */
  .who { padding-block: 72px 80px; }
  .buildlog { padding-block: 64px; }
  .terminal-sec { padding-block: 0 64px; }
  .elsewhere { padding-block: 0 80px; }

  /* Cat shrinks before it starts sitting on content (item 25). */
  .cat { width: 96px; height: 85px; right: 10px; }
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap; gap: 6px 14px; font-size: 10.5px;
    padding: 10px var(--edge);
  }
  .site-header .role { display: none; }
  .site-header .session-group { gap: 12px; }

  .hero { padding-block: 56px 0; }
  .hero .eyebrow { margin-bottom: 18px; }

  .crt-screen { padding: 12px 12px 48px; font-size: 10px; line-height: 1.7; }

  /* Date + status share a line, entry text drops beneath (item 23). */
  .log-row {
    grid-template-columns: auto 1fr; gap: 6px 12px; padding: 16px 0;
  }
  .log-row .text { grid-column: 1 / -1; font-size: 15px; }

  .terminal-body { min-height: 260px; max-height: 55vh; }
  /* 16px stops iOS zooming the page on focus. */
  .terminal-input { font-size: 16px; }
  .terminal-head { letter-spacing: .1em; }

  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile { min-height: 0; padding: 18px 20px; }

  .site-footer { flex-direction: column; gap: 8px; }

  /* The cursor trick can't work on touch, and 132px of cat over a 390px
     column is worse than no cat (item 25). */
  .cat { display: none; }
}

/* Short viewports: the hero must not eat the whole screen. */
@media (max-height: 640px) {
  .hero { min-height: auto; padding-block: 48px 0; }
}

/* =======================================================================
   Hero pin.

   The boot readout is scroll-driven, so it used to fill in *while* the
   panels scrolled out of the viewport: by the time SYS.STATUS read
   "100% ONLINE" it was already above the fold and nobody saw it finish.

   The hero now sticks to the viewport for a runway of scroll. The reveal
   happens in place, holds finished for a beat (site.js BOOT_SHARE), then
   the pin releases into the rest of the page.

   Gated on the hero being able to fit on screen. Everything inside scales
   with viewport height so it fits a 680px laptop viewport as well as 1080px.
   ======================================================================= */
@media (min-width: 901px) and (min-height: 680px) {
  /* The runway. It has to be min-height, not padding-bottom: a sticky box is
     constrained to its containing block's *content* box, so padding buys it
     no travel at all and it just scrolls away normally. */
  .hero-stage { min-height: 190vh; }
  @supports (height: 100dvh) { .hero-stage { min-height: calc(100dvh + 90vh); } }

  .hero {
    position: sticky; top: 0;
    min-height: 100vh;
    padding-block: clamp(64px, 9vh, 112px) clamp(24px, 5vh, 56px);
  }
  @supports (min-height: 100dvh) { .hero { min-height: 100dvh; } }

  .hero .eyebrow { margin-bottom: clamp(12px, 2.4vh, 26px); }
  .hero h1 { font-size: clamp(38px, min(6.4vw, 8.4vh), 84px); }
  .hero .lede { margin-bottom: clamp(20px, 4.4vh, 56px); }

  /* Height-bound instead of width-bound, so a short screen can't be handed
     a CRT taller than the box it has to fit inside. */
  .crt-screen { aspect-ratio: auto; height: clamp(230px, 38vh, 420px); }

  /* The 118vh hero used to supply this gap. */
  .who { padding-block: 96px 120px; }
}

/* =======================================================================
   Motion. Nothing above was guarded before (item 14).
   ======================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .live-dot { opacity: 1; }
  .ticker-track { animation: none; transform: none; }
  .grid-canvas { display: none; }
  .terminal-body .line { animation: none; }

  /* A pinned hero is a scroll-linked animation. Let the page scroll
     normally; site.js paints the readout finished on load. */
  .hero-stage { min-height: 0; }
  .hero { position: static; min-height: auto; }
}
