:root {
  --page: #262522;
  --side: #1f1e1c;
  --line: #3b3a36;
  --line-soft: #33322e;
  --card: #2c2b28;
  --active: #34332f;
  --hover: #2a2926;
  --text: #ebe9e4;
  --body: #c9c6c0;
  --muted: #9d9a93;
  --muted-2: #8f8c85;
  --muted-3: #b5b2ab;
  --accent: #d97757;
  --green: #3fb950;
  --purple: #a78bfa;
  --blue: #3b82f6;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); }
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; text-align: left; background: none; border: 0; padding: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-radius: 6px; }
h1, h2 { margin: 0; font-weight: 400; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }
.dim-2 { color: var(--muted-2); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Full-page layout: three columns, each scrolls on its own ---------- */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; height: 100vh; height: 100dvh; }
.sidebar, .main, .panel-side { min-height: 0; }

/* Sidebar */
.sidebar { background: var(--side); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; padding: 16px 10px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.avatar { width: 30px; height: 30px; border-radius: 15px; background: var(--accent); color: var(--side); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.who { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.who .name { font-weight: 600; font-size: 15px; }
.who .dim { font-size: 12px; }
.badge { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { min-height: 34px; padding: 6px 10px; border-radius: 8px; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-item .glyph { width: 16px; text-align: center; color: var(--muted-3); }
.group-label { padding: 18px 10px 6px; font-size: 12px; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 1px; }
.list-item { min-height: 30px; padding: 5px 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.list-item .ico { font-family: var(--mono); font-size: 11px; color: var(--muted-2); width: 18px; }
.list-item .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .yrs { font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.list-item .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.nav-item:hover, .list-item:hover { background: var(--hover); }
.nav-item[aria-current], .list-item[aria-current] { background: var(--active); }
.explorer { flex: 1; }
.contact { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.contact a { background: var(--card); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.contact a .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; }
.contact a:hover { background: var(--active); }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 52px; flex: none; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); }
.topbar h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd { font-family: var(--mono); font-size: 12px; color: var(--muted); flex: none; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.convo { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 28px 40px 20px; display: flex; flex-direction: column; gap: 16px; line-height: 1.6; }
.ask { align-self: flex-end; max-width: 520px; background: var(--active); border-radius: 12px; padding: 12px 16px; }
.status { font-size: 13px; color: var(--muted-2); }
.view { display: flex; flex-direction: column; gap: 14px; }
.headline { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.subhead { font-size: 18px; line-height: 1.5; color: var(--text); }
.path { font-size: 12px; color: var(--muted); }
.lead { font-size: 17px; line-height: 1.5; }
.tool { font-size: 13px; color: var(--muted-2); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .v { font-size: 22px; font-weight: 600; }
.stat .t { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pill { align-self: flex-start; font-family: var(--mono); font-size: 10px; padding: 2px 8px; border-radius: 6px; color: var(--pc); white-space: nowrap; }
.pill.dashed { border: 1px dashed var(--pc); }
.flow { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; }
.flow svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--sans); }
.flow .fl-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
.flow .fl-t { font-size: 17px; font-weight: 600; }
.flow .fl-h { font-size: 21px; font-weight: 600; }
.flow .fl-s { font-size: 13px; }
.flow .fl-band { animation: fl-dash 1.2s linear infinite; }
@keyframes fl-dash { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .flow .fl-dot, .flow .fl-pulse { display: none; } .flow .fl-band { animation: none; } }
.test { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; font-size: 15px; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.card-dashed { border-style: dashed; border-color: #6f6c66; }
.card .t { font-weight: 600; }
.card .b { font-size: 13px; color: var(--body); line-height: 1.55; }
.hyp { display: flex; flex-direction: column; gap: 6px; }
.hyp-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.hyp-head .t { font-size: 15px; }
.plan-step { display: flex; gap: 14px; align-items: flex-start; }
.plan-step .when { width: 92px; flex: none; font-size: 11px; padding-top: 12px; }
.plan-step .card { flex: 1; min-width: 0; padding: 10px 14px; }
.plan-bullets { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--body); line-height: 1.5; }
.plan-bullets li { position: relative; padding-left: 14px; }
.plan-bullets li::before { content: '\2022'; position: absolute; left: 0; color: var(--muted-2); }
.deliv { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted-3); }
.example { display: flex; flex-direction: column; gap: 10px; border-style: dashed; }
.ex-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.sketch { overflow-x: auto; margin: 0 -4px; }
.sketch svg { display: block; width: 100%; min-width: 620px; height: auto; }
.sketch .hand { font-family: 'Kalam', 'Comic Sans MS', cursive; }
.chain { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.chain-node { display: flex; flex-direction: column; background: var(--page); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 280px; max-width: 100%; }
.ck { font-size: 10px; color: var(--muted-2); letter-spacing: 0.04em; }
.cv { font-size: 13px; }
.chain-arrow { color: var(--muted-2); padding-left: 16px; line-height: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.span2 { grid-column: 1 / -1; }
.eyebrow { font-size: 11px; letter-spacing: 0.1em; color: var(--muted-2); padding-top: 6px; }
.cert-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.cert-rows div { display: flex; justify-content: space-between; }

/* Experience */
.xp { gap: 0; border-top: 1px solid var(--line); }
.xp-row { border-bottom: 1px solid var(--line); }
.xp-head { width: 100%; padding: 12px 0; display: flex; gap: 12px; align-items: flex-start; }
.chev { width: 12px; color: var(--muted-2); flex: none; }
.xp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xp-main .co { font-weight: 600; }
.xp-main .co .dim { font-weight: 400; }
.xp-main .blurb { color: var(--muted); font-size: 13px; line-height: 1.5; }
.dates { font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.dates.current { color: var(--green); }
.bullets { margin: 0; padding: 0 0 14px 24px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; color: #d6d3cd; list-style: none; }
.bullets li { position: relative; padding-left: 16px; }
.bullets li::before { content: '\2022'; color: var(--green); position: absolute; left: 0; }

/* Evidence */
.tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.status-pill { font-size: 10px; padding: 2px 7px; border-radius: 5px; color: var(--side); font-weight: 600; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--active); color: #d6d3cd; }
.tag-skill { background: transparent; border: 1px solid #4a4843; color: var(--muted-3); }
.ev-title { font-size: 24px; font-weight: 600; line-height: 1.25; }
.fields { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.field { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.flabel { width: 140px; flex: none; font-size: 12px; color: var(--muted-2); font-family: var(--mono); padding-top: 1px; }
.flabel.accent { color: var(--accent); }
.fvalue { flex: 1; min-width: 0; font-size: 13px; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; display: flex; flex-direction: column; }
.step { display: flex; gap: 12px; padding: 7px 0 7px 16px; position: relative; }
.step .node { position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 5px; }
.step .yr { width: 84px; flex: none; font-size: 11px; color: var(--muted); padding-top: 2px; }
.step .what { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; }
.step .desc { color: var(--body); }
.mode { font-size: 10px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--pc); color: var(--pc); }
.accel { font-size: 13px; color: var(--purple); }
.det-btn { align-self: flex-start; border: 1px solid var(--line); color: var(--muted-3); border-radius: 8px; padding: 6px 12px; font-size: 12px; }
.det-btn:hover { background: var(--hover); }
.details { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--body); }
.diagram { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12px; line-height: 1.35; overflow-x: auto; padding-bottom: 4px; }
.dcol { width: 190px; flex: none; display: flex; flex-direction: column; gap: 5px; }
.dgroup { border: 1px dashed var(--accent); border-radius: 10px; padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.dlink { text-align: center; color: var(--accent); font-size: 11px; }
.dbox { background: var(--page); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; color: var(--text); }
.dhub { background: var(--page); border: 1px solid #60a5fa; border-radius: 10px; padding: 9px; }
.dhub .t { font-weight: 600; font-size: 13px; color: var(--text); }
.layer { border-left: 3px solid; padding: 3px 8px; background: var(--active); border-radius: 4px; color: var(--text); }
.arrow { color: var(--muted-2); font-size: 18px; flex: none; }

/* Dock: career log, composer, footer */
.dock { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 40px 16px; display: flex; flex-direction: column; gap: 8px; }
.log { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.log-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted-3); }
.log-steps { display: flex; gap: 4px; }
.log-step { flex: 1; min-width: 0; border-top: 3px solid; padding-top: 4px; }
.log-step .yr { font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.log-step .lbl { font-size: 11px; line-height: 1.3; color: #d6d3cd; }
.composer { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 11px; }
.chips span { padding: 3px 8px; border-radius: 6px; background: var(--active); }
.prompt { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); padding: 0 4px; }

/* Right panel */
.panel { display: flex; flex-direction: column; gap: 12px; padding: 16px 12px; }
.panel-side { border-left: 1px solid var(--line-soft); overflow-y: auto; }
.panel-inline { display: none; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.box h2 { font-size: 13px; }
.box .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.box .row.big { font-size: 15px; }
.underline { text-decoration: underline; }
.toggle { width: 30px; height: 18px; border-radius: 9px; background: var(--blue); position: relative; flex: none; }
.toggle::after { content: ''; position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 7px; background: #fff; }
.segbar { display: flex; gap: 2px; height: 5px; }
.segbar div { border-radius: 2px; }
.themes { display: flex; flex-direction: column; gap: 6px; }
.theme { display: flex; align-items: center; gap: 10px; font-size: 13px; border-radius: 6px; padding: 2px 0; }
.theme:hover .name { text-decoration: underline; }
.theme .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.sq.dashed { border: 1px dashed var(--muted-2); vertical-align: -1px; margin-right: 6px; }
.n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sub { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.sub-label { font-size: 12px; color: var(--muted-2); }
.mode-row, .mode { }
.sub .mode { border: 0; padding: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--body); font-family: var(--sans); }
.circle { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.also { display: flex; flex-direction: column; gap: 6px; color: var(--muted-3); }
.also .chips { font-family: var(--sans); padding-left: 20px; }
.also .chips span { font-size: 11px; padding: 2px 7px; border-radius: 5px; color: #d6d3cd; }
.fine { font-size: 11px; color: var(--muted-2); line-height: 1.45; }
.mobile-explorer { display: none; }

/* ---------- Medium: drop the right column into the main column ---------- */
@media (max-width: 1199px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .panel-side { display: none; }
  .panel-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; width: 100%; max-width: 920px; margin: 0 auto; padding: 8px 40px 32px; }
}

/* ---------- Phone: one column, pinned section tabs ---------- */
@media (max-width: 899px) {
  .layout { display: block; height: auto; }
  .sidebar { position: sticky; top: 0; z-index: 10; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 10px max(12px, env(safe-area-inset-left, 0px)) 8px; overflow: visible; }
  .brand { padding: 0 4px 8px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: none; min-height: 34px; white-space: nowrap; border: 1px solid var(--line); }
  .explorer, .contact { display: none; }
  .main { display: block; }
  .topbar { height: auto; padding: 12px 16px; }
  .topbar h1 { white-space: normal; }
  .scroll { overflow: visible; display: block; }
  .convo { padding: 20px max(16px, env(safe-area-inset-left, 0px)) 16px max(16px, env(safe-area-inset-right, 0px)); }
  .mobile-explorer { display: block; padding: 0 16px 16px; }
  .mobile-explorer .group-label { padding-left: 4px; }
  .mobile-explorer .list-item { min-height: 40px; }
  .dock { padding: 0 16px 16px; }
  .log-steps { overflow-x: auto; }
  .log-step { min-width: 84px; }
  .panel-inline { display: flex; padding: 0 16px 32px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .field { flex-direction: column; gap: 2px; }
  .flabel { width: auto; }
  .plan-step { flex-direction: column; gap: 4px; }
  .plan-step .when { width: auto; padding-top: 0; }
  .xp-head { flex-wrap: wrap; }
  .dates { width: 100%; padding-left: 24px; order: 3; }
  .step .yr { width: 64px; }
  .foot { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
