/* IDE / Terminal flavored resume — neutral cool + teal accent */
:root {
  --bg: oklch(0.985 0.004 220);
  --bg-2: oklch(0.965 0.006 220);
  --bg-3: oklch(0.94 0.008 220);
  --line: oklch(0.9 0.01 220);
  --line-2: oklch(0.85 0.012 220);
  --ink: oklch(0.2 0.012 240);
  --ink-2: oklch(0.4 0.012 240);
  --muted: oklch(0.55 0.012 240);
  --muted-2: oklch(0.7 0.012 240);
  --accent: oklch(0.62 0.12 200);
  --accent-soft: oklch(0.92 0.04 200);
  --accent-ink: oklch(0.4 0.13 200);
  --highlight: oklch(0.95 0.06 200 / 0.5);
  --warn: oklch(0.7 0.12 60);

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --gutter: 56px;
}

[data-theme="dark"] {
  --bg: oklch(0.18 0.012 240);
  --bg-2: oklch(0.22 0.014 240);
  --bg-3: oklch(0.26 0.016 240);
  --line: oklch(0.32 0.014 240);
  --line-2: oklch(0.4 0.016 240);
  --ink: oklch(0.96 0.005 220);
  --ink-2: oklch(0.82 0.008 220);
  --muted: oklch(0.65 0.012 240);
  --muted-2: oklch(0.5 0.012 240);
  --accent: oklch(0.78 0.13 200);
  --accent-soft: oklch(0.32 0.05 200);
  --accent-ink: oklch(0.85 0.13 200);
  --highlight: oklch(0.4 0.08 200 / 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

.mono { font-family: var(--mono); }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

@media (min-width: 1280px) {
  .app { grid-template-columns: 280px 1fr 220px; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ---------- Sidebar (file tree) ---------- */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 18px 0 80px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
}

.sidebar-header {
  padding: 0 18px 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sidebar-header .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

.tree-section {
  padding: 12px 0 8px 0;
  border-bottom: 1px dashed var(--line);
}
.tree-label {
  padding: 4px 18px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 18px 5px 28px;
  cursor: pointer;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  position: relative;
}
.tree-item:hover { background: var(--bg-3); color: var(--ink); }
.tree-item.active {
  color: var(--accent-ink);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.tree-item .icon {
  font-size: 11px;
  color: var(--muted-2);
  width: 14px;
  text-align: center;
}
.tree-item.active .icon { color: var(--accent); }

.tree-meta {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10.5px;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 18px;
  font-size: 11.5px;
  color: var(--muted);
}
.filter-pill .x {
  margin-left: auto;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 3px;
}
.filter-pill .x:hover { background: var(--bg-3); color: var(--ink); }

.filter-empty {
  padding: 4px 18px;
  font-size: 11px;
  color: var(--muted-2);
  font-style: italic;
}

/* ---------- Outline (right panel) ---------- */
.outline {
  display: none;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  border-left: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--mono);
  padding: 18px 14px 18px 18px;
  font-size: 11.5px;
  overflow-y: auto;
}
@media (min-width: 1280px) {
  .outline { display: flex; flex-direction: column; }
}
.outline-head {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.outline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.outline-item { margin: 1px 0; }
.outline-item a {
  display: block;
  padding: 4px 8px 4px 10px;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 3px 3px 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.3;
}
.outline-item a:hover {
  background: var(--bg-2);
  color: var(--ink-2);
}
.outline-item.active a {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  color: var(--accent);
  border-left-color: var(--accent);
}
.outline-item.indent-1 a { padding-left: 22px; }
.outline-item.indent-1 .outline-label { font-family: var(--font-sans); font-size: 11.5px; }
.outline-label { display: block; }
.outline-sub {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  margin-top: 1px;
}
.outline-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.outline-progress-label {
  font-size: 9.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.outline-progress {
  flex: 1;
  height: 80px;
  background: var(--bg-2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.outline-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  background: color-mix(in oklab, var(--accent) 60%, transparent);
  transition: height 0.08s;
}

/* ---------- Main content ---------- */
.main {
  position: relative;
  padding-bottom: 120px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  font-family: var(--mono);
  font-size: 12px;
}

.tab {
  padding: 10px 18px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
}
.tab.active {
  background: var(--bg);
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}
.tab .close { color: var(--muted-2); font-size: 14px; }

.toolbar-spacer { flex: 1; }

.toolbar-actions {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  align-items: center;
}
.toolbar-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.toolbar-btn:hover { background: var(--bg-3); color: var(--ink); border-color: var(--line-2); }
.toolbar-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.toolbar-btn.primary:hover { filter: brightness(1.05); }
.toolbar-btn .kbd {
  font-size: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--muted);
}

/* ---------- Document body ---------- */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 48px 80px;
  position: relative;
}

@media (max-width: 700px) {
  .doc { padding: 28px 20px 60px; }
}

.line-numbers {
  position: absolute;
  left: 0;
  top: 40px;
  width: 40px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  text-align: right;
  user-select: none;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  display: none;
}

@media (min-width: 1100px) {
  .line-numbers { display: block; }
  .doc { padding-left: 70px; }
}

/* Hero */
.hero { margin-bottom: 36px; }
.discovery-hint {
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px dashed color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: color-mix(in oklab, var(--accent) 4%, transparent);
}
.discovery-hint .hint-icon {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  flex-shrink: 0;
}
.discovery-hint a.inline {
  display: inline-flex;
  padding: 1px 6px;
  margin: 0 2px;
}
.comment {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.comment .c-syntax { color: var(--accent); }

.hero-name {
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 6px 0 4px;
  line-height: 1.05;
}
.hero-name .punct { color: var(--accent); font-weight: 500; }

.hero-headline {
  font-family: var(--mono);
  color: var(--ink-2);
  font-size: 14px;
  margin: 2px 0 18px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 22px;
}
.contact-row a { color: var(--ink-2); text-decoration: none; }
.contact-row a:hover { color: var(--accent-ink); }
.contact-row .key { color: var(--accent); }

.summary {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  max-width: 64ch;
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 16px;
  margin: 12px 0 18px;
}

.primary-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

/* Section */
.section { margin: 44px 0 24px; scroll-margin-top: 64px; }
#summary { scroll-margin-top: 64px; }
.section-head {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.section-head::before {
  content: "";
  display: inline-block;
  width: 18px; height: 1px; background: var(--line-2);
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Role */
.role {
  margin-bottom: 36px;
  position: relative;
  scroll-margin-top: 64px;
}
.role.dimmed { opacity: 0.35; }
.role.dimmed:hover { opacity: 0.7; }

.role-sig {
  font-family: var(--mono);
  font-size: 16.5px;
  line-height: 1.5;
  margin-bottom: 4px;
  color: var(--ink);
}
.role-sig .keyword { color: var(--accent); }
.role-sig .fn { color: var(--ink); font-weight: 600; }
.role-sig .punct { color: var(--muted-2); }
.role-sig .arg { color: var(--ink-2); }
.role-sig .ret { color: var(--accent-ink); }

.role-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.role-meta .meta-key { color: var(--muted-2); }
.role-meta .meta-val { color: var(--ink-2); }
.role-meta .badge {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-size: 10.5px;
  color: var(--muted);
}
.role-meta .badge-note {
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  font-family: var(--font-sans);
  font-weight: 500;
}

.role-blurb {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 8px 0 14px;
  max-width: 70ch;
}

.bullet-group { margin: 0; }
.bullet-group + .bullet-group { margin-top: 4px; }
.bullet-section-head {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 18px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px dashed color-mix(in oklab, var(--accent) 35%, transparent);
}
.bullet-group:first-child .bullet-section-head { margin-top: 4px; }
.bullet-group .bullets { margin: 6px 0 8px; }
.bullets { list-style: none; padding: 0; margin: 14px 0 14px; }
.bullet {
  position: relative;
  padding: 8px 8px 8px 22px;
  margin: 0 -8px;
  border-radius: 3px;
  transition: background 0.12s, opacity 0.18s;
}
.bullet::before {
  content: "▸";
  position: absolute;
  left: 4px;
  top: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}
.bullet.hit { background: var(--highlight); }
.bullet.miss { opacity: 0.32; }
.bullet-head {
  font-weight: 600;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
}
.bullet-body {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 2px;
}
.bullet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
  white-space: nowrap;
  position: relative;
}
.chip:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.chip:active { transform: translateY(1px); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.chip.dim { opacity: 0.4; }

.chip-sm {
  font-size: 10.5px;
  padding: 1px 6px;
}

/* Stack row */
.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  align-items: center;
}
.stack-row .label {
  color: var(--accent);
  margin-right: 8px;
  font-weight: 600;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.skill-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  background: var(--bg-2);
}
.skill-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Education */
.edu-list { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.edu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-2);
}
.edu-degree { font-family: var(--mono); font-weight: 600; color: var(--ink); font-size: 14px; }
.edu-school { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }
.edu-honors {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* Status bar */
.statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 26px;
  background: var(--accent);
  color: white;
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  z-index: 50;
}
.statusbar .seg { display: flex; align-items: center; gap: 6px; opacity: 0.95; }
.statusbar .sep { opacity: 0.4; }
.statusbar .filter-active {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.statusbar .filter-active:hover { background: rgba(255,255,255,0.3); }

/* Tooltips on chips */
.chip[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  font-family: var(--mono);
  z-index: 20;
}
.chip[data-tooltip]:hover::after { opacity: 1; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* Print link area */
.print-cta {
  margin-top: 60px;
  padding: 18px 20px;
  border: 1px dashed var(--line-2);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.print-cta a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px dashed var(--accent); }
.print-cta a:hover { color: var(--accent); }

/* Tweaks panel host overrides */
:root[data-density="compact"] .doc { padding-top: 24px; }
:root[data-density="compact"] .role { margin-bottom: 24px; }
:root[data-density="compact"] .bullet { padding-top: 5px; padding-bottom: 5px; }
:root[data-density="compact"] .section { margin: 28px 0 16px; }

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