:root {
  color-scheme: dark;
  --bg: #0a0d11;
  --rail: #0e1217;
  --surface: #11161c;
  --surface-2: #151c24;
  --text: #edf2f4;
  --muted: #919ca5;
  --line: rgba(237, 242, 244, .13);
  --line-strong: rgba(237, 242, 244, .27);
  --accent: #c7ff4a;
  --accent-ink: #101703;
  --rail-width: 132px;
  --content-width: 1240px;
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f5f1;
  --rail: #eceee8;
  --surface: #ffffff;
  --surface-2: #e9ece5;
  --text: #14191c;
  --muted: #5e696f;
  --line: rgba(20, 25, 28, .13);
  --line-strong: rgba(20, 25, 28, .26);
  --accent: #426900;
  --accent-ink: #f8ffe9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); transition: background 180ms ease, color 180ms ease; }
body::before { position: fixed; inset: 0; z-index: -1; background: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(to right, transparent 5%, #000 35%, #000); content: ''; opacity: .45; pointer-events: none; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 40; padding: .7rem .9rem; background: var(--accent); color: var(--accent-ink); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.cursor-light, .node-field { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.cursor-light { background: radial-gradient(520px circle at var(--cursor-x, 78vw) var(--cursor-y, 22vh), color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); opacity: 0; transition: opacity 260ms ease; }
.cursor-light.is-visible { opacity: 1; }
.node-field { opacity: .68; }
.site-shell { min-height: 100vh; }
.rail { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: var(--rail-width); flex-direction: column; align-items: stretch; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--rail) 94%, transparent); backdrop-filter: blur(18px); }
.brand { display: grid; height: 108px; place-items: center; border-bottom: 1px solid var(--line); text-decoration: none; }
.brand img { width: 84px; aspect-ratio: 1; border: 1px solid var(--line-strong); border-radius: 50%; object-fit: cover; }
.brand i { position: absolute; top: 24px; right: 24px; width: 7px; aspect-ratio: 1; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent); }
.rail-nav { display: flex; flex: 1; flex-direction: column; justify-content: center; }
.rail-nav a { position: relative; display: flex; min-height: 92px; flex-direction: column; justify-content: center; gap: .3rem; padding: 1rem 1.15rem; border-top: 1px solid transparent; border-bottom: 1px solid transparent; color: var(--muted); text-decoration: none; transition: color 160ms ease, background 160ms ease; }
.rail-nav a::before { position: absolute; top: 50%; left: 0; width: 2px; height: 0; background: var(--accent); content: ''; transform: translateY(-50%); transition: height 160ms ease; }
.rail-nav a:hover, .rail-nav a.is-active { color: var(--text); background: color-mix(in srgb, var(--surface) 75%, transparent); }
.rail-nav a.is-active::before { height: 56%; }
.rail-nav span { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .65rem; }
.rail-nav strong { font-size: .78rem; font-weight: 650; }
.rail-bottom { border-top: 1px solid var(--line); }
.language-switch { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.language-button, .theme-toggle { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.language-button { min-height: 42px; font-size: .65rem; font-weight: 800; }
.language-button + .language-button { border-left: 1px solid var(--line); }
.language-button.is-active { color: var(--text); background: var(--surface); }
.theme-toggle { position: relative; display: grid; width: 100%; height: 44px; place-items: center; border-bottom: 1px solid var(--line); }
.theme-icon { position: absolute; width: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; transition: opacity 160ms ease, transform 160ms ease; }
.theme-icon-sun, :root[data-theme='light'] .theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-icon-moon, :root[data-theme='light'] .theme-icon-sun { opacity: 0; transform: rotate(-30deg) scale(.65); }
.rail-socials { display: grid; grid-template-columns: repeat(3, 1fr); }
.rail-socials a { display: grid; min-height: 42px; place-items: center; color: var(--muted); font-size: .61rem; font-weight: 800; text-decoration: none; }
.rail-socials a + a { border-left: 1px solid var(--line); }
.rail-socials a:hover { color: var(--accent); }

.content { position: relative; z-index: 1; width: min(calc(100% - var(--rail-width)), var(--content-width)); margin-left: max(var(--rail-width), calc((100vw - var(--content-width) + var(--rail-width)) / 2)); padding-inline: clamp(2rem, 4vw, 4.5rem); }
.section { padding-block: clamp(2.5rem, 4.5vw, 4.25rem); border-bottom: 1px solid var(--line); }
.section-tag { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.section-tag span:first-child { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.about { display: flex; min-height: min(600px, 78vh); flex-direction: column; justify-content: center; }
.about > .section-tag { margin-bottom: clamp(2rem, 5vw, 4rem); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .55fr); gap: clamp(2rem, 7vw, 7rem); align-items: end; }
.availability { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.4rem; color: var(--muted); font-size: .78rem; }
.availability i { width: 7px; aspect-ratio: 1; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent); }
h1 { max-width: 12ch; margin-bottom: .75rem; font-size: clamp(3.4rem, 6.6vw, 6.6rem); font-weight: 560; letter-spacing: -.07em; line-height: .88; }
.role { margin-bottom: 1.3rem; color: var(--accent); font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 650; }
.lede { max-width: 670px; margin-bottom: 1.75rem; color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.1rem); line-height: 1.62; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.button { display: inline-flex; min-height: 42px; align-items: center; gap: .45rem; padding: .65rem .9rem; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); font-size: .8rem; font-weight: 700; text-decoration: none; }
.button-primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.button-linkedin { border-color: #b9ddf5; background: #d9efff; color: #123b55; }
.button-leetcode { border-color: #e2ca91; background: #f3e1b5; color: #49350e; }
.text-action, .inline-link { padding: .35rem .15rem; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: .78rem; font-weight: 700; text-decoration: none; }
.text-action { display: inline-flex; align-items: center; gap: .45rem; }
.text-action:hover, .inline-link:hover { border-color: var(--accent); color: var(--text); }
.service-icon { width: 16px; height: 16px; flex: 0 0 auto; fill: currentColor; }
.service-icon-document, .service-icon-code { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.about-facts { border-top: 1px solid var(--line); }
.about-facts div { display: grid; grid-template-columns: 74px 1fr; gap: 1rem; align-items: baseline; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.about-facts strong { font-size: 1.05rem; letter-spacing: -.04em; }
.about-facts span { color: var(--muted); font-size: .78rem; line-height: 1.45; }

.section-header { display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: 2rem; align-items: end; margin-bottom: 1.7rem; }
.section-header > p { margin-bottom: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.project-card { display: flex; overflow: hidden; min-width: 0; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color 180ms ease, transform 180ms ease; }
.project-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.project-media { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); background: #030507; }
.project-media::after { position: absolute; inset: 0; background: linear-gradient(to top, rgba(3,5,7,.38), transparent 50%); content: ''; pointer-events: none; }
.project-media img, .project-media video { width: 100%; height: 100%; object-fit: cover; transition: transform 450ms cubic-bezier(.2,.8,.2,1); }
.project-card:nth-child(3) .project-media img { object-position: center 68%; }
.project-card:hover .project-media img, .project-card:hover .project-media video { transform: scale(1.025); }
.project-media > span { position: absolute; right: .7rem; bottom: .65rem; z-index: 1; padding: .32rem .5rem; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(5,8,11,.7); color: #f3f6f7; font-size: .62rem; font-weight: 700; backdrop-filter: blur(8px); }
.project-copy { display: flex; min-height: 252px; flex: 1; flex-direction: column; padding: 1.15rem; }
.card-index, .experience-company { margin-bottom: .7rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.project-copy h2 { margin-bottom: .75rem; font-size: clamp(1.35rem, 2vw, 1.8rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; }
.project-copy > p:not(.card-index) { margin-bottom: 1rem; color: var(--muted); font-size: .86rem; line-height: 1.56; }
.project-copy > .inline-link, .project-links { margin-top: auto; align-self: flex-start; }
.project-links { display: flex; gap: 1rem; }
.other-work { margin-top: 1rem; border-top: 1px solid var(--line); }
.work-row { position: relative; display: grid; grid-template-columns: 40px minmax(190px, .7fr) minmax(260px, 1.15fr) auto; gap: 1.2rem; align-items: center; min-height: 112px; padding: 1rem 1.15rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.work-row::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); content: ''; opacity: 0; transition: opacity 160ms ease; }
.work-row:hover::before { opacity: 1; }
.work-row-index { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .67rem; }
.work-row h3 { margin-bottom: 0; font-size: 1.05rem; letter-spacing: -.025em; }
.work-row > p { margin-bottom: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.work-row-links { display: flex; gap: .9rem; }
.work-row-links a { font-size: .72rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.work-row-links a:hover { color: var(--accent); }
.between-row { background-image: linear-gradient(90deg, color-mix(in srgb, var(--surface) 96%, transparent), var(--surface)), url('../assets/between-stops-rain.png'); background-position: center; background-size: cover; }

.experience-list { border-top: 1px solid var(--line); }
.experience-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 150px; gap: clamp(1.5rem, 4vw, 4rem); padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.experience-date { margin: .15rem 0 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .7rem; white-space: nowrap; }
.experience-company { margin-bottom: .35rem; color: var(--accent); }
.experience-row h2 { margin-bottom: .55rem; font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 600; letter-spacing: -.035em; }
.experience-row div > p:last-child { max-width: 740px; margin-bottom: 0; color: var(--muted); font-size: .87rem; line-height: 1.55; }
.experience-link { align-self: start; justify-self: end; padding-bottom: .3rem; border-bottom: 1px solid var(--line-strong); font-size: .76rem; font-weight: 700; text-decoration: none; text-align: right; }
.experience-link:hover { border-color: var(--accent); color: var(--accent); }
.experience-product { align-self: start; justify-self: end; color: var(--muted); font-size: .72rem; font-weight: 650; text-align: right; }

.footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; padding-block: 2.5rem 2rem; }
.footer > div:first-child > p:last-child { max-width: 560px; margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a { font-size: .75rem; font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.copyright { grid-column: 1 / -1; margin: 1rem 0 0; color: var(--muted); font-size: .67rem; }

@media (max-width: 1050px) {
  :root { --rail-width: 112px; }
  .content { margin-left: var(--rail-width); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .project-card:last-child .project-media { height: 100%; aspect-ratio: auto; border-right: 1px solid var(--line); border-bottom: 0; }
  .work-row { grid-template-columns: 32px minmax(170px, .7fr) 1fr auto; }
}

@media (max-width: 760px) {
  :root { --rail-width: 0px; }
  html { scroll-padding-top: 74px; }
  .rail { inset: 0 0 auto; width: 100%; height: 62px; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 62px; height: 61px; flex: 0 0 62px; border-right: 1px solid var(--line); border-bottom: 0; }
  .brand img { width: 42px; }
  .brand i { top: 13px; right: auto; left: 47px; width: 6px; }
  .rail-nav { display: flex; min-width: 0; flex: 1; flex-direction: row; justify-content: flex-start; overflow-x: auto; }
  .rail-nav a { min-width: 86px; min-height: 61px; flex: 0 0 auto; gap: .15rem; padding: .65rem .85rem; border-right: 1px solid var(--line); }
  .rail-nav a::before { inset: auto 0 0; width: auto; height: 2px; transform: none; }
  .rail-nav a.is-active::before { height: 2px; }
  .rail-bottom { display: flex; flex: 0 0 auto; border-top: 0; border-left: 1px solid var(--line); }
  .language-switch { width: 66px; border-right: 1px solid var(--line); border-bottom: 0; }
  .language-button { min-height: 61px; }
  .theme-toggle { width: 46px; height: 61px; border-bottom: 0; }
  .rail-socials { display: none; }
  .cursor-light, .node-field { display: none; }
  .content { width: 100%; margin-left: 0; padding-inline: 1.15rem; }
  .section { padding-block: 3rem; }
  .about { min-height: auto; padding-top: 7.3rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about > .section-tag { margin-bottom: 2.2rem; }
  .about-facts { display: grid; grid-template-columns: repeat(3, 1fr); }
  .about-facts div { grid-template-columns: 1fr; gap: .45rem; padding-right: .75rem; }
  .about-facts div + div { padding-left: .75rem; border-left: 1px solid var(--line); }
  .section-header { grid-template-columns: 1fr; gap: 1rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card:last-child { grid-column: auto; display: flex; }
  .project-card:last-child .project-media { height: auto; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-copy { min-height: 220px; }
  .work-row { grid-template-columns: 28px 1fr auto; gap: .8rem; }
  .work-row > p { grid-column: 2 / -1; }
  .work-row-links { grid-column: 3; grid-row: 1; }
  .experience-row { grid-template-columns: 84px minmax(0, 1fr); gap: 1.25rem; }
  .experience-link, .experience-product { grid-column: 2; justify-self: start; text-align: left; }
}

@media (max-width: 480px) {
  .rail-nav a { min-width: 72px; padding-inline: .65rem; }
  .rail-nav strong { font-size: .68rem; }
  h1 { font-size: clamp(3.2rem, 17vw, 4.7rem); }
  .actions .button { flex: 1; }
  .text-action { width: 100%; margin-top: .2rem; text-align: center; }
  .about-facts { grid-template-columns: 1fr; }
  .about-facts div { grid-template-columns: 62px 1fr; padding-inline: 0; }
  .about-facts div + div { padding-left: 0; border-left: 0; }
  .work-row { grid-template-columns: 24px 1fr; }
  .work-row-links { grid-column: 2; grid-row: auto; }
  .work-row > p { grid-column: 2; }
  .experience-row { grid-template-columns: 1fr; gap: .55rem; }
  .experience-link, .experience-product { grid-column: 1; }
  .footer { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; }
  .copyright { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cursor-light, .node-field { display: none; }
}
.pumpkin-rain { position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
