:root{
  --bg: #f2f3ef;
  --panel: #ffffff;
  --text: #1c1e1b;
  --muted: #8d9086;
  --linenum: #c7cac1;
  --border: #dedfda;
  --accent: #4c6b54;   /* string / link color */
  --accent-2: #a8763e; /* constant / secondary highlight */
  --gutter-w: 56px;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'JetBrains Mono Fallback', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a{ color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover, a:focus-visible{ border-bottom-color: var(--accent); }
a:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top tab bar ---------- */
.tabbar{
  position: sticky; top: 0; z-index: 50;
  display:flex; align-items:stretch; overflow-x:auto;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.tabbar::-webkit-scrollbar{ display:none; }
.tabbar .brand{
  display:flex; align-items:center;
  padding: 0 16px;
  color: var(--muted);
  white-space:nowrap;
  border-right: 1px solid var(--border);
  font-size: 13px;
}
.tab{
  padding: 14px 18px;
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
  border-right: 1px solid var(--border);
  background: transparent;
  position: relative;
}
.tab .dot{ color: var(--accent-2); }
.tab.active{ color: var(--text); background: var(--bg); }
.tab.active::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-1px; height:2px;
  background: var(--accent);
}
.tab:hover{ color: var(--text); border-bottom-color: transparent; }

/* ---------- editor body ---------- */
.editor{
  display:flex;
  max-width: 1040px;
  margin: 0 auto;
}
.gutter{
  width: var(--gutter-w);
  flex-shrink:0;
  text-align:right;
  padding: 48px 12px 120px 0;
  color: var(--linenum);
  font-size: 13px;
  user-select:none;
  border-right: 1px solid var(--border);
}
.gutter .num{ display:block; height: var(--lh, 27.2px); }

.content{
  flex:1;
  min-width:0;
  padding: 48px 24px 120px 24px;
}

section{ max-width: var(--maxw); }
section + section{ margin-top: 64px; padding-top: 8px; }

.comment{ color: var(--muted); }
.kw{ color: var(--accent-2); }
.str{ color: var(--accent); }

h1, h2{
  font-weight:700;
  margin: 0 0 6px 0;
  color: var(--text);
}
h1{ font-size: 22px; }
h2{ font-size: 16px; }

p{ margin: 0 0 14px 0; max-width: 62ch; }

.tagline{ color: var(--muted); margin-bottom: 28px; }

/* about / hero photo */
.about-grid{
  display:flex; gap: 28px; align-items:flex-start; flex-wrap: wrap;
}
.about-photo{
  width: 148px; height: 148px;
  flex-shrink:0;
  border: 1px solid var(--border);
  background: var(--panel);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  color: var(--muted);
  font-size: 11px;
  text-align:center;
  padding: 8px;
}
.about-photo img{ width:100%; height:100%; object-fit: cover; display:block; }
.about-text{ flex:1; min-width: 240px; }

/* notes / projects / companies lists */
.list{ border-top: 1px solid var(--border); }
.list-item{
  display:flex; gap: 18px; align-items:baseline;
  padding: 14px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--border);
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.list-item .meta{ color: var(--muted); font-size: 12px; width: 82px; flex-shrink:0; }
.list-item .main{ flex:1; min-width:0; }
.list-item .title{ color: var(--text); }
.list-item .desc{ color: var(--muted); font-size: 13px; margin-top: 2px; }
.list-item a.title:hover{ border-bottom-color: var(--accent); }

/* hoverable project / link rows */
.list-item.hoverable{ cursor: pointer; border-left: 2px solid transparent; }
.list-item.hoverable:hover{
  background: var(--panel);
  border-color: var(--border);
  border-left: 2px solid var(--accent);
  transform: translateX(4px);
}
.list-item.hoverable:hover .title{ color: var(--accent); }
.list-item .arrow{
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .18s ease, transform .18s ease;
  flex-shrink: 0;
}
.list-item.hoverable:hover .arrow{ opacity: 1; transform: translateX(0); }

/* tags */
.tags{ margin-top: 6px; display:flex; gap:8px; flex-wrap:wrap; }
.tag{
  font-size: 11px; color: var(--accent);
  border: 1px solid var(--border);
  padding: 2px 7px;
  background: var(--panel);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.list-item.hoverable:hover .tag{
  border-color: var(--accent);
}

/* section header row with "see all" link */
.section-head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap: 12px; max-width: var(--maxw);
}
.see-all{ font-size: 13px; white-space:nowrap; }

/* companies / experience timeline */
.company-item{
  display:flex; gap: 18px;
  padding: 14px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--border);
}
.company-item .meta{ color: var(--muted); font-size: 12px; width: 110px; flex-shrink:0; }
.company-item .main{ flex:1; min-width:0; }
.company-item .role{ color: var(--muted); font-size: 13px; }

/* channel / contact box */
.channel-box{
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 20px;
  max-width: var(--maxw);
}
.channel-box .row{ display:flex; gap:10px; }
.channel-box a{ font-weight:500; }

/* contact links */
.contact-grid{
  display:flex; flex-wrap:wrap; gap: 12px;
  max-width: var(--maxw);
}
.contact-link{
  display:flex; align-items:center; gap:8px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  transition: border-color .18s ease, transform .18s ease, color .18s ease;
}
.contact-link:hover{
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  border-bottom: 1px solid var(--accent);
}
.contact-link .k{ color: var(--accent-2); }

footer{
  max-width: var(--maxw);
  color: var(--muted);
  font-size: 12px;
  margin-top: 80px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px){
  .gutter{ display:none; }
  .content{ padding: 32px 18px 100px 18px; }
  .tab{ padding: 12px 14px; }
  .section-head{ flex-direction:column; align-items:flex-start; gap:4px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  .list-item, .list-item.hoverable, .tag, .contact-link{ transition: none; }
}
