:root {
  --bg-canvas: #1c1f24;
  --bg-surface: #2a2e34;
  --bg-surface-hover: #353a42;
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --accent-primary: #14b8a6;
  --accent-secondary: #0d9488;
  --border-subtle: #3f454e;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(0, 0, 0, 0.45);
  --glow-accent: 0 0 24px -4px #14b8a6;
}

*, *::before, *::after {
  box-sizing: border-box;
  border-radius: 0px !important;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  overflow-wrap: anywhere;
  hyphens: auto;
}

h1, h2, h3, h4, .serif-heading {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  line-height: 1.25;
  margin-top: 0;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.75rem; }

p, li {
  max-width: 70ch;
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

a:hover, a:focus-visible {
  color: #5eead4;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header: normal flow, transparent over opening visual, solid when scrolled class applied */
.site-header {
  position: relative;
  z-index: 20;
  width: 100%;
  background-color: transparent;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s ease;
}

.site-header.scrolled-fill {
  background-color: var(--bg-surface);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  margin-right: auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
  background-color: var(--accent-primary);
  color: var(--bg-canvas);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.desktop-nav a:hover, .desktop-nav a[aria-current="page"] {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.mobile-nav-panel {
  display: none;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--accent-primary);
  padding: 1rem 1.5rem;
}

.mobile-nav-panel.open {
  display: block;
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.mobile-nav-list a {
  color: var(--text-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.95rem;
  display: block;
  padding: 0.4rem 0;
}

/* Hero Section */
.hero-banner {
  position: relative;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  margin-top: -73px;
  padding-top: 73px;
}

.hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  background-color: var(--accent-primary);
  color: var(--bg-canvas);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.3rem 0.65rem;
  margin-bottom: 1rem;
}

.hero-visual-wrap {
  position: relative;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border-subtle);
}

.hero-fact-panel {
  position: relative;
  margin-top: -2.5rem;
  margin-left: 1.5rem;
  background-color: var(--bg-canvas);
  border: 2px solid var(--accent-primary);
  padding: 1.25rem;
  box-shadow: var(--shadow-elevation);
  max-width: 380px;
}

.hero-fact-panel h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  font-family: system-ui, sans-serif;
}

.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.fact-list li {
  border-left: 2px solid var(--accent-primary);
  padding-left: 0.65rem;
}

/* Outlined square-ended buttons */
.btn-outline, .btn-solid {
  display: inline-block;
  background-color: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
  padding: 0.8rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-kinetic), background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.btn-solid {
  background-color: var(--accent-primary);
  color: var(--bg-canvas);
}

.btn-outline:hover, .btn-solid:hover, .btn-outline:focus-visible, .btn-solid:focus-visible {
  background-color: var(--accent-primary);
  color: var(--bg-canvas);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevation);
}

/* Vertical Timeline / Pathway Layout */
.pathway-stream {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.pathway-stage {
  position: relative;
  padding-left: 3.5rem;
  padding-bottom: 4rem;
  border-left: 2px solid var(--accent-primary);
}

.pathway-stage:last-child {
  padding-bottom: 1rem;
}

.stage-marker {
  position: absolute;
  left: -1.15rem;
  top: 0;
  width: 2.2rem;
  height: 2.2rem;
  background-color: var(--bg-canvas);
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.stage-header {
  margin-bottom: 1.75rem;
}

.stage-kicker {
  color: var(--accent-primary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.35rem;
}

/* Grid & Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.puzzle-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease-kinetic), box-shadow 0.3s var(--ease-kinetic), border-color 0.3s ease;
}

.puzzle-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-elevation), var(--glow-accent);
  border-color: var(--accent-primary);
}

.card-media-wrap {
  position: relative;
}

.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.difficulty-badge {
  position: absolute;
  bottom: -0.75rem;
  right: 1rem;
  background-color: var(--accent-primary);
  color: var(--bg-canvas);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.7rem;
  border: 2px solid var(--bg-canvas);
}

.card-body {
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.card-footer-link {
  margin-top: auto;
}

/* Interactive Workbench Panels */
.workbench-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.75rem;
  margin-top: 1.25rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.chip-btn {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.chip-btn.active, .chip-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.sort-tile {
  background-color: var(--bg-canvas);
  border: 2px solid var(--border-subtle);
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  color: var(--text-primary);
}

.sort-tile.selected {
  border-color: var(--accent-primary);
  background-color: #16302d;
}

.sort-tile-val {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.35rem;
  color: var(--accent-primary);
}

.sort-tile-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-banner {
  background-color: var(--bg-canvas);
  border-left: 3px solid var(--accent-primary);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.92rem;
}

/* Expandable Reasoning Details */
details.reasoning-drawer {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  margin-top: 1rem;
  padding: 0.9rem 1.15rem;
}

details.reasoning-drawer summary {
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.84rem;
  color: var(--accent-primary);
}

details.reasoning-drawer[open] summary {
  margin-bottom: 0.75rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
  font-size: 0.92rem;
}

table.data-table th, table.data-table td {
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1rem;
  text-align: left;
}

table.data-table th {
  background-color: var(--bg-canvas);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

/* Forms */
.form-grid {
  display: grid;
  gap: 1.15rem;
  max-width: 640px;
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Article longform layout */
.article-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.article-main {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2.25rem;
}

.article-aside {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
}

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 2px solid var(--accent-primary);
  padding: 3rem 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-meta {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* Scroll reveal */
.reveal-item {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--ease-kinetic), transform 0.6s var(--ease-kinetic);
}

.js-enabled .reveal-item {
  opacity: 0;
  transform: translateY(18px);
}

.js-enabled .reveal-item.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .mobile-menu-btn { display: inline-block; }
  .hero-grid, .article-shell { grid-template-columns: 1fr; }
  .hero-fact-panel { margin-left: 0; margin-top: 1rem; max-width: 100%; }
  .pathway-stage { padding-left: 2.25rem; }
}

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