/* ───────── tokens ───────── */
:root {
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-serif: 'Fraunces', Georgia, serif;

  /* dark (default) — custom palette, not a copy */
  --bg: #0e1017;
  --bg-soft: #151822;
  --bg-hover: #1d2130;
  --bg-sel: #2a3045;
  --panel: #10131c;
  --border: #222838;
  --border-strong: #343b52;

  --fg: #d6dcea;
  --fg-dim: #8a93aa;
  --fg-muted: #545b70;
  --fg-line: #3a4056;

  --blue: #6aa9ff;
  --green: #88d488;
  --yellow: #e8c76a;
  --purple: #c5a0ff;
  --red: #f07a7a;
  --cyan: #7adbd1;
  --orange: #f0a868;
  --pink: #e88bcc;

  --linum-bg: #0b0d14;
  --status: #6aa9ff;
  --status-fg: #0e1017;
}

:root[data-theme='light'] {
  --bg: #f4efe6;
  --bg-soft: #ece5d7;
  --bg-hover: #e1d8c5;
  --bg-sel: #d6caae;
  --panel: #efe8db;
  --border: #d4c9b0;
  --border-strong: #b5a886;

  --fg: #2b2a24;
  --fg-dim: #6b6858;
  --fg-muted: #9a9482;
  --fg-line: #b8b09a;

  --blue: #2d66c9;
  --green: #4a8f4a;
  --yellow: #b8870a;
  --purple: #8c4fc7;
  --red: #c04848;
  --cyan: #2e8a82;
  --orange: #c46a1f;
  --pink: #b34f92;

  --linum-bg: #ece5d7;
  --status: #2d66c9;
  --status-fg: #f4efe6;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#root {
  height: 100vh;
  width: 100vw;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

::selection {
  background: var(--bg-sel);
  color: var(--fg);
}

/* ───────── app shell ───────── */
.nvim {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  height: 100vh;
  width: 100vw;
  background: var(--bg);
}

/* tabline */
.tabline {
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  height: 32px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabline::-webkit-scrollbar {
  display: none;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 12px;
  color: var(--fg-dim);
  border-right: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  position: relative;
}
.tab.active {
  background: var(--bg);
  color: var(--fg);
}
.tab.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--status);
}
.tab .tab-idx {
  color: var(--fg-muted);
  font-size: 10px;
}
.tab .tab-dot {
  color: var(--yellow);
  margin-left: 4px;
}
.tab-spacer {
  flex: 1;
  border-right: 1px solid var(--border);
}
.tab-meta {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--fg-muted);
  font-size: 11px;
  gap: 12px;
}

/* breadcrumb / winbar */
.winbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--fg-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.winbar .crumb {
  color: var(--fg-dim);
}
.winbar .crumb.accent {
  color: var(--blue);
}
.winbar .sep {
  color: var(--fg-line);
}

/* main split */
.split {
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  min-height: 0;
}
.split.no-tree {
  grid-template-columns: 1fr;
}
.split.no-tree .tree {
  display: none;
}

/* netrw tree */
.tree {
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 10px 0;
  font-size: 12px;
}
.tree-header {
  padding: 4px 14px 10px;
  color: var(--fg-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tree-group {
  padding: 10px 14px 4px;
  color: var(--fg-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 14px 3px 22px;
  color: var(--fg-dim);
  cursor: pointer;
  position: relative;
}
.tree-item:hover {
  background: var(--bg-hover);
  color: var(--fg);
}
.tree-item.active {
  background: var(--bg-sel);
  color: var(--fg);
}
.tree-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--status);
}
.tree-item .glyph {
  color: var(--fg-muted);
  width: 12px;
  text-align: center;
}
.tree-item.active .glyph {
  color: var(--status);
}
.tree-item .key {
  margin-left: auto;
  color: var(--fg-muted);
  font-size: 10px;
}

/* buffer area */
.buffer-wrap {
  display: grid;
  grid-template-columns: 54px 1fr;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}
.linum {
  background: var(--linum-bg);
  border-right: 1px solid var(--border);
  padding: 14px 10px 14px 0;
  text-align: right;
  font-size: 12px;
  color: var(--fg-muted);
  user-select: none;
  overflow: hidden;
  line-height: 1.55;
}
.linum .ln {
  display: block;
  height: 21.7px;
}
.linum .ln.current {
  color: var(--yellow);
  font-weight: 700;
}

.buffer {
  overflow-y: auto;
  padding: 14px 36px 80px;
  scroll-behavior: smooth;
  position: relative;
}
.buffer::-webkit-scrollbar {
  width: 4px;
}
.buffer::-webkit-scrollbar-track {
  background: transparent;
}
.buffer::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.buffer {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* cursor indicator on active row */
.cursor-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 21.7px;
  background: color-mix(in oklab, var(--yellow) 8%, transparent);
  pointer-events: none;
  transition: top 0.08s linear;
}

/* statusline */
.statusline {
  display: flex;
  align-items: stretch;
  height: 26px;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel);
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.sl-mode {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--status);
  color: var(--status-fg);
  letter-spacing: 0.12em;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  padding-right: 22px;
}
.sl-seg {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--fg-dim);
  background: var(--bg-soft);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  margin-left: -10px;
  padding-left: 20px;
}
.sl-seg.git {
  color: var(--green);
}
.sl-seg.diag {
  color: var(--yellow);
}
.sl-spacer {
  flex: 1;
  background: var(--panel);
  margin-left: -10px;
}
.sl-right {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--bg-soft);
  color: var(--fg-dim);
  gap: 14px;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
  padding-left: 22px;
}
.sl-right .sep {
  color: var(--fg-muted);
}

/* command line */
.cmdline {
  height: 22px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  font-size: 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  gap: 6px;
}
.cmdline.active {
  color: var(--fg);
}
.cmd-wildmenu {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding-left: 10px;
  margin-left: 4px;
}
.cmd-wm-item {
  padding: 1px 6px;
  border-radius: 2px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}
.cmd-wm-item.on {
  background: var(--yellow);
  color: var(--bg);
  font-weight: 600;
}
.cmdline .prefix {
  color: var(--yellow);
  font-weight: 700;
}
.cmdline input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
}
.cmdline .hint {
  color: var(--fg-muted);
  font-size: 11px;
}
.cmd-block {
  animation: blink 1s steps(2) infinite;
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--fg);
  vertical-align: middle;
  margin-left: 1px;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ───────── typography inside buffers ───────── */
.buffer h1,
.buffer h2,
.buffer h3 {
  margin: 0;
  font-weight: 700;
}
.buffer .comment {
  color: var(--fg-muted);
}
.buffer .kw {
  color: var(--purple);
}
.buffer .fn {
  color: var(--blue);
}
.buffer .str {
  color: var(--green);
}
.buffer .num {
  color: var(--orange);
}
.buffer .op {
  color: var(--red);
}
.buffer .type {
  color: var(--yellow);
}

/* hero */
.hero {
  display: grid;
  gap: 24px;
  padding: 28px 0 40px;
}
.hero-ascii {
  font-size: 13px;
  line-height: 1.05;
  color: var(--blue);
  white-space: pre;
  font-weight: 700;
  letter-spacing: 0;
  overflow-x: auto;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--fg);
  max-width: 900px;
}
.hero-name em {
  font-style: italic;
  color: var(--blue);
}
.hero-sub {
  font-size: 14px;
  color: var(--fg-dim);
  max-width: 680px;
  line-height: 1.6;
}
.hero-sub code {
  color: var(--yellow);
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 2px;
}

/* section heading (::) */
.h-section {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 32px 0 14px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 20px;
}
.h-section .idx {
  color: var(--fg-muted);
  font-size: 11px;
}
.h-section .title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.h-section .subt {
  color: var(--fg-dim);
  font-size: 12px;
  margin-left: auto;
}

/* project cards */
.proj-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
.proj {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
  gap: 20px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  align-items: start;
}
.proj:hover {
  background: var(--bg-soft);
}
.proj.search-hit {
  border-left: 2px solid transparent;
}
.proj.search-active {
  border-left-color: var(--orange);
  background: var(--bg-hover);
  box-shadow: inset 0 0 0 1px var(--orange);
}
.proj.focus {
  background: var(--bg-hover);
}
.proj.focus::before {
  content: '▌';
  position: absolute;
  left: 4px;
  top: 18px;
  color: var(--yellow);
  font-size: 16px;
  animation: blink 1s steps(2) infinite;
}
.proj-idx {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 600;
  padding-top: 4px;
}
.proj-body h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--fg);
}
.proj-body .desc {
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
  max-width: 640px;
}
.proj-body .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.proj-body .tag {
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  color: var(--fg-dim);
  border-radius: 2px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.proj-meta {
  text-align: right;
  font-size: 10px;
  color: var(--fg-muted);
  padding-top: 4px;
}
.proj-meta .arrow {
  color: var(--blue);
  font-size: 14px;
  margin-top: 4px;
}

/* project expanded detail */
.proj-detail {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border);
  padding: 18px 4px 4px;
  margin-top: 16px;
  display: grid;
  gap: 14px;
}
.proj-detail .highlights {
  display: grid;
  gap: 8px;
}
.proj-detail .hl {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  color: var(--fg-dim);
  font-size: 12.5px;
  line-height: 1.55;
}
.proj-detail .hl .bullet {
  color: var(--green);
}
.proj-detail .hl b {
  color: var(--yellow);
  font-weight: 700;
}
.proj-detail .links {
  display: flex;
  gap: 14px;
  font-size: 11px;
  padding-top: 6px;
}
.proj-detail .links a {
  color: var(--blue);
}

/* metric boxes */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  margin: 20px 0;
  background: var(--bg-soft);
}
.metric {
  padding: 20px;
  border-right: 1px solid var(--border);
  position: relative;
}
.metric:last-child {
  border-right: none;
}
.metric .big {
  font-family: var(--font-serif);
  font-size: 56px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--yellow);
  margin-bottom: 4px;
}
.metric .big .unit {
  color: var(--fg-dim);
  font-size: 24px;
  font-weight: 400;
}
.metric .label {
  font-size: 11px;
  color: var(--fg-dim);
  line-height: 1.4;
  max-width: 90%;
}
.metric .tag {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 9px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* experience timeline */
.exp-list {
  display: grid;
  gap: 0;
}
.exp {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 20px 0 20px 20px;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.exp:last-child {
  border-bottom: none;
}
.exp:hover {
  background: var(--bg-soft);
}
.exp.focus {
  background: var(--bg-hover);
}
.exp.focus::before {
  content: '▌';
  position: absolute;
  left: 4px;
  top: 20px;
  color: var(--yellow);
  font-size: 16px;
  animation: blink 1s steps(2) infinite;
}
.exp .when {
  font-size: 11px;
  color: var(--fg-muted);
  padding-top: 4px;
}
.exp .when .dates {
  color: var(--fg-dim);
}
.exp .when .loc {
  margin-top: 4px;
}
.exp .role h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 2px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.exp .role .org {
  color: var(--blue);
  font-size: 12px;
  margin-bottom: 10px;
}
.exp .bullets {
  margin: 0;
  padding-left: 18px;
  color: var(--fg-dim);
  font-size: 12.5px;
  line-height: 1.6;
}
.exp .bullets li {
  margin-bottom: 4px;
}
.exp .bullets b {
  color: var(--yellow);
  font-weight: 700;
}

/* about */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  padding: 8px 0 0;
}
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}
.about-prose p {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg);
  margin: 0 0 16px;
  max-width: 580px;
}
.about-prose p em {
  color: var(--blue);
  font-style: italic;
}
.about-sidebar {
  font-size: 12px;
  color: var(--fg-dim);
  display: grid;
  gap: 20px;
}
.sidebar-block {
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--bg-soft);
}
.sidebar-block h5 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin: 0 0 10px;
  font-weight: 600;
}
.sidebar-block .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 11.5px;
}
.sidebar-block .row:last-child {
  border-bottom: none;
}
.sidebar-block .row .k {
  color: var(--fg-muted);
}
.sidebar-block .row .v {
  color: var(--fg);
  text-align: right;
}

/* skill cloud */
.skill-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px 24px;
  padding: 4px 0;
}
.skill-grid .k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  padding-top: 4px;
}
.skill-grid .v {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  color: var(--fg-dim);
  border-radius: 2px;
  background: var(--bg-soft);
}
.skill.hot {
  color: var(--yellow);
  border-color: var(--yellow);
}
.skill.warm {
  color: var(--blue);
  border-color: var(--blue);
}

/* now page */
.now-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 20px 0;
}
.now-card {
  border: 1px solid var(--border);
  padding: 18px 20px;
  background: var(--bg-soft);
  position: relative;
}
.now-card .status {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 9px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.now-card .status::before {
  content: '●';
  margin-right: 4px;
  color: var(--green);
  font-size: 10px;
}
.now-card h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.now-card p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 12.5px;
  line-height: 1.55;
}
.now-card .tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  color: var(--blue);
}

/* contact */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 20px 0;
}
@media (max-width: 800px) {
  .contact-wrap {
    grid-template-columns: 1fr;
  }
}
.contact-intro p {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--fg);
  max-width: 420px;
}
.contact-intro .links {
  margin-top: 22px;
  display: grid;
  gap: 8px;
  font-size: 12.5px;
}
.contact-intro .links a {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg);
}
.contact-intro .links a:hover {
  border-color: var(--blue);
  text-decoration: none;
}
.contact-intro .links a.active {
  border-color: var(--status);
  background: var(--bg-sel);
}
.contact-intro .links .k {
  color: var(--fg-muted);
}
.contact-intro .links .v {
  color: var(--blue);
}

.mail-guide {
  margin-top: 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 12px 14px;
}
.mail-guide h5 {
  margin: 0 0 10px;
  font-size: 10px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mail-guide ul {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-dim);
}
.mail-guide li kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--yellow);
  padding: 1px 4px;
}
.mail-guide li code {
  font-family: var(--font-mono);
  color: var(--blue);
  font-size: 11px;
}

.contact-form {
  border: 1px solid var(--border);
  padding: 20px;
  background: var(--bg-soft);
  display: grid;
  gap: 12px;
}

.contact-form .field {
  display: grid;
  gap: 6px;
}
.contact-form label {
  font-size: 10px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.contact-form .field.active label {
  color: var(--blue);
}
.contact-form .field.active input,
.contact-form .field.active textarea {
  border-color: var(--status);
}
.contact-form input,
.contact-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  resize: vertical;
  color: var(--fg);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
}
.contact-form textarea {
  min-height: 160px;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--blue);
}
.contact-form .actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.contact-form button {
  background: var(--blue);
  color: var(--bg);
  border: none;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  cursor: pointer;
}
.contact-form button:hover {
  background: var(--yellow);
}
.contact-form button.active {
  box-shadow: 0 0 0 1px var(--status) inset;
}
.contact-form .hint {
  font-size: 10px;
  color: var(--fg-muted);
}
.contact-form .hint code {
  font-family: var(--font-mono);
  color: var(--blue);
  font-size: 10px;
}
.contact-form .mode-legend {
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 10px;
  color: var(--fg-muted);
}

@media (max-width: 800px) {
  .contact-form {
    padding: 14px;
  }
}

/* ───────── writing: empty state ───────── */
.writing-empty {
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  color: var(--fg-dim);
  margin: 20px 0;
}
.writing-empty h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--fg);
}
.writing-empty .tombstone {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 20px;
  font-family: var(--font-mono);
  white-space: pre;
}

/* ───────── writing: post list ───────── */
.writing-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
}
.writing-post-btn {
  all: unset;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}
.writing-post-btn:hover,
.writing-post-btn:focus {
  background: var(--bg-alt);
  border-color: var(--border);
  outline: none;
}
.writing-post-btn:focus {
  border-color: var(--blue);
}
.post-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.post-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
}
.post-title-line {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}
.post-excerpt-line {
  margin-top: 4px;
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.5;
}

/* ───────── writing: post view ───────── */
.post-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.post-back-btn {
  all: unset;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  padding: 4px 8px;
  border: 1px solid var(--blue);
  border-radius: 3px;
  transition: background 0.1s;
}
.post-back-btn:hover {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}
.post-nav-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.post-nav-hint kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--fg-dim);
}
.post-head {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.post-title-lg {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 12px;
  line-height: 1.25;
}
.post-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ───────── writing: rendered markdown ───────── */
.post-body {
  max-width: 680px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--fg-dim);
  padding-bottom: 60px;
}
.post-body p {
  margin: 0 0 18px;
}
.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg);
  margin: 32px 0 12px;
  line-height: 1.3;
}
.post-body h1 { font-size: 22px; color: var(--blue); }
.post-body h2 { font-size: 18px; }
.post-body h3 { font-size: 15px; letter-spacing: 0.02em; }
.post-body h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-alt);
  color: var(--yellow);
  padding: 1px 5px;
  border-radius: 3px;
}
.post-body pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.post-body pre::-webkit-scrollbar {
  height: 3px;
}
.post-body pre::-webkit-scrollbar-track {
  background: transparent;
}
.post-body pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.post-body pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--green);
}
.post-body blockquote {
  border-left: 3px solid var(--blue);
  margin: 0 0 20px;
  padding: 8px 0 8px 18px;
  color: var(--fg-muted);
  font-style: italic;
}
.post-body blockquote p { margin: 0; }
.post-body .callout {
  --callout-color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--callout-color) 35%, var(--border));
  border-left: 4px solid var(--callout-color);
  background: color-mix(in srgb, var(--callout-color) 10%, var(--panel));
  border-radius: 6px;
  margin: 0 0 20px;
  padding: 12px 14px;
  color: var(--fg-dim);
}
.post-body .callout-title {
  color: var(--fg);
  cursor: default;
  font-weight: 700;
  margin-bottom: 8px;
}
.post-body summary.callout-title {
  cursor: pointer;
}
.post-body .callout-title::before {
  color: var(--callout-color);
  content: '!';
  display: inline-block;
  margin-right: 8px;
}
.post-body .callout-content > :last-child { margin-bottom: 0; }
.post-body .callout-tip,
.post-body .callout-hint,
.post-body .callout-success,
.post-body .callout-check,
.post-body .callout-done { --callout-color: var(--green); }
.post-body .callout-warning,
.post-body .callout-caution,
.post-body .callout-attention,
.post-body .callout-important { --callout-color: var(--yellow); }
.post-body .callout-danger,
.post-body .callout-error,
.post-body .callout-failure,
.post-body .callout-fail,
.post-body .callout-missing,
.post-body .callout-bug { --callout-color: var(--red); }
.post-body .callout-question,
.post-body .callout-help,
.post-body .callout-faq { --callout-color: var(--purple); }
.post-body .callout-example { --callout-color: var(--orange); }
.post-body .callout-quote,
.post-body .callout-cite { --callout-color: var(--fg-muted); }
.post-body ul,
.post-body ol {
  padding-left: 22px;
  margin: 0 0 18px;
}
.post-body li { margin: 5px 0; }
.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}
.post-body a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.post-body a:hover { opacity: 0.8; }
.post-body strong { color: var(--fg); font-weight: 700; }
.post-body em { font-style: italic; }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  display: block;
  overflow-x: auto;
}
.post-body th,
.post-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.post-body th {
  color: var(--fg);
  font-weight: 700;
  background: var(--bg-alt);
}
.post-body dl {
  margin: 0 0 18px;
}
.post-body dt {
  color: var(--fg);
  font-weight: 700;
}
.post-body dd {
  margin: 0 0 12px 22px;
}
.post-body .task-list {
  list-style: none;
  padding-left: 0;
}
.post-body .task-list input {
  margin-right: 8px;
  accent-color: var(--blue);
}
.post-body .footnotes {
  margin-top: 32px;
  font-size: 13px;
  color: var(--fg-muted);
}
.post-body .footnotes hr {
  margin-bottom: 16px;
}
.post-body .footnote-ref,
.post-body .footnote-back {
  text-decoration: none;
}
.post-body .math.display {
  display: block;
  overflow-x: auto;
  margin: 20px 0;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.post-body .math.display::-webkit-scrollbar { height: 3px; }
.post-body .math.display::-webkit-scrollbar-track { background: transparent; }
.post-body .math.display::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ───────── which-key popup ───────── */
.whichkey-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 80;
  animation: fadein 0.12s ease-out;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.whichkey {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  width: min(760px, 92vw);
  max-height: min(84vh, 700px);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  z-index: 81;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: slideup 0.15s ease-out;
  display: flex;
  flex-direction: column;
}
@keyframes slideup {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}
.whichkey-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.whichkey-header .k {
  color: var(--yellow);
}
.whichkey-body {
  padding: 10px 16px 0;
  overflow-y: auto;
  min-height: 0;
}
.wk-group-title {
  font-size: 10px;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.whichkey-grid {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 24px;
}
.wk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
}
.wk-item .key {
  color: var(--yellow);
  font-weight: 700;
  font-size: 12px;
  min-width: 38px;
  text-align: right;
  padding: 2px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.wk-item .arrow {
  color: var(--fg-muted);
}
.wk-item .action {
  color: var(--fg);
  line-height: 1.35;
}
.wk-item .group {
  color: var(--purple);
}
.wk-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 10px;
}
@media (max-width: 900px) {
  .whichkey {
    width: min(640px, 95vw);
    max-height: 88vh;
    bottom: 12px;
  }
  .whichkey-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .whichkey-grid {
    grid-template-columns: 1fr;
    gap: 2px 0;
    padding: 10px 0;
  }
}
@media (max-width: 520px) {
  .whichkey {
    width: 96vw;
    bottom: 8px;
  }
  .wk-item {
    gap: 8px;
    font-size: 11px;
  }
  .wk-item .key {
    min-width: 32px;
    font-size: 11px;
    padding: 1px 5px;
  }
}

/* tweaks panel */
.tweaks-btn {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 70;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--fg-dim);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
.tweaks-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}
.tweaks-panel {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 280px;
  z-index: 71;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: slideup 0.15s ease-out;
}
.tweaks-panel .tp-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
}
.tweaks-panel .tp-body {
  padding: 14px;
  display: grid;
  gap: 14px;
}
.tp-row {
  display: grid;
  gap: 6px;
  font-size: 11px;
}
.tp-row label {
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9px;
}
.tp-segmented {
  display: flex;
  border: 1px solid var(--border);
}
.tp-segmented button {
  flex: 1;
  background: transparent;
  color: var(--fg-dim);
  border: none;
  padding: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tp-segmented button.on {
  background: var(--blue);
  color: var(--bg);
}
.tp-swatches {
  display: flex;
  gap: 6px;
}
.tp-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
}
.tp-swatch.on {
  border-color: var(--fg);
}

/* search highlights */
mark.vs-hl {
  background: var(--yellow);
  color: var(--bg);
  padding: 0 2px;
}
mark.vs-hl.active {
  background: var(--orange);
}

/* welcome splash on first visit */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: grid;
  place-items: center;
  animation: fadeout 0.4s ease 2.2s forwards;
}
@keyframes fadeout {
  to {
    opacity: 0;
    pointer-events: none;
  }
}
.splash-inner {
  text-align: center;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}
.splash-inner .logo {
  color: var(--blue);
  font-size: 13px;
  line-height: 1.05;
  white-space: pre;
  margin-bottom: 18px;
}
.splash-inner .ver {
  font-size: 11px;
  color: var(--fg-muted);
}
.splash-inner .tip {
  font-size: 11px;
  color: var(--yellow);
  margin-top: 22px;
}

/* help overlay key */
kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--yellow);
  min-width: 18px;
  text-align: center;
}

/* helper callout in hero */
.hero-help {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px dashed var(--border-strong);
  font-size: 11px;
  color: var(--fg-dim);
  background: var(--bg-soft);
}
.hero-help .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--yellow);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.3;
    transform: scale(0.7);
  }
}

/* audience picker + simple page */
html[data-audience='simple'],
html[data-audience='simple'] body,
html[data-audience='gate'],
html[data-audience='gate'] body {
  overflow: auto;
  height: auto;
  min-height: 100%;
}
html[data-audience='simple'] #root,
html[data-audience='gate'] #root {
  height: auto;
  min-height: 100vh;
  width: 100%;
}
/* paint the page so the centered simple-page doesn't sit on dark bars */
html[data-audience='simple'] body,
html[data-audience='gate'] body {
  background: linear-gradient(180deg, #fbf7ef 0%, #f3ead9 100%);
  color: #211f1b;
}

.audience-gate,
.simple-page {
  min-height: 100vh;
  background: transparent;
  color: #211f1b;
  font-family: var(--font-serif);
}

.audience-gate {
  display: grid;
  place-items: center;
  padding: 32px;
}

.gate-card {
  max-width: 920px;
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid rgba(33, 31, 27, 0.16);
  background: rgba(255, 252, 246, 0.78);
  box-shadow: 0 30px 80px rgba(33, 31, 27, 0.12);
}

.gate-kicker,
.section-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: #725f45;
}

.gate-card h1,
.simple-hero h1 {
  margin: 12px 0 18px;
  font-size: clamp(48px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.gate-card p,
.simple-hero p {
  max-width: 760px;
  font-size: clamp(18px, 2.4vw, 28px);
  line-height: 1.35;
  color: #4a4035;
}

.gate-actions,
.simple-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.gate-actions button,
.simple-cta a,
.simple-cta button,
.view-switch {
  border: 1px solid #211f1b;
  background: #211f1b;
  color: #fffaf1;
  padding: 14px 18px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.gate-actions button:nth-child(2),
.simple-cta > *:not(.cta-primary):nth-child(n+2),
.view-switch {
  background: transparent;
  color: #211f1b;
}
.simple-cta a:hover {
  background: #211f1b;
  color: #fffaf1;
  text-decoration: none;
}

.gate-actions span,
.gate-actions small {
  display: block;
  text-align: left;
}

.gate-actions span {
  font-size: 16px;
  font-weight: 800;
}

.gate-actions small {
  margin-top: 4px;
  opacity: 0.72;
}

.simple-page {
  padding: 0 clamp(20px, 4vw, 56px) clamp(20px, 4vw, 56px);
  max-width: 1280px;
  margin: 0 auto;
}

/* sticky topbar with scroll-spy */
.simple-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: #fbf7ef;
  border-bottom: 1px solid rgba(33, 31, 27, 0.12);
}
.simple-topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.simple-topbar .brand-mark {
  color: #b7421f;
  font-size: 18px;
  line-height: 1;
}
.simple-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}
.simple-anchors a {
  color: #6f6354;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.simple-anchors a:hover {
  color: #211f1b;
  text-decoration: none;
}
.simple-anchors a.is-active {
  color: #211f1b;
  border-bottom-color: #211f1b;
}
.simple-topbar-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
}
.simple-topbar-actions a {
  color: #211f1b;
}
.simple-topbar-actions .view-switch {
  padding: 8px 12px;
  font-size: 12px;
}

.simple-hero {
  padding: clamp(52px, 10vw, 130px) 0 48px;
  max-width: 1120px;
}
.simple-hero .hero-tagline {
  margin-bottom: 18px;
  font-style: italic;
  color: #3a3328;
}
.cta-primary {
  font-weight: 700;
}
.cta-primary:hover {
  background: #3a352c;
}

/* impact metrics */
.simple-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(33, 31, 27, 0.18);
  border: 1px solid rgba(33, 31, 27, 0.18);
}
.metric-card {
  background: rgba(255, 252, 246, 0.78);
  padding: 24px;
  transition: background 0.2s, transform 0.2s;
}
.metric-card:hover {
  background: #fffaf1;
  transform: translateY(-2px);
}
.metric-card strong {
  display: block;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.metric-card span {
  display: block;
  margin-top: 10px;
  color: #554a3f;
  font-size: 14px;
}

.simple-section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(24px, 5vw, 70px);
  padding: 70px 0 0;
  scroll-margin-top: 80px;
}

/* now (simple-scoped to avoid clashing with the dev /now buffer) */
.simple-page .now-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.simple-page .now-card {
  border: 1px solid rgba(33, 31, 27, 0.16);
  background: rgba(255, 252, 246, 0.72);
  padding: 22px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.simple-page .now-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 38px rgba(33, 31, 27, 0.08);
}
.simple-page .now-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b7421f;
}
.simple-page .now-card h3 {
  margin: 8px 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #211f1b;
}
.simple-page .now-card p {
  margin: 0;
  font-size: 15px;
  color: #554a3f;
}

/* projects */
.simple-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.project-card {
  border: 1px solid rgba(33, 31, 27, 0.16);
  background: rgba(255, 252, 246, 0.72);
  padding: 22px;
  display: grid;
  gap: 12px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.project-card.is-open {
  grid-column: 1 / -1;
  border-color: #211f1b;
  box-shadow: 0 18px 50px rgba(33, 31, 27, 0.12);
}
.project-card:hover {
  border-color: rgba(33, 31, 27, 0.45);
}
.project-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: #211f1b;
  font-family: inherit;
}
.project-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.project-year,
.project-toggle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #725f45;
}
.project-toggle {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(33, 31, 27, 0.3);
  border-radius: 50%;
  font-size: 14px;
  color: #211f1b;
}
.project-blurb {
  margin: 0;
  color: #554a3f;
  font-size: 16px;
  line-height: 1.45;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-stack b {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: #725f45;
  border: 1px solid rgba(33, 31, 27, 0.18);
  padding: 4px 8px;
  border-radius: 999px;
}
.project-detail {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px dashed rgba(33, 31, 27, 0.18);
  display: grid;
  gap: 14px;
}
.project-detail ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.project-detail li {
  color: #3a3328;
  font-size: 15px;
  line-height: 1.5;
}
.project-links {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.project-links a {
  color: #211f1b;
  border-bottom: 1px solid #211f1b;
}
.project-links a:hover {
  text-decoration: none;
  color: #b7421f;
  border-color: #b7421f;
}
/* experience */
.simple-timeline {
  display: grid;
  gap: 24px;
}
.exp-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 30px;
  padding: 0 0 24px;
  border-bottom: 1px solid rgba(33, 31, 27, 0.14);
}
.exp-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #725f45;
}
.exp-meta strong {
  display: block;
  color: #211f1b;
}
.exp-meta span {
  display: block;
  margin-top: 6px;
}
.exp-body h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.exp-body p {
  margin: 6px 0 12px;
  font-family: var(--font-mono);
  color: #725f45;
  font-size: 14px;
}
.exp-body ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.exp-body li {
  color: #3a3328;
  font-size: 15px;
  line-height: 1.5;
}
.exp-more {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  color: #b7421f;
  cursor: pointer;
  border-bottom: 1px solid currentColor;
}

/* writing (simple) */
.writing-list-r {
  display: grid;
  gap: 14px;
}
.writing-card-r {
  text-align: left;
  font-family: inherit;
  color: #211f1b;
  background: rgba(255, 252, 246, 0.72);
  border: 1px solid rgba(33, 31, 27, 0.16);
  padding: 22px 24px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.writing-card-r:hover {
  transform: translateY(-2px);
  border-color: #211f1b;
  box-shadow: 0 14px 38px rgba(33, 31, 27, 0.1);
}
.writing-meta-r {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #725f45;
  text-transform: uppercase;
}
.writing-tags-r {
  color: #b7421f;
  text-transform: none;
  letter-spacing: 0;
}
.writing-card-r h3 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.writing-card-r p {
  margin: 0;
  color: #554a3f;
  font-size: 15px;
  line-height: 1.5;
}
.writing-cta-r {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #b7421f;
  margin-top: 4px;
}

/* education */
.edu-list {
  display: grid;
  gap: 18px;
}
.edu-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(33, 31, 27, 0.14);
}
.edu-card strong {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #725f45;
}
.edu-card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.edu-card p {
  margin: 4px 0 6px;
  font-family: var(--font-mono);
  color: #4a4035;
  font-size: 14px;
}
.edu-card small {
  color: #6f6354;
}

/* skills */
.simple-skills {
  padding-bottom: 80px;
}
.skill-groups {
  display: grid;
  gap: 22px;
}
.skill-group h3 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #725f45;
}
.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(33, 31, 27, 0.18);
  border-radius: 999px;
  color: #3a3328;
  background: rgba(255, 252, 246, 0.55);
  transition: transform 0.15s, background 0.15s;
}
.skill-chip:hover {
  transform: translateY(-2px);
  background: #fffaf1;
}
.skill-chip.is-hot {
  background: #211f1b;
  color: #fffaf1;
  border-color: #211f1b;
}

/* footer */
.simple-footer {
  margin-top: 80px;
  padding: 60px 0 40px;
  border-top: 1px solid rgba(33, 31, 27, 0.18);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}
.simple-footer h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: -0.04em;
}
.footer-email {
  margin: 6px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(33, 31, 27, 0.35);
  color: inherit;
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: -0.04em;
  cursor: pointer;
  text-align: left;
  word-break: break-word;
  transition: border-color 0.15s, color 0.15s;
}
.footer-email:hover {
  color: #b7421f;
  border-bottom-color: #b7421f;
}

/* simple-mode post reader */
.simple-reader {
  max-width: 760px;
  padding: 0 clamp(20px, 4vw, 40px) 80px;
}
.reader-topbar {
  grid-template-columns: 1fr auto;
}
.reader-back {
  font-family: var(--font-mono);
  font-size: 13px;
  background: transparent;
  border: 0;
  padding: 8px 0;
  color: #211f1b;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.reader-back:hover {
  color: #b7421f;
  border-bottom-color: #b7421f;
}
.reader-article {
  padding: clamp(28px, 5vw, 56px) 0 0;
}
.reader-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(33, 31, 27, 0.16);
}
.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #725f45;
}
.reader-tag {
  color: #b7421f;
  text-transform: none;
  letter-spacing: 0;
}
.reader-head h1 {
  margin: 16px 0 12px;
  font-size: clamp(34px, 5.5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #211f1b;
}
.reader-excerpt {
  margin: 0;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.5;
  color: #4a4035;
  font-style: italic;
}
.reader-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.72;
  color: #2b251d;
}
.reader-body p {
  margin: 0 0 22px;
}
.reader-body h1,
.reader-body h2,
.reader-body h3,
.reader-body h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: #211f1b;
  margin: 40px 0 14px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.reader-body h1 { font-size: 30px; }
.reader-body h2 { font-size: 26px; }
.reader-body h3 { font-size: 21px; }
.reader-body h4 { font-size: 17px; }
.reader-body a {
  color: #b7421f;
  border-bottom: 1px solid currentColor;
}
.reader-body a:hover {
  text-decoration: none;
  opacity: 0.75;
}
.reader-body strong { font-weight: 700; color: #211f1b; }
.reader-body em { font-style: italic; }
.reader-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(33, 31, 27, 0.08);
  color: #6b3a1f;
  padding: 2px 6px;
  border-radius: 3px;
}
.reader-body pre {
  background: #1c1a17;
  color: #f1ead8;
  border: 1px solid rgba(33, 31, 27, 0.2);
  border-radius: 4px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.55;
}
.reader-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
/* Pandoc/skylighting token colors for rendered posts. The Neovim view's
   `.buffer` only tinted kw/op, and the simple view (`.reader-body`) renders
   outside `.buffer` entirely, so cover the full token set for both here.
   Colors are the bright accents tuned for the dark code background. */
.reader-body .kw, .post-body .kw,
.reader-body .cf, .post-body .cf { color: #c5a0ff; }
.reader-body .op, .post-body .op { color: #f07a7a; }
.reader-body .dt, .post-body .dt { color: #e8c76a; }
.reader-body .bu, .post-body .bu,
.reader-body .fu, .post-body .fu,
.reader-body .at, .post-body .at,
.reader-body .ex, .post-body .ex { color: #6aa9ff; }
.reader-body .st, .post-body .st,
.reader-body .ch, .post-body .ch,
.reader-body .sc, .post-body .sc { color: #88d488; }
.reader-body .dv, .post-body .dv,
.reader-body .fl, .post-body .fl,
.reader-body .bn, .post-body .bn,
.reader-body .cn, .post-body .cn { color: #f0a868; }
.reader-body .co, .post-body .co { color: #8f8a7a; font-style: italic; }
.reader-body blockquote {
  border-left: 3px solid #b7421f;
  margin: 0 0 22px;
  padding: 4px 0 4px 20px;
  color: #4a4035;
  font-style: italic;
}
.reader-body blockquote p { margin: 0; }
.reader-body .callout {
  --reader-callout: #b7421f;
  border: 1px solid color-mix(in srgb, var(--reader-callout) 28%, rgba(33, 31, 27, 0.18));
  border-left: 4px solid var(--reader-callout);
  background: color-mix(in srgb, var(--reader-callout) 8%, #f8f1df);
  border-radius: 4px;
  color: #4a4035;
  margin: 0 0 24px;
  padding: 14px 16px;
}
.reader-body .callout-title {
  color: #211f1b;
  cursor: default;
  font-weight: 700;
  margin-bottom: 8px;
}
.reader-body summary.callout-title {
  cursor: pointer;
}
.reader-body .callout-title::before {
  color: var(--reader-callout);
  content: '!';
  display: inline-block;
  margin-right: 8px;
}
.reader-body .callout-content > :last-child { margin-bottom: 0; }
.reader-body .callout-tip,
.reader-body .callout-hint,
.reader-body .callout-success,
.reader-body .callout-check,
.reader-body .callout-done { --reader-callout: #4d7d35; }
.reader-body .callout-warning,
.reader-body .callout-caution,
.reader-body .callout-attention,
.reader-body .callout-important { --reader-callout: #9b6a14; }
.reader-body .callout-danger,
.reader-body .callout-error,
.reader-body .callout-failure,
.reader-body .callout-fail,
.reader-body .callout-missing,
.reader-body .callout-bug { --reader-callout: #a83f35; }
.reader-body .callout-question,
.reader-body .callout-help,
.reader-body .callout-faq { --reader-callout: #7252a3; }
.reader-body .callout-example { --reader-callout: #b76524; }
.reader-body .callout-quote,
.reader-body .callout-cite { --reader-callout: #7b7165; }
.reader-body ul,
.reader-body ol {
  margin: 0 0 22px;
  padding-left: 26px;
}
.reader-body li { margin: 6px 0; }
.reader-body hr {
  border: 0;
  border-top: 1px solid rgba(33, 31, 27, 0.18);
  margin: 36px 0;
}
.reader-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0 22px;
}
.reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 15px;
}
.reader-body th,
.reader-body td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(33, 31, 27, 0.16);
  text-align: left;
}
.reader-body th {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #725f45;
}
.reader-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(33, 31, 27, 0.16);
}

@media (max-width: 720px) {
  .reader-body {
    font-size: 16px;
    line-height: 1.65;
  }
  .reader-body h1 { font-size: 24px; }
  .reader-body h2 { font-size: 20px; }
  .reader-body h3 { font-size: 18px; }
  .reader-body pre {
    padding: 12px 14px;
    font-size: 12px;
  }
}
.footer-links {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.footer-links a {
  color: #211f1b;
  border-bottom: 1px solid currentColor;
}
.footer-links a:hover {
  text-decoration: none;
  color: #b7421f;
}

.dev-switch {
  position: fixed;
  right: 14px;
  top: 56px;
  z-index: 50;
  border-color: var(--border-strong);
  color: var(--fg);
  background: var(--panel);
  padding: 7px 10px;
  font-size: 11px;
}

/* mobile-only notice inside neovim view */
.mobile-nvim-banner {
  display: none;
}
@media (max-width: 720px) {
  .dev-switch {
    display: none;
  }
  .mobile-nvim-banner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 60;
    margin: 0;
    padding: 12px 14px;
    background: var(--panel);
    border-bottom: 1px solid var(--yellow);
    font-family: var(--font-mono);
    color: var(--fg);
  }
  .mobile-nvim-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
  }
  .mobile-nvim-banner-text strong {
    color: var(--yellow);
    font-size: 12px;
    font-weight: 700;
  }
  .mobile-nvim-banner-text small {
    color: var(--fg-dim);
    font-size: 11px;
  }
  .mobile-nvim-banner-btn {
    border: 1px solid var(--yellow);
    background: var(--yellow);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.15s;
  }
  .mobile-nvim-banner-btn:active {
    opacity: 0.8;
  }
}

@media (max-width: 980px) {
  .simple-hero {
    padding: 14px 0 28px;
  }
  .simple-topbar {
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 12px 0;
    margin: 0;
  }
  .simple-anchors {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 14px;
    margin: 0 -16px;
    padding: 4px 16px;
    scrollbar-width: none;
  }
  .simple-anchors::-webkit-scrollbar {
    display: none;
  }
  .simple-anchors a {
    padding: 10px 2px;
    white-space: nowrap;
  }
  .simple-topbar-actions {
    justify-content: flex-end;
    gap: 10px;
  }
  .simple-metrics,
  .simple-projects,
  .simple-page .now-grid {
    grid-template-columns: 1fr;
  }
  .simple-section {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 48px;
  }
  .exp-card,
  .edu-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .simple-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .footer-links a {
    padding: 4px 0;
  }
}

@media (max-width: 560px) {
  html[data-audience='simple'] body,
  html[data-audience='gate'] body {
    -webkit-text-size-adjust: 100%;
  }
  .audience-gate {
    padding: 20px;
  }
  .gate-card {
    padding: 28px 22px;
  }
  .gate-card h1,
  .simple-hero h1 {
    font-size: clamp(38px, 12vw, 56px);
    letter-spacing: -0.04em;
  }
  .gate-card p,
  .simple-hero p {
    font-size: 17px;
  }
  .gate-actions,
  .simple-cta {
    gap: 10px;
    margin-top: 22px;
  }
  .gate-actions button,
  .simple-cta > * {
    flex: 1 1 100%;
    text-align: center;
    padding: 14px 16px;
  }
  .gate-actions span,
  .gate-actions small {
    text-align: center;
  }
  .cta-primary {
    /* keep email from overflowing on narrow screens */
    word-break: break-word;
  }
  .simple-page {
    padding: 0 16px 24px;
  }
  .simple-topbar {
    padding: 10px 0;
    gap: 10px;
  }
  .simple-topbar .brand {
    font-size: 13px;
  }
  .simple-topbar-actions a {
    display: none;
  }
  .simple-topbar-actions .view-switch {
    padding: 8px 10px;
    font-size: 11px;
  }
  .simple-hero {
    padding: 10px 0 28px;
  }
  .simple-section {
    padding-top: 32px;
  }
  .metric-card {
    padding: 18px;
  }
  .metric-card strong {
    font-size: clamp(30px, 11vw, 44px);
  }
  .project-card,
  .simple-page .now-card,
  .writing-card-r {
    padding: 18px;
  }
  .project-head h2,
  .exp-body h2,
  .writing-card-r h3 {
    font-size: clamp(20px, 5.5vw, 24px);
  }
  .simple-footer {
    margin-top: 56px;
    padding: 40px 0 28px;
  }
  .simple-footer h2,
  .footer-email {
    font-size: clamp(24px, 7vw, 36px);
    word-break: break-word;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exp.focus::before {
    animation: none;
  }
  .metric-card,
  .simple-page .now-card,
  .writing-card-r,
  .project-card {
    transition: none;
  }
  .metric-card:hover,
  .simple-page .now-card:hover,
  .writing-card-r:hover {
    transform: none;
    box-shadow: none;
  }
}

/* mobile fallback */
@media (max-width: 720px) {
  .tree {
    display: none;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .buffer-wrap {
    grid-template-columns: 32px 1fr;
  }
  .buffer {
    padding: 14px 16px 80px;
  }
  .hero-name {
    font-size: 40px;
  }
  .exp {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .hero-ascii {
    font-size: 9px;
  }
  .tweaks-btn {
    display: none;
  }
  /* post reader: shrink oversized title, keep hint on one line */
  .post-title-lg {
    font-size: clamp(22px, 6.5vw, 30px);
    line-height: 1.15;
  }
  .post-body {
    font-size: 14px;
    line-height: 1.7;
  }
  .post-body pre {
    padding: 12px 14px;
    font-size: 12px;
  }
  .post-body h1 { font-size: 19px; }
  .post-body h2 { font-size: 16px; }
  .post-body h3 { font-size: 14px; }
  .post-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cmdline {
    white-space: nowrap;
    overflow: hidden;
  }
  .cmdline .hint {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .winbar {
    padding-right: 8px;
  }
  .statusline {
    font-size: 10px;
  }
  .sl-mode,
  .sl-seg {
    padding-left: 10px;
    padding-right: 14px;
  }
}
