/* ─── Tokens ─── */
:root {
  --bg:         #FAFAF7;
  --bg-surface: #F0EEE8;
  --bg-card:    #EBEBDF;
  --fg:         #111210;
  --fg-muted:   #6B6B60;
  --fg-faint:   #9E9D94;
  --border:     #E2DFD8;
  --border-mid: #D3D1C7;
  --teal:       #0F6E56;
  --teal-light: #E1F5EE;
  --teal-mid:   #5DCAA5;
  --teal-border:#9FE1CB;
  --amber:      #BA7517;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans:  'Geist', -apple-system, sans-serif;
  --font-mono:  'Geist Mono', 'Courier New', monospace;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
}

[data-theme="dark"] {
  --bg:         #111210;
  --bg-surface: #1A1A17;
  --bg-card:    #202020;
  --fg:         #F0EDE6;
  --fg-muted:   #6B6B60;
  --fg-faint:   #444441;
  --border:     #252520;
  --border-mid: #2C2C2A;
  --teal:       #5DCAA5;
  --teal-light: #085041;
  --teal-mid:   #1D9E75;
  --teal-border:#0F6E56;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ─── Sidebar ─── */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  border-right: 0.5px solid var(--border);
  background: var(--bg);
  z-index: 100;
}
.sidebar-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 2.5rem;
  line-height: 1.3;
  transition: color 0.15s;
}
.sidebar-logo:hover { color: var(--teal); }
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}
.sidebar-links a {
  font-size: 0.82rem;
  color: var(--fg-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.sidebar-links a:hover {
  color: var(--fg);
  background: var(--bg-surface);
}
.sidebar-bottom { padding-top: 1rem; }

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.theme-toggle:hover { background: var(--bg-surface); color: var(--fg); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ─── Content wrap + Main ─── */
.content-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; max-width: 680px; padding: 3rem 2.5rem 4rem; }

/* ─── Hero (index only) ─── */
.hero {
  margin-bottom: 3.5rem;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
}
.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
}
.eyebrow-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 1.25rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--fg-muted);
}
.hero-bio {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--fg-muted);
  max-width: 46ch;
  margin-bottom: 1.75rem;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  display: inline-block;
}
.btn:hover { opacity: 0.85; }
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-ghost {
  background: transparent;
  border: 0.5px solid var(--border-mid);
  color: var(--fg-muted);
}
.btn-ghost:hover { border-color: var(--fg-muted); color: var(--fg); opacity: 1; }

.avail-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-light);
  border: 0.5px solid var(--teal-border);
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: 1.5rem;
}
.avail-pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal-mid);
}
.avail-pill span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ─── Stat pills ─── */
.stat-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
}
.stat-pill {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-left: 2px solid var(--teal);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 130px;
  flex: 1;
  max-width: 180px;
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  line-height: 1.5;
  display: block;
}

/* ─── Expertise ─── */
.expertise {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  flex-wrap: wrap;
}
.expertise-item {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--teal);
}
.expertise-sep {
  color: var(--border-mid);
  font-size: 0.72rem;
}

/* ─── About ─── */
.about { display: flex; flex-direction: column; gap: 1.5rem; }
.about-body {
  font-size: 0.92rem;
  color: var(--fg-muted);
  line-height: 1.75;
  font-weight: 300;
  max-width: 58ch;
}
.about-section { display: flex; flex-direction: column; gap: 0.75rem; }
.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.about-list li {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.65;
  font-weight: 300;
  padding-left: 1rem;
  position: relative;
}
.about-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--border-mid);
  font-size: 0.75rem;
}

/* ─── Divider ─── */
.divider {
  height: 0.5px;
  background: var(--border);
  margin: 2.5rem 0;
}

/* ─── Section label ─── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 1.25rem;
}

/* ─── Writing / post list ─── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 0.5px solid var(--border);
}
.post-list li:first-child { border-top: 0.5px solid var(--border); }
.post-info { flex: 1; min-width: 0; }
.post-info a {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  display: block;
  margin-bottom: 3px;
  transition: color 0.15s;
}
.post-info a:hover { color: var(--teal); }
.post-excerpt {
  font-size: 0.8rem;
  color: var(--fg-faint);
  line-height: 1.5;
  font-weight: 300;
}
time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-faint);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.substack-link {
  margin-top: 1.25rem;
}
.substack-link a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}
.substack-link a:hover { opacity: 0.7; }


/* ─── Post page ─── */
.post-page { flex: 1; max-width: 680px; padding: 3rem 2.5rem 5rem; }
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  margin-bottom: 2rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--teal); }
.post-header { margin-bottom: 1.75rem; }
.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 0.75rem;
}
.post-lede {
  font-size: 1rem;
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 54ch;
}
.post-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}
.post-meta-sep { color: var(--border-mid); }
.post-body { margin-top: 2rem; }
.post-body h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 2.25rem 0 0.6rem;
  font-weight: 400;
}
.post-body h3 strong { font-weight: 400; }
.post-origin {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}
.post-origin a {
  color: var(--teal);
  border-bottom: 0.5px solid currentColor;
}

/* ─── Pages ─── */
.page-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.page-subtitle {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
  font-weight: 300;
}
.content h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.5px solid var(--border);
}
.content h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  margin: 1.25rem 0 0.25rem;
}
.content p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 0.75rem;
}
.content ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.content ul li {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 0.25rem;
}
.content a {
  color: var(--teal);
  border-bottom: 0.5px solid currentColor;
  transition: opacity 0.15s;
}
.content a:hover { opacity: 0.7; }
.content strong { font-weight: 500; color: var(--fg); }

/* ─── Principles ─── */
.principles { display: flex; flex-direction: column; gap: 1.25rem; }
.principle-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.principle-list li {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.1rem 0;
  border-bottom: 0.5px solid var(--border);
}
.principle-list li:first-child { border-top: 0.5px solid var(--border); }
.principle-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--teal);
  padding-top: 3px;
  flex-shrink: 0;
  width: 1.5rem;
}
.principle-body { display: flex; flex-direction: column; gap: 3px; }
.principle-lead {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
}
.principle-detail {
  font-size: 0.83rem;
  color: var(--fg-muted);
  line-height: 1.65;
  font-weight: 300;
}

/* ─── Timeline ─── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Company block */
.tl-company {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tl-company-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}
.tl-company-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.tl-company-tenure {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-left: auto;
}
.tl-company-line {
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

/* Role rows within a company */
.tl-roles {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1.5px solid var(--border-mid);
  margin-left: 4px;
}
.tl-item {
  position: relative;
  padding: 0.75rem 0 0.75rem 1.25rem;
  border-bottom: 0.5px solid var(--border);
}
.tl-item:last-child { border-bottom: none; }
.tl-marker {
  position: absolute;
  left: -4.5px;
  top: 1.1rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  border: 1.5px solid var(--bg);
}
.tl-dates {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 3px;
}
.tl-role {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
  margin-bottom: 4px;
}
.tl-summary {
  font-size: 0.83rem;
  color: var(--fg-muted);
  line-height: 1.65;
  font-weight: 300;
}

/* ─── 404 ─── */
.error-page { text-align: center; padding: 5rem 2rem; }
.error-page h1 { font-family: var(--font-serif); font-size: 5rem; margin-bottom: 0.5rem; opacity: 0.15; }
.error-page p { color: var(--fg-muted); margin-bottom: 1.5rem; }

/* ─── Responsive ─── */
/* ─── Hamburger (hidden on desktop) ─── */
.hamburger {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.hamburger:hover { background: var(--bg-surface); color: var(--fg); }

@media (max-width: 640px) {
  body { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
  }
  .sidebar-logo { margin-bottom: 0; font-size: 0.95rem; }

  /* Hide nav links by default on mobile */
  .sidebar-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 0.5px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
    gap: 0;
    z-index: 200;
  }
  .sidebar-links.mobile-open { display: flex; }
  .sidebar-links a { padding: 10px 0; font-size: 0.88rem; border-bottom: 0.5px solid var(--border); }
  .sidebar-links a:last-child { border-bottom: none; }

  .sidebar-bottom { padding-top: 0; padding-left: 0; gap: 0.5rem; margin-left: auto; display: flex; align-items: center; }
  .hamburger { display: flex; }

  main { padding: 2rem 1.25rem 3rem; }
  .post-list li { flex-direction: column; gap: 0.25rem; }
}
