/* ============================================================
   gunvir.ca — design system
   PostHog-inspired: one cream canvas, hairline + dashed borders,
   one orange, mono eyebrows, tactile buttons. No shadows, no
   gradients, no framework.
   ============================================================ */

:root {
  /* canvas + surfaces */
  --canvas: #EFEEE7;
  --surface: #FDFCF5;
  --surface-2: #E7E5DC;
  --terminal-bg: #1E1F23;
  --terminal-ink: #E8E6DD;

  /* ink — muted/accent-ink shades chosen to clear WCAG AA (4.5:1) at small sizes */
  --ink: #151515;
  --body: #4A4C43;
  --muted: #696B60;

  /* lines */
  --border: #C6C4B9;
  --border-dashed: #CFCDC2;

  /* the one orange (+ a text-safe shade) */
  --accent: #F54E00;
  --accent-ink: #A83700;
  --accent-tint: rgba(245, 78, 0, 0.10);

  /* supporting tints (used only at low opacity) */
  --blue: #1D5BD6;
  --blue-tint: rgba(47, 111, 237, 0.10);
  --yellow: #8F5800;
  --yellow-tint: rgba(247, 165, 1, 0.14);
  --green: #1B6B41;
  --green-tint: rgba(33, 122, 75, 0.10);

  /* buttons — face is darker than the brand orange so white 14.5px text passes AA */
  --btn-face: #C43F00;
  --btn-shadow: #8F2E00;
  --btn-border: #6E2400;
  --btn-ghost-face: var(--surface);
  --btn-ghost-shadow: #C9C7BC;
  --btn-ghost-border: #ADAB9F;

  /* selection */
  --selection-bg: #A83700;
  --selection-fg: #FFFFFF;

  /* canvas texture */
  --grid-line: rgba(21, 21, 21, 0.05);
  --ghost: rgba(21, 21, 21, 0.16);

  /* type */
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --canvas: #1B1C20;
  --surface: #242529;
  --surface-2: #2C2D33;
  --terminal-bg: #131417;
  --terminal-ink: #E8E6DD;

  --ink: #F2F0E7;
  --body: #C6C4BA;
  --muted: #8F9089;

  --border: #3D3E45;
  --border-dashed: #45464E;

  --accent: #FF5A0A;
  --accent-ink: #FF7F45;
  --accent-tint: rgba(255, 90, 10, 0.14);

  --blue: #6E9AFF;
  --blue-tint: rgba(110, 154, 255, 0.14);
  --yellow: #E8B75B;
  --yellow-tint: rgba(232, 183, 91, 0.14);
  --green: #5DBE8C;
  --green-tint: rgba(93, 190, 140, 0.13);

  --btn-face: #C43F00;
  --btn-shadow: #7C2800;
  --btn-border: #5E1F00;
  --btn-ghost-face: var(--surface-2);
  --btn-ghost-shadow: #101114;
  --btn-ghost-border: #4A4B53;

  --selection-bg: #FF7F45;
  --selection-fg: #151515;

  --grid-line: rgba(242, 240, 231, 0.055);
  --ghost: rgba(242, 240, 231, 0.17);

  color-scheme: dark;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--canvas); }
[hidden] { display: none !important; }
body {
  margin: 0;
  background-color: var(--canvas);
  /* engineering paper: grain + a faint blueprint grid (gradients used as
     pattern tools here, never as color fades) */
  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.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 240px 240px, 44px 44px, 44px 44px;
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* theme flips crossfade instead of snapping */
  transition: background-color 250ms ease, color 250ms ease;
}
.nav, .card, .terminal, .footer {
  transition: background-color 250ms ease, border-color 250ms ease;
}
h1, h2, h3 { color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 800; }
h2 { font-size: 1.55rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
::selection { background: var(--selection-bg); color: var(--selection-fg); }

.mono { font-family: var(--font-mono); }
.t-dim { color: var(--muted); }
.container { max-width: 1080px; margin-inline: auto; padding-inline: 24px; }

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

.skip-link {
  position: absolute; left: 24px; top: -48px;
  background: var(--ink); color: var(--canvas);
  padding: 8px 14px; border-radius: 0 0 6px 6px;
  font-family: var(--font-mono); font-size: 13px; text-decoration: none;
  z-index: 100; transition: top 120ms ease;
}
.skip-link:focus { top: 0; color: var(--canvas); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--canvas);
  border-bottom: 1px dashed var(--border-dashed);
}
.nav-inner {
  display: flex; align-items: center; gap: 16px 24px;
  flex-wrap: wrap; /* if links ever don't fit, the bar grows instead of overflowing */
  min-height: 56px;
  padding-block: 8px;
}
.nav-logo {
  font-weight: 600; font-size: 14px; color: var(--ink);
  text-decoration: none;
}
.nav-logo::after {
  content: "▊"; color: var(--accent); margin-left: 2px;
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.nav-links a, .nav-logo {
  display: inline-block; position: relative;
  transition: transform 100ms ease;
}
.nav-links a {
  font-size: 13px; color: var(--body); text-decoration: none;
}
.nav-links a:hover { color: var(--accent-ink); transform: translateY(-1px); }
.nav-links a[aria-current] {
  color: var(--accent-ink);
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px;
}
.nav-logo:hover { transform: translateY(-1px); color: var(--accent-ink); }

/* theme toggle: moon in light mode, sun in dark mode */
.theme-toggle {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; padding: 0;
  transition: transform 100ms ease;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--muted); }
.theme-icon {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset -4.5px -4px 0 0 var(--ink);   /* crescent moon */
}
[data-theme="dark"] .theme-icon {
  box-shadow: none;
  background: var(--yellow);
  outline: 2px dashed var(--yellow);              /* sun + rays */
  outline-offset: 2.5px;
}

/* ---------- archived-lens marker (/0/ wears its museum tag) ---------- */
.archive-note {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  max-width: 1080px; margin: 0 auto;
  padding: 8px 24px;
  font-size: 12px; color: var(--muted);
  border-bottom: 1px dashed var(--border-dashed);
}
.archive-note .chip { flex: none; }
.archive-note-text { flex: 1; min-width: 0; }
.archive-note a { font-weight: 600; white-space: nowrap; }

/* ---------- live ticker (today's signal, under the nav) ---------- */
.ticker {
  display: flex; align-items: center; gap: 10px;
  max-width: 1080px; margin-inline: auto;
  padding: 9px 24px;
  font-size: 12px; color: var(--body);
  text-decoration: none;
  border-bottom: 1px dashed var(--border-dashed);
  white-space: nowrap; overflow: hidden;
}
.ticker:hover { color: var(--accent-ink); background: var(--surface); }
.ticker-dot {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.ticker-label { font-weight: 600; letter-spacing: 0.09em; color: var(--accent-ink); flex: none; }
/* date first and non-shrinking: on narrow screens the ellipsis eats the
   title, never the date */
.ticker-date { flex: none; color: var(--muted); }
#ticker-text { overflow: hidden; text-overflow: ellipsis; }
.ticker-arrow { flex: none; color: var(--muted); }

.page-title { font-size: clamp(1.8rem, 4vw, 2.4rem); }

/* ---------- scroll progress (the 2px HUD line) ---------- */
#progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  height: 2px; width: 0;
  background: var(--accent);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 48px; align-items: center;
  padding-block: 72px 64px;
}
#dotfield {
  position: absolute; inset: 0;
  width: 100%; height: 100%; /* canvas is replaced: inset alone won't stretch it */
  z-index: 0; pointer-events: none;
}
.hero-copy, .hero .terminal { position: relative; z-index: 1; }

.avatar-hero {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--border);
  margin-bottom: 0.9rem;
}
.hero-facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 0.4rem 0 1.5rem; }
.fact {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}
.fact-label { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; color: var(--accent-ink); }
.fact-value { font-weight: 700; color: var(--ink); font-size: 15px; }
.fact-edu { border-left: 3px solid var(--accent); }

.clock { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent-ink);
  margin: 0 0 0.75rem;
}
/* the persona trio doubles as the cross-theme switcher */
.persona a {
  color: inherit; text-decoration: none;
  border-bottom: 1px dashed var(--border);
  transition: border-color 100ms ease, color 100ms ease;
}
.persona a:hover { color: var(--accent); border-bottom-color: var(--accent); }
h1 em { font-style: normal; color: var(--accent-ink); }
.hero-sub { font-size: 1.05rem; max-width: 46ch; }
.hero-sub strong { color: var(--ink); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 1.4rem 0 1rem; }
.hero-meta { font-size: 12.5px; color: var(--muted); margin: 0; }

/* the one deliberately dark element on the light page */
.terminal {
  background: var(--terminal-bg);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
}
[data-theme="dark"] .terminal { border-color: var(--border); }
.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.terminal-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #4A4B52; }
.terminal-bar .dot:first-child { background: var(--accent); }
.terminal-title {
  margin-left: 8px; font-family: var(--font-mono);
  font-size: 11px; color: #8F9089;
}
.terminal-body {
  margin: 0; padding: 16px 16px 6px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.75;
  color: var(--terminal-ink);
  white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow-y: auto;
  cursor: text;
}
.t-prompt { color: var(--accent); font-weight: 600; }
.terminal-body .t-dim { color: #8F9089; }

/* the prompt is real — type `help` */
.terminal-form {
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 2px 16px 14px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.75;
  cursor: text;
}
.terminal-form input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; padding: 0;
  color: var(--terminal-ink); font: inherit;
  caret-color: var(--accent);
}
.terminal-form input:focus { outline: none; } /* the terminal border lights up instead */
.terminal-form input::placeholder { color: #8F9089; }
.terminal:focus-within { border-color: var(--accent); }

/* ---------- shared section bits ---------- */
.divider { border: none; border-top: 1px dashed var(--border-dashed); margin: 0 auto; }
.section { padding-block: 72px; scroll-margin-top: 40px; } /* clear the sticky nav on anchor jumps */

/* ghost section numerals — blueprint page markers */
.section[data-num] { position: relative; z-index: 0; }
.section[data-num]::after {
  content: attr(data-num);
  position: absolute; top: 40px; right: 12px; z-index: -1;
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(4.5rem, 10vw, 8rem); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ghost);
  letter-spacing: 0.04em;
  pointer-events: none; user-select: none;
}

/* eyebrows get a schematic rule running to the margin */
.section > .eyebrow, .hero-copy > .eyebrow {
  display: flex; align-items: center; gap: 14px;
}
.section > .eyebrow::after, .hero-copy > .eyebrow::after {
  content: ""; flex: 1;
  border-top: 1px dashed var(--border-dashed);
}
.section-sub { max-width: 62ch; margin-bottom: 2rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
}

/* crop-mark corners on interactive cards — CAD drawing energy */
.work-card, .pillar { position: relative; }
.work-card::before, .pillar::before, .work-card::after, .pillar::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  pointer-events: none;
  border: 0 solid var(--border);
  transition: border-color 150ms ease;
}
.work-card::before, .pillar::before { top: 6px; left: 6px; border-top-width: 1.5px; border-left-width: 1.5px; }
.work-card::after, .pillar::after { bottom: 6px; right: 6px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.work-card:hover::before, .work-card:hover::after,
.pillar:hover::before, .pillar:hover::after { border-color: var(--accent); }

.chip {
  display: inline-block; padding: 1px 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 3px;
}
.chip-orange { background: var(--accent-tint); color: var(--accent-ink); }
.chip-dashed { border: 1px dashed var(--border); color: var(--muted); background: none; }

/* project thumbnail — bleeds to the card's own padding, same radius as the card */
.card-img {
  display: block;
  width: calc(100% + 48px);
  margin: -24px -24px 16px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
}
/* award thumbnail — small, rounded, sits beside the award name */
.award-thumb {
  width: 46px; height: 46px; flex: none;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.award-left { display: flex; align-items: center; gap: 12px; }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding-block: 40px;
  text-align: center;
}
.stat { display: grid; gap: 2px; }
.stat-n {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 600;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.stat-l { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- pillars ---------- */
.pillars { padding-block: 64px; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar { transition: transform 120ms ease, background-color 250ms ease, border-color 250ms ease; }
.pillar h3 { margin-top: 0.1rem; }
.pillar p:last-of-type { margin-bottom: 0; }
.pillar-tags { font-size: 12px; color: var(--muted); margin-top: 0.9rem; }

/* ---------- work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.work-wide { grid-column: span 2; }
.work-card { transition: transform 100ms ease, border-color 100ms ease, background-color 250ms ease; }
.work-card:hover { transform: translateY(-2px); border-color: var(--muted); }
.work-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.work-head h3 { margin-bottom: 0.4rem; }
.work-tags { font-size: 12px; color: var(--muted); margin: 0; }
.work-links { margin: 0.6rem 0 0; font-size: 14px; }
.work-links a { font-weight: 600; text-decoration: none; }
.work-links a:hover { text-decoration: underline; }
.work-card p { margin-bottom: 0.4rem; }

.more-work { margin-top: 28px; }
.more-work summary {
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--accent-ink); list-style: none;
  display: inline-block; padding: 8px 14px;
  border: 1px dashed var(--border); border-radius: 6px;
  transition: transform 100ms ease;
  -webkit-user-select: none; user-select: none;
}
.more-work summary::-webkit-details-marker { display: none; }
.more-work summary::before { content: "▸ "; color: var(--muted); }
.more-work[open] summary::before { content: "▾ "; }
.more-work summary:hover { transform: translateY(-1px); border-color: var(--muted); }

.more-list { list-style: none; margin: 16px 0 0; padding: 0; }
.more-list li {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) 1.6fr minmax(130px, 0.7fr) 24px;
  gap: 12px; align-items: baseline;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--border-dashed);
  font-size: 14px;
}
.more-list li:last-child { border-bottom: none; }
.more-name { color: var(--ink); font-weight: 600; }
.more-desc { color: var(--body); }
.more-tech { font-size: 12px; color: var(--muted); }
.more-list a { text-decoration: none; font-weight: 600; }

/* ---------- clickable project cards + more-list rows ---------- */
.proj { cursor: pointer; }
.proj:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-list li.proj:hover { background: var(--surface); }

/* ---------- project detail modal ---------- */
dialog.pmodal {
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(640px, 90vw);
  max-height: 85vh;
  color: var(--body);
}
dialog.pmodal::backdrop { background: rgba(21, 21, 21, 0.45); }
@media (prefers-reduced-motion: no-preference) {
  dialog.pmodal { animation: pmodal-in 200ms ease; }
  @keyframes pmodal-in {
    from { opacity: 0; transform: translateY(8px); }
  }
}
.pmodal__panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  max-height: 85vh;
  overflow-y: auto;
}
.pmodal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}
.pmodal__close:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.pmodal__eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-ink);
  margin: 0 2rem 0.5rem 0;
}
.pmodal__title { margin: 0 2rem 0.9rem 0; }
.pmodal__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}
.pmodal__gallery img {
  width: 100%;
  aspect-ratio: 16 / 10; /* height derives from width — robust in a grid regardless of load state */
  height: auto;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.pmodal__desc { font-size: 14.5px; line-height: 1.6; margin: 0 0 1.1rem; }
.pmodal__links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.pmodal__links a {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px;
}
.pmodal__links a:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

/* ---------- feed ---------- */
.feed { border-top: 1px solid var(--border); }
.feed-loading { padding: 20px 0; font-size: 13px; color: var(--muted); }
.feed-error { padding: 20px 0; font-size: 14px; }

.feed-entry {
  display: grid;
  grid-template-columns: 110px 64px 1fr;
  gap: 16px;
  padding: 18px 12px;
  margin-inline: -12px; /* hover surface aligns with the text column */
  border-bottom: 1px dashed var(--border-dashed);
  border-radius: 6px;
  transition: background-color 150ms ease;
}
.feed-entry:hover { background: var(--surface); }
.feed-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.feed-badge {
  align-self: start; justify-self: start;
  padding: 1px 7px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 2px;
}
.feed-badge[data-type="til"] { background: var(--yellow-tint); color: var(--yellow); }
.feed-badge[data-type="news"] { background: var(--blue-tint); color: var(--blue); }
.feed-badge[data-type="link"] { background: var(--green-tint); color: var(--green); }
.feed-badge[data-type="tweet"] { background: var(--accent-tint); color: var(--accent-ink); }
.feed-badge[data-type="screenshot"] { background: var(--surface); color: var(--muted); }

/* entry screenshots: hairline frame, no shadow — click opens the raw file */
.feed-img-link { display: inline-block; margin: 0.35rem 0 0.15rem; }
.feed-img {
  display: block;
  max-width: min(100%, 320px);
  max-height: 190px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.feed-img-link:hover .feed-img,
.feed-img-link:focus-visible .feed-img { border-color: var(--accent); }

.feed-body { min-width: 0; overflow-wrap: anywhere; } /* agent-written titles can contain long hashes/URLs */
.feed-title { font-weight: 700; font-size: 15.5px; color: var(--ink); margin: 0 0 0.25rem; }
.feed-title a { color: inherit; text-decoration: none; }
.feed-title a:hover { color: var(--accent-ink); text-decoration: underline; }
.feed-summary { font-size: 14.5px; margin: 0 0 0.35rem; }
.feed-source { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin: 0; }

.feed-entry[data-fallback="true"] { border-left: 2px dashed var(--border); padding-left: 12px; }
.feed-entry[data-fallback="true"] .feed-source::after { content: " · from the evergreen backlog"; }

.feed-foot { display: flex; align-items: center; gap: 20px; margin-top: 20px; }
.feed-rss { font-size: 12px; text-decoration: none; font-weight: 600; }

/* ---------- experience ---------- */
.exp-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; }
.exp-heading {
  font-size: 12px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 1rem;
}
.exp-col > .exp-heading:not(:first-child) { margin-top: 2rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 22px 22px;
  border-left: 1px dashed var(--border);
}
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: ""; position: absolute; left: -4.5px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--canvas); border: 2px solid var(--accent);
}
.tl-role { color: var(--ink); margin: 0 0 0.15rem; font-size: 15.5px; }
.tl-meta { font-size: 12px; color: var(--muted); margin: 0 0 0.35rem; }
.tl-desc { font-size: 14.5px; margin: 0; }

.edu-card { margin-bottom: 0.5rem; }
.edu-card .tl-desc { margin-bottom: 0; }
.edu-card p { margin-bottom: 0.3rem; }
.edu-loud { border-left: 3px solid var(--accent); }
.edu-school { font-size: 1.35rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin: 0 0 0.3rem; }

.awards { list-style: none; margin: 0; padding: 0; }
.award {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--border-dashed);
  font-size: 14.5px;
}
.award-name { color: var(--ink); font-weight: 600; }
.awards-note { font-size: 12px; color: var(--muted); margin-top: 0.8rem; }

/* ---------- contact ---------- */
.contact {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px;
  margin-block: 40px 72px;
}
.contact > .eyebrow::after { border-color: var(--border); }
.contact-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 1.4rem; }
.contact-links { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.contact-links a {
  display: inline-block; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: transform 100ms ease;
}
.contact-links a:hover { transform: translateY(-1px); text-decoration: underline; }

/* ---------- footer ---------- */
.footer { border-top: 1px dashed var(--border-dashed); }
.footer-inner {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-block: 28px;
}
.footer-inner p { margin: 0; font-size: 12.5px; color: var(--muted); }
.footer-inner a { font-weight: 600; }

/* ---------- 3D pressable buttons (the PostHog trick) ---------- */
.btn {
  display: inline-block;
  padding: 0; border: none;
  background: var(--btn-shadow);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-sans); font-size: 14.5px; font-weight: 700;
  transition: transform 150ms ease; /* magnetic pull eases back on leave */
}
.btn > span {
  display: block;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--btn-border);
  transform: translateY(-2.5px);
  transition: transform 100ms ease;
}
.btn:hover > span { transform: translateY(-4px); }
/* full press, near-instant: the sound-free click */
.btn:active > span { transform: translateY(0); transition-duration: 45ms; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary > span { background: var(--btn-face); color: #FFFFFF; }
.btn-ghost { background: var(--btn-ghost-shadow); }
.btn-ghost > span {
  background: var(--btn-ghost-face); color: var(--ink);
  border-color: var(--btn-ghost-border);
}

/* ---------- scroll reveals (JS adds .revealed; no JS = nothing hidden) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] {
    opacity: 0; transform: translateY(16px);
    transition: opacity 500ms ease, transform 500ms cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  html.js [data-reveal].revealed { opacity: 1; transform: none; }
}

/* ---------- theme variant switcher ---------- */
.theme-switch {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  display: flex; gap: 9px; align-items: center;
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
}
.theme-switch a {
  text-decoration: none; font-weight: 600; color: var(--muted);
  transition: color 100ms ease;
}
.theme-switch a:hover { color: var(--accent-ink); }
.theme-switch a[aria-current] {
  color: var(--accent-ink);
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-block: 56px 48px; }
  .pillar-grid { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
}
@media (max-width: 720px) {
  .section { padding-block: 56px; }
  .contact { padding: 32px 20px; margin-block: 24px 56px; }
  .section[data-num]::after { font-size: 3.4rem; top: 28px; }
  .work-grid { grid-template-columns: 1fr; }
  .work-wide { grid-column: auto; }
  .more-list li { grid-template-columns: 1fr 24px; }
  .more-desc, .more-tech { grid-column: 1; }
  .more-list a { grid-row: 1; grid-column: 2; }
  .feed-entry { grid-template-columns: 1fr; gap: 4px; }
  .feed-date { order: 2; }
  .feed-badge { order: 1; }
  .feed-body { order: 3; }
  .nav-links { gap: 14px; }
}
@media (max-width: 520px) {
  /* compress rather than hide — every section stays reachable on phones.
     Row 1: logo + toggle. Row 2: all four links. */
  .nav-inner { gap: 6px 14px; }
  .theme-toggle { order: 2; margin-left: auto; }
  .nav-links { order: 3; flex-basis: 100%; margin-left: 0; gap: 12px; }
  .nav-links a { font-size: 12px; }
  .nav-logo { font-size: 13px; }
}

/* ---------- motion prefs ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover > span, .btn:active > span { transform: translateY(-2.5px); }
  .work-card:hover, .nav-links a:hover, .contact-links a:hover,
  .nav-logo:hover, .theme-toggle:hover, .more-work summary:hover { transform: none; }
  .nav-logo::after { animation: none; }
  .ticker-dot { animation: none; }
  #dotfield { display: none; }
}
