:root {
  --bg: #0b0c0d;
  --bg-2: #111315;
  --surface: #15171a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ecebe6;
  --muted: #8f9196;
  --faint: #5d6066;
  --accent: #c8ff4d;
  --accent-ink: #0b0c0d;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html, body { overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1; padding-bottom: 3px;
}
.brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a { position: relative; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(200,255,77,.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(200,255,77,0); } 100% { box-shadow: 0 0 0 0 rgba(200,255,77,0); } }

/* HERO */
.hero {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: clamp(56px, 10vh, 120px) var(--gutter) clamp(64px, 10vh, 120px);
  display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(32px, 4vw, 64px); align-items: center;
}
.hero-glow {
  position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(circle at center, rgba(200,255,77,.13), rgba(200,255,77,0) 60%);
  pointer-events: none; z-index: -1;
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform .6s var(--ease);
}
.eyebrow {
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 28px;
}
.eyebrow .sep { color: var(--accent); margin: 0 6px; }
h1 {
  font-size: clamp(42px, 6.2vw, 92px); line-height: .98; letter-spacing: -.045em; font-weight: 500;
  margin: 0 0 32px; text-wrap: balance;
}
h1 em { color: var(--accent); letter-spacing: -.02em; padding-right: .04em; }
.lede { font-size: clamp(17px, 1.35vw, 20px); color: var(--muted); max-width: 58ch; margin: 0 0 40px; text-wrap: pretty; }
.cta, .links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 500;
  border: 1px solid var(--line-2); color: var(--text); background: transparent;
  transition: background .25s, border-color .25s, transform .25s var(--ease), color .25s;
}
.btn:hover { border-color: var(--text); transform: translateY(-2px); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Terminal */
.terminal {
  border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, #14171a, #0e1012);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden; min-width: 0;
}
.term-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--faint); }
.lights { display: inline-flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: #2a2d31; }
.term-title { flex: 1; }
.term-badge { color: var(--accent); letter-spacing: .1em; font-size: 11px; }
.term-body {
  margin: 0; padding: 22px 20px 26px; font-family: var(--mono); font-size: 12.5px; line-height: 1.9; color: #c9cbcf;
  overflow-x: auto; white-space: pre;
  min-height: 250px;
}
.term-body .p { color: var(--accent); }
.term-body .a { color: #6f96c2; }
.term-body .ok { color: var(--bg); background: var(--accent); padding: 1px 6px; border-radius: 3px; font-weight: 500; }
.term-body .m { color: var(--muted); }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* MARQUEE */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 20px 0; background: var(--bg-2); }
.marquee-track { display: flex; gap: 32px; width: max-content; animation: marquee 50s linear infinite; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.4vw, 32px); color: var(--muted); white-space: nowrap; }
.marquee-track b { color: var(--accent); font-weight: 400; font-family: var(--sans); font-style: normal; font-size: .7em; align-self: center; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* SECTIONS */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 12vh, 160px) var(--gutter) 0; }
.section-head { margin-bottom: clamp(48px, 8vh, 96px); max-width: 900px; }
.kicker { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 20px; }
h2 { font-size: clamp(36px, 5.2vw, 72px); line-height: 1; letter-spacing: -.04em; font-weight: 500; margin: 0 0 20px; text-wrap: balance; }
h2 em { color: var(--muted); }
.section-head > p { color: var(--muted); margin: 0 0 24px; }

/* PROJECTS */
.t-vault { --tint: #6f96c2; } .t-osfi { --tint: #7aa3d6; } .t-fd { --tint: #f07a4a; }
.project {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: clamp(40px, 6vh, 72px) 0; border-top: 1px solid var(--line);
}
.project.flip .project-copy { order: 2; }
.project-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.idx { font-family: var(--mono); font-size: 13px; color: var(--tint, var(--accent)); }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.tag.ghost { color: var(--accent); border-color: rgba(200,255,77,.35); }
.project h3, .osss h3 { font-size: clamp(36px, 4.2vw, 60px); line-height: 1; letter-spacing: -.04em; font-weight: 500; margin: 0 0 16px; }
.quote { font-family: var(--serif); font-size: clamp(22px, 2vw, 28px); line-height: 1.25; margin: 0 0 20px; color: var(--text); }
.quote span { color: var(--tint, var(--accent)); font-style: italic; }
.project-copy > p:not(.quote) { color: var(--muted); margin: 0 0 24px; max-width: 54ch; }
.facts { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.facts li { background: var(--bg); padding: 14px 16px; font-size: 14px; color: var(--muted); line-height: 1.4; }
.facts b { display: block; color: var(--text); font-weight: 500; font-size: 15px; }

/* Screenshot frames */
.shot {
  display: block; position: relative; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line-2); background: #1a1c1f;
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.4);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease), border-color .4s;
}
.shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint, #fff) 0%, transparent);
  transition: box-shadow .4s;
}
.shot:hover { transform: translateY(-6px) rotate(-.3deg); border-color: color-mix(in srgb, var(--tint, #fff) 60%, transparent); box-shadow: 0 60px 120px -40px color-mix(in srgb, var(--tint, #000) 35%, #000); }
.shot-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: #1c1e22; border-bottom: 1px solid var(--line); }
.url { flex: 1; max-width: 340px; margin: 0 auto; text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: #121417; border-radius: 6px; padding: 4px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-view { aspect-ratio: 16 / 10; overflow: hidden; }
.shot-view img { width: 100%; transition: transform 4.5s cubic-bezier(.45, .05, .35, 1); will-change: transform; }
.shot:hover .shot-view img { transform: translateY(calc(-100% + 100cqh)); }
.shot-view { container-type: size; }

.shot-stack { position: relative; padding-bottom: 12%; }
.shot-mini { position: absolute; width: 52%; right: -4%; bottom: 0; z-index: 2; transform: rotate(2deg); }
.shot-mini:hover { transform: rotate(0) translateY(-6px); }
.shot-mini .shot-bar { padding: 7px 10px; }
.shot-mini .lights i { width: 7px; height: 7px; }
.shot-mini .url { font-size: 10px; }

/* OSSS */
.osss {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 64px);
  padding: clamp(28px, 4vw, 56px); border-radius: 24px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(200,255,77,.08), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
  margin-bottom: 24px;
}
.abbr { font-family: var(--mono); font-size: .32em; letter-spacing: .1em; vertical-align: middle; color: var(--accent); border: 1px solid rgba(200,255,77,.35); padding: 4px 10px; border-radius: 999px; margin-left: 6px; }
.osss .big { font-family: var(--serif); font-size: clamp(22px, 2.1vw, 30px); line-height: 1.25; margin: 0 0 16px; }
.osss-copy > p:not(.big) { color: var(--muted); margin: 0 0 28px; }
.osss-copy > p em { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; border-top: 1px solid var(--line); padding-top: 24px; }
.stats b { display: block; font-size: clamp(32px, 3.4vw, 48px); font-weight: 500; letter-spacing: -.04em; line-height: 1; margin-bottom: 6px; }
.stats span { font-size: 13px; color: var(--muted); line-height: 1.3; display: block; }
.license { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.osss-visual { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.code {
  margin: 0; padding: 20px; border-radius: 14px; background: #0c0e10; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; line-height: 1.75; color: #b9bcc1; overflow-x: auto;
}
.code .c { color: var(--faint); } .code .k { color: #9dc3ee; } .code .s { color: #e8c07a; } .code .n { color: var(--accent); }
.grid-sched { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.grid-sched span { aspect-ratio: 1.6; border-radius: 6px; background: #16191c; border: 1px solid var(--line); }
.grid-sched span.on { background: rgba(200,255,77,.14); border-color: rgba(200,255,77,.4); animation: cell 4s ease-in-out infinite; }
.grid-sched span.on:nth-child(3n) { animation-delay: .8s; } .grid-sched span.on:nth-child(4n) { animation-delay: 1.6s; }
@keyframes cell { 50% { background: rgba(200,255,77,.32); } }

.repos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.repo {
  position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--bg-2);
  transition: border-color .3s, transform .4s var(--ease), background .3s;
}
.repo:hover { border-color: var(--line-2); transform: translateY(-4px); background: var(--surface); }
.repo-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 18px; font-family: var(--mono); font-size: 11px; }
.lang { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.lang::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3178c6; }
.lang.py::before { background: #e5c34b; }
.wip { color: #f0a24a; }
.repo h4 { font-family: var(--mono); font-size: 17px; font-weight: 500; margin: 0 0 10px; letter-spacing: -.01em; }
.repo p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.repo code { font-family: var(--mono); font-size: 13px; color: var(--text); }

/* WRITING */
.writing { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); }
.col-title { font-size: 14px; font-weight: 500; color: var(--muted); margin: 0 0 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: baseline; }
.col-title span { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 28px; color: var(--text); }
.posts { list-style: none; margin: 0; padding: 0; counter-reset: p; }
.posts li { position: relative; display: flex; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--line); counter-increment: p; }
.posts li > a:first-child { flex: 1; display: block; padding: 20px 0 20px 40px; position: relative; }
.posts li > a:first-child::before { content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: 24px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.posts .t { display: block; font-size: 18px; font-weight: 500; letter-spacing: -.015em; line-height: 1.3; transition: color .2s; }
.posts .d { display: block; font-size: 14.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.posts li > a:first-child:hover .t { color: var(--accent); }
.code-link { flex: none; margin-top: 22px; font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; transition: color .2s, border-color .2s; }
.code-link:hover { color: var(--accent); border-color: var(--accent); }

/* CONTACT */
.contact { max-width: var(--max); margin: 0 auto; padding: clamp(120px, 18vh, 220px) var(--gutter) clamp(80px, 12vh, 140px); }
.contact h2 { font-size: clamp(56px, 11vw, 168px); line-height: .9; letter-spacing: -.05em; margin-bottom: clamp(48px, 8vh, 96px); }
.contact h2 em { color: var(--accent); }
.contact-links { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); }
.contact-links a { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 28px 24px 28px 0; border-bottom: 1px solid var(--line-2); transition: padding .4s var(--ease); min-width: 0; }
.contact-links a + a { padding-left: 24px; border-left: 1px solid var(--line-2); }
.contact-links span { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.contact-links small { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-links i { position: absolute; top: 28px; right: 20px; font-style: normal; color: var(--faint); transition: color .3s, transform .3s var(--ease); }
.contact-links a:hover span { color: var(--accent); }
.contact-links a:hover i { color: var(--accent); transform: translate(3px, -3px); }

.foot { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.foot-sites { display: flex; gap: 20px; }
.foot-sites a:hover { color: var(--accent); }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 1080px) {
  .repos { grid-template-columns: 1fr 1fr; }
  .contact-links { grid-template-columns: 1fr 1fr; }
  .contact-links a:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 920px) {
  .hero, .project, .osss, .writing { grid-template-columns: 1fr; }
  .project.flip .project-copy { order: 0; }
  .nav-links { display: none; }
  .shot-stack { padding-bottom: 18%; }
  .shot-mini { right: -2%; width: 58%; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .status-text { display: none; }
  .status { padding: 8px; }
  .repos, .facts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .contact-links { grid-template-columns: 1fr; }
  .contact-links a, .contact-links a + a { padding-left: 0; border-left: 0; }
  .term-body { font-size: 10.5px; padding: 18px 14px; min-height: 0; }
  .posts li > a:first-child { padding-left: 32px; }
  .shot:hover { transform: none; }
}

@media (hover: none) {
  .shot-view img { animation: peek 14s cubic-bezier(.45, .05, .35, 1) infinite alternate; animation-play-state: paused; }
  .shot.in-view .shot-view img { animation-play-state: running; }
  @keyframes peek { 0%, 15% { transform: none; } 85%, 100% { transform: translateY(calc(-100% + 100cqh)); } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ADDITIONS: identity, labs, arch, featured writing */
.t-labs { --tint: #2dd4bf; } .t-arch { --tint: #a78bfa; }
.ident { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.ident .eyebrow { margin: 0; }
.avatar {
  width: 64px; height: 64px; object-fit: contain; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #2a2e33, #15171a);
  box-shadow: 0 0 0 1px var(--line-2), 0 0 0 5px var(--bg), 0 0 0 6px rgba(200,255,77,.5);
  padding: 2px;
}

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: clamp(56px, 8vh, 96px); }
.feature { display: flex; flex-direction: column; }
.feature-img { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); margin-bottom: 18px; background: var(--surface); }
.feature-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; filter: saturate(.9); }
.feature:hover .feature-img img { transform: scale(1.05); filter: saturate(1.1); }
.feature-date { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.feature h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.15; letter-spacing: -.025em; font-weight: 500; margin: 0 0 8px; transition: color .2s; }
.feature:hover h3 { color: var(--accent); }
.feature p { color: var(--muted); margin: 0; font-size: 15px; line-height: 1.55; }

.posts li > a:first-child { display: grid; grid-template-columns: 96px 1fr; column-gap: 18px; align-items: start; padding-left: 0; }
.posts li > a:first-child::before { display: none; }
.posts .thumb { grid-row: span 2; width: 96px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin-top: 3px; transition: transform .5s var(--ease); }
.posts li > a:first-child:hover .thumb { transform: scale(1.06); }
.posts .d { margin-top: 4px; }

@media (max-width: 920px) {
  .features { grid-template-columns: 1fr; }
  .feature-img { aspect-ratio: 2 / 1; }
}
@media (max-width: 560px) {
  .posts li > a:first-child { grid-template-columns: 72px 1fr; column-gap: 14px; padding-left: 0; }
  .posts .thumb { width: 72px; height: 40px; }
  .avatar { width: 56px; height: 56px; }
}

.t-alex { --tint: #22d3ee; }
.shot-view.wide { aspect-ratio: 16 / 9; }
.shot-card { width: 30%; right: -3%; bottom: -2%; border-radius: 16px; transform: rotate(3deg); box-shadow: 0 40px 80px -20px rgba(0,0,0,.9), 0 0 40px -10px rgba(34,211,238,.35); }
.shot-card:hover { transform: rotate(0) translateY(-6px); }
@media (max-width: 920px) { .shot-card { width: 36%; right: -1%; } }
