/* Design tokens — chrome: surfaces, controls, focus */
:root {
  /* Ink + stone neutrals (warm, less “flat gray”) */
  --text: #141210;
  --text-muted: #5c5855;
  --border: #e6e3df;
  --border-strong: #c9c4be;
  --surface: #ffffff;
  --surface-elevated: #faf9f7;
  --surface-control: #f3f1ee;
  /* Accent: deep blue — distinct from neutrals, not green */
  --accent: #1e4a8c;
  --accent-hover: #163a70;
  --accent-muted: rgba(30, 74, 140, 0.14);
  /* Default corners: modest; use --radius-lg for controls; pill reserved for rare full pills */
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 16, 0.05);
  --shadow-md: 0 4px 16px rgba(20, 18, 16, 0.07);
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  /* Page vs. paper (backdrop + card) */
  --page-backdrop: #e3e0dc;
  --page-backdrop-mid: #ebe8e4;
  --page-backdrop-highlight: #f3f1ed;
  --paper-shadow: 0 10px 36px rgba(20, 18, 16, 0.08), 0 2px 8px rgba(20, 18, 16, 0.04);
  --paper-border: rgba(90, 83, 78, 0.14);
}
/* Document does not scroll — only `.site-content` does (site shell below). */
html {
  height: 100%;
  overflow: hidden;
}

/* Page chrome — body carries atmosphere; résumé lives on white “paper” (tokens: page-backdrop, paper). */
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text);
  background-color: var(--page-backdrop);
  background-image: linear-gradient(
    165deg,
    var(--page-backdrop-highlight) 0%,
    var(--page-backdrop-mid) 42%,
    var(--page-backdrop) 100%
  );
  padding: max(0.75rem, env(safe-area-inset-top))
    max(0.85rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(0.85rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

/* Site shell: nav + scrollable main column (no document scroll) */
.site {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0 auto;
  align-items: stretch;
  gap: 0.5rem 0;
  position: relative;
  overflow: hidden;
}

.site-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
  /* Thinner, quieter rail than the default OS scrollbar on the main column. */
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 113, 108, 0.45) transparent;
}

.site-content::-webkit-scrollbar {
  width: 6px;
}

.site-content::-webkit-scrollbar-track {
  background: transparent;
}

.site-content::-webkit-scrollbar-thumb {
  background: rgba(120, 113, 108, 0.4);
  border-radius: 999px;
}

.site-content::-webkit-scrollbar-thumb:hover {
  background: rgba(87, 83, 78, 0.5);
}

/* Desktop: outer | résumé (max 48rem) | outer — only `.site-content` scrolls.
   Breakpoint = siteNavMaxWidthPx + 1 (see ``ui_config.css_token_replacements``). */
@media (min-width: 1150px) {
  .site {
    grid-template-columns: minmax(10.5rem, 1fr) minmax(0, 48rem) minmax(10.5rem, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0 1rem;
    align-items: stretch;
  }

  .site-nav {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    width: 10.5rem;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    box-sizing: border-box;
  }

  .site-content {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
  }
}

.site-nav {
  position: relative;
  z-index: 25;
}

.site-nav-toggle {
  display: none;
}

/* Site nav breakpoint: ``siteNavMaxWidthPx`` in ``ui_config.py`` (substituted at bundle). */
@media (max-width: 1149px) {
  .site-nav {
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.45rem;
  }

  .site-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0.45rem 0.65rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--accent);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    width: 100%;
  }

  .site-nav-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
  }

  /* Start collapsed on mobile; JS controls `hidden` + `.site-nav--open`. */
  .site-nav-list[hidden] {
    display: none;
  }

  .site-nav.site-nav--open {
    align-items: stretch;
  }

  .site-nav.site-nav--open .site-nav-list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.2rem;
  }

  .site-nav-list {
    width: 100%;
  }

  .site-nav-link {
    padding: 0.45rem 0.6rem;
  }
}

.site-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-nav-link {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.site-nav-link:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.site-nav-link--current {
  color: var(--accent);
  background: var(--surface-control);
  border-color: var(--border);
}

.site-nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.site-placeholder-section {
  margin-top: 1rem;
}

.site-placeholder-section h2 {
  font-size: 1rem;
}

.site-placeholder-section p {
  margin: 0.35rem 0 0;
  line-height: 1.45;
}
/* Primary resume column: white card; max-width unchanged in spirit */
main.resume {
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 0.65rem) clamp(0.85rem, 3vw, 1.35rem) clamp(0.75rem, 2.5vw, 1rem);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--paper-border);
  box-shadow: var(--paper-shadow);
  overflow-wrap: anywhere;
}

/* Desktop resume column — same breakpoint as ``01_base_layout`` (siteNavMaxWidthPx + 1). */
@media (min-width: 1150px) {
  .site-content main.resume {
    max-width: none;
    margin: 0;
  }
}

/* Name + contact only; section `<header>` rows stay left-aligned */
.resume-masthead {
  text-align: center;
  margin-bottom: 0.3rem;
}

.resume-masthead p {
  margin: 0.12rem 0 0;
  line-height: 1.3;
}

.resume-summary-block {
  margin-top: 0.35rem;
  text-align: left;
}

.resume-summary-heading {
  margin-top: 0.35rem;
}

.resume-summary {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
}

h1 {
  font-size: 1.45rem;
  margin: 0 0 0.12rem;
}

h2 {
  font-size: 1rem;
  margin: 0 0 0.28rem;
  padding-bottom: 0.12rem;
  border-bottom: 1px solid var(--border);
}

/* Section title row: optional “More” control (web-only) */
.resume-section-head {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.22rem;
  padding-bottom: 0.12rem;
  border-bottom: 1px solid var(--border);
}

.resume-section-head h2 {
  font-size: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  flex: 1;
  min-width: 0;
}

/* Secondary: section “More” / “Back” */
.resume-section-expand {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  margin: 0;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--surface-control);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.resume-section-expand:hover {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
  color: var(--accent-hover);
}

h3 {
  font-size: 0.88rem;
  margin: 0;
}

/* Vertical spacing between Skills / Experience / Education blocks */
section.resume-section {
  margin-bottom: 0.3rem;
}

/* Wraps default résumé block + web carousel for height animation between states */
.resume-section-body {
  min-width: 0;
}

/* Carousel height transitions: tokens from ``ui_config.py`` (bundle time). */
html.resume-carousel-motion-ok .resume-section-body.resume-section-body--animating {
  transition: height 0.35s ease;
}

html.resume-carousel-motion-ok
  .resume-section-body.resume-section-body--animating.resume-section-body--shrinking {
  transition: height 0.5s ease;
}

/* Flex row: title block on the left, optional date on the right */
.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.06rem;
}

/* Progression variant: title + role timeline stack; aligns flex children to the top */
.entry-head--progression {
  margin-bottom: 0.1rem;
  align-items: flex-start;
}

/* Progression variant: stacks job title line and progression line vertically */
.entry-head--progression .entry-title {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  align-items: flex-start;
}

/* Left column in entry-head (title, or credential text) */
.entry-title {
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* Right column in entry-head (date range); does not shrink */
.entry-date {
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
}

/* One line in a role progression (roles and dates) */
p.progression-line {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

/* Keeps progression + dates on one line */
p.progression-line--dated {
  white-space: nowrap;
}

p.progression-line--dated .prog-dates {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.92em;
}

p.progression-line--dated .prog-arrow {
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 0.06rem;
}

/* Mobile: progression rows can’t reliably stay on one line */
@media (max-width: 36rem) {
  .entry-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .entry-date {
    text-align: left;
  }

  p.progression-line--dated {
    white-space: normal;
    line-height: 1.25;
  }

  p.progression-line {
    font-size: 0.82rem;
  }

  p.progression-line--dated .prog-arrow {
    margin: 0 0.15rem;
  }
}

ul {
  margin: 0.12rem 0 0;
  padding-left: 1.05rem;
}

article {
  margin-bottom: 0.48rem;
}

article:last-child {
  margin-bottom: 0;
}

/* One skills subgroup (label + comma list) */
.skills-group {
  margin-bottom: 0.26rem;
}

.skills-group:last-child {
  margin-bottom: 0;
}

.skills-group h3 {
  margin-bottom: 0.04rem;
}

.skills-group p {
  margin: 0;
}

/* Education: tighten entry-head spacing under the school article */
.school-block .entry-head {
  margin-bottom: 0.06rem;
}

/* One degree line (credential | date) */
.degree-row {
  margin-bottom: 0.1rem;
}

.degree-tag {
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.degree-row:last-child {
  margin-bottom: 0;
}
/* Section web carousels (Skills / Experience / Education “More” panels).
   - Height transition durations: ``__UI_CAROUSEL_*__`` in ``02_resume.css`` (from ``ui_config.py``).
   - Mobile modal + education table tweaks: ``767`` (must match JS ``resumeModalMaxWidthPx``).
   - Breakpoints in ``rem`` (e.g. 28rem, 40rem) are layout-only; they are not mirrored in ``SITE_UI_CONFIG``. */

.resume-section-web[hidden] {
  display: none;
}

.resume-section-default[hidden] {
  display: none !important;
}

.resume-section--web-active {
  scroll-margin-top: 0.5rem;
}

.resume-carousel {
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem 0.5rem;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}

/* Constant stage height (no jump between slides); long slides scroll inside (~2/3 of prior 11/70/28) */
/* Stage height: modest bump over 2/3 (~12.5%) so tables/lists scroll a bit less. */
.resume-carousel-viewport {
  height: clamp(
    calc(11rem * 3 / 4),
    calc(70vh * 3 / 4),
    calc(28rem * 3 / 4)
  );
  overflow: auto;
  overflow-x: hidden;
}

/* Mobile: give carousels more breathing room, reduce “squished” feel */
@media (max-width: 40rem) {
  .resume-carousel {
    font-size: 0.9rem;
    padding: 0.6rem 0.65rem 0.55rem;
  }

  .resume-carousel-viewport {
    height: min(78vh, 34rem);
  }

  .resume-carousel-slide-title {
    font-size: 0.96rem;
  }

  .resume-carousel-slide-dates {
    font-size: 0.82rem;
  }

  .resume-carousel-prose,
  .resume-carousel-slide-intro {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .resume-carousel-figure {
    width: 9.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .resume-carousel-viewport {
    scroll-behavior: auto;
  }
}

html.resume-carousel-motion-ok .resume-carousel-viewport {
  scroll-behavior: smooth;
}

/* Track is at least one viewport-tall. Figure carousels: column flex so the open slide
   (flex:1) actually fills the stage; % min-height on the slide is unreliable on a block track. */
.resume-carousel-track {
  min-height: 100%;
}
.resume-carousel-viewport:has(.resume-carousel-slide--figure) .resume-carousel-track {
  display: flex;
  flex-direction: column;
}

/* List carousels (Skills, Education): fill the stage and vertically center copy when it’s shorter than the viewport. */
.resume-carousel-viewport:has(.resume-carousel-slide--list) .resume-carousel-track {
  display: flex;
  flex-direction: column;
}

/* Must not set display on [hidden] slides: two classes beat [hidden] and undo display:none. */
.resume-carousel-slide--figure:not([hidden]) {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-width: 0;
}

.resume-carousel-slide--list:not([hidden]) {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-width: 0;
  min-height: 100%;
}

/* Same idea as `.resume-carousel-figure-pair`: title stays top; body fills the stage and centers vertically. */
.resume-carousel-slide-list-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.resume-carousel-slide-title {
  margin: 0 0 0.12rem;
  font-size: 0.95rem;
}

.resume-carousel-slide-dates {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.resume-carousel-slide-intro {
  margin: 0 0 0.45rem;
  line-height: 1.4;
}

.resume-carousel-deflist {
  margin: 0;
}

.resume-carousel-deflist dt {
  font-weight: 600;
  margin-top: 0.35rem;
}

.resume-carousel-deflist dt:first-child {
  margin-top: 0;
}

.resume-carousel-deflist dd {
  margin: 0.06rem 0 0;
  padding-left: 1rem;
}

.resume-carousel-table-wrap {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.resume-carousel-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.88em;
  line-height: 1.35;
}

.resume-carousel-table th,
.resume-carousel-table td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.5rem;
  vertical-align: top;
  text-align: left;
}

.resume-carousel-table thead th {
  font-weight: 600;
  color: var(--text);
  background: var(--surface-control);
}

.resume-carousel-table tbody th[scope="row"] {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Figure carousels: logo / visual left, copy right; stack on narrow viewports */
.resume-carousel-figure-pair {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.resume-carousel-figure {
  margin: 0;
  flex: 0 0 auto;
  width: var(--figure-width, 11rem);
  min-width: 0;
  padding: 0.4rem;
  box-sizing: border-box;
}

.resume-carousel-figure--list {
  width: var(--figure-width, 7.5rem);
}

.resume-carousel-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  transform: scale(var(--logo-scale, 1));
  transform-origin: center;
}

.resume-carousel-figure-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.resume-carousel-prose {
  margin: 0.4rem 0 0;
  line-height: 1.45;
}

.resume-carousel-figure-text .resume-carousel-prose:first-of-type {
  margin-top: 0;
}

.resume-carousel-skills {
  margin: 0.55rem 0 0;
  padding-bottom: 0.35rem;
  font-size: 0.9em;
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.resume-carousel-skills-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 0.1rem;
}
.resume-carousel-skills-terms {
  margin: 0;
}

@media (max-width: 28rem) {
  .resume-carousel-figure-pair {
    /* Keep image on the left, even on narrow screens */
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.6rem;
  }

  .resume-carousel-figure {
    width: 6.75rem;
    max-width: none;
    align-self: flex-start;
    padding: 0.25rem;
  }
}

/* Mobile: keep tables as tables; allow horizontal pan inside the carousel. */
@media (max-width: 40rem) {
  .resume-carousel-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .resume-carousel-table {
    table-layout: auto;
    font-size: 0.84em;
  }

  .resume-carousel-table th,
  .resume-carousel-table td {
    padding: 0.28rem 0.42rem;
  }
}

/* Résumé modal breakpoint: ``resumeModalMaxWidthPx`` in ``ui_config.py`` (substituted at bundle). */
/* Mobile modal: Education tables should favor the Courses column. */
@media (max-width: 767px) {
  html.resume-web-modal-open [data-section="education"] .resume-carousel-table {
    table-layout: fixed;
    width: 100%;
  }

  html.resume-web-modal-open [data-section="education"] .resume-carousel-table thead th:first-child,
  html.resume-web-modal-open [data-section="education"] .resume-carousel-table tbody th[scope="row"] {
    width: 8.75rem;
    max-width: 8.75rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 767px) {
  /* Hide the site nav while a carousel is open so the menu button doesn't peek
     above the centered modal card on tall phones. */
  html.resume-web-modal-open .site-nav {
    display: none;
  }

  html.resume-web-modal-open .resume-section--web-active .resume-section-web:not([hidden]) {
    position: fixed;
    z-index: 60;
    inset: max(0.5rem, env(safe-area-inset-top, 0px))
      max(0.5rem, env(safe-area-inset-right, 0px))
      max(0.5rem, env(safe-area-inset-bottom, 0px))
      max(0.5rem, env(safe-area-inset-left, 0px));
    max-height: 600px;
    margin: auto 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    background: color-mix(in srgb, var(--page-backdrop) 55%, transparent);
    backdrop-filter: blur(10px);
    border: 1px solid var(--paper-border);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
    padding: 0.25rem;
  }

  html.resume-web-modal-open .resume-section--web-active .resume-carousel {
    margin-top: 0;
    border: none;
    box-shadow: none;
    background: var(--surface);
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  html.resume-web-modal-open .resume-carousel-viewport {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile modal: keep figure left, vertically centered. */
  html.resume-web-modal-open .resume-carousel-figure-pair {
    align-items: center;
  }

  html.resume-web-modal-open .resume-carousel-figure {
    align-self: center;
  }
}

.resume-carousel-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}

/* Secondary: circular prev/next (~40px touch target) */
.resume-carousel-prev,
.resume-carousel-next {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  font: inherit;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.resume-carousel-prev:hover,
.resume-carousel-next:hover {
  background: var(--accent-muted);
  border-color: var(--border-strong);
  color: var(--accent-hover);
}

.resume-carousel-nav-icon {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
  margin-top: -0.06em;
  pointer-events: none;
}

.resume-carousel-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 0.25rem;
}

/* Dash / pip indicators (not numeric tabs) */
.resume-carousel-dot {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 0;
  line-height: 0;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.15s ease;
}

.resume-carousel-dot::after {
  content: "";
  display: block;
  width: 1.4rem;
  height: 0.22rem;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  opacity: 0.55;
  transition:
    width 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.resume-carousel-dot:hover::after {
  opacity: 0.85;
}

.resume-carousel-dot--current::after {
  width: 1.85rem;
  background: var(--accent);
  opacity: 1;
}

.resume-carousel-dot:focus-visible,
.resume-carousel-prev:focus-visible,
.resume-carousel-next:focus-visible,
.resume-carousel-close:focus-visible,
.resume-section-expand:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.resume-carousel-dot:focus-visible {
  background: var(--accent-muted);
}

/* Tertiary: link-like “Back to resume” */
.resume-carousel-close {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.45rem 0.35rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

.resume-carousel-close:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* Placeholder when UNDER_CONSTRUCTION in frontends/jinja/cli.py is True */
.site-under-construction {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.site-under-construction-img {
  max-width: min(100%, 36rem);
  height: auto;
  vertical-align: middle;
}
/* Writings: Markdown-derived prose in the browser.
   Print rules (``@media print`` below) also affect the résumé home page when printing:
   - Flatten `.site` to a normal block; drop nav chrome.
   - Hide `.site-nav` (global menu).
   - Strip “paper” shadow/border from `main.resume` for a clean sheet.
   - Hide web-only carousels: `.resume-web-only`, `.resume-section-web` (print shows default résumé lists only). */

/* Writings — prose block (Markdown → HTML fragment) */
.writing-back {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.writing-back a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.writing-back a:hover {
  text-decoration: underline;
}

.writings-list-items {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.writings-list-items li {
  margin: 0.45rem 0;
}

.writings-list-path {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.writings-list-path code {
  font-size: 0.88em;
}

.writing-body {
  margin-top: 1rem;
  max-width: 42rem;
}

.writing-body > *:first-child {
  margin-top: 0;
}

.writing-body h2 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 650;
  color: var(--text);
}

.writing-body h3 {
  font-size: 1.02rem;
  margin: 1rem 0 0.4rem;
  font-weight: 600;
}

.writing-body p,
.writing-body ul,
.writing-body ol {
  margin: 0.5rem 0;
}

.writing-body ul,
.writing-body ol {
  padding-left: 1.35rem;
}

.writing-body li {
  margin: 0.25rem 0;
}

.writing-body a {
  color: var(--accent);
}

.writing-body pre {
  margin: 0.65rem 0;
  padding: 0.65rem 0.75rem;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.4;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.writing-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}

.writing-body :not(pre) > code {
  padding: 0.12em 0.35em;
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
}

.writing-body table {
  border-collapse: collapse;
  margin: 0.65rem 0;
  font-size: 0.92rem;
}

.writing-body th,
.writing-body td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.55rem;
  text-align: left;
}

.writing-body th {
  background: var(--surface-elevated);
  font-weight: 600;
}

@media print {
  html {
    height: auto;
    overflow: visible;
  }

  body {
    min-height: 0;
    height: auto;
    overflow: visible;
    background: #fff !important;
    background-image: none !important;
    padding: 0;
  }

  .site {
    display: block;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .site-nav {
    display: none !important;
  }

  .site-content {
    overflow: visible !important;
    padding-left: 0 !important;
  }

  main.resume {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0.35rem 0.8rem 0.7rem;
    max-width: none;
  }

  .resume-web-only,
  .resume-section-web {
    display: none !important;
  }
}
