:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-soft: #f3f3f1;
  --ink: #615e56;
  --heading: #3f3b34;
  --muted: #7a766e;
  --muted-2: #a49d8e;
  --line: #e7e2d8;
  --brand: #42858c;
  --brand-2: #1863dc;
  --link: #42858c;
  --sand: #cfc5b0;
  --success: #42858c;
  --warning: #9a6a2f;
  --radius: 4px;
  --radius-sm: 2px;
  --shadow: 0 18px 42px -34px rgba(97, 94, 86, 0.42);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(66, 133, 140, 0.08), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 40%);
  font-family: "Josefin Sans", "Aptos", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid rgba(66, 133, 140, 0.72);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(231, 226, 216, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.header-shell {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: fit-content;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small { display: block; }

.brand small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
  margin-top: -2px;
}

.desktop-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.desktop-nav a,
.mobile-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover {
  color: var(--brand);
  background: var(--surface-soft);
}

.logout-form { margin: 0; }

.ghost-button,
.mobile-menu-toggle {
  border: 1px solid var(--line);
  color: var(--muted);
  background: white;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mobile-menu-toggle { display: none; }
.mobile-nav { display: none; padding-bottom: 16px; }

.hero-section { padding: 54px 0 26px; }
.hero-grid {
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; color: var(--heading); line-height: 1.08; letter-spacing: -0.025em; }
h1 { font-size: clamp(36px, 3.7vw, 48px); max-width: 780px; }
h2 { font-size: clamp(28px, 2.8vw, 42px); }
h3 { font-size: 22px; }

.hero-copy,
.page-hero p,
.section-heading p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.62;
  max-width: 68ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.primary-button,
.secondary-button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-button {
  border: 0;
  color: white;
  background: var(--brand);
  cursor: pointer;
  box-shadow: none;
}

.secondary-button {
  border: 1px solid var(--line);
  color: #f3f3f1;
  background: var(--ink);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.ghost-button,
.mobile-menu-toggle,
.document-link,
.assignment-link,
.source-row,
.candidate-summary,
input,
select {
  transition:
    background-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ghost-button:hover,
.mobile-menu-toggle:hover {
  color: var(--brand);
  border-color: rgba(66, 133, 140, 0.36);
  background: #edf7f8;
}

input:focus,
select:focus {
  border-color: rgba(66, 133, 140, 0.5);
  box-shadow: 0 0 0 3px rgba(66, 133, 140, 0.12);
  outline: none;
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.mobile-menu-toggle:active {
  transform: translateY(-1px) scale(0.99);
}

.text-link {
  color: var(--link);
  margin-top: auto;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-note,
.card,
.metric-card,
.markdown-card,
.code-card {
  border: 1px solid rgba(231, 226, 216, 0.86);
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-note { padding: 24px; color: var(--muted); }
.hero-note strong { color: var(--ink); }

.section-block { padding: 42px 0; }
.section-heading { margin-bottom: 24px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.metric-card {
  display: block;
  grid-column: span 2;
  min-height: 154px;
  padding: 22px;
  color: inherit;
  text-decoration: none;
}
.metric-card:first-child {
  grid-column: span 2;
  background: linear-gradient(135deg, #ffffff 0%, #edf7f8 100%);
}
.metric-card:nth-child(4),
.metric-card:nth-child(5) {
  grid-column: span 3;
}
.metric-card span { color: var(--muted); font-weight: 750; font-size: 13px; }
.metric-card strong { display: block; font-size: 38px; letter-spacing: -0.055em; margin: 12px 0 8px; }
.metric-card p { color: var(--muted); margin: 0; font-size: 14px; line-height: 1.45; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.single-column { grid-template-columns: minmax(0, 1fr); }
.profile-report-list .report-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 28px;
}
.profile-report-list .report-card .eyebrow {
  grid-column: 1;
  margin: 0;
}
.profile-report-list .report-card h2 {
  grid-column: 1;
  font-size: clamp(24px, 2.4vw, 34px);
}
.profile-report-list .report-card p {
  grid-column: 1;
  max-width: 78ch;
}
.profile-report-list .report-card .tag-row {
  grid-column: 1;
  margin-top: 4px;
}
.profile-report-list .report-card .text-link {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: start;
  white-space: nowrap;
}
.card { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.clickable-card {
  color: inherit;
  text-decoration: none;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms cubic-bezier(0.16, 1, 0.3, 1), background-color 220ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.clickable-card:hover,
.clickable-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(66, 133, 140, 0.4);
  box-shadow: 0 24px 54px -34px rgba(97, 94, 86, 0.55);
  outline: none;
}
.clickable-card:active {
  transform: translateY(-1px) scale(0.99);
}
.card p { color: var(--muted); margin: 0; }
.clickable-card:hover .text-link,
.clickable-card:focus-visible .text-link {
  transform: translateX(3px);
}
.card h2 {
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.12;
}
.report-card h2 {
  font-size: clamp(22px, 2vw, 28px);
}
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: #edf7f8;
  font-size: 12px;
  font-weight: 800;
}
.status-pill.success { color: var(--brand); background: #edf7f8; }
.status-pill.warning { color: var(--warning); background: #f5efe3; }
.compact-list { margin: 0; padding-left: 18px; color: var(--muted); }
.compact-list li + li { margin-top: 6px; }

.split-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 22px;
  align-items: start;
}
.number-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: item;
}
.number-list li {
  counter-increment: item;
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.number-list li::before {
  content: counter(item);
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--brand);
  font-weight: 900;
}

.page-hero { padding: 56px 0 28px; }
.page-hero.compact { padding-bottom: 12px; }
.back-link { color: var(--muted); text-decoration: none; font-weight: 800; display: inline-block; margin-bottom: 18px; }
.tag-row, .score-row, .mini-stats, .source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-row span,
.score-row span,
.mini-stats span,
.source-strip a {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}
.mini-stats span strong { color: var(--brand); margin-right: 5px; }
.source-strip { padding: 0 0 20px; }
.market-highlights {
  padding-bottom: 28px;
}
.report-browser {
  padding-bottom: 36px;
}
.section-divider {
  height: 1px;
  margin: 4px 0 30px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.highlight-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.highlight-card {
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.highlight-card h3 {
  font-size: 22px;
}
.highlight-card p {
  margin: 0;
  color: var(--muted);
}
.highlight-card strong {
  color: var(--brand);
  font-size: 14px;
  line-height: 1.45;
}
.assignment-context {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}
.assignment-context h2 {
  font-size: 26px;
}
.assignment-context p {
  margin: 10px 0 0;
  color: var(--muted);
}
.assignment-links {
  display: grid;
  gap: 10px;
}
.assignment-link {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: inherit;
  background: white;
  text-decoration: none;
}
.assignment-link:hover {
  border-color: rgba(66, 133, 140, 0.36);
  background: #edf7f8;
}
.assignment-link.primary {
  border-color: rgba(66, 133, 140, 0.36);
  background: linear-gradient(135deg, #edf7f8, #ffffff 78%);
}
.assignment-link strong {
  color: var(--brand);
}
.assignment-link span {
  color: var(--muted);
  font-size: 13px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 24px;
  padding: 44px 0;
  align-items: start;
}
.detail-aside {
  position: sticky;
  top: 100px;
  color: var(--muted);
}
.detail-aside h1 { font-size: 34px; color: var(--ink); }
.detail-aside h3 { color: var(--ink); margin-top: 26px; font-size: 16px; }
.source-links { padding-left: 18px; }
.source-links li + li { margin-top: 8px; }
.source-links a { color: var(--link); }
[x-cloak] { display: none !important; }
.document-switcher {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.document-link {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--muted);
  background: white;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.document-link:hover,
.document-link.active {
  color: var(--brand);
  border-color: rgba(66, 133, 140, 0.36);
  background: #edf7f8;
}
.source-open-link {
  margin-top: 16px;
}
.document-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.document-meta a {
  color: var(--link);
}

.markdown-card { padding: clamp(26px, 4vw, 52px); overflow: hidden; }
.markdown-body {
  color: var(--ink);
  font-family: "Josefin Sans", "Aptos", ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.62;
}
.markdown-body h1 { font-size: 36px; margin-bottom: 20px; line-height: 1.1; }
.markdown-body h2 { font-size: 25px; margin: 34px 0 12px; }
.markdown-body h3 { font-size: 18px; margin: 24px 0 10px; }
.markdown-body p, .markdown-body li { color: var(--ink); }
.markdown-body p { margin: 0 0 16px; }
.markdown-body ul,
.markdown-body ol { margin-top: 8px; margin-bottom: 18px; }
.markdown-body a { color: var(--link); }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
}
.filter-bar label { display: grid; gap: 6px; color: var(--muted); font-weight: 800; font-size: 13px; flex: 1 1 220px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  font: inherit;
  background: white;
  color: var(--ink);
}

.candidates-panel { padding: 14px 0 52px; }
.candidate-list { display: grid; gap: 12px; }
.candidate-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
}
.candidate-summary {
  width: 100%;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.candidate-summary small { display: block; color: var(--muted); margin-top: 3px; }
.candidate-rank {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--brand);
  font-weight: 900;
}
.candidate-detail {
  padding: 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfaf8 0%, #ffffff 100%);
}
.candidate-detail-inner {
  display: grid;
  gap: 16px;
  padding: 18px;
}
.candidate-profile-grid,
.candidate-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.candidate-notes-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr);
}
.profile-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: white;
  color: var(--muted);
}
.profile-panel-primary {
  background: linear-gradient(135deg, #edf7f8, #ffffff 72%);
  border-color: rgba(66, 133, 140, 0.28);
}
.profile-panel h3 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: -0.02em;
}
.profile-panel p {
  margin: 0;
}
.profile-panel p + p {
  margin-top: 10px;
}
.profile-role {
  color: var(--brand);
  font-weight: 850;
  margin-bottom: 12px !important;
}
.candidate-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}
.candidate-facts div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}
.candidate-facts div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
dt { color: var(--muted); font-size: 12px; font-weight: 850; }
dd { margin: 3px 0 0; color: var(--heading); }
.detail-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.detail-columns h3 { font-size: 16px; margin-bottom: 10px; }
.detail-columns ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.detail-columns li + li {
  margin-top: 8px;
}
.review-grid {
  margin-top: 0;
  gap: 14px;
}

.source-library { padding-bottom: 54px; }
.source-table { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: white; }
.source-row {
  display: grid;
  grid-template-columns: 1fr 180px 80px;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.source-row:last-child { border-bottom: 0; }
.source-row:hover { background: #edf7f8; }
.source-row small { display: block; color: var(--muted); margin-top: 4px; word-break: break-word; }
.code-card {
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: #dbeafe;
  background: #0f172a;
  font-size: 13px;
  line-height: 1.6;
}
.mono-path, code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.small { font-size: 13px; }
.muted { color: var(--muted); }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}
.login-brand { margin-bottom: 24px; }
.login-card h1 { font-size: 38px; margin-bottom: 12px; }
.login-card p { color: var(--muted); }
.login-card form { display: grid; gap: 12px; margin-top: 20px; }
.form-error {
  padding: 12px;
  border-radius: 14px;
  color: #991b1b !important;
  background: #fee2e2;
}

.site-footer { padding: 34px 0 46px; color: var(--muted); }
.footer-shell {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  font-size: 13px;
}

.motion-ready .reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.motion-ready .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 920px) {
  .desktop-nav, .logout-form { display: none; }
  .mobile-menu-toggle { display: inline-flex; margin-left: auto; }
  .mobile-nav { display: grid; gap: 8px; }
  .hero-grid, .split-panel, .detail-layout, .assignment-context { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card,
  .metric-card:first-child,
  .metric-card:nth-child(4),
  .metric-card:nth-child(5) {
    grid-column: span 1;
  }
  .two-column { grid-template-columns: 1fr; }
  .profile-report-list .report-card {
    grid-template-columns: 1fr;
  }
  .profile-report-list .report-card .tag-row,
  .profile-report-list .report-card .text-link {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }
  .highlight-list { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .detail-columns { grid-template-columns: 1fr; }
  .candidate-profile-grid,
  .candidate-notes-grid {
    grid-template-columns: 1fr;
  }
  .source-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card,
  .metric-card:first-child,
  .metric-card:nth-child(4),
  .metric-card:nth-child(5) {
    grid-column: span 1;
  }
  .candidate-summary { grid-template-columns: 42px 1fr; }
  .candidate-summary .status-pill { grid-column: 2; }
}
