/* ==========================================================================
   Abhijith Sharma — portfolio stylesheet
   Plain CSS, no build step. Tokens first, then components, then pages.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* ---------- Tokens ---------- */
:root {
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-hand: 'Caveat', 'Bradley Hand', 'Segoe Script', cursive;

  /* paper (light) */
  --bg: #F3F0E8;
  --card: #FBFAF6;
  --card-2: #F1EEE6;
  --ink: #17160F;
  --ink-2: #44413A;
  --muted: #7B776D;
  --line: #E3DED3;
  --line-2: #CDC7BA;
  --dot: rgba(23, 22, 15, 0.11);
  --shadow: 0 1px 2px rgba(23,22,15,.04), 0 14px 34px -18px rgba(23,22,15,.22);
  --shadow-hover: 0 2px 4px rgba(23,22,15,.05), 0 22px 44px -18px rgba(23,22,15,.28);

  /* pen (accent): green by default, see [data-pen] below */
  --accent: #2D7638;
  --accent-ink: #245F2E;
  --accent-soft: rgba(45, 118, 56, 0.12);
  --accent-contrast: #FFFFFF;

  --ok: #1E7A4C;
  --radius: 18px;
  --radius-sm: 10px;
  --gap: 14px;
  --max: 1180px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121210;
  --card: #1B1B18;
  --card-2: #23231F;
  --ink: #F1EEE6;
  --ink-2: #CBC6BB;
  --muted: #8E897D;
  --line: #2C2C27;
  --line-2: #3D3C35;
  --dot: rgba(241, 238, 230, 0.09);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 14px 34px -18px rgba(0,0,0,.7);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.4), 0 22px 44px -18px rgba(0,0,0,.8);
  --accent: #79BF83;
  --accent-ink: #98D3A0;
  --accent-soft: rgba(121, 191, 131, 0.16);
  --accent-contrast: #141412;
  --ok: #4FCB8E;
  color-scheme: dark;
}

:root[data-pen="red"] { --accent: #C4361B; --accent-ink: #A12C14; --accent-soft: rgba(196, 54, 27, 0.10); }
:root[data-theme="dark"][data-pen="red"] { --accent: #FF6B4A; --accent-ink: #FF8E74; --accent-soft: rgba(255, 107, 74, 0.15); }

:root[data-pen="blue"] { --accent: #2156E0; --accent-ink: #1A47BC; --accent-soft: rgba(33, 86, 224, 0.11); }
:root[data-theme="dark"][data-pen="blue"] { --accent: #6F93FF; --accent-ink: #8FAAFF; --accent-soft: rgba(111, 147, 255, 0.16); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Base ---------- */
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 22px 22px;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s ease, color .25s ease;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 42% at 50% -8%, var(--accent-soft), transparent 70%);
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--ink); letter-spacing: -0.015em; }
strong { color: var(--ink); font-weight: 600; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-contrast); }

.skip { position: absolute; left: -999px; top: 10px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mono { font-family: var(--font-mono); }
.hand {
  font-family: var(--font-hand);
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1.05;
  font-weight: 500;
}
.label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.label.plain::before { display: none; }

/* ---------- Nav ---------- */
.nav {
  max-width: var(--max); margin: 0 auto; padding: 18px 20px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-contrast);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 17px;
  box-shadow: 2px 2px 0 var(--ink);
}
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand .sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: block; margin-top: -2px; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.tabs {
  display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow);
}
.tab {
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2);
  text-decoration: none; white-space: nowrap; transition: background .15s, color .15s;
}
.tab:hover { background: var(--card-2); color: var(--ink); }
.tab[aria-current="page"] { background: var(--ink); color: var(--bg); }
.tab[aria-current="page"]:hover { color: var(--bg); }
.tab .ext { font-size: 11px; opacity: .7; margin-left: 2px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; color: var(--ink); cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
:root[data-theme="dark"] .icon-btn .sun, :root:not([data-theme="dark"]) .icon-btn .moon { display: none; }

/* ---------- Bento grid ---------- */
.bento {
  max-width: var(--max); margin: 10px auto 0; padding: 0 20px;
  display: grid; gap: var(--gap); grid-template-columns: 1fr;
}
@media (min-width: 680px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(96px, auto);
    grid-template-areas:
      "intro   intro"
      "edu     edu"
      "now     clock"
      "focus   pubs"
      "focus   pubs"
      "stack   contact"
      "news    news"
      "journey journey"
      "code    fun";
  }
  .a-intro { grid-area: intro; } .a-edu { grid-area: edu; } .a-focus { grid-area: focus; } .a-now { grid-area: now; }
  .a-clock { grid-area: clock; } .a-pubs { grid-area: pubs; } .a-stack { grid-area: stack; }
  .a-contact { grid-area: contact; } .a-news { grid-area: news; } .a-journey { grid-area: journey; }
  .a-code { grid-area: code; } .a-fun { grid-area: fun; }
}
@media (min-width: 1024px) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(104px, auto);
    grid-template-areas:
      "intro   intro   intro   edu"
      "intro   intro   intro   now"
      "intro   intro   intro   clock"
      "focus   pubs    pubs    stack"
      "focus   pubs    pubs    stack"
      "focus   pubs    pubs    contact"
      "journey journey news    news"
      "journey journey news    news"
      "code    fun     news    news";
  }
}

/* ---------- Card ---------- */
.card {
  position: relative; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background-color .25s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card { isolation: isolate; }
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity .3s ease;
}
.card:hover::before { opacity: 1; }
.card.is-hidden { opacity: 0; }
.card > h2 { font-size: 19px; font-weight: 700; }
.card .corner {
  position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; color: var(--muted);
  transition: color .15s, transform .15s;
}
.card:hover .corner { color: var(--accent); transform: translate(2px, -2px); }
.card-link { position: absolute; inset: 0; border-radius: inherit; }
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Intro ---------- */
.a-intro { padding: 26px; }
.intro-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; height: 100%; }
@media (min-width: 760px) { .intro-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; } }
@media (min-width: 1024px) { .intro-grid { align-items: center; } }
.intro-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.greet { font-size: 1.5rem; transform: rotate(-1.5deg); transform-origin: left; display: inline-block; }
.headline {
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  font-size: clamp(28px, 4.3vw, 44px); line-height: 1.06; letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 96;
}
.headline .u-hand { position: relative; display: inline-block; white-space: nowrap; }
.headline .u-hand svg { position: absolute; left: -2px; right: -2px; bottom: -7px; width: calc(100% + 4px); height: 12px; color: var(--accent); overflow: visible; }
.headline .u-hand path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.3,.8,.3,1) .7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.headline .line2 { display: block; margin-top: 6px; color: var(--ink-2); font-weight: 600; }
.headline .type { color: var(--accent-ink); }
.headline .caret { display: inline-block; width: 3px; height: .9em; background: var(--accent); margin-left: 2px; vertical-align: -0.08em; animation: blink 1s steps(1) infinite; border-radius: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.intro-copy p { font-size: 14.5px; max-width: 60ch; }
.intro-copy p a { font-weight: 500; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.venues { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.venues .label { margin-right: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 13px; font-weight: 500;
  text-decoration: none; box-shadow: 2px 2px 0 var(--line-2); cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s, color .12s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); box-shadow: 2px 2px 0 var(--accent); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: 2px 2px 0 var(--accent); }
.btn.primary:hover { color: var(--bg); }

/* avatar */
.avatar-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.avatar-wrap { position: relative; width: 260px; height: 260px; margin: 0 auto; perspective: 900px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 48s linear infinite; }
.ring text { font-family: var(--font-mono); font-size: 12.2px; letter-spacing: .22em; fill: var(--muted); text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-float { position: absolute; inset: 0; animation: levitate 5.5s ease-in-out infinite; transform-style: preserve-3d; }
.avatar-3d { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.back-mark {
  position: absolute; left: 42px; top: 42px; width: 176px; height: 176px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 84px;
  color: var(--accent-contrast); letter-spacing: -0.04em; text-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.disc {
  position: absolute; left: 42px; top: 42px; width: 176px; height: 176px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 55%, var(--card)), color-mix(in srgb, var(--accent) 78%, var(--ink)) 95%);
  box-shadow: inset 0 -10px 24px rgba(0,0,0,.12), 0 18px 36px -20px rgba(0,0,0,.5);
}
.avatar {
  position: absolute; left: 30px; top: 18px; width: 200px; height: 200px;
  clip-path: path('M12 0 H188 V112 A88 88 0 0 1 12 112 Z');
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.18));
}
@keyframes levitate { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(5px); } }
.stamp {
  position: absolute; right: 10px; bottom: 30px; transform: rotate(-12deg); z-index: 2;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; font-weight: 500;
  color: var(--accent); background: var(--card); padding: 4px 8px; border-radius: 6px;
  border: 2px solid var(--accent); box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--accent);
  animation: stamp-in .5s cubic-bezier(.2,1.4,.4,1) 1.4s both;
}
@keyframes stamp-in { from { transform: rotate(-12deg) scale(1.8); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
.annot { display: flex; align-items: flex-start; gap: 6px; pointer-events: none; margin-left: -18px; }
.annot .hand { transform: rotate(-3deg); padding-top: 10px; }
.annot svg { width: 36px; height: 36px; flex: none; color: var(--accent); overflow: visible; }

/* ---------- Education ---------- */
.edu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.edu li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 11px 0; border-top: 1px dashed var(--line-2); align-items: start; }
.edu li:first-child { border-top: 0; padding-top: 2px; }
.edu strong { display: block; font-family: var(--font-display); font-size: 14.5px; color: var(--ink); line-height: 1.25; }
.edu .deg { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.edu .note { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 3px; }
.edu .note a { color: var(--ink-2); }
.logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 4px; }
.a-edu .hand { margin-top: auto; align-self: flex-end; transform: rotate(-2deg); }

/* ---------- Threads (research focus) ---------- */
.threads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.threads li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 11px 0; border-top: 1px dashed var(--line-2); }
.threads li:first-child { border-top: 0; padding-top: 2px; }
.threads .n { font-family: var(--font-mono); font-size: 11px; color: var(--accent); padding-top: 3px; }
.threads strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.threads p { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.a-focus .hand { margin-top: auto; align-self: flex-end; transform: rotate(-3deg); }

/* ---------- Now / clock ---------- */
.a-now .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: .7; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { to { transform: scale(2); opacity: 0; } }
.a-now time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.a-now p { font-size: 13.5px; }
.clock { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.clock-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.clock-you { font-size: 12.5px; color: var(--ink-2); border-top: 1px dashed var(--line-2); padding-top: 8px; margin-top: auto; display: flex; justify-content: space-between; gap: 8px; }
.clock-you b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }

/* ---------- Selected work ---------- */
.pubs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pubs li { padding: 10px 0; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.pubs li:first-child { border-top: 0; padding-top: 0; }
.pubs .t { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.pubs .t:hover { color: var(--accent-ink); }
.pubs .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pubs .tldr { font-size: 13px; color: var(--ink-2); }
.badge {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap;
}
.more { font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: none; margin-top: auto; align-self: flex-start; }
.more:hover { color: var(--accent-ink); }
.more::after { content: ' →'; }

/* ---------- Toolbox ---------- */
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack .g { display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-family: var(--font-mono); font-size: 11.5px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2); transition: border-color .12s, color .12s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- Contact ---------- */
.a-contact h2 { font-size: 21px; line-height: 1.15; }
.kv { margin: 0; display: grid; gap: 8px; }
.kv dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0 0 4px; font-size: 14px; color: var(--ink); }
.copy { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-decoration: underline dotted; text-underline-offset: 3px; word-break: break-all; text-align: left; position: relative; }
.copy:hover { color: var(--accent-ink); }
.copy::after { content: 'copied ✓'; position: absolute; left: 0; top: -22px; font-family: var(--font-mono); font-size: 11px; color: var(--accent); opacity: 0; transition: opacity .15s, transform .15s; transform: translateY(4px); }
.copy.copied::after { opacity: 1; transform: none; }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.links a { text-decoration: none; font-size: 14px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; width: fit-content; transition: transform .12s, color .12s; }
.links a:hover { color: var(--accent-ink); transform: translateX(3px); }
.links a::after { content: '↗'; font-size: 11px; color: var(--muted); }
.a-contact .hand { margin-top: auto; transform: rotate(-2deg); }

/* ---------- Changelog ---------- */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line-2); font-size: 13.5px; }
.log li:first-child { border-top: 0; padding-top: 0; }
.log time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding-top: 3px; }
.log a { color: var(--ink); font-weight: 500; }

/* ---------- Journey ---------- */
.journey { list-style: none; margin: 6px 0 0; padding: 0; position: relative; display: grid; gap: 10px; }
.journey li { position: relative; padding-left: 22px; }
.journey .logo { width: 30px; height: 30px; border-radius: 8px; margin-bottom: 6px; }
.journey li::before { content: ''; position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--accent); }
.journey li::after { content: ''; position: absolute; left: 5px; top: 20px; bottom: -14px; width: 1.5px; background: var(--line-2); }
.journey li:last-child::after { display: none; }
.journey .y { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: block; }
.journey strong { display: block; font-family: var(--font-display); font-size: 14.5px; }
.journey span.d { font-size: 12.5px; color: var(--ink-2); }
@media (min-width: 680px) {
  .journey { grid-template-columns: repeat(4, 1fr); gap: 12px; padding-top: 18px; }
  .journey li { padding-left: 0; }
  .journey li::before { top: -18px; left: 0; }
  .journey li::after { top: -13px; left: 14px; right: -12px; bottom: auto; width: auto; height: 1.5px; }
}
.a-journey .hand { position: absolute; right: 22px; top: 18px; transform: rotate(-2deg); font-size: 1.2rem; }
@media (max-width: 679px) { .a-journey .hand { display: none; } }

/* ---------- Code / off the clock ---------- */
.repos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.repos a { text-decoration: none; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: baseline; font-size: 13.5px; }
.repos a b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); font-size: 12.5px; }
.repos a span { color: var(--muted); font-size: 12px; text-align: right; }
.repos a:hover b { color: var(--accent-ink); }
.a-fun p { font-size: 13.5px; }
.a-fun .lang { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: auto; }

/* ---------- Footer ---------- */
.foot { max-width: var(--max); margin: 0 auto; padding: 26px 20px 44px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; font-size: 12.5px; color: var(--muted); }
.foot .meta { font-family: var(--font-mono); font-size: 11px; }
.pens { display: flex; align-items: center; gap: 8px; }
.pens .hand { font-size: 1.15rem; transform: rotate(-3deg); }
.pen { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1.5px var(--line-2); cursor: pointer; padding: 0; transition: transform .12s, box-shadow .12s; }
.pen:hover { transform: scale(1.12); }
.pen[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.pen.green { background: #3D9A50; } .pen.red { background: #C4361B; } .pen.blue { background: #2156E0; }

/* ---------- Inner pages ---------- */
.page { max-width: 920px; margin: 16px auto 0; padding: 0 20px 20px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
.page-head h1 { font-size: clamp(30px, 4.5vw, 46px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 700; max-width: 22ch; }
.page-head .lede { font-size: 16px; max-width: 66ch; color: var(--ink-2); }
.page-head .hand { align-self: flex-start; transform: rotate(-2deg); }
.prose { font-size: 15.5px; max-width: 70ch; display: flex; flex-direction: column; gap: 14px; }
.prose p a { color: var(--ink); font-weight: 500; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 720px) { .two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.thread-card h3 { font-size: 17px; font-weight: 700; }
.thread-card p { font-size: 14px; }
.thread-card .papers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.thread-card .papers a { text-decoration: none; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 12px 0; border-top: 1px dashed var(--line-2); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .when { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); padding-top: 3px; }
.timeline .what strong { display: block; font-family: var(--font-display); font-size: 15.5px; }
.timeline .what .org { font-size: 13px; color: var(--muted); display: block; margin-bottom: 3px; }
.timeline .what p { font-size: 13.5px; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }
.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 720px) { .awards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.awards li { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 13.5px; padding: 8px 0; border-top: 1px dashed var(--line-2); }
.awards li b { font-weight: 600; color: var(--ink); display: block; }
.awards li span { color: var(--muted); font-size: 12.5px; }
.awards li .when { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.portrait { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: auto; }
.side-grid { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
@media (min-width: 820px) { .side-grid { grid-template-columns: minmax(0, 1fr) 260px; } }

/* publications page */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { font-family: var(--font-mono); font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); cursor: pointer; transition: .12s; }
.filter:hover { border-color: var(--accent); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.year-group { display: grid; grid-template-columns: 72px 1fr; gap: 14px; }
@media (max-width: 600px) { .year-group { grid-template-columns: 1fr; gap: 6px; } }
.year-group > h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--muted); letter-spacing: -0.03em; line-height: 1; padding-top: 22px; }
.year-group .list { display: flex; flex-direction: column; gap: var(--gap); }
.pub { gap: 8px; }
.pub h3 { font-size: 17px; font-weight: 700; line-height: 1.3; }
.pub h3 a { text-decoration: none; }
.pub h3 a:hover { color: var(--accent-ink); }
.pub .authors { font-size: 13.5px; color: var(--ink-2); }
.pub .authors strong { color: var(--ink); }
.pub .venue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.pub .tldr { font-size: 13.5px; color: var(--ink-2); }
.pub .note { font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink); }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pub-links a, .pub-links button { font-family: var(--font-mono); font-size: 11.5px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; transition: .12s; }
.pub-links a:hover, .pub-links button:hover { border-color: var(--accent); color: var(--accent-ink); }
.pub-links button[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bib { position: relative; margin: 4px 0 0; padding: 12px 14px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.bib .copybtn { position: absolute; top: 8px; right: 8px; font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; }
.bib .copybtn:hover { border-color: var(--accent); color: var(--accent-ink); }
.pub[hidden] { display: none; }
.empty { font-size: 14px; color: var(--muted); padding: 10px 0; }

/* 404 */
.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.lost h1 { font-size: clamp(40px, 8vw, 96px); letter-spacing: -0.04em; }
.lost .lede { font-size: 16px; color: var(--ink-2); margin-top: 6px; }
