:root {
  --sidebar-bg: #17140f;
  --sidebar-text: #f3ede2;
  --sidebar-muted: #a89c88;
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #211d18;
  --text-muted: #6b6357;
  --border: #e7e0d4;
  --accent: #b5651d;
  --accent-soft: #f1e3d0;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-width: 280px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sidebar-bg: #0e0c0a;
    --bg: #171310;
    --surface: #1e1913;
    --text: #f1ece2;
    --text-muted: #a89c88;
    --border: #332c22;
    --accent: #e0a446;
    --accent-soft: #2e2419;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: inherit; }

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-inner {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
}

.sidebar h1 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--sidebar-text);
}

.sidebar .role {
  margin: -1.25rem 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.98rem;
}

.sidebar .location {
  margin: -1rem 0 0;
  color: var(--sidebar-muted);
  font-size: 0.88rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.side-nav a {
  text-decoration: none;
  color: var(--sidebar-muted);
  font-size: 0.92rem;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.side-nav a:hover, .side-nav a.active {
  color: var(--accent);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.social-links a {
  text-decoration: none;
  color: var(--sidebar-muted);
  font-size: 0.88rem;
}

.social-links a:hover { color: var(--sidebar-text); }

/* Main content */
main {
  flex: 1;
  min-width: 0;
  max-width: 720px;
  padding: 4rem 3rem 5rem;
}

.block {
  padding-bottom: 3.5rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
}

.block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

.about-lede {
  font-size: 1.2rem;
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.about-body {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.quote {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 0;
}

/* Experience */
.role {
  margin-bottom: 2.5rem;
}

.role:last-child { margin-bottom: 0; }

.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.role-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.role-date {
  font-family: var(--sans);
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.role-org {
  margin: 0.2rem 0 0.75rem;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
}

.role-points {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.role-points li { margin-bottom: 0.45rem; }
.role-points li:last-child { margin-bottom: 0; }

.section-note {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 520px) {
  .skills-grid { grid-template-columns: 1fr; }
}

.skill-group h3 {
  font-family: var(--sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  font-size: 0.85rem;
}

/* Languages */
.lang-row {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.lang {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.lang-name { font-weight: 600; }
.lang-level { color: var(--text-muted); font-size: 0.88rem; }

/* Contact / footer */
#contact.block {
  border-bottom: none;
}

.contact-lede {
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--sidebar-bg);
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.footer-fine {
  margin: 1.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 860px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .sidebar-inner {
    padding: 2.5rem 1.75rem;
  }
  main {
    max-width: none;
    padding: 3rem 1.75rem 4rem;
  }
}
