*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Themes ── */
:root {
  --bg: #fafaf8;
  --surface: #f5f5f5;
  --text: #111111;
  --muted: #666666;
  --accent: #0052cc;
  --border: #e0e0e0;
  --header-bg: rgba(250, 250, 248, 0.85);
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --text: #f0f0f0;
  --muted: #888888;
  --accent: #4d9fff;
  --border: #2a2a2a;
  --header-bg: rgba(15, 15, 15, 0.85);
}

/* ── Base ── */
body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

h1 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.role {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.location {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.header-contact a {
  color: var(--accent);
  text-decoration: none;
}

.header-contact a:hover {
  text-decoration: underline;
}

.ext-icon {
  width: 11px;
  height: 11px;
  vertical-align: middle;
  margin-left: 0.2rem;
  position: relative;
  top: -1px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.15s;
}

.theme-toggle:hover {
  background: var(--surface);
}

/* ── Main ── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Tech Stack ── */
.tech-stack {
  margin-bottom: 2.5rem;
}

.tech-stack-details {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.tech-stack-summary {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.75rem;
  cursor: default;
  list-style: none;
  user-select: none;
}

.tech-stack-summary::-webkit-details-marker {
  display: none;
}

.tech-stack-summary::marker {
  content: none;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

/* Languages & Frameworks */
.tag--lang {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* Databases */
.tag--db {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

/* Tools & Infrastructure */
.tag--tool {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

[data-theme="dark"] .tag--lang {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #93c5fd;
}

[data-theme="dark"] .tag--db {
  background: #14532d;
  border-color: #22c55e;
  color: #86efac;
}

[data-theme="dark"] .tag--tool {
  background: #451a03;
  border-color: #d97706;
  color: #fcd34d;
}

/* AI Tools */
.tag--ai {
  background: #f3e8ff;
  border-color: #c084fc;
  color: #7e22ce;
}

[data-theme="dark"] .tag--ai {
  background: #3b0764;
  border-color: #a855f7;
  color: #d8b4fe;
}

@media (max-width: 600px) {
  .tech-stack-summary {
    cursor: pointer;
  }

  .tech-stack-summary::after {
    content: " ▾";
    font-size: 0.7rem;
  }

  .tech-stack-details[open] .tech-stack-summary::after {
    content: " ▴";
  }
}

@media (min-width: 601px) {
  .tech-stack-details > .tech-tags {
    display: flex !important;
  }
}

/* ── Timeline ── */
.timeline-section {
  display: none;
}

.timeline {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.tl-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 480px;
  height: 1.8rem;
}

.tl-row.tl-head {
  height: 1.75rem;
  align-items: flex-end;
  margin-bottom: 0.25rem;
}

.tl-row.tl-group {
  margin-top: 0.5rem;
}

.tl-label {
  flex: 0 0 120px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.timeline .tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
}

.tl-track {
  flex: 1;
  position: relative;
  height: 8px;
  background-image: repeating-linear-gradient(
    to right,
    var(--border) 0, var(--border) 1px,
    transparent 1px, transparent 11.11%
  );
}

.tl-head .tl-track {
  height: 100%;
  background-image: none;
  border-bottom: 1px solid var(--border);
}

.tl-year {
  position: absolute;
  left: calc(var(--p) * 1%);
  bottom: 4px;
  font-size: 0.68rem;
  color: var(--muted);
  transform: translateX(-50%);
  white-space: nowrap;
}

.tl-bar {
  position: absolute;
  top: 0;
  height: 100%;
  left: calc(var(--s) * 1%);
  width: calc(var(--w) * 1%);
  border-radius: 999px;
  min-width: 4px;
}

.tl-bar.tag--lang { background: #93c5fd; }
.tl-bar.tag--db   { background: #86efac; }
.tl-bar.tag--tool { background: #fcd34d; }
.tl-bar.tag--ai   { background: #c084fc; }

[data-theme="dark"] .tl-bar.tag--lang { background: #3b82f6; }
[data-theme="dark"] .tl-bar.tag--db   { background: #22c55e; }
[data-theme="dark"] .tl-bar.tag--tool { background: #d97706; }
[data-theme="dark"] .tl-bar.tag--ai   { background: #a855f7; }

/* ── Sections ── */
.cv-section {
  margin-bottom: 3rem;
}

.section-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.75rem;
}

.section-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.languages-section {
  margin-bottom: 1.5rem;
}

.lang-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  font-size: 0.9rem;
}

.lang-level {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

/* ── Entries ── */
.entry {
  margin-bottom: 2rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  transition: border-left-color 0.2s;
}

.entry:hover {
  border-left-color: var(--accent);
}

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

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.entry-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.entry-org {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.entry-date {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.entry-summary {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.entry-bullets {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.entry-bullets li {
  font-size: 0.9rem;
  line-height: 1.55;
  padding-left: 1rem;
  position: relative;
}

.entry-bullets li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.entry-bullets .tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.entry-desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.project-stubs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.project-stubs li {
  font-size: 0.9rem;
  color: var(--muted);
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
