:root {
  --bg: #f4f6fb;
  --fg: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --border: #e6e9f0;
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.06);
  --card-shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c12;
    --fg: #e7ebf3;
    --muted: #8b93a7;
    --accent: #7aa2ff;
    --accent-soft: #161c2e;
    --border: #1e2431;
    --card: #12151d;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 14px 34px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 1.5rem 4rem;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

/* ---------- Hero ---------- */
.hero { padding-bottom: 2.5rem; }

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.intro-lead {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.2rem, 2.6vw, 1.45rem);
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.intro-body {
  margin: 1rem 0 0;
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
}

.links { margin-top: 1.75rem; display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.links a svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ---------- Section header ---------- */
.section { margin-top: 2.5rem; }

.section-title {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-hint { margin: 0 0 1.75rem; font-size: 0.9rem; color: var(--muted); }

/* ---------- Spine timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }

.entry {
  --rail: 5.75rem;
  --col-gap: 2rem;
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  column-gap: var(--col-gap);
}

.rail {
  text-align: right;
  padding-top: 1.5rem;
}

/* vertical spine line — absolutely placed, centred in the gap so it never
   collides with the right-aligned date */
.entry::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) + var(--col-gap) / 2);
  margin-left: -1px;
  width: 2px;
  top: 0;
  bottom: -1.5rem;
  background: var(--border);
}
.entry:first-child::before { top: 1.75rem; }
.entry:last-child::before { top: 0; bottom: auto; height: 1.75rem; }
.entry:only-child::before { display: none; }

/* dot on the spine, aligned with the card header */
.entry::after {
  content: "";
  position: absolute;
  left: calc(var(--rail) + var(--col-gap) / 2);
  margin-left: -6.5px;
  top: 1.75rem;
  margin-top: -6.5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.rail-date {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Card (details) ---------- */
.card {
  margin-bottom: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card[open] { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

.card-summary {
  list-style: none;
  cursor: pointer;
  padding: 1.4rem 1.5rem;
  -webkit-tap-highlight-color: transparent;
}
.card-summary::-webkit-details-marker { display: none; }

/* Static card (Education) — not expandable */
.card-static { cursor: default; }
.card-static .card-summary { cursor: default; }
.card-static .role { margin-bottom: 0; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }

.company {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.company-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.company-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  line-height: 1.4;
}
.badge-now { color: var(--accent); background: var(--accent-soft); }

.role { margin: 0.3rem 0 0; font-size: 0.88rem; color: var(--muted); }
.role .dot { margin: 0 0.35rem; opacity: 0.6; }

.chevron {
  flex: none;
  color: var(--muted);
  display: inline-flex;
  transition: transform 0.2s ease, color 0.2s ease;
}
.card[open] .chevron { transform: rotate(180deg); color: var(--accent); }

.highlight { margin: 0.9rem 0 0; color: var(--fg); }
.highlight strong { font-weight: 600; }

.more-hint {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
.more-hint::after { content: "Show more \0000a0›"; }
.card[open] .more-hint::after { content: "Show less \0000a0›"; }

/* expanded body */
.card-body {
  padding: 0 1.5rem 1.5rem;
  animation: reveal 0.22s ease;
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.bullets {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}
.bullets li { margin-bottom: 0.55rem; }
.bullets li:last-child { margin-bottom: 0; }
.bullets strong { font-weight: 600; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}
.tags li {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .entry { --rail: 5rem; --col-gap: 1.25rem; }
  .rail-date { font-size: 0.7rem; }
  .card-summary { padding: 1.15rem 1.15rem; }
  .card-body { padding: 0 1.15rem 1.25rem; }
  .company { font-size: 1.1rem; }
}

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