:root {
  --bg: #f4f1ea;
  --bg-2: #ebe6db;
  --ink: #1a1a1a;
  --ink-2: #3a3a3a;
  --ink-3: #6a6a6a;
  --ink-4: #a8a5a0;
  --rule: #2a2a2a33;

  --accent: oklch(0.42 0.12 255);
  --accent-soft: oklch(0.42 0.12 255 / 0.12);
  /* Green used only by the hero chat-status dot when the bot is up. */
  --chat-online: #1c7c45;
  --chat-online-soft: color-mix(in srgb, #1c7c45 22%, transparent);

  --map-fill: #e6e1d4;
  --map-fill-strong: #ccc6b4;
  --map-stroke: #1a1a1aaa;

  /* Swiss aesthetic — locked */
  --ff-display: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ff-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1400px;
  --pad: clamp(32px, 5vw, 96px);
}

:root[data-theme="dark"] {
  --bg: #121010;
  --bg-2: #1a1817;
  --ink: #eae6dc;
  --ink-2: #c6c2b9;
  --ink-3: #8a857d;
  --ink-4: #52504c;
  --rule: #eae6dc2e;

  --accent: oklch(0.68 0.14 255);
  --accent-soft: oklch(0.68 0.14 255 / 0.18);
  --chat-online: #3dcc7a;
  --chat-online-soft: color-mix(in srgb, #3dcc7a 28%, transparent);

  --map-fill: #201e1c;
  --map-fill-strong: #35322e;
  --map-stroke: #eae6dcaa;
}

html { transition: background 200ms ease, color 200ms ease; }

.floating-logo {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  flex-shrink: 0;
  min-width: 72px;
  min-height: 72px;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,0.25);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.floating-logo:hover {
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(0,0,0,0.3);
}
.floating-logo img { width: 58px; height: 58px; flex-shrink: 0; display: block; }

.tilt-prompt {
  position: fixed;
  bottom: 20px;
  right: 144px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  z-index: 101;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.35);
  animation: tiltPromptNudge 2.2s ease-in-out infinite;
}
.tilt-prompt[hidden] { display: none; }
.tilt-prompt-icon { display: flex; }
.tilt-prompt-icon svg { width: 18px; height: 18px; display: block; }
@keyframes tiltPromptNudge {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(6deg); }
  60% { transform: rotate(-6deg); }
}

.theme-toggle,
.back-to-top {
  position: fixed;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  border: none;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease, opacity 200ms ease;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.35);
}
.theme-toggle { right: 80px; }
.back-to-top {
  right: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.theme-toggle:hover,
.back-to-top.visible:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.theme-toggle:focus-visible,
.back-to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg,
.back-to-top svg { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 600ms;
  animation-timing-function: ease;
}

:root.theme-transitioning,
:root.theme-transitioning *,
:root.theme-transitioning *::before,
:root.theme-transitioning *::after {
  transition-property: background-color, background, color, border-color, fill, stroke, box-shadow !important;
  transition-duration: 500ms !important;
  transition-timing-function: ease !important;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--ff-display); font-weight: 400; letter-spacing: -0.02em; }

/* Section label — numbered eyebrow */
.section-label {
  display: flex;
  gap: 20px;
  align-items: baseline;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 32px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.section-label .num { color: var(--ink); font-weight: 500; }

/* ============== HERO ============== */
.hero {
  min-height: 100svh;
  padding: 32px var(--pad) 80px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
/* Eyebrow plus the chat badge. The badge stays on the left so the
   fixed logo in the center of the page does not cover it. */
.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow .dot {
  flex-shrink: 0;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Hero link to chat.efrain.me. Same pill shape as the buttons, a bit quieter.
   data-state is set by app.js: checking | up | down. */
.chat-status {
  --chat-pad-x: 14px;
  display: inline-flex;
  align-items: center;
  /* Same 10px gap as the eyebrow, so the label lines up once the dots do. */
  gap: 10px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px var(--chat-pad-x);
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
  /* The eyebrow dot is flush with the column. This pill's border and
     left padding would push its dot inward, so shift the pill back by
     that amount and the two dots share one vertical line. */
  margin-left: calc((var(--chat-pad-x) + 1px) * -1);
}
.chat-status:hover { border-color: var(--ink); color: var(--ink); }
.chat-status:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Offline: not a link. JS also drops href and sets aria-disabled. */
.chat-status[aria-disabled="true"] {
  cursor: default;
  color: var(--ink-3);
  pointer-events: none;
}
.chat-status[aria-disabled="true"]:hover { border-color: var(--rule); color: var(--ink-3); }
.chat-status-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}
.chat-status-sep,
.chat-status-state { color: var(--ink-3); }
/* Neutral pulse while the health check is in flight. */
.chat-status[data-state="checking"] .chat-status-dot {
  animation: chat-status-pulse 1.6s ease-out infinite;
}
@keyframes chat-status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink-3) 45%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
/* Green only when the API says status "up". */
.chat-status[data-state="up"] .chat-status-dot {
  background: var(--chat-online);
  box-shadow: 0 0 0 3px var(--chat-online-soft);
  animation: none;
}
.chat-status[data-state="up"] .chat-status-state { color: var(--chat-online); }
/* Grey when the bot is down, timed out, or the check failed. */
.chat-status[data-state="down"] .chat-status-dot {
  background: var(--ink-4);
  box-shadow: none;
  animation: none;
}
/* The checking rule above is more specific, so name it again here.
   Otherwise the pulse would keep running for people who asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  .chat-status[data-state="checking"] .chat-status-dot { animation: none; }
}
.btn-ghost, .btn-primary {
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 18px; border-radius: 999px; cursor: pointer;
  transition: all 200ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-ghost svg, .btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary.big svg { width: 18px; height: 18px; }
.btn-ghost { border: 1px solid var(--rule); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary.big { padding: 18px 32px; font-size: 13px; }

.hero-name {
  margin-top: auto;
  margin-bottom: 64px;
}
.hero-name h1 {
  font-size: clamp(72px, 14vw, 240px);
  line-height: 0.85;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.04em;
  isolation: isolate;
}
.hero-name .line-2 { font-style: italic; color: var(--ink-2); }
@property --ai-glow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: -30deg;
}
.hero-name .name-ai {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  isolation: isolate;
  color: #fff;
}
:root[data-theme="dark"] .hero-name .name-ai {
  color: #000;
}
.hero-name .name-ai::before {
  content: "ai";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: max-content;
  background-image: conic-gradient(
    from var(--ai-glow-angle) at 50% 45%,
    #ff3b30,
    #ff9500,
    #ffd60a,
    #34c759,
    #64d2ff,
    #0a84ff,
    #5e5ce6,
    #bf5af2,
    #ff3b30
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: blur(0.04em);
  transform: translate(-50%, -50%) scale(1.08);
  pointer-events: none;
  user-select: none;
  animation: ai-glow-spin 6s linear infinite;
}
@keyframes ai-glow-spin {
  to { --ai-glow-angle: 330deg; }
}
.hero-title {
  margin-top: 40px;
  font-family: var(--ff-mono);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  max-width: 600px;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
@media (max-width: 800px) {
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 28px; }
}
.meta-label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.meta-val { font-size: 15px; color: var(--ink); }
.meta-val.dim { color: var(--ink-3); font-size: 13px; }
.meta-val a { color: inherit; transition: color 200ms ease; }
.meta-val a:hover { color: var(--accent); }

.hero-scroll-hint {
  position: absolute;
  right: var(--pad);
  bottom: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero-scroll-hint svg { width: 18px; height: 18px; }

/* ============== SUMMARY ============== */
.summary {
  padding: 80px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.summary-text {
  font-family: var(--ff-display);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 1100px;
  margin: 0;
  text-wrap: pretty;
}

.competencies { margin-top: 80px; }
.comp-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (max-width: 800px) { .comp-grid { grid-template-columns: 1fr 1fr; } }
.comp-grid li {
  background: var(--bg);
  padding: 18px 22px;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.comp-num { font-family: var(--ff-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.1em; }
.comp-text { font-size: 14px; color: var(--ink); }

/* ============== EXPERIENCE (scroll map) ============== */
.experience { position: relative; }
.exp-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  /* svh = smallest viewport height — stable when mobile URL bar toggles */
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

.exp-chrome {
  position: absolute;
  top: 24px;
  left: var(--pad);
  right: var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 3;
  pointer-events: none;
}
.year-ticker {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1;
}
.year-big {
  font-family: var(--ff-display);
  font-size: clamp(48px, 7vw, 96px);
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-style: italic;
}
.year-lbl {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Rail */
.rail {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  height: 60vh;
  width: 160px;
  z-index: 4;
  pointer-events: none;
}
.rail-track {
  position: absolute;
  left: 10px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--rule);
}
.rail-progress {
  position: absolute;
  left: 9px;
  top: 0;
  width: 3px;
  background: var(--accent);
  transition: height 120ms linear;
}
.rail-stops {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  z-index: 1;
}
.rail-stop {
  position: relative;
  padding-left: 26px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  transition: color 200ms ease;
}
.rail-stop .rail-dot {
  position: absolute; left: 6px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--ink-4);
  transition: all 200ms ease;
}
.rail-stop.past { color: var(--ink-3); }
.rail-stop.past .rail-dot { background: var(--ink); border-color: var(--ink); }
.rail-stop.active { color: var(--ink); }
.rail-stop.active .rail-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.rail-year { color: inherit; }
.rail-org { font-size: 9px; opacity: 0.7; margin-top: 2px; }

/* Map */
.map-box {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.usmap {
  width: 100%;
  height: 100%;
  display: block;
}
/* Solid map style — locked default */
.usmap .states path {
  fill: var(--map-fill);
  stroke: var(--map-stroke);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}
.usmap .counties path {
  fill: var(--map-fill);
  stroke: var(--map-stroke);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* Arcs — thick style locked */
.arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}
.arc-active { stroke-width: 1.6; }
.arcs-trail .arc { stroke: var(--ink-3); stroke-width: 0.8; }

/* Pins */
.pin-core {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}
.pin-halo {
  fill: var(--accent-soft);
}
.pin-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  animation: pinpulse 2.4s ease-out infinite;
}
.pin-current .pin-core { stroke-width: 1.6; }
@keyframes pinpulse {
  0% { transform: scale(0.4); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 0; }
}

.travel-dot { fill: var(--accent); }
.travel-halo { fill: var(--accent-soft); }

/* Floating card */
.exp-card {
  position: absolute;
  top: 50%;
  right: var(--pad);
  transform: translate(var(--drag-x, 0px), calc(-50% + var(--drag-y, 0px)));
  width: min(440px, 38vw);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(110%);
  -webkit-backdrop-filter: blur(12px) saturate(110%);
  border: 1px solid var(--rule);
  padding: 32px 34px;
  z-index: 3;
  transition: opacity 180ms ease;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.18);
  cursor: grab;
  touch-action: none;
  /* Stay clear of the fixed tilt / theme / back-to-top controls. */
  max-height: calc(100vh - 168px);
  max-height: calc(100dvh - 168px);
  overflow-y: auto;
}
.exp-card.dragging { cursor: grabbing; user-select: none; }
.card-drag-handle {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  color: var(--ink-4);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 200ms ease, color 200ms ease;
}
.card-drag-handle svg { width: 100%; height: 100%; display: block; }
.exp-card:hover .card-drag-handle { opacity: 0.9; color: var(--accent); }
.exp-card.dragging .card-drag-handle { opacity: 1; color: var(--accent); }
.card-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.card-kind { color: var(--accent); }
.card-dates-stack {
  position: relative;
  flex: 1;
  height: 1.2em;
}
.card-dates-stack .card-dates {
  position: absolute;
  top: 0;
  right: 0;
  white-space: nowrap;
}
.card-promo { position: relative; overflow: hidden; }
.card-promo .card-role {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0;
  pointer-events: none;
}
.card-promo-bodies { margin-top: 28px; }
.card-promo-bodies .card-bullets { margin-top: 0; }
.card-logo {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 0 14px;
  object-fit: contain;
  object-position: left center;
  /* Brand files are black. Flatten to the page ink, and flip for dark mode. */
  filter: brightness(0);
}
.card-logo.is-wordmark {
  width: auto;
  height: 32px;
  max-width: 100%;
}
.card-logo.is-wordmark.is-compact {
  height: 24px;
}
.card-logo.is-tall {
  height: 40px;
}
:root[data-theme="dark"] .card-logo {
  filter: brightness(0) invert(1);
}
.card-title {
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.card-org {
  margin-top: 10px;
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.card-sep { color: var(--ink-4); }
.card-city { color: var(--ink-3); }

.card-bullets {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: flex; flex-direction: column; gap: 14px;
}
.card-bullets li {
  display: flex; gap: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  transition: opacity 300ms ease, transform 300ms ease;
}
.bullet-mark { color: var(--accent); flex-shrink: 0; }
.card-bullets li > span:last-child { min-width: 0; }
.card-bullets a,
.static-role a,
.static-promo a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 48%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
  transition: color 200ms ease, text-decoration-color 200ms ease, text-decoration-thickness 200ms ease;
}
.card-bullets a:hover,
.static-role a:hover,
.static-promo a:hover {
  text-decoration-color: currentColor;
  text-decoration-thickness: 1.5px;
}
.card-bullets a:focus-visible,
.static-role a:focus-visible,
.static-promo a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Pin tooltips */
.pin-tooltips {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.pin-tt {
  position: absolute;
  transform: translate(-50%, calc(-100% - 14px));
  pointer-events: auto;
  opacity: 0;
  transition: opacity 200ms ease;
}
.pin-tt[data-side="down"]  { transform: translate(-50%, 14px); }
.pin-tt[data-side="left"]  { transform: translate(calc(-100% - 14px), -50%); }
.pin-tt[data-side="right"] { transform: translate(14px, -50%); }
.pin-tt:hover { opacity: 1; }
.pin-tt.is-current { opacity: 1; }
.pin-tt-inner {
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 2px;
  position: relative;
}
.pin-tt-inner::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -5px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--ink);
}
.pin-tt[data-side="down"] .pin-tt-inner::after {
  left: 50%; top: -5px; bottom: auto; right: auto;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--ink);
  border-top: none;
}
.pin-tt[data-side="left"] .pin-tt-inner::after {
  top: 50%; right: -5px; bottom: auto; left: auto;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid var(--ink);
  border-right: none;
}
.pin-tt[data-side="right"] .pin-tt-inner::after {
  top: 50%; left: -5px; bottom: auto; right: auto;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid var(--ink);
  border-left: none;
}
.pin-tt-city { color: var(--bg); }
.pin-tt-org { color: var(--ink-4); margin-top: 2px; }
.pin-tt-years { color: var(--accent); margin-top: 2px; }

/* ============== CAREER TIMELINE ============== */
.career-gantt {
  position: relative;
  padding: 72px var(--pad) 56px;
}
.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px 32px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
}
.tl-head .section-label {
  border-top: none;
  flex: 1 1 180px;
  margin: 0;
}
.tl-legend {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 18px 0 32px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tl-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tl-swatch {
  width: 18px;
  height: 6px;
  background: var(--accent);
  flex: none;
}
.tl-swatch.is-education { background: var(--ink); }
.tl-kicker {
  margin: 0 0 6px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tl-readout { margin: 0 0 28px; }
.tl-readout-title {
  margin: 0;
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}
.tl-readout-title { font-size: clamp(22px, 2.6vw, 34px); }
.tl-readout-meta {
  margin: 8px 0 0;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tl-details > summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 22px auto 0;
  padding: 6px 4px;
  cursor: pointer;
  list-style: none;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.tl-details > summary::-webkit-details-marker { display: none; }
.tl-details > summary::marker { content: ""; }
.tl-details > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.tl-chevron {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform 200ms ease;
}
.tl-details:not([open]) .tl-chevron { transform: rotate(180deg); }
.tl-details[open] .tl-toggle-closed { display: none; }
.tl-details:not([open]) .tl-toggle-open { display: none; }
.tl-details:not([open]) > :not(summary) { display: none; }
.tl-details[open] {
  display: flex;
  flex-direction: column;
}
.tl-details[open] > .tl-body { order: 1; }
.tl-details[open] > summary { order: 2; }

.tl-axis {
  position: relative;
  height: 28px;
  border-top: 1px solid var(--rule);
}
.tl-axis span {
  position: absolute;
  top: 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  transform: translateX(-50%);
  white-space: nowrap;
}
.tl-axis span.is-start { transform: none; }
.tl-axis span.is-today { transform: translateX(-100%); }
@media (max-width: 700px) {
  .tl-axis span { font-size: 10px; letter-spacing: 0.04em; }
  .tl-axis span.is-near-end { transform: translateX(calc(-100% - 8px)); }
}

/* A — staircase of rules */
.tl-a-chart { padding-top: 4px; }
.tl-plot {
  position: relative;
  height: calc(var(--lanes) * 42px);
}
.tl-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tl-grid span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule);
}
.tl-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
}
.career-gantt .tl-item {
  position: absolute;
  left: 0;
  right: 0;
  height: 42px;
  bottom: calc(var(--lane) * 42px);
}
.career-gantt .tl-label {
  position: absolute;
  left: 0;
  width: var(--x);
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-family: var(--ff-display);
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.career-gantt .tl-item.is-origin .tl-label {
  left: calc(var(--x) + max(var(--w), 28px) + 12px);
  width: auto;
  right: 0;
  justify-content: flex-start;
  padding-right: 0;
}
.career-gantt .tl-hit {
  position: absolute;
  left: var(--x);
  width: max(var(--w), 28px);
  top: 0;
  bottom: 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.career-gantt .tl-mark {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  background: var(--accent);
}
.career-gantt .tl-hit.is-education .tl-mark { background: var(--ink); }
.career-gantt .tl-hit.is-active .tl-mark { height: 8px; }
.career-gantt .tl-hit:focus { outline: none; }
.career-gantt .tl-hit:focus-visible .tl-mark {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
.career-gantt .tl-hit.is-active + .tl-label,
.career-gantt .tl-item:has(.tl-hit.is-active) .tl-label { color: var(--accent); }
@media (max-width: 700px) {
  .career-gantt .tl-plot { height: calc(var(--lanes) * 58px); }
  .career-gantt .tl-item { height: 58px; bottom: calc(var(--lane) * 58px); }
  .career-gantt .tl-label,
  .career-gantt .tl-item.is-origin .tl-label {
    left: 0;
    right: 0;
    width: auto;
    top: 0;
    height: 22px;
    bottom: auto;
    justify-content: flex-start;
    padding: 0;
    font-size: 13px;
  }
  .career-gantt .tl-hit { top: 24px; bottom: 8px; }
}

@media (max-width: 640px) {
  .tl-legend { width: 100%; padding-top: 0; padding-bottom: 16px; }
}

/* ============== SKILLS ============== */
.skills {
  padding: 100px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--rule);
  background: var(--rule);
  gap: 1px;
}
@media (max-width: 800px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-block {
  background: var(--bg);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 800px) { .skill-block { grid-template-columns: 1fr; gap: 10px; } }
.skill-head {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.skill-body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}

/* ============== HIGHLIGHTS ============== */
.highlights {
  padding: 100px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.highlights-list {
  display: flex;
  flex-direction: column;
}
.highlight {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
}
.highlight-main { display: flex; flex-direction: column; gap: 8px; }
.highlight-title {
  font-family: var(--ff-display);
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.highlight-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
}
.highlight-year {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
@media (max-width: 640px) {
  .highlight { grid-template-columns: 1fr; }
  .highlight-year { padding-top: 4px; }
}

/* ============== PROJECTS ============== */
.projects {
  padding: 100px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.projects-list {
  display: flex;
  flex-direction: column;
}
.project {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
}
.project-main { display: flex; flex-direction: column; gap: 8px; }
.project-title {
  font-family: var(--ff-display);
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.project-title a { color: inherit; transition: color 200ms ease; }
.project-title a:hover { color: var(--accent); }
.project-role {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.project-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
}
.project-bullets {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.project-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
}
.project-tag {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.project-tag::before {
  content: "#";
  color: var(--accent);
}
.project-year {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
@media (max-width: 640px) {
  .project { grid-template-columns: 1fr; }
  .project-year { padding-top: 4px; }
}

/* ============== CERTIFICATIONS ============== */
.certifications {
  padding: 100px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.certs-list {
  display: flex;
  flex-direction: column;
}
.cert {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
}
.cert-main { display: flex; flex-direction: column; gap: 4px; }
.cert-title {
  font-family: var(--ff-display);
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cert-title a { color: inherit; transition: color 200ms ease; }
.cert-title a:hover { color: var(--accent); }
.cert-org {
  font-size: 14px;
  color: var(--ink-3);
}
.cert-year {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
@media (max-width: 640px) {
  .cert { grid-template-columns: 1fr; }
  .cert-year { padding-top: 4px; }
}

/* ============== LANGUAGES ============== */
.languages {
  padding: 100px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.langs {
  display: flex;
  gap: 80px;
  padding-top: 12px;
}
@media (max-width: 640px) {
  .langs { flex-direction: column; gap: 20px; }
}
.lang-name {
  font-family: var(--ff-display);
  font-size: 32px;
  letter-spacing: -0.02em;
}
.lang-level {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ============== CONTACT ============== */
.contact {
  padding: 100px var(--pad) 60px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.contact-big {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 40px;
  border-bottom: 1px solid var(--rule);
}
.contact-line {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 20px;
  align-items: center;
  padding: 12px 0;
}
.contact-line .k {
  display: flex;
  align-items: center;
  color: var(--ink-3);
}
.contact-line .k svg { width: 22px; height: 22px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.contact-line .v {
  font-family: var(--ff-display);
  font-size: clamp(22px, 2.6vw, 36px);
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 200ms ease;
}
.contact-line a.v:hover { color: var(--accent); }

.contact-cta {
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cta-meta {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.foot a { transition: color 200ms ease; }
.foot a:hover { color: var(--accent); }
.foot {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Subtle underline affordance for inline text links.
   Buttons (.btn-*) and the floating logo keep their own treatment. */
.meta-val a,
.cert-title a,
.project-title a,
.foot a,
.contact-line a.v {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 200ms ease, text-decoration-color 200ms ease;
}
.meta-val a:hover,
.cert-title a:hover,
.project-title a:hover,
.foot a:hover,
.contact-line a.v:hover {
  text-decoration-color: currentColor;
}

/* The status pill and download button share the top row with the logo
   until the longest pill would meet it, near 660px. Below that they drop
   under the portrait and sit side by side, filling the width. */
@media (max-width: 680px) {
  .hero-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 14px;
    align-items: stretch;
    margin-top: 72px;
  }
  .hero-intro { display: contents; }
  .eyebrow { grid-column: 1 / -1; }
  .chat-status {
    margin-left: 0;
    min-width: 0;
    height: 100%;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
  }
  .chat-status > span { flex-shrink: 0; }
  .chat-status > .chat-status-state {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-actions { min-width: 0; }
  .hero-actions .btn-primary {
    width: 100%;
    height: 100%;
    min-width: 0;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
  }
}

/* ============== MOBILE (hero row + footer) ============== */
@media (max-width: 640px) {
  .hero {
    min-height: 0;
    justify-content: flex-start;
    gap: 40px;
    padding-top: 104px;
    padding-bottom: 40px;
  }
  .hero-top {
    column-gap: 8px;
    margin-top: 0;
  }
  .chat-status {
    gap: 6px;
    padding: 10px 10px;
    font-size: 10px;
    letter-spacing: 0.04em;
  }
  .btn-ghost, .btn-primary {
    text-align: center;
    padding: 12px 10px;
    font-size: 11px;
    letter-spacing: 0.05em;
  }
  .hero-name { margin-top: 0; margin-bottom: 0; }
  .hero-meta { margin-top: 0; }
  .hero-scroll-hint { display: none; }

  /* Tighten vertical rhythm so section headers sit closer to the top */
  .summary,
  .career-gantt,
  .skills,
  .highlights,
  .projects,
  .certifications,
  .languages,
  .contact { padding-top: 56px; padding-bottom: 56px; }
  .competencies { margin-top: 56px; }
  .section-label { padding-bottom: 20px; }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Keep the icon beside the value and shrink the type so long
     addresses still fit on a phone. */
  .contact-line {
    grid-template-columns: 28px 1fr;
    gap: 12px;
    padding: 14px 0;
  }
  .contact-line .k svg { width: 20px; height: 20px; }
  .contact-line .v {
    font-size: clamp(18px, 5vw, 26px);
    overflow-wrap: anywhere;
  }
}

/* The offline status label stops fitting beside Download resume near 530px.
   Stack them, with the download button above Ask my AI. */
@media (max-width: 540px) {
  .hero-top {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
  .hero-actions { grid-column: 1; grid-row: 2; }
  .chat-status,
  .hero-actions .btn-primary {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-size: 11px;
    letter-spacing: 0.05em;
    line-height: 1;
  }
  .chat-status { grid-column: 1; grid-row: 3; gap: 8px; }
}

/* ============== MOBILE (experience section) ============== */
@media (max-width: 800px) {
  /* Slim rail — dots only, labels hidden, narrow column above the card */
  .rail {
    left: 10px;
    top: 56px;
    transform: none;
    width: 28px;
    height: 36vh;
  }
  .rail-stop { padding-left: 0; min-height: 13px; }
  .rail-stop .rail-year,
  .rail-stop .rail-org { display: none; }

  .exp-chrome {
    top: 16px;
    left: 16px;
    right: 16px;
  }
  .year-big { font-size: clamp(36px, 11vw, 56px); }

  .exp-card {
    top: auto;
    bottom: 88px;
    left: 16px;
    right: 16px;
    width: auto;
    max-height: 45vh;
    overflow-y: auto;
    transform: translate(var(--drag-x, 0px), var(--drag-y, 0px));
    padding: 20px 22px;
    cursor: default;
    touch-action: auto;
  }
  .card-drag-handle { display: none; }
  .card-title { font-size: clamp(22px, 5.5vw, 30px); }
  .card-logo { width: 36px; height: 36px; margin-bottom: 10px; }
  .card-logo.is-wordmark { width: auto; height: 26px; }
  .card-logo.is-wordmark.is-compact { height: 20px; }
  .card-logo.is-tall { height: 32px; }
  .card-bullets { margin-top: 18px; gap: 10px; }
  .card-promo-bodies { margin-top: 18px; }
  .card-bullets li { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .pin-pulse { animation: none; }
  .card-bullets li { transition: none; }
  .hero-name .name-ai::before { animation: none; }
  .tl-chevron { transition: none; }
}

/* Readable experience list when JavaScript is off. With JS, the noscript
   block is not rendered, so the scroll map stays the only experience view. */
html:not(.js) .exp-sticky { display: none; }
.experience-static {
  padding: 24px 0 40px;
}
.static-role {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.static-role h3 {
  font-family: var(--ff-display);
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.static-role-kind,
.static-role-meta,
.static-promo-dates {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
}
.static-role ul,
.static-promo ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.static-role li,
.static-promo li {
  position: relative;
  padding-left: 22px;
  margin: 0 0 8px;
  line-height: 1.5;
}
.static-role li::before,
.static-promo li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.static-promo { margin-top: 18px; }
.static-promo h4 {
  font-family: var(--ff-display);
  font-size: 20px;
  margin: 0 0 4px;
}
