/* ==========================================================================
   yohaan narayanan — shared styles
   design language adapted from matthewzhang.works
   ========================================================================== */

:root {
    --white: #fff;
    --black: #0a0a0a;
    --blue: #00f;
    --orange: #f60;
    --grey-100: #f5f5f5;
    --grey-200: #e5e5e5;
    --grey-300: #d4d4d4;
    --grey-400: #a3a3a3;
    --grey-500: #737373;
    --grey-600: #525252;
    --grey-700: #404040;
    --grey-800: #262626;
    --grey-900: #171717;

    --accent: var(--blue);
    --accent-soft: rgba(0, 0, 255, 0.14);
    --background: var(--white);
    --foreground: var(--black);
    --muted: var(--grey-500);
    --border: var(--grey-200);
    --surface: var(--grey-200);
    --surface-hover: var(--grey-100);
    --surface-elevated: var(--grey-300);
    --card-body: var(--white);
    --grid-line: 0, 0, 0;
    --grid-alpha: 1;
    --on-accent: #fff;
    --merged: #8250df;
    --term-accent: #ff7a1a;

    --tiniest: 4px;
    --tinier: 8px;
    --tiny: 12px;
    --smallest: 16px;
    --smaller: 24px;
    --small: 32px;
    --big: 48px;
    --bigger: 64px;
    --biggest: 96px;
    --margin: var(--smallest);
    --radius: 6px;

    --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
    --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    /* stacking scale */
    --z-content: 1;
    --z-header: 100;
    --z-tooltip: 900;
    --z-cursor: 1000;
    --z-splash: 1100;

    overscroll-behavior-y: none;
    font-family: var(--sans);
    color-scheme: light;
}
@media (min-width: 769px) {
    :root { --margin: var(--small); }
}
[data-theme="dark"] {
    --accent: var(--orange);
    --accent-soft: rgba(255, 102, 0, 0.22);
    --background: var(--black);
    --foreground: var(--white);
    --muted: var(--grey-400);
    --border: var(--grey-800);
    --surface: var(--grey-900);
    --surface-hover: var(--grey-800);
    --surface-elevated: var(--grey-700);
    --card-body: var(--grey-900);
    --grid-line: 255, 255, 255;
    --grid-alpha: 0.75;
    --on-accent: #0a0a0a;
    --merged: #a371f7;
    color-scheme: dark;
}

::selection { background-color: var(--accent); color: var(--white); }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { width: 100%; max-width: 100%; scrollbar-width: none; overflow-x: clip; background: var(--background); }
html::-webkit-scrollbar { display: none; }
body {
    overflow-x: clip;
    background: var(--background);
    color: var(--foreground);
    font-feature-settings: "liga" 1, "calt" 1, "ss04" 1, "ss07" 1;
    font-optical-sizing: auto;
    text-wrap: pretty;
    width: 100%;
    min-height: 100vh;
    font-family: var(--sans);
    font-weight: 400;
    line-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: inherit; }
img, video { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; background: transparent; border: none; }
h1 { font-size: var(--bigger); letter-spacing: -0.025em; font-weight: 500; line-height: 100%; text-wrap: balance; }
h2 { font-size: var(--small); letter-spacing: -0.025em; font-weight: 500; line-height: 100%; text-wrap: balance; }
h3 { font-size: var(--smaller); letter-spacing: -0.01em; font-weight: 500; line-height: 110%; }
h4 { font-size: 18px; letter-spacing: -0.01em; font-weight: 500; line-height: 110%; }
p { font-size: var(--smallest); letter-spacing: -0.01em; line-height: 140%; }
@media (max-width: 768px) { h1 { font-size: var(--big); } h2 { font-size: var(--smaller); } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- target-lock cursor (fine pointers only) ---------- */
.reticle, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
    html.has-cursor, html.has-cursor * { cursor: none !important; }
    html.has-cursor.cursor-live .reticle, html.has-cursor.cursor-live .cursor-dot { display: block; }
}
.reticle { position: fixed; left: 0; top: 0; width: 22px; height: 22px; pointer-events: none; z-index: var(--z-cursor); mix-blend-mode: difference; will-change: transform; }
.reticle i { position: absolute; width: 7px; height: 7px; border: 0 solid #fff; transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out); }
.reticle i:nth-child(1) { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; }
.reticle i:nth-child(2) { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; }
.reticle i:nth-child(3) { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; }
.reticle i:nth-child(4) { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.reticle.locked i { width: 12px; height: 12px; }
.reticle.pressed i { width: 4px; height: 4px; }
.cursor-dot { position: fixed; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 1px; background: #fff; pointer-events: none; z-index: var(--z-cursor); mix-blend-mode: difference; transition: opacity 0.2s; }
.cursor-dot.locked { opacity: 0.45; }

/* typewriter tooltip that trails the cursor */
.cursor-tooltip { position: fixed; top: -100px; z-index: var(--z-tooltip); pointer-events: none; background: var(--foreground); color: var(--background); font-family: var(--sans); font-size: var(--smallest); padding: 4px; border-radius: 20px; line-height: 1.4; overflow: hidden; white-space: nowrap; width: 0; opacity: 0; transition: width 0.45s ease-in-out, opacity 0.2s ease, padding 0.35s ease-in-out, border-radius 0.35s ease-in-out; }
.cursor-tooltip.visible { opacity: 1; }
.cursor-tooltip.typing { padding: 8px 14px; border-radius: 12px; }
.tooltip-measure { position: absolute; visibility: hidden; white-space: nowrap; font-family: var(--sans); font-size: var(--smallest); padding: 8px 14px; }

/* ---------- header ---------- */
.site-header { padding: var(--margin); pointer-events: none; position: sticky; top: 0; z-index: var(--z-header); }
.header-blur { position: absolute; top: 0; left: 0; right: 0; height: calc(100% + 40px); pointer-events: none; }
.header-blur > div { position: absolute; inset: 0; }
.header-blur > div:nth-child(1) { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: color-mix(in srgb, var(--background) 60%, transparent); mask: linear-gradient(to bottom, black 50%, transparent 80%); -webkit-mask: linear-gradient(to bottom, black 50%, transparent 80%); }
.header-blur > div:nth-child(2) { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); mask: linear-gradient(to bottom, black 35%, transparent 65%); -webkit-mask: linear-gradient(to bottom, black 35%, transparent 65%); }
.header-blur > div:nth-child(3) { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); mask: linear-gradient(to bottom, black 20%, transparent 50%); -webkit-mask: linear-gradient(to bottom, black 20%, transparent 50%); }
.header-inner { pointer-events: auto; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.logo { font-size: var(--smallest); color: var(--foreground); letter-spacing: -0.01em; font-weight: 500; line-height: 1.05; }
.site-nav { display: flex; align-items: center; gap: var(--smaller); }
.nav-sep { color: var(--border); font-weight: 300; font-size: 14px; }
.nav-link { font-size: var(--smallest); color: var(--muted); transition: color 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--foreground); }
.theme-toggle { width: 32px; height: 32px; margin-left: var(--tinier); color: var(--muted); display: flex; justify-content: center; align-items: center; transition: color 0.2s; }
.theme-toggle:hover { color: var(--foreground); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
@media (max-width: 768px) {
    .site-nav { gap: var(--tiny); }
    .nav-link { font-size: 14px; }
    .theme-toggle { width: 24px; height: 24px; margin-left: 0; }
    .nav-sep { display: none; }
}
@media (max-width: 520px) { .nav-ext { display: none; } }
.nav-term { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; line-height: 1; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; transition: color 0.2s, border-color 0.2s; }
.nav-term:hover { color: var(--foreground); border-color: var(--foreground); }
.nav-term .flag-count::before { content: '\2691  '; }
html.ctf-done .nav-term { color: var(--accent); border-color: var(--accent); }
@media (max-width: 520px) { .nav-term .flag-count { display: none; } .nav-term { padding: 6px 8px; } }

/* ---------- page shell ---------- */
.page-content { position: relative; z-index: var(--z-content); background: var(--background); min-height: 100vh; }
main { min-height: 100vh; }

.section-title { font-size: var(--small); letter-spacing: -0.025em; font-weight: 500; line-height: 110%; }
@media (max-width: 768px) { .section-title { font-size: 22px; } }

/* reveal on scroll: content is visible by default, JS opts in to the entrance */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
html.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- footer: glitchy ascii name + contact ---------- */
.site-footer { position: relative; padding: var(--bigger) var(--margin) var(--small); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--big); background: var(--background); }
.footer-name { display: block; width: 100%; height: clamp(90px, 22vw, 330px); touch-action: pan-y; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--smaller) var(--big); }
.footer-contact { display: flex; flex-direction: column; gap: 10px; }
.email-copy { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: clamp(22px, 2.6vw, 36px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; color: var(--foreground); padding: 0; text-align: left; }
.copy-label { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; min-width: 8.5ch; text-align: center; transition: color 0.2s, border-color 0.2s; }
.email-copy:hover .copy-label { color: var(--accent); border-color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; }
.footer-links a { color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--foreground); }
.footer-term { font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--muted); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px; text-align: left; transition: border-color 0.2s, color 0.2s; }
.footer-term:hover { color: var(--foreground); border-color: var(--foreground); border-style: solid; }
.footer-term b { color: var(--accent); font-weight: 500; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--tinier); font-size: 13px; color: var(--muted); line-height: 1.5; }
.footer-bottom a { text-decoration: underline; text-underline-offset: 0.15em; }
.footer-bottom a:hover { color: var(--foreground); }

/* ---------- ascii placeholder art ---------- */
.ph { position: relative; width: 100%; overflow: hidden; background: var(--surface-hover); display: grid; place-items: center; container-type: inline-size; }
.ph-art { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--mono); font-size: 10px; line-height: 10px; letter-spacing: 0; white-space: pre; color: var(--foreground); opacity: 0.2; user-select: none; pointer-events: none; }
.ph-title { position: relative; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(22px, 9cqi, 40px); letter-spacing: -0.01em; line-height: 1; color: var(--foreground); background: var(--surface-hover); padding: 0.08em 0.3em 0.14em; border-radius: 6px; text-align: center; max-width: 86%; }
[data-theme="dark"] .ph-art { opacity: 0.26; }

/* ---------- skeleton ---------- */
.skeleton { background: var(--surface); background-image: linear-gradient(90deg, var(--surface) 0%, var(--surface-elevated) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==========================================================================
   home
   ========================================================================== */
.home-main { padding: var(--tiny) 4% var(--margin); display: flex; flex-direction: column; gap: var(--bigger); }
@media (max-width: 768px) { .home-main { padding: var(--smaller) var(--margin) var(--margin); gap: var(--big); } }

/* hero */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--big); min-height: clamp(300px, 27vw, 440px); padding: var(--smaller) 2.6% var(--small); }
.hero-copy { display: flex; flex-direction: column; gap: var(--tiny); max-width: 21em; font-size: clamp(30px, 3.05vw, 50px); }
.hero-title { font-size: 1em; font-weight: 600; letter-spacing: -0.032em; line-height: 1.12; text-wrap: balance; }
.hero-at { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--accent); letter-spacing: -0.01em; white-space: nowrap; font-size: 1.22em; line-height: 0.9; }
.hero-at .at { font-size: 1.3em; font-style: normal; font-weight: 400; margin-right: 0.02em; position: relative; top: 0.04em; }
.hero-sub { font-size: 0.42em; font-weight: 400; letter-spacing: -0.015em; color: var(--muted); line-height: 1.3; }
.nw { white-space: nowrap; }
.verb { font: inherit; letter-spacing: inherit; color: inherit; padding: 0 0.06em; margin: 0 -0.06em; border-radius: 0.1em; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 100% 0.085em; background-position: 0 94%; background-repeat: no-repeat; transition: background-size 0.4s var(--ease-out), color 0.25s; }
.verb:hover, .verb:focus-visible { background-size: 100% 100%; color: var(--on-accent); }
.hero-term { font-family: var(--mono); font-size: 14px; line-height: 1.4; color: var(--muted); padding: 0; margin-top: var(--tinier); width: fit-content; text-align: left; transition: color 0.2s; }
.hero-term:hover { color: var(--foreground); }
.hero-term kbd { font-family: inherit; font-size: 12px; color: var(--foreground); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; margin: 0 2px; }
.hero-term .caret { display: inline-block; width: 0.6em; height: 1.05em; vertical-align: -0.18em; margin-left: 4px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (hover: none) { .kbd-hint { display: none; } }
@media (hover: hover) { .tap-hint { display: none; } }
.hero-owl { position: relative; margin-right: 2%; }
.owl { font-family: var(--mono); font-size: clamp(9px, 0.98vw, 15px); line-height: 1.12; white-space: pre; color: var(--foreground); user-select: none; display: block; }
.owl .owl-eye { color: var(--accent); }
.owl-caption { position: absolute; left: 0; bottom: -1.8em; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: var(--small); padding: var(--tinier) 0 var(--smaller); min-height: 0; }
    .hero-copy { font-size: clamp(28px, 7.4vw, 44px); }
    .hero-owl { justify-self: start; margin: 0; }
    .owl { font-size: clamp(8px, 2.2vw, 12px); }
    .owl-caption { display: none; }
}

/* work: a dot matrix that lights up under the cursor */
.work { position: relative; padding: var(--smaller) 0; scroll-margin-top: 96px; }
.work::before, .work::after { content: ''; position: absolute; top: -40px; bottom: -40px; left: -4.5vw; right: -4.5vw; z-index: -1; pointer-events: none; background-size: 16px 16px; }
.work::before {
    background-image: radial-gradient(circle, rgba(var(--grid-line), 0.2) 1px, transparent 1.5px);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 90px, black calc(100% - 90px), transparent);
    mask-image: linear-gradient(to bottom, transparent, black 90px, black calc(100% - 90px), transparent);
}
.work::after {
    background-image: radial-gradient(circle, var(--accent) 1.4px, transparent 2px);
    -webkit-mask-image: radial-gradient(200px circle at calc(var(--mx, -999px) + 4.5vw) calc(var(--my, -999px) + 40px), black, transparent 70%);
    mask-image: radial-gradient(200px circle at calc(var(--mx, -999px) + 4.5vw) calc(var(--my, -999px) + 40px), black, transparent 70%);
    opacity: 0; transition: opacity 0.4s;
}
.work.lit::after { opacity: 0.6; }

.work-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tiny) var(--smallest); margin-bottom: var(--smaller); font-family: var(--mono); font-size: 13px; }
.work-path { color: var(--muted); white-space: nowrap; }
.work-path b { color: var(--accent); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--foreground); background: var(--background); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; transition: border-color 0.2s, background-color 0.2s, color 0.2s; }
.chip:hover { border-color: var(--foreground); }
.chip[aria-pressed="true"] { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.chip-n { font-size: 11px; color: var(--muted); }
.chip[aria-pressed="true"] .chip-n { color: inherit; opacity: 0.6; }

.masonry { column-count: 3; column-gap: var(--tiny); }
@media (max-width: 900px) { .masonry { column-count: 2; } }
@media (max-width: 480px) { .masonry { column-count: 1; } }

@keyframes cardIn { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mediaIn { 0% { filter: blur(12px); transform: scale(0.94); } 50% { filter: blur(12px); transform: scale(1); } 100% { filter: blur(0); transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.project-card { position: relative; display: block; break-inside: avoid; margin-bottom: var(--tiny); border: 1px solid var(--border); border-radius: 10px; background: var(--card-body); overflow: hidden; animation: cardIn 0.5s var(--ease-out) backwards; transition: border-color 0.25s, opacity 0.35s var(--ease-out), filter 0.35s var(--ease-out); }
.project-card[hidden] { display: none; }
.project-card:hover { border-color: var(--foreground); }
.card-strip { display: flex; justify-content: space-between; align-items: baseline; gap: var(--tiny); padding: 9px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); transition: background-color 0.25s, color 0.25s; }
.card-name { color: var(--foreground); transition: color 0.25s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-year { white-space: nowrap; }
.card-arrow { display: inline-block; opacity: 0; transform: translate(-3px, 3px); transition: opacity 0.25s, transform 0.3s var(--ease-out); }
.project-card:hover .card-strip, .project-card:focus-within .card-strip { background: var(--foreground); color: var(--background); }
.project-card:hover .card-name, .project-card:focus-within .card-name { color: var(--background); }
.project-card:hover .card-arrow, .project-card:focus-within .card-arrow { opacity: 1; transform: none; }
.project-card-inner { position: relative; overflow: hidden; }
.project-card-inner > img, .project-card-inner > video, .project-card-inner > .ph { width: 100%; height: auto; object-fit: cover; animation: mediaIn 0.6s ease-out backwards; animation-delay: inherit; }
.project-card-inner > img, .project-card-inner > video { display: block; }
.card-hit { position: absolute; inset: 0; z-index: 3; padding: 0; border-radius: inherit; }
.card-hit:focus-visible { outline-offset: -3px; border-radius: 10px; }
.project-card.dim { opacity: 0.16; filter: grayscale(1); }
.masonry.spotlighting .project-card:not(.dim) { border-color: var(--accent); }
@media (max-width: 768px) {
    .project-card { animation-name: fadeIn; }
    .project-card-inner > img, .project-card-inner > video, .project-card-inner > .ph { animation-name: fadeIn; }
}

/* github marquee */
.repos { display: flex; flex-direction: column; gap: var(--smaller); }
.repos-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--tiny) var(--smallest); }
.repos-head .section-title { padding-left: clamp(0px, 1.8vw, 28px); }
.repos-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.marquee { width: 100vw; margin-left: calc(50% - 50vw); display: flex; flex-direction: column; gap: var(--tiny); -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); }
.marquee-row { overflow: hidden; padding: 4px 0; }
.marquee-track { display: flex; gap: var(--tiny); padding-right: var(--tiny); width: max-content; animation: marquee var(--duration, 120s) linear infinite; }
.marquee-row.reverse .marquee-track { animation-direction: reverse; }
.marquee-row:hover .marquee-track, .marquee-row:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.repo { position: relative; flex: none; width: 290px; min-height: 124px; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 12px; background: var(--card-body); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.2s, transform 0.3s var(--ease-out); }
.repo:hover { border-color: var(--foreground); transform: translateY(-3px); }
.repo-link { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.repo-link:focus-visible { outline: none; }
.repo-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.repo-desc { font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.repo-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: var(--tiny); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.repo-lang { display: inline-flex; align-items: center; gap: 6px; }
.repo-lang i { width: 8px; height: 8px; border-radius: 50%; }
.repo-live { position: relative; z-index: 1; color: var(--accent); }
.repo-merged, .merged-note { color: var(--merged); }
.repo.is-contrib .repo-link { font-size: 13px; }
.repo-live:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.gists-link { align-self: flex-start; margin-left: clamp(0px, 1.8vw, 28px); font-family: var(--mono); font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 0.2em; transition: color 0.2s; }
.gists-link:hover { color: var(--accent); }
@media (max-width: 768px) { .repo { width: 250px; } }

/* project dialog */
.project-dialog { border: none; background: none; padding: 0; max-width: min(1300px, 94vw); width: 100%; height: min(75vh, 760px); border-radius: var(--smaller); overflow: hidden; inset: 0; margin: auto; position: fixed; color: var(--foreground); }
.project-dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.project-dialog[open] { animation: fadeIn 0.3s ease; }
.dialog-content { background: var(--background); border: 1px solid var(--border); border-radius: var(--smaller); overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; height: 100%; }
.dialog-media { position: relative; overflow: hidden; background: var(--surface-hover); min-height: 280px; }
.dialog-media > img, .dialog-media > video, .dialog-media > .ph { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.dialog-media > img, .dialog-media > video { display: block; }
.dialog-media > .first-load { animation: mediaIn 0.5s ease-out both; }
.dialog-close, .carousel-nav { position: absolute; width: 32px; height: 32px; border-radius: 9999px; background: var(--background); border: 1px solid var(--border); color: var(--foreground); display: flex; align-items: center; justify-content: center; z-index: 2; }
.dialog-close { top: var(--tinier); right: var(--tinier); }
.carousel-nav { top: 50%; transform: translateY(-50%); opacity: 0.75; transition: opacity 0.15s; }
.carousel-nav:hover { opacity: 1; }
.carousel-prev { left: var(--tinier); }
.carousel-next { right: var(--tinier); }
.carousel-dots { display: flex; gap: var(--tinier); position: absolute; bottom: var(--tiny); left: 50%; transform: translateX(-50%); z-index: 2; }
.carousel-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--foreground); opacity: 0.3; transition: opacity 0.2s; }
.carousel-dot.active { opacity: 1; }
.dialog-info { padding: var(--smaller); display: flex; flex-direction: column; gap: var(--tiny); overflow-y: auto; scrollbar-width: none; }
.dialog-info::-webkit-scrollbar { display: none; }
.dialog-info h2 { font-size: var(--smaller); font-weight: 600; letter-spacing: -0.01em; }
.dialog-path { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dialog-status { font-size: 13px; color: var(--muted); }
.dialog-tags { display: flex; flex-wrap: wrap; gap: var(--tinier); }
.dialog-tag { font-size: 13px; color: var(--muted); background: var(--surface); padding: 3px var(--tinier); border-radius: var(--radius); line-height: 1.3; }
.dialog-divider { border: none; border-top: 1px solid var(--border); margin: var(--tinier) 0; }
.dialog-label { font-size: 13px; color: var(--muted); margin-top: var(--tiny); }
.dialog-text { font-size: var(--smallest); line-height: 160%; max-width: 60ch; }
.dialog-items { list-style: none; display: flex; flex-direction: column; gap: var(--tinier); margin-top: 2px; }
.dialog-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; transition: border-color 0.2s; }
.dialog-item:hover { border-color: var(--foreground); }
.dialog-item-head { display: flex; align-items: center; gap: 8px; }
.dialog-item-name { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.dialog-item-status { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }
.dialog-item-desc { font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 60ch; }
.dialog-item-links { display: flex; gap: 16px; font-family: var(--mono); font-size: 12px; }
.dialog-item-links a { color: var(--accent); }
.dialog-item-links a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.dialog-link { font-size: 14px; text-decoration: underline; text-underline-offset: 0.2em; width: fit-content; }
.dialog-link:hover { color: var(--accent); }
@media (max-width: 768px) {
    .project-dialog { height: 88vh; max-width: 94vw; }
    .dialog-content { grid-template-columns: 1fr; grid-template-rows: 42% 1fr; }
    .dialog-media { min-height: 0; }
}

/* experience / education / volunteering, rendered as git logs */
.list-section { display: flex; flex-direction: column; gap: var(--small); }
.list-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--bigger) var(--big); align-items: start; }
@media (max-width: 1000px) { .list-pair { grid-template-columns: minmax(0, 1fr); gap: var(--bigger); } }
.list-section > .section-title { padding-left: clamp(0px, 1.8vw, 28px); }
.log { list-style: none; display: flex; flex-direction: column; padding-left: clamp(0px, 1.8vw, 28px); }
.commit { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); padding-bottom: var(--smaller); }
.commit::before { content: ''; position: absolute; left: 6px; top: 19px; bottom: -5px; width: 1px; background: var(--border); }
.commit:last-child::before { display: none; }
.commit-dot { position: relative; width: 13px; height: 13px; margin-top: 5px; border-radius: 50%; border: 1.5px solid var(--muted); background: var(--background); transition: border-color 0.25s, background-color 0.25s, transform 0.3s var(--ease-out); }
.commit.is-head .commit-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.commit:hover .commit-dot { border-color: var(--accent); transform: scale(1.2); }
.commit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); min-height: 23px; }
.commit-hash { color: var(--accent); }
.commit-ref { color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px; font-size: 11px; line-height: 1.4; }
.commit-title { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; margin-top: 6px; transition: transform 0.3s var(--ease-out); }
.commit:hover .commit-title { transform: translateX(3px); }
.commit-at { color: var(--accent); font-weight: 400; }
.commit-desc { font-size: 14px; line-height: 1.55; color: var(--muted); margin-top: 6px; max-width: 68ch; }
@media (max-width: 768px) {
    .log { padding-left: 0; }
    .commit { grid-template-columns: 24px minmax(0, 1fr); }
    .commit-title { font-size: 17px; }
    .commit-desc { font-size: 13px; }
}

/* honors — scoreboard */
.board { list-style: none; display: flex; flex-direction: column; }
.board-head, .board-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: var(--smaller); align-items: baseline; }
.board-head { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 0 0 var(--tiny); border-bottom: 1px solid var(--border); }
.board-head span:last-child { text-align: right; }
.board-row { padding: var(--smaller) 0; border-bottom: 1px solid var(--border); position: relative; }
.board-row::after { content: ''; position: absolute; inset: 0 -1.2%; background: var(--surface-hover); border-radius: 10px; opacity: 0; z-index: -1; transition: opacity 0.25s; }
.board-row:hover::after { opacity: 1; }
.board-rank { font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-event { display: flex; flex-direction: column; gap: 6px; }
.board-name { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; }
.board-detail { font-size: 14px; color: var(--muted); line-height: 1.5; }
.board-year { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; text-align: right; }
@media (max-width: 768px) {
    .board-head, .board-row { grid-template-columns: 76px minmax(0, 1fr); gap: var(--tiny); }
    .board-head span:last-child, .board-year { display: none; }
    .board-row { padding: var(--smallest) 0; }
    .board-rank { font-size: 12px; white-space: normal; line-height: 1.3; }
    .board-name { font-size: 17px; }
    .board-detail { font-size: 13px; }
}

/* writing rows (home teaser + writing page) */
.entry-list { list-style: none; display: flex; flex-direction: column; }
.entry { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: var(--smaller); align-items: baseline; padding: var(--smaller) 0; border-bottom: 1px solid var(--border); position: relative; }
a.entry::after { content: ''; position: absolute; inset: 0 -1.2%; background: var(--surface-hover); border-radius: 10px; opacity: 0; z-index: -1; transition: opacity 0.25s; }
a.entry:hover::after { opacity: 1; }
.entry-date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-main { display: flex; flex-direction: column; gap: 6px; }
.entry-title { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: var(--smaller); line-height: 1.15; transition: color 0.2s; }
a.entry:hover .entry-title { color: var(--accent); }
.entry-summary { font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 70ch; }
.entry-meta { font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; gap: var(--tinier); align-items: baseline; }
.entry-kind { font-family: var(--mono); font-size: 12px; }
.entry-arrow { display: inline-block; transition: transform 0.3s var(--ease-out); }
a.entry:hover .entry-arrow { transform: translateX(4px); color: var(--accent); }
.entry-empty { padding: var(--smaller) 0; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--border); }
.see-all { font-size: var(--smallest); color: var(--foreground); text-decoration: underline; text-underline-offset: 0.2em; width: fit-content; margin-left: clamp(0px, 1.8vw, 28px); }
.see-all:hover { color: var(--accent); }
@media (max-width: 768px) {
    .entry { grid-template-columns: 74px minmax(0, 1fr); gap: var(--tiny); padding: var(--smallest) 0; }
    .entry-meta { display: none; }
    .entry-date { font-size: 11px; padding-top: 5px; }
    .entry-title { font-size: 19px; }
    .entry-summary { font-size: 13px; }
}

/* ==========================================================================
   inner pages (info, writing, post)
   ========================================================================== */
.inner-main { padding: var(--big) var(--margin) var(--bigger); }
@media (max-width: 768px) { .inner-main { padding: var(--small) var(--margin) var(--big); } }
.page-header { padding-bottom: var(--big); border-bottom: 1px solid var(--border); margin-bottom: var(--big); display: flex; flex-direction: column; gap: var(--smallest); }
.page-lede { font-size: var(--smaller); line-height: 1.4; color: var(--muted); letter-spacing: -0.015em; max-width: 36ch; }
@media (max-width: 768px) { .page-lede { font-size: 19px; } }

/* info */
.info-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--smallest); }
.info-left { grid-column: 1 / 7; display: flex; flex-direction: column; gap: var(--bigger); }
.info-right { grid-column: 8 / -1; position: sticky; top: calc(var(--big) + 40px); height: fit-content; }
@media (max-width: 768px) {
    .info-grid { display: flex; flex-direction: column; gap: var(--big); }
    .info-right { position: static; order: -1; max-width: 420px; }
}
.bio { display: flex; flex-direction: column; gap: var(--smallest); }
.bio p { font-size: var(--smaller); line-height: 150%; max-width: 44ch; }
@media (max-width: 768px) { .bio p { font-size: 19px; } }
.bio a, .detail a { text-decoration: underline; text-underline-offset: 0.2em; transition: color 0.15s; }
.bio a:hover, .detail a:hover { color: var(--accent); }
.details { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--smaller) var(--smallest); }
.detail h3 { font-size: 18px; color: var(--muted); font-weight: 400; margin-bottom: var(--tinier); }
.detail p { line-height: 1.45; }
.portrait { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-hover); }
.portrait > .ph { position: absolute; inset: 0; height: 100%; }
.portrait > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait.has-photo > img { opacity: 0; filter: blur(8px); transition: opacity 0.6s var(--ease-out), filter 0.6s var(--ease-out); }
.portrait.has-photo:hover > img, .portrait.has-photo.revealed > img { opacity: 1; filter: none; }
.portrait.has-photo .ph-art { opacity: 0.75; }
.portrait-caption { margin-top: var(--tinier); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.whoami { font-family: var(--mono); font-weight: 500; letter-spacing: -0.04em; }
.whoami-prompt { color: var(--accent); margin-right: 0.1em; }

/* hall of fame */
.hof-you { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hof-hunt { font: inherit; color: var(--foreground); text-decoration: underline; text-underline-offset: 0.2em; transition: color 0.2s; }
.hof-hunt:hover { color: var(--accent); }
.hof-empty .board-rank { color: var(--muted); }
.board-detail a { text-decoration: underline; text-underline-offset: 0.2em; transition: color 0.15s; }
.board-detail a:hover { color: var(--accent); }
.board-detail code { font-family: var(--mono); font-size: 13px; color: var(--foreground); }

/* writing page */
.writing-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--big); align-items: start; margin-bottom: var(--bigger); }
.writing-section { display: flex; flex-direction: column; gap: var(--small); min-width: 0; }
.writing-cols .entry { grid-template-columns: 80px minmax(0, 1fr) auto; }
@media (max-width: 1024px) { .writing-cols { grid-template-columns: 1fr; gap: var(--bigger); } }
@media (max-width: 768px) { .writing-cols .entry { grid-template-columns: 74px minmax(0, 1fr); } }

/* post */
.post { max-width: 720px; margin: 0 auto; }
.post-back { font-size: 14px; color: var(--muted); display: inline-flex; gap: 6px; transition: color 0.2s; }
.post-back:hover { color: var(--foreground); }
.post-head { display: flex; flex-direction: column; gap: var(--smallest); padding: var(--small) 0 var(--big); border-bottom: 1px solid var(--border); margin-bottom: var(--big); }
.post-title { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(40px, 6vw, 68px); line-height: 1; letter-spacing: -0.015em; }
.post-meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--tinier); }
.post-cta { display: inline-flex; align-items: center; gap: 8px; width: fit-content; background: var(--foreground); color: var(--background); padding: 10px 16px; border-radius: 999px; font-size: 15px; margin-top: var(--tinier); transition: background-color 0.2s; }
.post-cta:hover { background: var(--accent); color: var(--white); }
.post-foot { margin-top: var(--bigger); padding-top: var(--smaller); border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: var(--smallest); font-size: 14px; color: var(--muted); }
.post-foot a:hover { color: var(--foreground); }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: calc(var(--z-header) + 1); pointer-events: none; }

.prose { font-size: 18px; line-height: 1.7; letter-spacing: -0.011em; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose li { font-size: inherit; line-height: inherit; max-width: 68ch; }
.prose h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; margin-top: 2em; }
.prose h3 { font-size: 21px; font-weight: 600; margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { position: relative; font-family: var(--serif); font-style: italic; font-size: 1.45em; line-height: 1.35; padding: 0.2em 0 0.2em 1.3em; color: var(--foreground); }
.prose blockquote::before { content: '\201C'; position: absolute; left: -0.05em; top: -0.18em; font-size: 2.2em; color: var(--accent); font-style: normal; line-height: 1; }
.prose blockquote p { max-width: 40ch; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-hover); border: 1px solid var(--border); padding: 0.1em 0.35em; border-radius: 5px; }
.prose pre { background: var(--surface-hover); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; overflow-x: auto; line-height: 1.55; }
.prose pre code { background: none; border: none; padding: 0; font-size: 14px; }
.prose img { display: block; border-radius: 12px; margin-inline: auto; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.35); }
.prose hr { border: none; text-align: center; margin: 2.6em 0; }
.prose hr::after { content: '* * *'; color: var(--muted); letter-spacing: 0.6em; font-family: var(--mono); font-size: 14px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; }
.post-state { padding: var(--bigger) 0; color: var(--muted); font-size: 18px; line-height: 1.5; }
.post-state a { color: var(--foreground); text-decoration: underline; text-underline-offset: 0.2em; }

/* 404 */
.lost { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--smaller); text-align: center; padding: var(--big) var(--margin); }
.lost h1 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(40px, 7vw, 72px); }
.lost p { color: var(--muted); }
.lost a { text-decoration: underline; text-underline-offset: 0.2em; color: var(--foreground); }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: var(--z-splash); display: flex; align-items: center; justify-content: center; background: var(--background); transition: opacity 0.5s ease-out, visibility 0.5s; }
.splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-name { font-family: var(--mono); font-size: clamp(18px, 2.2vw, 26px); letter-spacing: 0.06em; color: var(--foreground); white-space: pre; }
.splash-name .settled { color: var(--foreground); }
.splash-name .scrambling { color: var(--accent); }
html.no-splash .splash { display: none; }

/* ---------- terminal ---------- */
.term { position: fixed; inset: 0; margin: auto; padding: 0; border: none; width: min(760px, 94vw); height: min(540px, 80vh); background: #0c0c0c; color: #e6e6e6; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.09); font-family: var(--mono); font-size: 13.5px; line-height: 1.55; }
.term[open] { display: flex; flex-direction: column; animation: termIn 0.35s var(--ease-out); }
@keyframes termIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.term::backdrop { background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); color: #8f8f8f; font-size: 12px; }
.term-title { flex: 1; }
.term-close { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: #8f8f8f; }
.term-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.term-out { flex: 1; overflow-y: auto; padding: 14px 16px 4px; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.term-row { min-height: 1.55em; }
.term-echo { margin-top: 10px; color: #fff; }
.term-row.muted, .t-muted { color: #8f8f8f; }
.term-row.err, .t-err { color: #ff8080; }
.t-accent, .t-prompt { color: var(--term-accent); }
.t-ok { color: #5ee08a; }
.term-line { display: flex; align-items: center; gap: 10px; padding: 8px 16px 16px; }
.term-prompt { color: var(--term-accent); white-space: nowrap; }
.term-input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: #fff; font: inherit; caret-color: var(--term-accent); }
@media (max-width: 600px) { .term { font-size: 12.5px; height: 70vh; } .term-keys { display: none; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 16px; bottom: 16px; z-index: var(--z-tooltip); max-width: calc(100vw - 32px); font-family: var(--mono); font-size: 13px; line-height: 1.5; background: var(--foreground); color: var(--background); padding: 10px 14px; border-radius: 10px; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity 0.3s, transform 0.45s var(--ease-out); }
.toast.show { opacity: 1; transform: none; }
.toast b { font-weight: 600; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    html.js .reveal { opacity: 1; transform: none; }
    .marquee-row { overflow-x: auto; }
    .marquee-track { animation: none; }
}
