/* ============================================================
   localfamo.us — design system v3 "instrument"
   One accent. Real typography. The data is the art.
   Instrument Sans / Instrument Serif / Geist Mono, self-hosted.
   ============================================================ */

@import url('/fonts/fonts.css');

@view-transition { navigation: auto; }

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

:root {
  color-scheme: dark;
  --bg: #0a0c0a;
  --bg-alt: #0e110d;
  --surface: rgba(226,240,222,0.028);
  --surface-hi: rgba(226,240,222,0.055);
  --border: rgba(226,240,222,0.11);
  --border-strong: rgba(226,240,222,0.22);

  /* single live accent — phosphor */
  --green: #4ce383;
  --green-neon: #5bff9d;
  --green-dim: #2c9e5c;
  --green-glow: rgba(76,227,131,0.22);
  --green-ink: #062012;

  /* data-encoding hues only — never decoration */
  --orange: #e8935a;
  --orange-dim: #a35f33;
  --orange-glow: rgba(232,147,90,0.16);
  --purple: #a091d6;
  --purple-deep: #7a6bb8;
  --purple-glow: rgba(160,145,214,0.16);
  --red: #e0655f;
  --amber: #d9a940;
  --blue: #6aaede;

  --text: #e6eae2;
  --text-dim: #a9b2a4;
  --muted: #8a9483;
  --faint: #5a6455;

  --mono: 'Geist Mono', 'SF Mono', ui-monospace, Menlo, monospace;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  --radius: 10px;
  --radius-sm: 6px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------
   Atmosphere — one faint phosphor wash + film grain. Nothing else.
   --------------------------------------------------------------- */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 1100px 480px at 50% -12%, rgba(76,227,131,0.055), transparent 62%),
    var(--bg);
}
body::after {
  content: '';
  position: fixed; inset: -50%; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
}

::selection { background: rgba(76,227,131,0.28); color: #fff; }

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

a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(76,227,131,0.45); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.15s ease, text-decoration-color 0.15s ease; }
a:hover { color: var(--green); text-decoration-color: var(--green); }

code {
  background: rgba(226,240,222,0.05);
  border: 1px solid var(--border);
  padding: 0.12em 0.42em;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--green);
  font-weight: 400;
}

strong { color: var(--text); font-weight: 600; }

/* serif italic — the editorial accent voice */
.em-serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

/* numbers are data */
.toks, .val, .prod-big, .bar-val, .era-num, [data-count] { font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(10,12,10,0.8);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.site-logo {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex; align-items: baseline;
}
.site-logo:hover { color: var(--text); }
.site-logo .local { color: var(--green); }
.site-logo .famous { color: var(--text); }
.site-logo::after { content: '_'; color: var(--green); animation: caret 1.2s steps(1) infinite; margin-left: 1px; }
@keyframes caret { 50% { opacity: 0; } }

.header-right { display: flex; align-items: center; gap: 1.6rem; }

.site-nav { display: flex; gap: 1.4rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; }
.site-nav a { color: var(--muted); text-decoration: none; position: relative; padding: 4px 0; }
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--green); }
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--green);
  transition: right 0.22s ease;
}
.site-nav a:hover::after, .site-nav a.active::after { right: 0; }

.status-dot { display: flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--muted); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-neon); position: relative; }
.dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--green); opacity: 0.5;
  animation: ping-ring 2.4s cubic-bezier(0,0.4,0.6,1) infinite;
}
@keyframes ping-ring { 0% { transform: scale(0.5); opacity: 0.6; } 100% { transform: scale(1.9); opacity: 0; } }

.kbd-hint {
  font-family: var(--mono); font-size: 0.64rem; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 2px 7px;
  cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease;
}
.kbd-hint:hover { color: var(--green); border-color: var(--green-dim); }

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */
.page-outer { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main.narrow, .content { max-width: 720px; margin: 0 auto; padding: 4.5rem 24px 7rem; }

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero { padding: 6.5rem 0 4rem; position: relative; }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.hero-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--green); }
.hero h1 {
  font-size: clamp(2.7rem, 7.2vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.0;
  margin-bottom: 1.7rem;
  color: var(--text);
}
.hero h1 .accent-orange, .hero h1 .accent-em {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.01em; color: var(--green);
}
.hero p.lead { font-size: 1.16rem; color: var(--text-dim); max-width: 600px; line-height: 1.65; }

.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2.2rem; }
.btn {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green);
  background: var(--green);
  color: var(--green-ink);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn:hover { transform: translateY(-1px); background: var(--green-neon); border-color: var(--green-neon); color: var(--green-ink); box-shadow: 0 6px 24px rgba(76,227,131,0.25); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-hi); border-color: var(--green-dim); color: var(--green); box-shadow: none; }

/* ---------------------------------------------------------------
   Stat rows — hairline grid, tabular numerals
   --------------------------------------------------------------- */
.hero-meta, .stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin-top: 3rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-stat, .stat-cell {
  background: var(--bg-alt);
  padding: 1.4rem 1.5rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.hero-stat .val, .stat-cell .val {
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}
.hero-stat .val.green, .stat-cell .val.green { color: var(--green); }
.hero-stat .val.orange, .stat-cell .val.orange { color: var(--text); }
.hero-stat .val.purple, .stat-cell .val.purple { color: var(--text); }
.hero-stat .lbl, .stat-cell .lbl { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.03em; color: var(--muted); line-height: 1.5; text-transform: uppercase; }

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */
section { padding: 4.2rem 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }

.section-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.section-label::before { content: ''; width: 24px; height: 1px; background: var(--green); }

section > p { color: var(--text-dim); max-width: 680px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 2rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-strong); background: var(--surface-hi); transform: translateY(-2px); }
.card h3 { font-size: 1.02rem; color: var(--text); margin-bottom: 0.6rem; letter-spacing: -0.01em; }
.card p { font-size: 0.92rem; color: var(--text-dim); margin-bottom: 0; }

/* tag pills — data encoding */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 6px 6px 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}
.tag-win, .tg-win  { color: var(--green); background: rgba(76,227,131,0.08); border-color: rgba(76,227,131,0.22); }
.tag-lose, .tg-fail { color: var(--red); background: rgba(224,101,95,0.08); border-color: rgba(224,101,95,0.22); }
.tag-info, .tg-info { color: var(--blue); background: rgba(106,174,222,0.08); border-color: rgba(106,174,222,0.22); }
.tag-note, .tg-note { color: var(--amber); background: rgba(217,169,64,0.08); border-color: rgba(217,169,64,0.22); }
.tag-nvidia { color: var(--purple); background: rgba(160,145,214,0.08); border-color: rgba(160,145,214,0.22); }

/* ---------------------------------------------------------------
   Data table
   --------------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 1.2rem; }
.data-table th {
  text-align: left; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border-strong); font-weight: 500;
}
.data-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.data-table tr:hover td { background: var(--surface); }
.val-good { color: var(--green); }
.val-red { color: var(--red); }
.val-accent { color: var(--purple); }
.val-amber { color: var(--amber); }
.val-faint { color: var(--faint); }

/* ---------------------------------------------------------------
   Bar chart
   --------------------------------------------------------------- */
.bar-chart { margin-top: 1rem; }
.bar-row { display: grid; grid-template-columns: 190px 1fr 80px; align-items: center; gap: 12px; margin-bottom: 9px; }
.bar-label { font-size: 0.7rem; color: var(--text-dim); text-align: right; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 6px; background: rgba(226,240,222,0.05); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }
.bar-fill.green { background: var(--green); }
.bar-fill.orange { background: var(--orange); }
.bar-fill.red { background: var(--red); }
.bar-val { font-family: var(--mono); font-size: 0.74rem; font-weight: 500; text-align: right; }

/* ---------------------------------------------------------------
   Notes / callouts
   --------------------------------------------------------------- */
.note {
  border-left: 2px solid var(--green-dim);
  padding: 0.95rem 1.2rem;
  margin: 1.4rem 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note strong { color: var(--text); }
.warn { border-left-color: var(--orange); }
.win-note { border-left-color: var(--green); }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2.2rem max(24px, calc((100vw - 1120px) / 2)) 2.6rem;
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.03em; color: var(--muted);
}
footer.site-footer .footer-links { display: flex; gap: 1.3rem; flex-wrap: wrap; }
footer.site-footer a { color: var(--muted); text-decoration: none; }
footer.site-footer a:hover { color: var(--green); }

@media (max-width: 700px) {
  .site-header { height: auto; flex-direction: column; gap: 0.6rem; align-items: flex-start; padding: 0.9rem 20px; }
  .header-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem; }
  .site-nav { gap: 1.1rem; }
  .status-dot { white-space: nowrap; }
  .bar-row { grid-template-columns: 110px 1fr 60px; }
  .bar-label { font-size: 0.6rem; }
  .hero { padding: 4rem 0 3rem; }
}

/* ============================================================
   Interaction layer
   ============================================================ */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a3128; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }
* { scrollbar-width: thin; scrollbar-color: #2a3128 var(--bg); }

.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  background: var(--green);
  transform: scaleX(0); transform-origin: left center;
}

/* entrance stagger */
@keyframes stagger-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.stagger-in { opacity: 0; animation: stagger-rise 0.65s cubic-bezier(.2,.7,.2,1) forwards; }

@media (prefers-reduced-motion: reduce) {
  .stagger-in { opacity: 1; animation: none; }
}

/* scroll reveal — only hides content when JS is actually running */
html.js .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(.2,.7,.2,1), transform 0.6s cubic-bezier(.2,.7,.2,1);
}
html.js .reveal.revealed { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

/* section label tick draws in */
.section-label::before { width: 0; transition: width 0.5s ease 0.1s; }
.reveal.revealed .section-label::before, .section-label.revealed::before { width: 24px; }

/* legacy hooks kept inert — markup still carries these classes */
.tilt, .magnetic { }
.canvas-wrap { display: none; }

/* ---------------------------------------------------------------
   Hero trajectory chart — instrument panel, high contrast
   --------------------------------------------------------------- */
.traj {
  margin-top: 3.2rem; position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem 1.3rem;
}
.traj-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding-bottom: 1rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--border);
}
.traj-head .t { color: var(--text); display: flex; align-items: center; gap: 0.6rem; }
.traj-head .t::before { content: ''; width: 8px; height: 8px; background: var(--green); }
.traj-head a { color: var(--muted); text-decoration: none; letter-spacing: 0.08em; }
.traj-head a:hover { color: var(--green); }
.traj svg { width: 100%; height: auto; display: block; overflow: visible; }
.traj .axis { font-family: var(--mono); font-size: 13px; fill: var(--muted); letter-spacing: 0.06em; }
.traj .pt-label { font-family: var(--mono); font-size: 15px; font-weight: 500; fill: #ffffff; }
.traj .pt-label.hot { fill: var(--green-neon); }
.traj .pt-label.cold { fill: #ff8d86; }
.traj .pt-sub { font-family: var(--mono); font-size: 12px; fill: var(--text-dim); }
.traj .gridline { stroke: rgba(226,240,222,0.14); stroke-width: 1; stroke-dasharray: 3 5; }
.traj .traj-line {
  stroke: var(--green-neon); stroke-width: 2.6; fill: none;
  stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(76,227,131,0.55));
}
.traj .traj-area { fill: url(#trajFill); }
.traj .traj-dot { fill: #10130f; stroke: var(--green-neon); stroke-width: 2.2; }
.traj .traj-dot.cold { stroke: #ff8d86; }
.traj .traj-dot.now { fill: var(--green-neon); stroke: #ffffff; filter: drop-shadow(0 0 8px rgba(91,255,157,0.9)); }
.traj-caption { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 1.1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 700px) {
  .traj { padding: 0.9rem 1rem 1rem; }
  .traj .axis { font-size: 27px; }
  .traj .pt-label { font-size: 36px; }
  .traj .pt-sub { display: none; }
  .traj .traj-line { stroke-width: 4.5; }
  .traj .traj-dot { stroke-width: 4; r: 9; }
}
@media (prefers-reduced-motion: no-preference) {
  .traj.animate .traj-line { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: traj-draw 2.2s cubic-bezier(.4,0,.2,1) 0.35s forwards; }
  .traj.animate .traj-dot, .traj.animate .pt-label, .traj.animate .pt-sub { opacity: 0; animation: traj-pop 0.4s ease forwards; }
  @keyframes traj-draw { to { stroke-dashoffset: 0; } }
  @keyframes traj-pop { to { opacity: 1; } }
}

/* ---------------------------------------------------------------
   Command palette (Ctrl/Cmd+K)
   --------------------------------------------------------------- */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(6,8,6,0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh;
  opacity: 0; pointer-events: none; transition: opacity 0.16s ease;
}
.cmdk-overlay.open { opacity: 1; pointer-events: auto; }
.cmdk-box {
  width: min(560px, 90vw); background: var(--bg-alt); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(-8px) scale(0.99); transition: transform 0.16s ease;
  overflow: hidden;
}
.cmdk-overlay.open .cmdk-box { transform: translateY(0) scale(1); }
.cmdk-input-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.95rem 1.1rem; border-bottom: 1px solid var(--border); }
.cmdk-input-row svg { flex-shrink: 0; opacity: 0.45; }
.cmdk-input {
  flex: 1; background: transparent; border: none; outline: none; color: var(--text);
  font-family: var(--sans); font-size: 0.98rem;
}
.cmdk-input::placeholder { color: var(--faint); }
.cmdk-esc { font-family: var(--mono); font-size: 0.62rem; color: var(--faint); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 6px; }
.cmdk-results { max-height: 360px; overflow-y: auto; padding: 0.4rem; }
.cmdk-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.65rem 0.8rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.88rem; color: var(--text-dim);
}
.cmdk-item .t { color: var(--text); font-weight: 500; }
.cmdk-item .k { font-family: var(--mono); font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.cmdk-item.active { background: rgba(76,227,131,0.09); }
.cmdk-item.active .t { color: var(--green); }
.cmdk-empty { padding: 1.4rem; text-align: center; color: var(--muted); font-size: 0.86rem; }

@keyframes flash-highlight {
  0%, 100% { box-shadow: none; }
  20%, 60% { box-shadow: 0 0 0 1.5px var(--green); }
}
.cmdk-flash { animation: flash-highlight 1.3s ease; border-radius: var(--radius-sm); }

@media (max-width: 700px) {
  .kbd-hint { display: none; }
}
