:root {
  --bg:        #0c0c0d;
  --surface:   #131315;
  --text:      #ececec;
  --text-dim:  #b4b4b8;
  --muted:     #82828a;
  --rule:      #232326;
  --rule-soft: #1a1a1d;
  --accent:    #e8590c;
  --accent-dim:#b8460a;
  --selection: rgba(232,89,12,0.25);
}

html[data-theme="light"] {
  --bg:        #faf8f5;
  --surface:   #ffffff;
  --text:      #16161a;
  --text-dim:  #3d3d45;
  --muted:     #6b6b75;
  --rule:      #e2ded6;
  --rule-soft: #eeebe4;
  --accent:    #c1440e;
  --accent-dim:#9c360b;
  --selection: rgba(193,68,14,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--selection); }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; }

/* ── PRIMITIVES ── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.serif {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.015em;
}

section { padding: 6.5rem 0; border-top: 1px solid var(--rule-soft); }
section:first-of-type { border-top: none; }

/* Editorial 2-column: label rail + content */
.cols {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3.5rem;
  align-items: start;
}
.rail { position: sticky; top: 6rem; }
.rail .mono { display: block; }
.rail .rail-num { color: var(--accent); margin-bottom: 0.4rem; }

h2.sec-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
h2.sec-title em { font-style: italic; color: var(--accent); }

p.lede {
  font-size: 1.06rem;
  color: var(--text-dim);
  line-height: 1.75;
  max-width: 62ch;
}
p.lede + p.lede { margin-top: 1.1rem; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.3s, border-color 0.3s;
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 2rem;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; gap: 1.9rem; list-style: none; }
.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }

.theme-toggle {
  width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--rule); border-radius: 3px;
  color: var(--muted); cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 14px; height: 14px; }
.icon-sun { display: none; }
html[data-theme="light"] .icon-sun { display: block; }
html[data-theme="light"] .icon-moon { display: none; }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 8rem 0 4rem;
  border-top: none;
}
.hero-meta {
  display: flex; align-items: center; gap: 0.8rem;
  margin-bottom: 2.2rem;
}
.hero-meta .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
h1.hero-name {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 1.8rem;
}
.hero-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 2.4rem;
  padding-bottom: 2.4rem;
  border-bottom: 1px solid var(--rule);
  max-width: 62ch;
}
.hero-role b { color: var(--text); font-weight: 500; }
.hero-thesis {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 58ch;
  margin-bottom: 3.2rem;
}
.hero-thesis em { font-style: italic; color: var(--text); }

/* Arc strip */
.arc {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  max-width: 780px;
}
.arc-step { padding: 1.4rem 1.6rem 0 0; position: relative; }
.arc-step::before {
  content: ''; position: absolute; top: -1px; left: 0;
  width: 34px; height: 1px; background: var(--accent);
}
.arc-step .yr { display: block; margin-bottom: 0.45rem; }
.arc-step .nm {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.12rem; line-height: 1.3;
}
.arc-step:last-child .nm { color: var(--accent); }

/* ── ARC DETAIL ── */
.era { padding: 2.2rem 0; border-bottom: 1px solid var(--rule-soft); }
.era:last-child { border-bottom: none; padding-bottom: 0; }
.era-head {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 0.7rem; flex-wrap: wrap;
}
.era-head h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem; font-weight: 400; letter-spacing: -0.015em;
}
.era p { color: var(--text-dim); max-width: 64ch; line-height: 1.7; }

/* ── WORK ── */
.work-item {
  display: grid; grid-template-columns: 190px 1fr;
  gap: 3.5rem;
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: border-color 0.2s;
}
.work-item:first-child { padding-top: 0; }
.work-item:last-child { border-bottom: none; }
.work-item:hover { border-bottom-color: var(--rule); }
.work-item:hover h3 { color: var(--accent); }

.work-meta .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; color: var(--accent);
  display: block; margin-bottom: 0.5rem;
}
.work-meta .domain { display: block; margin-bottom: 0.3rem; }
.work-meta .ctx {
  font-size: 0.78rem; color: var(--muted); line-height: 1.5;
  font-family: 'Inter', sans-serif; text-transform: none; letter-spacing: 0;
}

.work-body h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem; font-weight: 400; letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 0.7rem;
  transition: color 0.2s;
}
.work-body p {
  color: var(--text-dim); line-height: 1.7; max-width: 62ch;
  margin-bottom: 1rem;
}
.stack {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 1.1rem;
}
.stack span::after { content: ' / '; color: var(--rule); }
.stack span:last-child::after { content: ''; }

.links { display: flex; gap: 1.6rem; }
.links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; color: var(--text-dim);
  padding-bottom: 3px; border-bottom: 1px solid var(--rule);
  transition: color 0.18s, border-color 0.18s;
}
.links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── PLATFORM WORK ── */
.platform { padding: 2.4rem 0; border-bottom: 1px solid var(--rule-soft); }
.platform:first-of-type { padding-top: 0; }
.platform:last-of-type { border-bottom: none; }
.platform-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 0.45rem;
}
.platform h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.35rem; font-weight: 400; letter-spacing: -0.015em;
}
.platform .arch {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em;
  margin-bottom: 0.9rem;
}
.platform > p { color: var(--text-dim); line-height: 1.7; max-width: 64ch; margin-bottom: 1.1rem; }
.decision {
  border-left: 2px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1rem;
  max-width: 62ch; margin-bottom: 1.1rem;
}
.decision .mono { display: block; margin-bottom: 0.25rem; color: var(--accent); }
.decision p { color: var(--text-dim); line-height: 1.7; }
.metrics {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em;
}
.metrics b { color: var(--text); font-weight: 500; }
.metrics span::after { content: '  ·  '; color: var(--rule); }
.metrics span:last-child::after { content: ''; }

.group { margin: 0 0 0.4rem; }
.group-label { display: block; color: var(--accent); margin-bottom: 0.6rem; }
.group p { color: var(--text-dim); max-width: 62ch; line-height: 1.7; }
.group.split { margin-top: 3.2rem; padding-top: 2.6rem; border-top: 1px solid var(--rule); }
.platform:has(+ .group) { border-bottom: none; }

/* ── EXPERIENCE ── */
.job {
  display: grid; grid-template-columns: 190px 1fr;
  gap: 3.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.job:first-child { padding-top: 0; }
.job:last-child { border-bottom: none; }
.job-meta .co { display: block; margin-top: 0.4rem; font-size: 0.78rem; text-transform: none; letter-spacing: 0; font-family: 'Inter', sans-serif; }
.job-body h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.25rem; font-weight: 400; letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
}
.job-body ul { list-style: none; }
.job-body li {
  color: var(--text-dim); line-height: 1.7;
  padding-left: 1.1rem; position: relative;
  max-width: 64ch;
}
.job-body li + li { margin-top: 0.5rem; }
.job-body li::before {
  content: ''; position: absolute; left: 0; top: 0.72em;
  width: 5px; height: 1px; background: var(--accent);
}

/* ── TOOLKIT ── */
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.2rem 3rem; }
.tool-group h4 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.05rem; font-weight: 500;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule-soft);
}
.tool-group p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem; line-height: 1.9; color: var(--text-dim);
}

/* ── EDUCATION / RECOGNITION ── */
.cred { padding: 1.5rem 0; border-bottom: 1px solid var(--rule-soft); }
.cred:first-child { padding-top: 0; }
.cred:last-of-type { border-bottom: none; }
.cred-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; }
.cred h4 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.15rem; font-weight: 400;
}
.cred .school { color: var(--text-dim); font-size: 0.92rem; margin-top: 0.2rem; }
.honors {
  margin-top: 2rem; padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.honors ul { list-style: none; margin-top: 0.8rem; }
.honors li {
  color: var(--text-dim); padding-left: 1.1rem; position: relative; line-height: 1.7;
}
.honors li::before {
  content: ''; position: absolute; left: 0; top: 0.72em;
  width: 5px; height: 1px; background: var(--accent);
}

/* ── CONTACT ── */
#contact .lede { margin-bottom: 2rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 1.8rem; }
.contact-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; letter-spacing: 0.04em;
  text-decoration: none; color: var(--text);
  padding-bottom: 4px; border-bottom: 1px solid var(--rule);
  transition: color 0.18s, border-color 0.18s;
}
.contact-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.contact-links a .arr { color: var(--muted); }
.contact-links a:hover .arr { color: var(--accent); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--rule-soft);
  padding: 2.2rem 0;
}
.foot-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 2rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ── REVEAL ── */
html.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) { .nav-links { display: none; } }
@media (max-width: 820px) {
  .cols, .work-item, .job { grid-template-columns: 1fr; gap: 1.2rem; }
  .rail { position: static; }
  .rail .mono { display: inline; margin-right: 0.8rem; }
  .tools { grid-template-columns: 1fr; }
  .arc { grid-template-columns: 1fr; max-width: none; }
  .arc-step { padding: 1.1rem 0 1.1rem 0; border-top: 1px solid var(--rule-soft); }
  .arc-step:first-child { border-top: none; }
  .arc-step::before { display: none; }
  .nav-links { display: none; }
  section { padding: 4.5rem 0; }
  .wrap, .nav-inner, .foot-inner { padding: 0 1rem; }
  .work-meta .num { display: inline; margin-right: 0.8rem; }
  .work-meta .domain { display: inline; }
  .work-meta .ctx { display: block; margin-top: 0.3rem; }
}

/* ── INNER PAGES (writing) ── */
.nav-links.keep { display: flex; }
a.nav-logo { text-decoration: none; }

.page { padding: 9rem 0 5rem; }
.page-wrap { max-width: 720px; margin: 0 auto; padding: 0 2rem; }
.post-meta { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.post-meta .mono:first-child { color: var(--accent); }
h1.post-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 1.2rem;
}
.post-dek {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 300;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--text-dim);
  padding-bottom: 2.4rem;
  margin-bottom: 2.6rem;
  border-bottom: 1px solid var(--rule);
}

.prose { font-size: 1.04rem; line-height: 1.8; color: var(--text-dim); }
.prose > * + * { margin-top: 1.3rem; }
.prose h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; font-size: 1.65rem; line-height: 1.25;
  letter-spacing: -0.015em; color: var(--text);
  margin-top: 3rem;
}
.prose h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500; font-size: 1.25rem; color: var(--text);
  margin-top: 2.2rem;
}
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--text);
  text-decoration: underline; text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.5rem; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1.1rem;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.2rem; line-height: 1.6; color: var(--text);
}
.prose code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.84em;
  background: var(--surface); border: 1px solid var(--rule-soft);
  padding: 0.1em 0.35em; border-radius: 3px;
}
.prose pre {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 3px;
  padding: 1.1rem 1.2rem; overflow-x: auto;
  font-size: 0.82rem; line-height: 1.65;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: var(--text-dim); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--rule-soft); }
.prose th {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  border-bottom-color: var(--rule);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }
.prose img { max-width: 100%; }

/* Rouge syntax — restrained, two tones */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cp { color: var(--muted); font-style: italic; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .mi, .highlight .mf { color: var(--accent); }
.highlight .k, .highlight .kn, .highlight .kd, .highlight .kc, .highlight .ow, .highlight .nf { color: var(--text); }

.post-foot {
  margin-top: 4rem; padding-top: 1.6rem; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.post-foot a, .back-link {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none;
  border-bottom: 1px solid var(--rule); padding-bottom: 3px;
}
.post-foot a:hover, .back-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Writing index */
.post-list { list-style: none; margin-top: 2.6rem; }
.post-list li { padding: 1.8rem 0; border-bottom: 1px solid var(--rule-soft); }
.post-list li:first-child { border-top: 1px solid var(--rule); }
.post-list a { text-decoration: none; display: block; }
.post-list h2 {
  font-family: 'Newsreader', Georgia, serif; font-weight: 400;
  font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.015em;
  margin: 0.4rem 0 0.5rem; color: var(--text); transition: color 0.2s;
}
.post-list a:hover h2 { color: var(--accent); }
.post-list p { color: var(--text-dim); line-height: 1.7; }
.empty { color: var(--muted); margin-top: 2.6rem; }

@media (max-width: 820px) {
  .page { padding: 7rem 0 4rem; }
  .page-wrap { padding: 0 1rem; }
}
