/* ============================================================
   OneTrust Portfolio — Design System
   Brand: white-forward base, OneTrust navy/teal accents
   Typography: corporate clean (Inter)
   Motion: light transitions only, prefers-reduced-motion respected
   ============================================================ */

/* --- Custom Properties --- */
:root {
  /* Brand palette */
  --color-bg: #ffffff;
  --color-surface: #f7f8fa;
  --color-border: #e2e5ea;
  --color-navy: #1a2b4a;
  --color-teal: #00a6a0;
  --color-teal-dark: #008a85;
  --color-accent-block: #f0f8f7;
  --color-text-primary: #1a2b4a;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;
  --color-link: #008a85;
  --color-focus-ring: #00a6a0;
  --color-white: #ffffff; /* on-dark surfaces: text and stroke on navy/teal backgrounds */
  --color-white-ghost: rgba(255,255,255,0.1); /* subtle hover bg on dark overlay surfaces */
  --color-white-dim: rgba(255,255,255,0.65);  /* header subtitle text on navy */
  --color-white-faint: rgba(255,255,255,0.4); /* focus ring on dark header backgrounds */
  --color-overlay-bg: rgba(26, 43, 74, 0.85); /* lightbox overlay (navy at 85%) */
  --shadow-lightbox: 0 24px 60px rgba(0,0,0,0.35); /* lightbox card shadow */

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-stat: 1.8rem;
  --font-size-dismiss: 1.125rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-base: 1.6;
  --line-height-snug: 1.5;
  --line-height-ui: 1.35;
  --line-height-tight: 1.25;
  --letter-spacing-label: 0.06em;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --header-height: 56px;
  --nav-height: 48px;
  --sidebar-width: 220px;
  --content-max-width-standard: 1120px;
  --content-max-width-presentation: 1240px;
  --layout-col-fixed-30: 270px;
  --layout-col-fixed-30-wide: 315px;
  --shell-top: calc(var(--header-height) + var(--nav-height));
  --present-toolbar-height: 44px;
  --present-nav-color: #4f5b6b;
  --present-nav-hover-color: var(--color-text-primary);
  --present-nav-hover-bg: var(--color-bg);
  --present-nav-icon-size: 0.875rem;
  --present-nav-control-height: var(--present-toolbar-height);
  --present-nav-control-max: 100%;
  --present-nav-font-size: var(--font-size-sm);
  --present-toolbar-close-col: var(--present-toolbar-height);

  /* Motion */
  --transition-duration: 320ms;
  --transition-easing: ease-in-out;
  --transition-fade: opacity var(--transition-duration) var(--transition-easing);
  --transition-short: 150ms ease;

  /* Shape */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-round: 50%;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- Base --- */
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1 { font-size: var(--font-size-3xl); font-weight: var(--font-weight-bold); line-height: var(--line-height-tight); }
h2 { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); line-height: var(--line-height-tight); }
h3 { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); line-height: var(--line-height-tight); }
h4 { font-size: var(--font-size-lg); font-weight: var(--font-weight-medium); }
p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: var(--font-weight-semibold); }

/* Shared label pattern for section eyebrows and table/meta labels */
.hero-eyebrow,
.section-label,
.pao-label,
.fit-table th,
#local-nav .local-nav-label {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-label);
}

/* --- Focus styles (WCAG 2.4.7) --- */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Shell Layout --- */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--color-navy);
  color: var(--color-white);
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  z-index: 100;
}

#app-header .header-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
  color: var(--color-white);
}

#app-header .header-favicon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  margin-right: var(--space-3);
  flex-shrink: 0;
}

#app-header .header-role {
  margin-left: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-white-dim);
  font-weight: var(--font-weight-normal);
}

/* Header home links — no underline, no color change, inherit layout */
#app-header .header-home-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 0;
}
#app-header .header-home-link:hover,
#app-header .header-home-link:focus {
  text-decoration: none;
  outline: 2px solid var(--color-white-faint);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Global Tab Nav --- */
#app-nav {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0;
  height: var(--nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: stretch;
  padding: 0 var(--space-8);
  gap: 0;
  z-index: 99;
}

#app-nav .nav-tab {
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
  transition: color var(--transition-duration) var(--transition-easing),
              border-color var(--transition-duration) var(--transition-easing);
  text-decoration: none;
}

#app-nav .nav-tab:hover {
  color: var(--color-text-primary);
}

#app-nav .nav-tab[aria-selected="true"],
#app-nav .nav-tab.active {
  color: var(--color-teal-dark);
  border-bottom-color: var(--color-teal);
  font-weight: var(--font-weight-semibold);
}

#app-nav .nav-separator {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-border);
  user-select: none;
  font-weight: var(--font-weight-normal);
}

/* --- Page Shell --- */
#page-shell {
  display: flex;
  margin-top: var(--shell-top);
  /* Fixed height — makes #content-mount the scroll container, not the window.
     This is what allows mount.scrollTop = 0 to reliably reset scroll on nav. */
  height: calc(100vh - var(--shell-top));
}

/* --- Sidebar Local Nav --- */
#local-nav {
  width: var(--sidebar-width);
  flex-shrink: 0;
  /* padding-top matches #content-mount padding-top so the sidebar label
     aligns with the page eyebrow on every page. */
  padding: var(--space-12) var(--space-6) var(--space-8);
  /* No sticky needed — #page-shell is fixed-height so this column
     naturally stays put as #content-mount scrolls beside it. */
  overflow-y: auto;
}
/* Sidebar always holds its 220px column — gives every page identical
   left-edge content alignment, whether or not a TOC is present.
   (The :empty collapse that was here caused pages without a TOC to
   start content at the left edge, inconsistent with pages that have one.) */

#local-nav .local-nav-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

#local-nav ul {
  list-style: none;
}

#local-nav li + li {
  margin-top: var(--space-1);
}

#local-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: background var(--transition-duration) var(--transition-easing),
              color var(--transition-duration) var(--transition-easing);
}

#local-nav a:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
  text-decoration: none;
}

#local-nav a.active {
  background: var(--color-accent-block);
  color: var(--color-teal-dark);
  font-weight: var(--font-weight-medium);
}

#local-nav .local-nav-groups {
  list-style: none;
  margin: 0;
  padding: 0;
}

#local-nav .local-nav-group + .local-nav-group {
  margin-top: var(--space-1);
}

#local-nav .local-nav-group.bonus-topic {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* Keep bonus section spacing/divider, but avoid a special active pill look. */
#local-nav .local-nav-group.bonus-topic .local-nav-group-toggle.active {
  background: none;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-normal);
}

#local-nav .local-nav-group-toggle {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  color: var(--color-text-secondary);
  text-align: left;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-ui);
  cursor: pointer;
  text-decoration: none;
}

#local-nav .local-nav-group.has-children .local-nav-group-toggle {
  position: relative;
  padding-right: calc(var(--space-3) + 12px);
}

#local-nav .local-nav-group.has-children .local-nav-group-toggle::after {
  content: '';
  position: absolute;
  right: var(--space-3);
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-60%) rotate(-45deg);
  opacity: 0.55;
  transition: transform var(--transition-short), opacity var(--transition-short);
}

#local-nav .local-nav-group.has-children.active .local-nav-group-toggle::after {
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.85;
}

#local-nav .local-nav-group-toggle:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

#local-nav .local-nav-group-toggle.active {
  background: var(--color-accent-block);
  color: var(--color-teal-dark);
  font-weight: var(--font-weight-medium);
}

#local-nav .local-subnav {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-4);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 800ms cubic-bezier(0.4, 0, 0.2, 1), opacity 800ms ease;
}

#local-nav .local-nav-group.active .local-subnav {
  max-height: 320px;
  opacity: 1;
}

#local-nav .local-subnav-link {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  text-align: left;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}

#local-nav .local-subnav-link:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

#local-nav .local-subnav-link.active {
  color: var(--color-teal-dark);
  font-weight: var(--font-weight-medium);
}

.artifact-caption {
  margin-top: var(--space-2);
  margin-bottom: var(--space-8);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  text-align: center;
}

/* Bolded lists (items leading with <strong>) get a small left indent
   to set the labeled-pair pattern apart from regular prose. */
#content-mount ul:has(> li > strong:first-child),
#content-mount ol:has(> li > strong:first-child) {
  margin-left: var(--space-4);
}

/* --- Content Area --- */
#content-mount {
  flex: 1;
  min-width: 0;
  /* Explicit scroll container — scroll resets via mount.scrollTop = 0 in app.js */
  overflow-y: auto;
  scrollbar-gutter: stable; /* reserve space for scrollbar, prevent layout shift */
  padding: var(--space-12) var(--space-12) var(--space-16);
  outline: none; /* suppress :focus-visible ring — not an interactive element */
}

/* --- Page Transition --- */
#content-mount {
  transition: var(--transition-fade);
}

#content-mount.fading-out {
  opacity: 0;
}

#content-mount.fading-in {
  opacity: 1;
}

/* --- Hero Split (Overview) --- */
.hero-split {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-12);
  align-items: start;
  padding: var(--space-8) 0;
}

.hero-photo img {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
  object-position: top center;
  display: block;
}

@media (max-width: 768px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-photo img { width: 120px; height: 120px; }
}

/* --- Role Fit Table --- */
.fit-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
}

.fit-table th {
  background: var(--color-surface);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}

.fit-table th:first-child { width: 44%; }
.fit-table th:last-child  { width: 56%; }

.fit-table td {
  padding: var(--space-4);
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
}

.fit-table tr:last-child td { border-bottom: none; }

.fit-table td:first-child {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.fit-table td:last-child {
  color: var(--color-text-primary);
}

.fit-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.fit-check-icon {
  width: 18px;
  height: 18px;
  background: var(--color-teal);
  border-radius: var(--radius-round);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.fit-check-icon svg {
  width: 10px;
  height: 10px;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Hero (Home) --- */
.hero {
  padding: var(--space-12) 0 var(--space-8);
}

.hero-eyebrow {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-teal-dark);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-6);
  max-width: 640px;
}

.hero-body {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-bottom: var(--space-8);
}

/* --- Accent Block --- */
.accent-block {
  background: var(--color-accent-block);
  border-left: 4px solid var(--color-teal);
  padding: var(--space-6) var(--space-8);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-8) 0;
}

/* --- Section --- */
.section {
  max-width: var(--content-max-width-standard);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-12);
}

/* First section in any fragment gets zero top margin — ensures identical
   top spacing on every tab. The top buffer is provided by #content-mount
   padding only, so nothing can accidentally add extra air above the heading. */
#content-mount > .section:first-child,
#content-mount > *:first-child {
  margin-top: 0;
}

.section-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-teal-dark);
  margin-bottom: var(--space-3);
}

.section-title {
  margin-bottom: var(--space-4);
}

/* --- Fit Points --- */
.fit-point {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-6);
}

.fit-point-icon {
  width: 28px;
  height: 28px;
  background: var(--color-teal);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.fit-point-icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-white);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fit-point-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.fit-point-body {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  margin-bottom: 0;
}

/* --- PAO (Problem-Action-Outcome) --- */
.pao-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-8);
}

.pao-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  border-bottom: 1px solid var(--color-border);
}

.pao-row:last-child { border-bottom: none; }

.pao-label {
  background: var(--color-surface);
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  display: flex;
  align-items: flex-start;
  border-right: 1px solid var(--color-border);
}

.pao-content {
  padding: var(--space-4) var(--space-6);
  color: var(--color-text-primary);
}

.pao-content p { margin-bottom: 0; }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-8);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8) + 6px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-round);
  background: var(--color-teal);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-teal);
}

.timeline-period {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-teal-dark);
  margin-bottom: var(--space-1);
}

.timeline-role {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.timeline-org {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.timeline-bullets {
  list-style: none;
  padding: 0;
}

.timeline-bullets li {
  position: relative;
  padding-left: var(--space-4);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.timeline-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-teal);
}

/* --- Diagram --- */
.diagram-container {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-8) 0;
  cursor: zoom-in;
}
.diagram-container:hover { border-color: var(--color-teal); }
.diagram-container:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Frameless variant — image only, no chrome (used in process & contributions section) */
.diagram-container.frameless {
  border: none;
  border-radius: 0;
  overflow: visible;
}
.diagram-container.frameless:hover { border-color: transparent; }
.diagram-container.frameless > .diagram-title { display: none; }
.diagram-container.frameless > .diagram-body { padding: 0; }

.diagram-title {
  background: var(--color-surface);
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  text-align: center;
}

.diagram-body {
  padding: var(--space-8);
}

/* SVG org chart nodes */
.org-node rect {
  fill: var(--color-bg);
  stroke: var(--color-border);
  stroke-width: 1.5;
  rx: 6;
}

.org-node.highlight rect {
  fill: var(--color-accent-block);
  stroke: var(--color-teal);
  stroke-width: 2;
}

.org-node text {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  fill: var(--color-text-primary);
}

.org-node.highlight text {
  fill: var(--color-teal-dark);
  font-weight: 600;
}

.org-edge {
  stroke: var(--color-border);
  stroke-width: 1.5;
  fill: none;
}

/* --- Quick-links (Home) --- */
.quick-links {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-teal);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: background var(--transition-short);
}

.quick-link:hover {
  background: var(--color-teal-dark);
  text-decoration: none;
  color: var(--color-white);
}

.quick-link.secondary {
  background: transparent;
  color: var(--color-teal);
  border: 1.5px solid var(--color-teal);
}

.quick-link.secondary:hover {
  background: var(--color-accent-block);
}

/* --- Artifact tag --- */
.artifact-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

/* --- Layout Utilities --- */
.page-cols {
  display: grid;
  gap: var(--space-8);
  align-items: start;
}
.page-cols.cols-70-30 { grid-template-columns: minmax(0, 1fr) var(--layout-col-fixed-30); }
.page-cols.cols-30-70 { grid-template-columns: var(--layout-col-fixed-30) minmax(0, 1fr); }
.page-cols.cols-70-30,
.page-cols.cols-30-70 { align-items: stretch; }
.page-cols.cols-equal  { grid-template-columns: 1fr 1fr; }
.page-cols.cols-3      { grid-template-columns: 1fr 1fr 1fr; }

@media (min-width: 1400px) {
  .page-cols.cols-70-30 { grid-template-columns: minmax(0, 1fr) var(--layout-col-fixed-30-wide); }
  .page-cols.cols-30-70 { grid-template-columns: var(--layout-col-fixed-30-wide) minmax(0, 1fr); }
}

/* --- In-paragraph emphasis --- */
.emph {
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
}

/* --- Callout card (sidebar stat, quote) --- */
.callout-card {
  background: var(--color-accent-block);
  border-left: 4px solid var(--color-teal);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-6) var(--space-8);
}
.callout-card .callout-stat {
  font-size: var(--font-size-stat);
  font-weight: var(--font-weight-bold);
  color: var(--color-teal);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.callout-card .callout-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* --- Metric row (3-col grid of stats) --- */
.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-6);
  margin: var(--space-6) 0;
}
.metric-cell {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.metric-cell .metric-num {
  font-size: var(--font-size-stat);
  font-weight: var(--font-weight-bold);
  color: var(--color-teal);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.metric-cell .metric-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

/* --- Divider --- */
hr.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-12) 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --space-12: 2rem;
  }

  #app-header { padding: 0 var(--space-4); }
  #app-nav { padding: 0 var(--space-2); overflow-x: auto; }
  #app-nav .nav-tab { padding: 0 var(--space-3); font-size: var(--font-size-sm); }

  #local-nav { display: none; }

  #content-mount {
    padding: var(--space-8) var(--space-6) var(--space-12);
  }

  .hero-title { font-size: var(--font-size-2xl); }

  .pao-row { grid-template-columns: 1fr; }
  .pao-label { border-right: none; border-bottom: 1px solid var(--color-border); }

  .fit-point { grid-template-columns: 1fr; }
  .fit-point-icon { display: none; }
  .page-cols,
  .page-cols.cols-70-30,
  .page-cols.cols-30-70,
  .page-cols.cols-equal,
  .page-cols.cols-3 { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-duration: 0ms;
  }
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Lightbox
   ============================================================ */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-short);
  padding: var(--space-6);
  box-sizing: border-box;
}
.lb-overlay.lb-visible { opacity: 1; }

.lb-inner {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  width: min(96vw, 1600px);
  max-height: 94vh;
  overflow: auto;
  box-shadow: var(--shadow-lightbox);
  padding: var(--space-4);
}

.lb-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  background: none;
  border: none;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  z-index: 1;
  transition: background var(--transition-short), color var(--transition-short);
}
.lb-close:hover {
  color: var(--color-navy);
  background: var(--color-surface);
}
.lb-close:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Inside lightbox, let diagrams expand fully */
.lb-inner .diagram-container,
.lb-content {
  cursor: default;
  margin: var(--space-4) 0 0;
}
.lb-inner .diagram-body {
  padding: var(--space-4);
}
.lb-inner .diagram-body,
.lb-inner .diagram-container {
  overflow: visible !important;
}
.lb-inner .diagram-title,
.lb-inner .artifact-caption,
.lb-inner .lb-caption {
  text-align: center;
}
.lb-inner .diagram-container.frameless > .diagram-title {
  display: block;
}
.lb-inner img,
.lb-inner svg {
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .lb-overlay { transition: none; }
}


/* ── Presentation Mode ──────────────────────────────────────────────────────
  Route-based case-study presentation mode (non-modal).
  Entry hash: #present/usbank/<slide-slug>
  ────────────────────────────────────────────────────────────────────────── */

/* Inline case-study actions (aligned with title row) */
.case-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.case-heading-row .section-title,
.case-heading-row .hero-title {
  margin-bottom: 0;
  min-width: 0;
}

.case-action-strip {
  display: flex;
  align-items: center;
  justify-self: end;
  margin: 0;
}

.case-present-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--transition-short), color var(--transition-short), background var(--transition-short);
}

.case-present-btn:hover {
  color: var(--color-teal-dark);
  border-color: var(--color-teal);
  background: var(--color-accent-block);
}

.case-present-btn:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Presentation shell */
body.presentation-mode {
  overflow: hidden;
}

/* Presentation mode replaces the normal app chrome with the slide toolbar. */
body.presentation-mode #app-header {
  display: none;
}

body.presentation-mode #app-nav,
body.presentation-mode #local-nav {
  display: none;
}

body.presentation-mode #page-shell {
  margin-top: 0;
  height: 100vh;
  grid-template-columns: 1fr;
}

body.presentation-mode #content-mount {
  max-width: 100%;
  width: 100%;
  height: calc(100vh - 72px);
  padding: var(--space-12) var(--space-12) var(--space-12);
  overflow-y: auto;
}

body.presentation-mode #content-mount::before {
  content: 'Click left/right edges for prev/next';
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-4);
}

body.presentation-mode #content-mount {
  cursor: ew-resize;
}

body.presentation-mode #content-mount .artifact-caption {
  font-size: var(--font-size-xs);
  margin-top: var(--space-1);
  margin-bottom: var(--space-3);
  line-height: var(--line-height-ui);
}

body.presentation-mode.deep-dive #content-mount::before {
  content: 'Use toolbar for section navigation';
}

body.presentation-mode.deep-dive #content-mount {
  cursor: default;
}

body.presentation-mode #content-mount a,
body.presentation-mode #content-mount button,
body.presentation-mode #content-mount .diagram-container,
body.presentation-mode #content-mount .lightbox-trigger {
  cursor: pointer;
}

/* Top control bar */
.present-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) var(--present-toolbar-close-col);
  align-items: center;
  column-gap: var(--space-3);
  height: var(--present-toolbar-height);
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.present-deep-dive-panel {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.present-deep-dive-heading {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-3);
}

.present-deep-dive-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.present-deep-dive-link {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}

.present-return-strip {
  margin: 0 auto var(--space-6);
  max-width: 980px;
  display: flex;
  justify-content: flex-start;
}

.present-return-btn {
  border: 1px solid var(--color-teal-dark);
  color: var(--color-teal-dark);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
}

/* Larger type + more whitespace in presentation mode */
body.presentation-mode #content-mount h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
body.presentation-mode #content-mount h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
body.presentation-mode #content-mount h3 { font-size: clamp(1.125rem, 2vw, 1.75rem); }
body.presentation-mode #content-mount p,
body.presentation-mode #content-mount li { font-size: clamp(1rem, 1.35vw, 1.18rem); line-height: 1.72; }
body.presentation-mode #content-mount .section {
  max-width: var(--content-max-width-presentation);
  margin: 0 auto;
}
body.presentation-mode #content-mount .section-label { font-size: var(--font-size-base); }
body.presentation-mode #content-mount img { max-width: 100%; height: auto; }

/* Control buttons */
.present-nav-btn,
.present-up-btn {
  min-width: 0;
  max-width: var(--present-nav-control-max);
  width: 100%;
  height: var(--present-nav-control-height);
  background: transparent;
  color: var(--present-nav-color);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  font-size: var(--present-nav-font-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-ui);
  text-decoration: none;
  transition: background var(--transition-short), color var(--transition-short), border-color var(--transition-short);
}

.present-toolbar [hidden] {
  display: none !important;
}

.present-nav-prev {
  grid-column: 1;
  justify-self: start;
  justify-content: flex-start;
}

.present-up-btn {
  grid-column: 2;
  justify-self: center;
  justify-content: center;
}

.present-nav-next {
  grid-column: 3;
  justify-self: end;
  justify-content: flex-end;
  text-align: right;
}

.present-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.present-nav-next .present-nav-icon {
  order: 2;
}

.present-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.present-nav-btn svg,
.present-up-btn svg {
  width: var(--present-nav-icon-size);
  height: var(--present-nav-icon-size);
  display: block;
}

.present-nav-btn:hover,
.present-up-btn:hover,
.present-nav-btn:focus-visible,
.present-up-btn:focus-visible {
  text-decoration: none;
}

.present-nav-btn:hover,
.present-up-btn:hover {
  background: var(--present-nav-hover-bg);
  border-color: var(--color-border);
  color: var(--present-nav-hover-color);
}
.present-nav-btn:focus-visible,
.present-up-btn:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.present-exit-btn {
  grid-column: 4;
  justify-self: end;
  line-height: 1;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--present-nav-color);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  width: var(--present-nav-control-height);
  height: var(--present-nav-control-height);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-short), color var(--transition-short);
}

.present-exit-btn svg {
  width: var(--present-nav-icon-size);
  height: var(--present-nav-icon-size);
  display: block;
}

.present-exit-btn:hover {
  background: var(--present-nav-hover-bg);
  color: var(--present-nav-hover-color);
}

.present-exit-btn:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .present-toolbar {
    column-gap: var(--space-1);
    padding: 0 var(--space-2);
  }

  .present-nav-btn,
  .present-up-btn {
    padding: 0 var(--space-1);
  }

  .present-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Shared dismiss controls for overlays */
.lb-close {
  font-size: var(--font-size-dismiss);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-sm);
}
