/* ============================================================
   DESIGN TOKENS — "correspondence stationery"
   A cool, pale writing-paper desk; bright white card stock whose painted
   edge is each period's ink; an engraved serif for names and titles; a
   blind-embossed monogram and a wax seal bookending the experience.
   ============================================================ */

:root {
  --desk: #e4eaec;
  --desk-shade: #d3dce0;
  --card: #ffffff;
  --ink: #1d2b3a;
  --ink-2: #3b4a5a;
  --muted: #5e6a77;
  --faint: #6f7a86;
  --rule: #c3cdd3;
  --hair: #dde3e6;
  --foil: #a88746;
  --foil-light: #d4bb7e;
  --seal: #7e2633;
  --edu: #5f5687;
  --focus: #2e5c9a;
  --font-display: "Marcellus", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-doc: "Crimson Pro", Georgia, "Times New Roman", serif;
  --paper-shadow: 0 1px 0 rgba(29, 43, 58, 0.04), 0 14px 30px -20px rgba(29, 43, 58, 0.38);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.17 0 0 0 0 0.23 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The page itself never scrolls — all movement is horizontal, inside
   #track. (The print rules undo this so the resume paginates.) */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--desk) var(--grain);
}

/* The `hidden` attribute must always win, even over elements that get a
   `display` value from this stylesheet. */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   STAGE & TRACK
   ============================================================ */

#stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#stage button,
#resume-overlay button {
  font-family: var(--font-ui);
}

#stage :focus-visible,
#resume-overlay :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

#track-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

#track {
  position: absolute;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
  outline: none;
}

#track:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--focus);
}

#track::-webkit-scrollbar {
  height: 8px;
}

#track::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 4px;
}

#track-content {
  position: relative;
  height: 100%;
}

/* ============================================================
   MONOGRAM & SEAL
   ============================================================ */

.monogram {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  line-height: 1;
  user-select: none;
}

/* Blind embossing: no ink, just paper pressed up from behind. */
.monogram-emboss {
  width: 78px;
  height: 78px;
  font-size: 29px;
  color: #f1f3f2;
  background: radial-gradient(circle at 40% 35%, #ffffff 0%, #f4f6f5 60%, #eef1f0 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 3px rgba(29, 43, 58, 0.07),
    0 1px 1px rgba(29, 43, 58, 0.08),
    0 -1px 0 rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 1), 0 -1px 1px rgba(29, 43, 58, 0.16);
  position: relative;
}

.monogram-emboss::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(29, 43, 58, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9);
}

.monogram-seal {
  width: 34px;
  height: 34px;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--ink), inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--rule);
}

.wax-seal {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 34% 30%, #b04656 0%, #8c2c3b 42%, #6a1d29 100%);
  box-shadow:
    inset 0 0 0 7px rgba(0, 0, 0, 0.08),
    inset 0 2px 3px rgba(255, 255, 255, 0.22),
    0 2px 0 rgba(90, 20, 30, 0.35),
    0 12px 22px -12px rgba(90, 20, 30, 0.6);
}

.wax-seal span {
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: 0.04em;
  color: #c86070;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ============================================================
   LANDING — a correspondence card on the desk
   ============================================================ */

.landing-panel,
.outro-panel {
  position: absolute;
  top: 0;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.landing-panel {
  left: 0;
  overflow-y: auto;
}

.landing-card {
  width: 100%;
  max-width: 600px;
  margin: auto 0;
  box-sizing: border-box;
  padding: 48px 56px 44px;
  background: var(--card);
  border: 1.5px solid var(--ink); /* the painted edge */
  border-radius: 4px;
  box-shadow: var(--paper-shadow), 0 30px 60px -40px rgba(29, 43, 58, 0.35);
}

.landing-card .monogram-emboss {
  margin-bottom: 26px;
}

.landing-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5.4vw, 52px);
  line-height: 1.04;
  letter-spacing: 0.005em;
}

.landing-title {
  margin: 12px 0 0;
  font-size: 17px;
  color: var(--muted);
}

/* A short foil rule under the letterhead. */
.landing-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin: 22px 0 22px;
  background: linear-gradient(90deg, var(--foil), var(--foil-light), var(--foil));
}

.landing-intro {
  margin: 0 0 20px;
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
}

#job-intake-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#job-intake-form textarea {
  min-height: 132px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  resize: vertical;
}

#job-intake-form textarea::placeholder {
  color: #8a949e;
}

.intake-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

#intake-submit,
#match-new-role,
#skill-panel-open,
#download-resume,
#lead-form button[type="submit"] {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

#intake-submit,
#download-resume,
#lead-form button[type="submit"] {
  padding: 13px 26px;
  color: #fff;
  background: var(--ink);
  border: 0;
}

#intake-submit:hover:not(:disabled),
#download-resume:hover,
#lead-form button[type="submit"]:hover {
  background: var(--ink-2);
}

#intake-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Loading stages: an index of little tasks, ticked off in turn. */
.loading-stages {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}

.stage {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15.5px;
  color: var(--ink-2);
  transition: opacity 0.3s ease, color 0.3s ease;
}

.stage[data-state="waiting"] {
  opacity: 0.4;
}

.stage-mark {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 1.5px solid var(--rule);
  border-radius: 2px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.stage[data-state="active"] .stage-mark {
  border-color: var(--ink);
}

.stage[data-state="active"] .stage-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 1px;
  background: var(--foil);
  animation: stage-pulse 1.1s ease-in-out infinite;
}

.stage[data-state="active"] .stage-text::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: stage-dots 1.4s steps(4, end) infinite;
}

.stage[data-state="done"] .stage-mark {
  background: var(--ink);
  border-color: var(--ink);
}

.stage[data-state="done"] .stage-mark::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

@keyframes stage-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes stage-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

.landing-hint {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

#match-new-role,
#skill-panel-open {
  padding: 10px 18px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
}

#match-new-role {
  margin-top: 18px;
}

#match-new-role:hover,
#skill-panel-open:hover {
  background: var(--ink);
  color: #fff;
}

/* ============================================================
   OUTRO — the sealed envelope
   ============================================================ */

.outro-panel {
  text-align: center;
}

.outro-inner h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 40px);
}

.outro-status {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.outro-status.is-pending::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: stage-dots 1.4s steps(4, end) infinite;
}

/* ============================================================
   TIMELINE LAYER
   Positions come from js/timeline.js; the CSS variables (--axis-y,
   --lane-bottom, ...) are written onto #track-frame on every layout.
   ============================================================ */

.timeline-layer {
  position: absolute;
  top: 0;
  height: 100%;
  pointer-events: none;
}

/* ---------- Central axis ---------- */

.axis {
  position: absolute;
  left: 0;
  top: var(--axis-y);
  width: 100%;
  height: 0;
  z-index: 1;
  opacity: var(--dim, 1);
  transition: opacity 0.3s ease;
}

.axis-line {
  position: absolute;
  left: 0;
  top: -1px;
  height: 2px;
  background: var(--rule);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 180px);
  mask-image: linear-gradient(to right, transparent, #000 180px);
}

/* Each period is a stroke of its own ink along the line. */
.axis-seg {
  position: absolute;
  top: -3px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
}

.axis-seg.is-secondary {
  top: calc(-11px - (var(--lane, 1) - 1) * 6px);
  height: 3px;
  border-radius: 2px;
  opacity: 0.85;
}

.axis-seg.is-present::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 2.6s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(29, 43, 58, 0.25); }
  70% { box-shadow: 0 0 0 9px rgba(29, 43, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(29, 43, 58, 0); }
}

/* Time in school: a dashed study line just under the axis. */
.edu-line {
  position: absolute;
  top: calc(9px + var(--edu-lane, 0) * 7px);
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--edu) 0 7px, transparent 7px 11px);
  opacity: 0.75;
}

.edu-line.is-continuing {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px);
  mask-image: linear-gradient(to right, transparent, #000 56px);
}

.edu-line.is-open-ended::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -3px;
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1.5px solid var(--edu);
  background: var(--desk);
}

.axis-ticks {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}

.axis-tick {
  position: absolute;
  top: 13px;
  width: 1px;
  height: 4px;
  background: var(--rule);
}

.axis-tick.is-major {
  top: 12px;
  height: 8px;
  background: var(--faint);
}

.axis-label {
  position: absolute;
  top: 31px;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.axis-label.is-start {
  transform: none;
}

.axis-break {
  position: absolute;
  top: -8px;
  width: 7px;
  height: 16px;
  margin-left: -3.5px;
  background: var(--desk);
  border-left: 1.5px solid var(--faint);
  border-right: 1.5px solid var(--faint);
  transform: skewX(-20deg);
}

.axis-now {
  position: absolute;
  top: 0;
}

.axis-now-dot {
  position: absolute;
  left: -6px;
  top: -6px;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--ink);
}

.axis-now-label {
  position: absolute;
  top: 31px;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink);
}

/* ---------- Period cards: edge-painted card stock ---------- */

.journey-item {
  position: absolute;
  top: var(--expand-top);
  height: calc(var(--lane-bottom) - var(--expand-top));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 4;
}

.journey-item.is-stacked-secondary {
  justify-content: flex-start;
  padding-top: calc(var(--lane-top) - var(--expand-top));
}

.journey-item.is-secondary-lane {
  z-index: 3;
}

/* Opened: the card keeps its top edge and may grow down over the axis
   (everything there is receded and locked anyway), lifting slightly only
   when it needs more room — see setExpandedUi in timeline.js. */
.journey-item.is-expanded-host {
  z-index: 30;
  height: calc(var(--track-h) - var(--expand-top) - 14px);
  justify-content: flex-start;
  padding-top: 0;
}

.journey-item.is-expanded-host .journey-card.is-expanded {
  margin-top: var(--open-offset, 0px);
  max-height: calc(var(--track-h) - var(--expand-top) - 14px - var(--open-offset, 0px));
}

.journey-card {
  position: sticky;
  width: var(--card-w);
  box-sizing: border-box;
  max-height: var(--lane-h);
  display: flex;
  flex-direction: column;
  padding: 18px 20px 14px;
  background: var(--card);
  border: 2px solid var(--accent); /* the painted edge, in this period's ink */
  border-radius: 3px;
  box-shadow: var(--paper-shadow);
  pointer-events: auto;
  opacity: calc(var(--scroll-opacity, 1) * var(--dim, 1));
  transition: opacity 0.15s linear, box-shadow 0.3s ease, width 0.3s ease, margin-top 0.3s ease;
}

.journey-card.is-gone {
  pointer-events: none;
}

.journey-card.is-active {
  box-shadow: 0 1px 0 rgba(29, 43, 58, 0.05), 0 22px 40px -22px rgba(29, 43, 58, 0.5);
}

.journey-card.is-sharing {
  max-height: var(--card-max-shared, var(--lane-h));
}

/* Opened: taller AND wider (where the screen allows), so a long list of
   achievements isn't squeezed into a narrow column. */
.journey-card.is-expanded {
  width: var(--card-w-expanded, var(--card-w));
  max-height: calc(var(--lane-bottom) - var(--expand-top));
  touch-action: pan-y;
}

.card-head {
  flex: none;
}

.card-eyebrow {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent, var(--muted));
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.2;
}

.card-org {
  margin: 4px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.card-meta {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.card-dates {
  font-variant-numeric: tabular-nums;
}

.card-location {
  display: block;
  color: var(--faint);
}

/* Scroll shadows: a soft shadow appears at an edge only when there's
   more to read in that direction. */
.card-body,
.point.is-expanded .point-list,
.station-card {
  background:
    linear-gradient(var(--card) 30%, rgba(255, 255, 255, 0)) center top / 100% 28px no-repeat local,
    linear-gradient(rgba(255, 255, 255, 0), var(--card) 70%) center bottom / 100% 28px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(29, 43, 58, 0.22), rgba(29, 43, 58, 0)) center top / 100% 12px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(29, 43, 58, 0.22), rgba(29, 43, 58, 0)) center bottom / 100% 12px no-repeat scroll;
  background-color: var(--card);
}

.card-body {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.card-overview {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.journey-card.is-expanded .card-overview {
  display: block;
  overflow: visible;
}

.card-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
}

.is-expanded .card-list {
  max-height: 2400px;
  margin-top: 12px;
  opacity: 1;
}

.card-list li + li {
  margin-top: 7px;
}

.card-list li::marker {
  color: var(--accent, var(--faint));
}

.card-toggle {
  flex: none;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, var(--ink));
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.card-toggle:hover {
  text-decoration-thickness: 2px;
}

.toggle-chevron {
  transition: transform 0.25s ease;
}

.is-expanded .toggle-chevron {
  transform: rotate(180deg);
}

.journey-item.is-stacked-secondary .journey-card:not(.is-expanded) {
  padding: 12px 14px 10px;
}

.journey-item.is-stacked-secondary .journey-card:not(.is-expanded) .card-body,
.journey-item.is-stacked-secondary .journey-card:not(.is-expanded) .card-location {
  display: none;
}

.journey-item.is-stacked-secondary .journey-card:not(.is-expanded) .card-title {
  font-size: 16.5px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.journey-item.is-stacked-secondary .journey-card:not(.is-expanded) .card-toggle {
  margin-top: 6px;
}

/* ---------- Education: graduation stations and "started" nodes ---------- */

.station,
.edu-start {
  position: absolute;
  top: var(--axis-y);
  width: 0;
  height: 0;
  z-index: 3;
  opacity: var(--dim, 1);
  transition: opacity 0.3s ease;
}

.station.is-expanded,
.edu-start.is-expanded {
  z-index: 30;
}

/* An engraved double frame, like a calling card. */
.station-pill {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  height: 30px;
  padding: 0 12px 0 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink-2);
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 0 3px var(--desk), inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--hair);
  transition: background 0.25s ease, color 0.25s ease;
}

.station.is-raised .station-pill {
  transform: translate(-50%, calc(-50% - 34px));
}

.station.is-passed .station-pill {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 0 0 3px var(--desk), inset 0 0 0 2px var(--ink), inset 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.station.is-passed .station-year {
  color: rgba(255, 255, 255, 0.75);
}

.station-icon {
  flex: none;
}

.station-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-year {
  flex: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.edu-node {
  position: absolute;
  left: -5px;
  top: calc(5.5px + var(--edu-lane, 0) * 7px);
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1.5px solid var(--edu);
  background: var(--desk);
  transition: background 0.25s ease;
}

.edu-start.is-passed .edu-node {
  background: var(--edu);
}

.edu-start.is-continuing .edu-node {
  display: none;
}

.edu-start.is-continuing .edu-start-pill {
  left: 92px;
}

.edu-start-pill {
  position: absolute;
  left: 9px;
  top: calc(8px + var(--edu-lane, 0) * 7px);
  height: 19px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 17px;
  color: var(--edu);
  background: var(--card);
  border: 1px solid var(--edu);
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 0 3px var(--desk);
}

.station-card {
  position: absolute;
  left: 0;
  bottom: 26px;
  transform: translateX(-50%);
  width: min(310px, 86vw);
  max-height: calc(var(--axis-y) - var(--expand-top) - 30px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 16px 18px;
  border: 2px solid var(--edu);
  border-radius: 3px;
  box-shadow: var(--paper-shadow), 0 20px 36px -22px rgba(29, 43, 58, 0.45);
  pointer-events: auto;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  --accent: var(--edu);
}

.station.is-expanded .station-card,
.edu-start.is-expanded .station-card {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
  touch-action: pan-y;
}

.station-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.25;
}

.station-note {
  margin: 8px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.station-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- Points: tags hung from the line by a punched hole ---------- */

.point {
  position: absolute;
  top: var(--axis-y);
  width: 0;
  height: 0;
  z-index: 2;
  opacity: var(--dim, 1);
  transition: opacity 0.3s ease;
}

.point.is-expanded {
  z-index: 30;
}

.point-dot {
  position: absolute;
  left: -5.5px;
  top: -5.5px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--ink-2);
  transition: background 0.3s ease;
}

.point.is-revealed .point-dot {
  background: var(--ink-2);
}

/* The tag's string. */
.point-stem {
  position: absolute;
  left: -0.5px;
  top: 6px;
  width: 1px;
  height: calc(var(--stem) - 6px);
  background: var(--ink-2);
  opacity: 0.45;
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.4s ease;
}

.point.is-revealed .point-stem {
  transform: scaleY(1);
}

.point-card {
  position: absolute;
  top: var(--stem);
  left: var(--card-offset);
  width: var(--point-card-w);
  max-height: var(--point-max, 240px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 14px 13px 10px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(29, 43, 58, 0.04), 0 10px 20px -16px rgba(29, 43, 58, 0.4);
  pointer-events: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px) rotate(-0.6deg);
  transform-origin: var(--hole-x, 50%) 0;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s, box-shadow 0.25s ease,
    left 0.3s ease, top 0.3s ease, width 0.3s ease;
}

/* The punched, reinforced hole where the string meets the tag. */
.point-card::before {
  content: "";
  position: absolute;
  left: var(--hole-x, 50%);
  top: -5px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--desk);
  border: 1.5px solid var(--ink-2);
}

.point.is-revealed .point-card {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0.15s, 0.15s, 0s, 0s, 0s, 0s, 0s;
}

/* Opened: the tag lifts off its string into a large reading card (full
   width on a phone), positioned by setExpandedUi in timeline.js. */
.point.is-expanded .point-card {
  left: var(--open-left, var(--card-offset));
  top: var(--open-top, var(--stem));
  width: var(--open-w, var(--point-card-w));
  max-height: var(--open-maxh, var(--point-max, 240px));
  padding: 20px 22px 14px;
  border: 2px solid var(--ink-2);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(29, 43, 58, 0.05), 0 26px 48px -24px rgba(29, 43, 58, 0.55);
  touch-action: pan-y;
}

.point.is-expanded .point-card::before,
.point.is-expanded .point-stem {
  opacity: 0;
}

.point-stem {
  transition: transform 0.4s ease, opacity 0.2s ease;
}

.point.is-expanded .point-title {
  font-size: 20px;
}

.point.is-expanded .point-role {
  font-size: 14px;
}

.point.is-expanded .point-list {
  font-size: 14px;
  line-height: 1.55;
}

.point-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.point-role {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.point.is-expanded .point-title {
  display: block;
  overflow: visible;
}

.point.is-expanded .point-role {
  white-space: normal;
}

.point-list {
  flex: 1 1 auto;
  min-height: 0;
  font-size: 13px;
}

.point.is-expanded .point-list {
  overflow-y: auto;
}

.point-card .card-toggle {
  margin-top: 6px;
  padding: 2px 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------- Focus mode: one card open, everything else recedes ---------- */

#track.has-expanded-card .journey-card:not(.is-expanded),
#track.has-expanded-card .axis,
#track.has-expanded-card .point:not(.is-expanded),
#track.has-expanded-card .station:not(.is-expanded),
#track.has-expanded-card .edu-start:not(.is-expanded) {
  --dim: 0.14;
}

/* ============================================================
   HUD
   ============================================================ */

#timeline-hud {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#timeline-hud.is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

#playhead-chip,
#playhead-line,
#timeline-progress,
#chapter-nav,
#timeline-brand {
  transition: opacity 0.3s ease;
}

#track-frame.has-expanded-card #playhead-chip,
#track-frame.has-expanded-card #playhead-line,
#timeline-hud.is-past-end #playhead-chip,
#timeline-hud.is-past-end #playhead-line {
  opacity: 0;
}

#track-frame.has-expanded-card #timeline-progress,
#track-frame.has-expanded-card #chapter-nav,
#track-frame.has-expanded-card #timeline-brand {
  opacity: 0.35;
}

#timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--foil), var(--foil-light));
  transform-origin: left center;
  transform: scaleX(0);
}

#timeline-brand {
  position: absolute;
  top: 12px;
  left: 18px;
  max-width: calc(100% - 140px);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 4px 4px;
  margin: -4px;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
}

#timeline-brand:hover {
  background: rgba(255, 255, 255, 0.55);
}

.timeline-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#timeline-brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-brand-sub {
  font-size: 12px;
  color: var(--muted);
}

#playhead-line {
  position: absolute;
  left: var(--playhead-x);
  top: var(--lane-bottom);
  width: 0;
  height: calc(var(--axis-y) - var(--lane-bottom));
  border-left: 1px dashed rgba(29, 43, 58, 0.45);
}

/* An ink date stamp riding on the line. */
#playhead-chip {
  position: absolute;
  left: var(--playhead-x);
  top: var(--axis-y);
  transform: translate(-50%, -50%);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--ink);
  border-radius: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--desk), 0 0 0 3px var(--ink);
}

#track-frame.is-narrow #playhead-chip {
  transform: translate(-4px, -50%);
}

#chapter-nav {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

#chapter-nav button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(29, 43, 58, 0.08);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

#chapter-nav button:hover {
  border-color: var(--ink);
}

#chapter-nav button:active {
  transform: scale(0.94);
}

/* ============================================================
   SKILL DOCK — a ledger strip along the bottom
   ============================================================ */

#skill-dock {
  flex: none;
  height: 96px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

#skill-dock.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.skill-dock-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}

.skill-dock-title {
  font-family: var(--font-display);
  font-size: 18px;
}

/* Five totals in two columns, so they fit the dock's height. */
#skill-tier-counts {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 14px;
}

.tier-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Exactly two rows of the most recent skills; the rest live in "See all". */
#skill-archive {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-self: center;
  gap: 6px 7px;
  max-height: 62px;
  overflow: hidden;
}

.skill-token {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  box-sizing: border-box;
  padding: 0 10px 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.3s ease;
}

.skill-token.is-visible {
  opacity: 1;
  transform: none;
}

.skill-token.is-leaving {
  opacity: 0;
  transform: translateY(4px);
}

.skill-token[data-tier="3"],
.skill-token[data-tier="4"] {
  border-color: var(--rule);
}

.skill-token[data-tier="5"] {
  color: var(--ink);
  font-weight: 600;
  border-color: var(--foil-light);
}

/* Tier pips: one to four filled in ink — all five in gold foil at Expert. */
.skill-pips {
  display: inline-flex;
  gap: 2px;
}

.skill-pips {
  gap: 1.5px;
}

.skill-pips i {
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: var(--hair);
  transition: background 0.3s ease;
}

[data-tier="1"] .skill-pips i:nth-child(1),
[data-tier="2"] .skill-pips i:nth-child(-n + 2),
[data-tier="3"] .skill-pips i:nth-child(-n + 3),
[data-tier="4"] .skill-pips i:nth-child(-n + 4) {
  background: var(--ink-2);
}

[data-tier="5"] .skill-pips i {
  background: var(--foil);
}

@keyframes skill-upgrade {
  0% { box-shadow: 0 0 0 0 rgba(168, 135, 70, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(168, 135, 70, 0); }
}

.skill-token.just-upgraded {
  animation: skill-upgrade 0.7s ease-out;
}

#skill-panel-open {
  padding: 9px 15px;
  font-size: 13.5px;
  white-space: nowrap;
}

/* ---------- "See all" sheet ---------- */

#skill-panel {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px 0;
  background: rgba(29, 43, 58, 0.28);
}

.skill-panel-sheet {
  width: 100%;
  max-width: 880px;
  max-height: 80%;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 26px 32px 32px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -20px 40px -24px rgba(29, 43, 58, 0.5);
  animation: sheet-rise 0.3s ease;
}

@keyframes sheet-rise {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.skill-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.skill-panel-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
}

#skill-panel-close {
  padding: 6px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.skill-panel-intro {
  margin: 8px 0 18px;
  max-width: 64ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.skill-group + .skill-group {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}

.skill-group h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
}

.skill-group-count {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

.skill-group-note {
  margin: 2px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.skill-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-panel-empty {
  margin: 0;
  color: var(--muted);
}

/* ============================================================
   NARROW SCREENS
   ============================================================ */

@media (max-width: 639px) {
  .landing-card {
    padding: 32px 24px 28px;
  }

  .monogram-emboss {
    width: 62px;
    height: 62px;
    font-size: 23px;
  }

  .card-title {
    font-size: 19px;
  }

  .card-overview {
    -webkit-line-clamp: 3;
  }

  #chapter-nav {
    right: 12px;
  }

  #timeline-brand .timeline-brand-sub {
    display: none;
  }

  #skill-dock {
    height: 70px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 12px;
  }

  .skill-dock-summary {
    display: none;
  }

  #skill-archive {
    max-height: 28px;
  }

  .skill-panel-sheet {
    padding: 20px 18px 26px;
  }
}

/* ============================================================
   DETAIL POPUPS
   ============================================================ */

.detail-anchor {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
}

#detail-popup {
  position: fixed;
  max-width: 280px;
  padding: 11px 14px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.45;
  color: #fff;
  background: var(--ink);
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 60;
}

#detail-popup.is-visible {
  opacity: 1;
}

#detail-popup h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
}

#detail-popup p {
  margin: 0;
}

/* ============================================================
   RESUME — a sheet of paper on the desk
   ============================================================ */

#resume-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: var(--desk) var(--grain);
  font-family: var(--font-ui);
  color: var(--ink);
}

#resume-page {
  box-sizing: border-box;
  max-width: calc(8.5in + 32px);
  margin: 0 auto;
  padding: 0 16px 56px;
}

.resume-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  background: linear-gradient(var(--desk) 70%, rgba(228, 234, 236, 0));
}

#resume-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}

#resume-back:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

#download-resume {
  padding: 11px 20px;
  font-size: 14.5px;
}

.resume-sheet {
  box-sizing: border-box;
  padding: 0.5in;
  background: #fff;
  box-shadow: 0 1px 1px rgba(29, 43, 58, 0.08), 0 30px 60px -36px rgba(29, 43, 58, 0.45);
}

/* The resume document itself. Sizes follow the RESUME - BASE template in
   points, so the screen matches print. The same class is applied to the
   page-fit measurer in main.js, so measurements match too. */
.resume-doc {
  font-family: var(--font-doc);
  font-size: 10.5pt;
  line-height: 1.35;
  color: #1c1c1c;
}

.resume-header {
  text-align: center;
  margin-bottom: 14pt;
}

.resume-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20pt;
  letter-spacing: 0.08em;
  text-transform: uppercase; /* "CHRISTIAN SCHLAEFER", per the template */
}

.resume-title {
  margin: 3pt 0 2pt;
  font-size: 14pt;
  font-weight: 700;
}

.resume-contact {
  font-size: 10.5pt;
  color: #444;
}

.resume-section {
  margin-bottom: 12pt;
}

.resume-section p {
  margin: 0;
}

.resume-section h2 {
  margin: 0 0 6pt;
  padding-bottom: 3pt;
  font-family: var(--font-doc);
  font-size: 10.5pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid #bcbcbc;
  break-after: avoid;
  page-break-after: avoid;
}

.resume-entry {
  margin-bottom: 8pt;
  break-inside: avoid;
  page-break-inside: avoid;
}

.resume-entry-title {
  margin: 0;
  font-size: 10.5pt;
  font-weight: 700;
}

.resume-org {
  text-transform: uppercase;
}

.resume-entry-meta {
  margin: 1pt 0 3pt;
  font-size: 10.5pt;
  font-style: italic;
  color: #555;
}

.resume-entry ul {
  margin: 2pt 0 0;
  padding-left: 15pt;
}

.resume-entry li {
  margin-bottom: 2pt;
}

.resume-fluency {
  margin-bottom: 3pt !important;
}

.resume-education {
  margin-bottom: 2pt !important;
}

@page {
  margin: 0.5in;
}

#more-info-bar {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

#more-info-open {
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
}

#more-info-open:hover {
  color: #fff;
  background: var(--ink);
}

/* ---------- Email popup: a note card with an oxblood edge ---------- */

#lead-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(29, 43, 58, 0.35);
}

.lead-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  padding: 34px 34px 30px;
  background: var(--card);
  border: 2px solid var(--seal);
  border-radius: 4px;
  box-shadow: 0 30px 60px -30px rgba(29, 43, 58, 0.6);
  animation: sheet-rise 0.3s ease;
}

#lead-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

#lead-close:hover {
  color: var(--ink);
  background: var(--desk);
}

#lead-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 1.15;
}

.lead-intro {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

#lead-form {
  display: flex;
  flex-direction: column;
}

#lead-form label {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* Fill-in lines, like a printed reply card. */
#lead-form input {
  padding: 8px 0 7px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}

#lead-form input:focus {
  outline: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
}

#lead-form button[type="submit"] {
  align-self: flex-start;
  margin-top: 24px;
}

/* Off-screen rather than display:none — some bots skip fields that are
   display:none, but happily fill ones that are merely out of view. */
.lead-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#lead-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: progress;
}

#lead-error {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--seal);
}

#lead-confirmation {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
}

@media (max-width: 639px) {
  .resume-sheet {
    padding: 22px 18px;
  }

  .resume-toolbar {
    padding: 10px 0;
  }

  .lead-card {
    padding: 28px 22px 24px;
  }
}

/* "Download PDF" uses the browser's print dialog. Only the resume
   document itself prints — no desk, toolbar, popup, or timeline. */
@media print {
  html,
  body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  #stage,
  #timeline-announcer,
  #detail-popup,
  .resume-toolbar,
  #more-info-bar,
  #lead-dialog,
  #debug-panel {
    display: none !important;
  }
  #resume-overlay {
    position: static !important;
    overflow: visible !important;
    background: #fff !important;
  }
  #resume-page {
    max-width: none;
    padding: 0;
  }
  .resume-sheet {
    padding: 0;
    box-shadow: none;
  }
}

/* ============================================================
   DEBUG PANEL (only created with ?debug=true)
   ============================================================ */
#debug-panel {
  position: fixed;
  top: 64px; /* below the chapter navigation buttons */
  right: 8px;
  z-index: 999;
  width: min(260px, calc(100vw - 16px));
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.85);
  color: #0f0;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 10px;
  border-radius: 6px;
}

#debug-panel.is-collapsed {
  width: auto;
  padding: 0;
}

#debug-panel.is-collapsed #debug-body {
  display: none;
}

#debug-toggle {
  display: block;
  width: 100%;
  padding: 0 0 6px;
  font: inherit;
  font-weight: bold;
  text-align: left;
  color: #0f0;
  background: none;
  border: 0;
  cursor: pointer;
}

#debug-panel.is-collapsed #debug-toggle {
  padding: 6px 10px;
}

#debug-summary {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#debug-summary div {
  margin-bottom: 2px;
  word-break: break-word;
}

#debug-log div {
  margin-bottom: 2px;
  opacity: 0.85;
}
