/* ============================================================
   Saaim Japanwala — digital garden
   Design system: warm off-white ground, extralight lowercase
   serif headers, subtle bento cards, translucent mono pills.
   ============================================================ */

:root {
  /* ---- color system ---- */
  --bg: #ffffff;
  --card-bg: #fafafa;
  --card-bg-hover: #f5f5f5;
  --ink: #171717;
  --muted: #737373;
  --label: #a3a3a3;
  --nav-border: #e5e5e5;
  --nav-chip: #e5e5e5;
  --scrim-bottom: rgba(0, 0, 0, 0.55);

  /* abstract placeholder "art" — one accent color per variant, each
     drawn as a distinct shape (circle, triangle, ribbon, rings, blob,
     dot-grid, arch, stripes — see the ABSTRACT PLACEHOLDER ART section
     below) so tiles read as different "things", not recolored copies
     of the same shape. Swap for a real photo/screenshot once you have
     one (README). */
  --art-1-bg: #f1e4d8; --art-1-a: #d99a7c;
  --art-2-bg: #e6ede4; --art-2-a: #7fa88a;
  --art-3-bg: #ece8f5; --art-3-a: #a99bd6;
  --art-4-bg: #f1e9da; --art-4-a: #c7a06f;
  --art-5-bg: #e3edf0; --art-5-a: #8fb9c9;
  --art-6-bg: #f4e7ec; --art-6-a: #d59fb4;
  --art-7-bg: #eaeee0; --art-7-a: #a8c17e;
  --art-8-bg: #ece9e2; --art-8-a: #b7ac97;

  --radius-card: 8px;
  --radius-nav: 8px;
  --radius-chip: 4px;

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ============================================================
   NAV — a plain sticky row; the tab group is its own small
   rounded-corner pill, the external links are separate plain
   text sitting at the opposite end of the same row.
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  flex-wrap: wrap;
}

.nav-pill {
  position: relative; /* so .nav-hover's offsetLeft/offsetParent math
    (see initNavHover in js/main.js) is relative to this, not .site-nav */
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-nav);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  padding: 6px;
  flex-wrap: wrap;
}

/* Gray hover indicator — a single element that slides between tabs
   (position/width set in js/main.js on mouseenter) instead of each
   tab independently fading its own background in/out. Doesn't apply
   to the active tab — that gets a colored underline instead (below). */
.nav-hover {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(100% - 12px);
  width: 0;
  background: var(--nav-chip);
  border-radius: var(--radius-chip);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, width 220ms ease, opacity 150ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .nav-hover { transition: opacity 150ms ease; }
}

.tab-link {
  position: relative;
  z-index: 1; /* sit above .nav-hover */
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--label);
  background: transparent;
  border: none;
  text-decoration: none; /* .tab-link is a <button> in the SPA nav but a
    plain <a> on article pages (writing/*.html) — this keeps both plain */
  padding: 8px 14px;
  border-radius: var(--radius-chip);
  cursor: pointer;
  transition: color 160ms ease;
}
.tab-link:hover { color: var(--ink); }
.tab-link.active { color: var(--ink); }

/* Active tab gets a colored squiggly underline instead of a solid
   background — same colors as the matching word in the home intro
   (.link-software/.link-photography/.link-writing). "Saaim" (home)
   has no assigned color, so it just gets the plain dark text above. */
.tab-link.active[data-tab="projects"] {
  text-decoration: underline dashed #ff9102;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.tab-link.active[data-tab="photography"] {
  text-decoration: underline solid #00b7ff;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.tab-link.active[data-tab="writing"] {
  text-decoration: underline wavy #00ec72;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-links a {
  font-size: 13px;
  color: var(--label);
  text-decoration: none;
  transition: color 160ms ease;
}
.nav-links a:hover { color: var(--ink); }

/* ============================================================
   MAIN / TAB PANELS
   ============================================================ */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 120px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 220ms ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  font-family: var(--font-serif);
  font-weight: 200;
  text-transform: lowercase;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 24px 0 20px;
}

.section-header-photography {
  text-decoration: underline solid #00b7ff;
  font-family: var(--font-serif);
  font-weight: 200;
  text-transform: lowercase;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 24px 0 20px;
}

.section-header-writing {
  text-decoration: underline wavy #00ec72;
  font-family: var(--font-serif);
  font-weight: 200;
  text-transform: lowercase;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 24px 0 20px;
}

.section-header-projects {
  text-decoration: underline dashed #ff9102;
  font-family: var(--font-serif);
  font-weight: 200;
  text-transform: lowercase;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 24px 0 20px;
}

.section-header-cv {
  text-decoration: underline dotted #000000;
  font-family: var(--font-serif);
  font-weight: 200;
  text-transform: lowercase;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 24px 0 20px;
}

/* Rotating home greeting — text/lang swapped in js/main.js on an
   interval; this just handles the fade between languages. */
.greeting {
  display: inline-block;
  text-transform: none; /* keep each language's own capitalization (Hello!, Bonjour !, …) */
  transition: opacity 250ms ease, transform 250ms ease;
}
.greeting.is-swapping {
  opacity: 0;
  transform: translateY(6px);
}
@media (prefers-reduced-motion: reduce) {
  .greeting { transition: none; }
}

/* Waving hand in the home intro — shakes on hover. */
.wave-emoji {
  display: inline-block;
  transform-origin: 70% 70%;
}
.wave-emoji:hover {
  animation: wave-shake 500ms ease-in-out;
}
@keyframes wave-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wave-emoji:hover { animation: none; }
}

/* Coffee cup in the home intro — two staggered steam wisps rise and
   fade on hover. */
.coffee-emoji {
  position: relative;
  display: inline-block;
}
.coffee-emoji::before,
.coffee-emoji::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 3px;
  height: 9px;
  background: rgba(120, 120, 120, 0.55);
  border-radius: 2px;
  filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
}
.coffee-emoji::before { left: 38%; }
.coffee-emoji::after  { left: 58%; }
.coffee-emoji:hover::before {
  animation: steam-rise 1.4s ease-in-out infinite;
}
.coffee-emoji:hover::after {
  animation: steam-rise 1.4s ease-in-out infinite 0.45s;
}
@keyframes steam-rise {
  0%   { transform: translateY(0) scaleX(1);   opacity: 0; }
  25%  { opacity: 0.6; }
  60%  { transform: translateY(-11px) scaleX(1.4); opacity: 0.35; }
  100% { transform: translateY(-19px) scaleX(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .coffee-emoji:hover::before,
  .coffee-emoji:hover::after { animation: none; }
}

.section-intro {
  color: var(--label);
  font-size: 16px;
  line-height: 1.6;
  max-width: 65ch;
  margin: 0 0 40px;
}

/* ============================================================
   HOME TAB
   ============================================================ */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 24px;
}

.intro-text {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 2.2vw, 34px);
  line-height: 1.35;
  color: #6b6b6b;
  max-width: 600px;
  margin: 0;
}
.intro-text .ink {
  color: #111111;
  font-weight: 700;
}

/* Bolded topic words in the intro — each links to its tab (wired up in
   js/main.js via [data-tab-link]) and gets its own colored, textured
   underline on hover so the three read as distinct, not identical. */
.word-link {
  text-decoration: none;
  cursor: pointer;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
  transition: text-decoration-color 160ms ease;
}
.word-link:hover,
.word-link:focus-visible {
  text-decoration-line: underline;
}
.link-software:hover, .link-software:focus-visible {
  text-decoration-style: dashed;
  text-decoration-color: #ff9102; /* orange — matches the Projects nav tab */
}
.link-photography:hover, .link-photography:focus-visible {
  text-decoration-style: solid;
  text-decoration-color: #00b7ff; /* blue — matches the Photography nav tab */
}
.link-writing:hover, .link-writing:focus-visible {
  text-decoration-style: wavy;
  text-decoration-color: #00ec72; /* green — matches the Writing nav tab */
}

/* Intro photo — a Polaroid-style frame (white border, slight tilt,
   soft shadow) with a handwritten sticky note taped over one corner
   as the caption. Swap the <img> src/alt in index.html and edit the
   <figcaption> text to change the photo or note. */
.intro-photo {
  align-self: center;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  background: #fff;
  padding: 14px 14px 20px;
  border-radius: 6px;
  box-shadow: 0 20px 40px rgba(17, 17, 17, 0.18);
  transform: rotate(-3deg);
}
.intro-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 3px;
}

.sticky-note {
  position: relative;
  margin: 16px -8px -10px auto;
  width: fit-content;
  max-width: 220px;
  background: #fff6b8;
  color: #4a4020;
  font-family: "Caveat", cursive;
  font-weight: 600;
  font-size: 23px;
  line-height: 1.2;
  padding: 12px 16px 14px;
  border-radius: 2px;
  transform: rotate(4deg);
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.2);
}
/* a strip of "tape" holding the note to the photo */
.sticky-note::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 56px;
  height: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(17, 17, 17, 0.04);
  transform: translateX(-50%) rotate(-4deg);
}

@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
  .intro-photo { max-width: 280px; }
}

/* ============================================================
   BENTO GRID — fixed-size square cells (240x240). Columns are a flat
   240px, not minmax(...,1fr), so cards never stretch into flat
   rectangles when there are only a couple of them — "wide"/"big" just
   means more 240px squares side by side, not one inflated tile.
   ============================================================ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: 16px;
}

/* Larger cells for Projects/Writing — more room for a screenshot/logo
   or a title + excerpt to breathe than the 240px default. */
.bento-grid--lg {
  grid-template-columns: repeat(auto-fill, 320px);
  grid-auto-rows: 320px;
}

/* Projects: cards stretch to fill the row and split it evenly instead
   of sitting at a fixed size — with same-span cards this means "N
   equal-width cards filling the width together" regardless of N. */
.bento-grid--fill {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card-span-wide { grid-column: span 2; }
.card-span-big  { grid-column: span 3; }

@media (max-width: 480px) {
  .bento-grid,
  .bento-grid--lg,
  .bento-grid--fill { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .card-span-wide,
  .card-span-big { grid-column: span 1; min-height: 260px; }
}

/* ============================================================
   CARD — base
   ============================================================ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: background-color 160ms ease;
}
.card:hover { background: var(--card-bg-hover); }
a.card { cursor: pointer; }

.card-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.card-eyebrow {
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--label);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.card-arrow {
  font-size: 15px;
  color: var(--label);
  line-height: 1;
  flex-shrink: 0;
}

.card-arrow:hover {
  font-size: 15px;
  color: var(--label);
  line-height: 1;
  flex-shrink: 0;
  cursor: alias;
}


.card-body {
  position: relative;
  z-index: 2;
  padding: 12px 20px 20px;
  margin-top: auto;
  min-width: 0;
}

/* Every card title clamps to 2 lines with an ellipsis rather than
   clipping mid-word or spilling past the card's rounded corners. */
.card-title {
  overflow: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Project/image card descriptions clamp too — same reasoning as
   .card-title above, just a couple more lines since there's no
   separate title-vs-body budget to share. */
.card-desc {
  overflow: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ---- variant: text-only card ---- */
.card--text .card-body { display: flex; align-items: flex-end; height: 100%; margin-top: 0; }
.card--text .card-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 28px;
  line-height: 1.2;
}

/* ---- variant: image card (art fills the card + scrim caption) ---- */
.card--image .card-art {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.card--image .card-eyebrow { color: rgba(255, 255, 255, 0.85); }
.card--image .card-arrow { color: rgba(255, 255, 255, 0.85); }
.card--image .card-body {
  background: linear-gradient(to top, var(--scrim-bottom), transparent);
  padding-top: 48px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

/* ---- variant: project card — the name lives in the eyebrow
   ("Projects · Soritch"); the rest of the card is just the screenshot,
   inset with padding rather than full-bleed, and left to bleed off the
   bottom edge (clipped by the card's own overflow:hidden) instead of
   being scaled to fit — matches the reference aesthetic requested. ---- */
.card--project .card-eyebrow { font-size: 15px; }
.card--project .card-project-art {
  flex: 1;
  margin: 14px 16px -20px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(17, 17, 17, 0.1);
  background: var(--card-bg);
}

.card--project .card-project-art > * {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 300ms ease;
}
/* Only the screenshot/logo scales on hover — the frame (padding,
   rounded corner, shadow) around it stays put. */
.card--project:hover .card-project-art > * {
  transform: scale(1.06);
}
@media (prefers-reduced-motion: reduce) {
  .card--project .card-project-art > * { transition: none; }
}

/* ---- variant: blog-post card ---- */
.card--post .card-body { margin-top: 0; }
.card--post .card-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.25;
  margin: 6px 0 6px;
}
.card--post .post-date {
  font-size: 12px;
  color: var(--label);
}
.card--post .post-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 8px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   ABSTRACT PLACEHOLDER ART — each art-N variant is a distinct,
   recognizable shape (not just a recolor of the same blob), so tiles
   read as genuinely different things. Swap any of these for a real
   <img> per card type in js/main.js once you have the real asset
   (README). Each shape is drawn with a single ::before pseudo-element
   against the variant's --art-N-bg background.
   ============================================================ */
.card-art {
  position: relative;
  overflow: hidden;
  background: var(--art-bg);
}
/* When card-art is a real <img> (a project with a real screenshot —
   see p.image in content/projects.js) instead of an abstract shape. */
img.card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--card-bg);
}
.card-art::before {
  content: "";
  position: absolute;
}

/* 1 — circle, off-center top-right (sun / coffee ring) */
.art-1 { --art-bg: var(--art-1-bg); }
.art-1::before {
  width: 68%; height: 68%;
  top: -16%; right: -16%;
  border-radius: 50%;
  background: var(--art-1-a);
}

/* 2 — triangular peak (mountain) */
.art-2 { --art-bg: var(--art-2-bg); }
.art-2::before {
  inset: 0;
  background: var(--art-2-a);
  clip-path: polygon(50% 16%, 92% 88%, 8% 88%);
}

/* 3 — diagonal repeating stripes (ribbon) */
.art-3 { --art-bg: var(--art-3-bg); }
.art-3::before {
  inset: -20%;
  background: repeating-linear-gradient(
    115deg,
    var(--art-3-a) 0 14%,
    transparent 14% 32%
  );
}

/* 4 — single diagonal band across the card */
.art-4 { --art-bg: var(--art-4-bg); }
.art-4::before {
  width: 150%; height: 30%;
  top: 40%; left: -25%;
  background: var(--art-4-a);
  transform: rotate(-11deg);
}

/* 5 — concentric rings (target) */
.art-5 { --art-bg: var(--art-5-bg); }
.art-5::before {
  inset: 0;
  background: radial-gradient(
    circle at 32% 32%,
    transparent 0 16%,
    var(--art-5-a) 16% 27%,
    transparent 27% 42%,
    var(--art-5-a) 42% 53%,
    transparent 53% 100%
  );
}

/* 6 — organic asymmetric blob (leaf) */
.art-6 { --art-bg: var(--art-6-bg); }
.art-6::before {
  width: 78%; height: 78%;
  top: 10%; left: 8%;
  background: var(--art-6-a);
  border-radius: 61% 39% 33% 67% / 59% 32% 68% 41%;
}

/* 7 — dot grid (polka pattern) */
.art-7 { --art-bg: var(--art-7-bg); }
.art-7::before {
  inset: 0;
  background-image: radial-gradient(var(--art-7-a) 24%, transparent 25%);
  background-size: 26px 26px;
}

/* 8 — arch / dome rising from the bottom edge */
.art-8 { --art-bg: var(--art-8-bg); }
.art-8::before {
  width: 92%; height: 130%;
  left: 4%; bottom: -22%;
  background: var(--art-8-a);
  border-radius: 50% 50% 0 0 / 62% 62% 0 0;
}

/* ============================================================
   ARTICLE PAGE — individual "writing." posts (writing/*.html).
   Each is its own static HTML file (no JS needed) that reuses the
   site's nav markup/CSS and fonts; this section just styles the
   reading column itself. See writing/alberta-seperation.html for
   an example of the expected markup.
   ============================================================ */
.article-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 140px;
}

.article-back {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--label);
  text-decoration: none;
  margin-bottom: 40px;
}
.article-back:hover { color: var(--ink); }

.article-kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.article-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 16px;
}

.article-meta {
  font-size: 14px;
  color: var(--label);
  margin: 0 0 48px;
}

.article-body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: #333333;
}
.article-body h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 26px;
  color: var(--ink);
  margin: 48px 0 16px;
}
.article-body p { margin: 0 0 22px; }
.article-body strong { color: var(--ink); }
.article-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--label);
  text-underline-offset: 3px;
}
.article-body a:hover { text-decoration-color: var(--ink); }

.article-note {
  font-size: 14px;
  color: var(--muted);
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 28px 0;
  line-height: 1.6;
}
.article-note a { color: var(--muted); }

.article-rule {
  border-top: 1px solid var(--nav-border);
  margin: 44px 0;
}

.article-image { margin: 32px 0; }
.article-image img { width: 100%; border-radius: 8px; display: block; }
.article-image figcaption { font-size: 13px; color: var(--label); margin-top: 10px; }

.article-signoff {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  margin-top: 48px;
}

.article-contact {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .article-page { padding: 24px 16px 100px; }
}

/* ============================================================
   CV PAGE (cv.html) — an expandable timeline rendered by js/cv.js
   from content/cv.js. Each entry is collapsed to a one-line summary
   by default; clicking the header expands it (grid-template-rows
   0fr -> 1fr, so no JS height math is needed for the animation).
   ============================================================ */
.cv-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 140px;
}

.cv-intro {
  font-size: 16px;
  line-height: 1.65;
  color: #333333;
  max-width: 560px;
  margin: 0 0 28px;
}

.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
}
.cv-skill-chip {
  font-size: 13px;
  color: var(--ink);
  background: var(--card-bg);
  border-radius: var(--radius-chip);
  padding: 6px 12px;
}

.cv-toggle-all {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--label);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
  text-decoration: underline;
  text-decoration-color: var(--nav-border);
  text-underline-offset: 3px;
}
.cv-toggle-all:hover { color: var(--ink); text-decoration-color: var(--ink); }

.cv-section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  color: var(--ink);
  margin: 40px 0 4px;
}

.cv-timeline { position: relative; }

.cv-entry {
  position: relative;
  padding-left: 28px;
}
.cv-entry + .cv-entry { border-top: 1px solid var(--nav-border); }

/* Dot marker + connecting rail, drawn once per entry so the rail only
   needs to run the height of each entry rather than being one giant
   absolutely-positioned line the JS has to keep in sync with content. */
.cv-entry::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 28px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--label);
  transition: background-color 160ms ease, border-color 160ms ease;
}
.cv-entry.expanded::before {
  background: var(--ink);
  border-color: var(--ink);
}
.cv-entry:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--nav-border);
}

.cv-entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  font-family: inherit;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 20px 0 2px;
}
.cv-entry-role {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink);
}
.cv-entry-org { font-size: 15px; color: var(--muted); }
.cv-entry-dates {
  font-size: 13px;
  color: var(--label);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 4px;
}

.cv-entry-summary {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 4px;
}

.cv-entry-detail-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .cv-entry-detail-wrap { transition: none; }
}
.cv-entry.expanded .cv-entry-detail-wrap { grid-template-rows: 1fr; }
.cv-entry-detail { overflow: hidden; min-height: 0; }

.cv-entry-bullets {
  margin: 8px 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.65;
  color: #333333;
}
.cv-entry-bullets li { margin-bottom: 6px; }

.cv-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 22px;
}
.cv-tag {
  font-size: 12px;
  color: var(--muted);
  background: var(--card-bg);
  border-radius: var(--radius-chip);
  padding: 4px 10px;
}

@media (max-width: 640px) {
  .cv-page { padding: 24px 16px 100px; }
  .cv-entry-header { flex-direction: column; gap: 2px; }
}

/* ============================================================
   RESPONSIVE — nav + page paddings on small screens
   ============================================================ */
@media (max-width: 640px) {
  .site-nav { padding: 12px 16px; }
  main { padding: 24px 16px 90px; }
}
