/** 
 * Project Hamilton — Website theme
 * Black & white theme from keeper: background lines, loading icon, button animations.
 */
/* -------------------------------------------------------------------------
   Variables
   ------------------------------------------------------------------------- */
:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.65);
  --border: rgba(255, 255, 255, 0.5);
  --line-color: rgba(255, 255, 255, 0.35);
  --line-glow: rgba(255, 255, 255, 0.95);
  --font-sans: "Lora", Georgia, "Times New Roman", serif;
  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --content-max: 920px;
  --wide-max: 1100px;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 5rem;
  --space-5xl: 6rem;
  --nav-height: 4rem;
  --radius: 0;
}

/* -------------------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  text-align: center;
}

/* Global white grain — very subtle texture on base background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px;
  mix-blend-mode: screen;
}

/* Slightly warm the whites and soften contrast for an aged feel */
#main-wrap {
  position: relative;
  filter: sepia(0.07) contrast(0.94) brightness(0.96);
}

/* Film grain overlay — behind interactive content */
#main-wrap::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: overlay;
}

/* Subtle vignette — behind interactive content */
#main-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%);
}

/* -------------------------------------------------------------------------
   Loading screen (initial load)
   ------------------------------------------------------------------------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
  isolation: isolate; /* grain blends only with this background, not the page behind */
}

/* Same film grain as main site — visible on black (screen blend so noise shows) */
.loading-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: screen;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Loading: keeper-style gif or fallback boxes (dots-bars-5) */
.loading-screen .loading-media,
.loading-screen .loading-boxes {
  position: relative;
  z-index: 1;
}

.loading-screen .loading-media {
  width: 128px;
  height: 128px;
  object-fit: contain;
  display: block;
  /* Screen blend: black in gif becomes see-through so grain shows behind */
  mix-blend-mode: screen;
}

.loading-screen .loading-boxes {
  width: 60px;
  height: 36px;
  --c: linear-gradient(currentColor 0 0);
  background:
    var(--c) 0    100%/8px 30px,
    var(--c) 50%  100%/8px 20px,
    var(--c) 100% 100%/8px 10px;
  background-repeat: no-repeat;
  position: relative;
  clip-path: inset(-100% 0);
  animation: loading-bars 2s infinite linear;
  color: rgba(255, 255, 255, 0.8);
}

.loading-screen .loading-boxes::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  left: -16px;
  top: 0;
  animation:
    loading-bar-dot-x 2s infinite linear,
    loading-bar-dot-y 0.5s infinite cubic-bezier(0.2, 0.9, 0.3, 0.7);
}

@keyframes loading-bars {
  16.67% { background-size: 8px 20px, 8px 30px, 8px 10px; }
  33.33% { background-size: 8px 10px, 8px 20px, 8px 30px; }
  50%    { background-size: 8px 30px, 8px 10px, 8px 20px; }
  66.67% { background-size: 8px 20px, 8px 30px, 8px 10px; }
  83.33% { background-size: 8px 10px, 8px 20px, 8px 30px; }
}

@keyframes loading-bar-dot-x {
  100% { left: calc(100% + 8px); }
}

@keyframes loading-bar-dot-y {
  100% { top: -0.1px; }
}


/* -------------------------------------------------------------------------
   Background animation — rising vertical lines (keeper style)
   ------------------------------------------------------------------------- */
.bg-lines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-line {
  position: absolute;
  width: 1px;
  height: 100%;
  background: var(--line-color);
  overflow: hidden;
  filter: blur(0.65px);
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.12);
}

/* The light that passes through the line — brighter and glowy */
.bg-line::after {
  content: "";
  display: block;
  position: absolute;
  height: 18vh;
  width: 100%;
  top: -50%;
  left: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 35%,
    rgba(255, 255, 255, 0.95) 65%,
    rgba(255, 255, 255, 1) 100%
  );
  box-shadow: 0 0 16px 4px rgba(255, 255, 255, 0.55);
  filter: blur(0.5px);
  animation: line-rise var(--line-duration, 7s) infinite;
  animation-delay: var(--line-delay, 0s);
  animation-timing-function: cubic-bezier(0.4, 0.26, 0, 0.97);
}

@keyframes line-rise {
  0% { top: 110%; }
  100% { top: -50%; }
}

/* Line positions — grouped near the sides, clear center for content */
.bg-line--left-1 { left: 10%;  --line-delay: 0s;   --line-duration: 7s; }
.bg-line--left-2 { left: 14%;  --line-delay: 2s;   --line-duration: 8s; }
.bg-line--left-3 { left: 18%;  --line-delay: 4s;   --line-duration: 9s; }
.bg-line--right-1 { right: 10%;  --line-delay: 1s;   --line-duration: 6s; }
.bg-line--right-2 { right: 14%;  --line-delay: 3s;   --line-duration: 7.5s; }
.bg-line--right-3 { right: 18%;  --line-delay: 5s;   --line-duration: 9s; }

/* -------------------------------------------------------------------------
   Main content (above background)
   ------------------------------------------------------------------------- */
.main-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.main-wrap.visible {
  opacity: 1;
}

/* Nav — centered content */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-nav .nav-inner {
  width: 100%;
  max-width: var(--wide-max, 960px);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__brand {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav__brand:hover {
  color: var(--text-muted);
}

.site-nav__links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.site-nav__links a:hover {
  color: var(--text);
}

.site-nav__toggle {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.88);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
}

.site-nav__toggle span {
  display: block;
  width: 0.95rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.92);
}

/* Main content area — full width so container centers in viewport */
.main {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: var(--space-4xl) var(--space-xl);
  min-height: calc(100vh - var(--nav-height) - 180px);
  box-sizing: border-box;
  text-align: center;
}

.container {
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-xl);
  box-sizing: border-box;
  text-align: center;
}

.container--wide {
  max-width: var(--wide-max);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: var(--space-md);
  color: var(--text);
  text-align: center;
}

h1 { font-size: 2.25rem; margin-bottom: var(--space-lg); letter-spacing: 0.01em; }
h2 { font-size: 1.375rem; margin-top: 0; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }

p {
  margin-top: 0;
  margin-bottom: var(--space-lg);
  margin-left: auto;
  margin-right: auto;
  color: var(--text);
  line-height: 1.6;
  max-width: 80ch;
  text-align: center !important; /* force line-by-line center alignment */
}

.section > p:last-child {
  margin-bottom: 0;
}

/* Center paragraphs that contain buttons */
.section p:has(.btn) {
  text-align: center;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Blockquote */
blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--text);
  color: var(--text);
  text-align: center;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Sections — no boxes, use divider between; content centered */
.section {
  margin-bottom: 0;
  padding-bottom: 0;
  padding-top: var(--space-xl);
  margin-left: auto;
  margin-right: auto;
  max-width: 80ch;
  text-align: center;
}

.section__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: var(--space-lg);
  margin-left: auto;
  margin-right: auto;
  color: var(--text);
  letter-spacing: 0.02em;
  text-align: center;
}

/* Section divider — centered arrow with short lines */
.section-divider {
  display: block;
  position: relative;
  width: 100%;
  margin: var(--space-5xl) auto;
  border: none;
  background: none;
  text-align: center;
  font-size: 0.5rem;
  color: var(--border);
  letter-spacing: 0.15em;
}

.section-divider::before {
  content: '\25BC';
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  opacity: 0.85;
}

/* Reports & blog page: placeholder slot for latest entry */
.report-slot {
  border: 1px solid rgba(255,255,255,0.15);
  padding: var(--space-2xl) var(--space-xl);
  margin: var(--space-xl) 0;
  text-align: center;
}

.report-archive {
  margin: var(--space-xl) 0;
}

/* Center text on reports and blog pages */
/* Homepage: same text centering as other content pages */
.home-page .container { text-align: center; max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.home-page .section { text-align: center; }
.home-page .section p { text-align: center; margin-left: auto; margin-right: auto; }
.home-page .section__title { text-align: center; }
.home-page .ticker-wrap,
.home-page .ticker-wrap p { text-align: center; }

.reports-page .container,
.blog-page .container { text-align: center; }

.reports-page .section,
.blog-page .section { text-align: center; }

.reports-page .section p,
.blog-page .section p { margin-left: auto; margin-right: auto; }

.reports-page .metric-grid,
.blog-page .metric-grid { justify-items: center; }

.reports-page .metric-card,
.blog-page .metric-card { text-align: center; }

.reports-page .compare-table,
.blog-page .compare-table { margin-left: auto; margin-right: auto; }

/* Debt page anchor offset — clears both sticky navs */
.section[id] {
  scroll-margin-top: calc(var(--nav-height) + 3rem);
}

/* Debt page section sub-nav */
.debt-subnav {
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding: 0 var(--space-xl);
}

.debt-subnav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.debt-subnav li {
  margin: 0;
}

.debt-subnav a {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.debt-subnav a:hover,
.debt-subnav a.active {
  color: var(--text);
}

@media (max-width: 600px) {
  .debt-subnav a {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
  }
  .debt-subnav {
    padding: 0 0.35rem;
  }
  .debt-subnav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
}

/* Debt page charts */
.chart-wrap {
  margin: var(--space-xl) 0;
  max-width: 100%;
  min-height: 280px;
}

.chart-wrap canvas {
  max-width: 100%;
  height: auto;
}

/* Metric grid — used on debt page for pressure indicators */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.metric-card {
  border: 1px solid var(--border);
  padding: var(--space-lg);
  text-align: center;
}

.metric-card__label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.metric-card__value--sm {
  font-size: 1.125rem;
}

.metric-card__note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Team section — compact member tiles */
.team-roster {
  margin: var(--space-xl) auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.15rem;
  max-width: 980px;
}

.member-tile {
  border: 1px solid rgba(255, 255, 255, 0.26);
  padding: 0.9rem 0.65rem 0.85rem;
  text-align: center;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.member-tile__photo-frame {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.member-tile__photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.member-tile__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.05);
  transition: transform 0.22s ease, filter 0.22s ease;
}

.member-tile--d3bt .member-tile__photo-frame {
  background: #000;
}

.member-tile--d3bt .member-tile__photo {
  /* Flip light background to black for theme consistency */
  filter: invert(1) grayscale(1) contrast(1.08);
}

.member-tile__photo-frame--placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.member-tile__name,
.member-tile__role {
  margin: 0;
}

.member-tile__name {
  margin-bottom: 0.1rem;
}

.member-tile__role {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.member-tile__social {
  margin-top: 0.28rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
}

.social-icon {
  width: 0.9rem;
  height: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #ffffff;
  text-decoration: none;
  opacity: 0.86;
}

.social-icon svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentColor;
}

.social-icon:hover {
  opacity: 1;
  color: #fff;
}

/* Home page team cards: subtle lift + glow on hover/focus */
.home-page .member-tile:hover,
.home-page .member-tile:focus-within {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.58);
  background-color: rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.home-page .member-tile:hover .member-tile__photo,
.home-page .member-tile:focus-within .member-tile__photo {
  transform: scale(1.03);
  filter: grayscale(0.9) contrast(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .member-tile,
  .member-tile__photo {
    transition: none;
  }
  .home-page .member-tile:hover,
  .home-page .member-tile:focus-within {
    transform: none;
  }
  .home-page .member-tile:hover .member-tile__photo,
  .home-page .member-tile:focus-within .member-tile__photo {
    transform: none;
  }
}

@media (max-width: 980px) {
  .team-roster {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .team-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Comparison table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-xl) 0;
  font-size: 0.9375rem;
}

.compare-table th,
.compare-table td {
  padding: 0.6rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.compare-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.compare-table td {
  color: var(--text);
}

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

.compare-table .highlight td {
  color: var(--text);
  font-weight: 700;
}

/* Legacy card class: now unstyled (section only) */
.card {
  margin-bottom: var(--space-2xl);
}

.card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: var(--space-md);
  color: var(--text);
}

ul, ol {
  margin-top: 0;
  margin-bottom: var(--space-md);
  padding-left: 1.5rem;
}

li { margin-bottom: 0.25rem; }

/* -------------------------------------------------------------------------
   Button — keeper launch style (white/black, corner brackets, flash)
   ------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  position: relative;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.btn::before,
.btn::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
}

.btn::before {
  top: 2px;
  right: 2px;
  border-top: 1px solid var(--bg);
  border-right: 1px solid var(--bg);
  animation: corner-flash 1.2s infinite;
}

.btn::after {
  bottom: 2px;
  left: 2px;
  border-bottom: 1px solid var(--bg);
  border-left: 1px solid var(--bg);
  animation: corner-flash 1.2s infinite;
}

.btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
}

.btn:hover::before,
.btn:hover::after {
  border-color: var(--text);
}

.btn + .btn {
  margin-left: var(--space-md);
}

@keyframes corner-flash {
  0%, 100% { opacity: 1; }
  12% { opacity: 0; }
  18% { opacity: 1; }
  28% { opacity: 0; }
  34% { opacity: 1; }
  44% { opacity: 0; }
  50% { opacity: 1; }
}

/* Hero — title with blinking corners on all four sides */
.hero {
  text-align: center;
  padding: 0 2rem var(--space-3xl);
  margin-bottom: 0;
}

.hero__title-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 4rem;
  text-align: center;
}

.hero__title-wrap::before,
.hero__title-wrap::after,
.hero__title-corners::before,
.hero__title-corners::after {
  content: '';
  position: absolute;
  width: 2rem;
  height: 2rem;
  pointer-events: none;
  animation: corner-stutter 1s infinite;
  filter: blur(0.5px);
}

.hero__title-wrap::before {
  top: 0;
  left: 0;
  border-top: 1px solid rgba(255, 255, 255, 1);
  border-left: 1px solid rgba(255, 255, 255, 1);
}

.hero__title-wrap::after {
  bottom: 0;
  right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 1);
  border-right: 1px solid rgba(255, 255, 255, 1);
}

.hero__title-corners {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.hero__title-corners::before {
  top: 0;
  right: 0;
  border-top: 1px solid rgba(255, 255, 255, 1);
  border-right: 1px solid rgba(255, 255, 255, 1);
}

.hero__title-corners::after {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 1);
  border-left: 1px solid rgba(255, 255, 255, 1);
}

@keyframes corner-stutter {
  0%, 100% { opacity: 1; }
  10% { opacity: 0; }
  15% { opacity: 1; }
  25% { opacity: 0; }
  30% { opacity: 1; }
  40% { opacity: 0; }
  45% { opacity: 1; }
}

/* Hero title — 404-style glitch (top/bottom slice + skew), synced with corners (1s, 10%, 25%, 40%) */
.hero__title {
  font-size: clamp(2rem, 6.5vw, 3.25rem);
  font-weight: 700;
  margin: 0 auto;
  padding: 0.5rem 0;
  color: var(--text);
  letter-spacing: 0.03em;
  line-height: 1.15;
  position: relative;
  animation: hero-glitch-main 1s linear infinite;
  white-space: normal;
  text-align: center;
}

.hero__title::before,
.hero__title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 0.5rem 0;
  color: var(--text);
  background: transparent;
  overflow: hidden;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.15;
  font-family: var(--font-heading);
  pointer-events: none;
  white-space: nowrap;
}

.hero__title::before {
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  animation: hero-glitch-top 1s linear infinite;
}

.hero__title::after {
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  -webkit-clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  animation: hero-glitch-bottom 1s linear infinite;
}

@keyframes hero-glitch-main {
  0%, 8%, 12%, 23%, 27%, 38%, 42%, 100% {
    transform: translate(0, 0) skew(0deg);
  }
  9%, 11% {
    transform: translate(2px, 0) skew(0deg);
  }
  24%, 26% {
    transform: translate(-2px, 0) skew(0deg);
  }
  39%, 41% {
    transform: translate(2px, 0) skew(0deg);
  }
  10%, 25%, 40% {
    transform: translate(0, 0) skew(5deg);
  }
}

@keyframes hero-glitch-top {
  0%, 8%, 12%, 23%, 27%, 38%, 42%, 100% {
    transform: translate(0, 0);
  }
  9%, 11% {
    transform: translate(2px, -2px);
  }
  24%, 26% {
    transform: translate(-2px, 2px);
  }
  39%, 41% {
    transform: translate(2px, -2px);
  }
  10%, 25%, 40% {
    transform: translate(8px, -1px) skew(-10deg);
  }
}

@keyframes hero-glitch-bottom {
  0%, 8%, 12%, 23%, 27%, 38%, 42%, 100% {
    transform: translate(0, 0);
  }
  9%, 11% {
    transform: translate(-2px, 0);
  }
  24%, 26% {
    transform: translate(2px, 0);
  }
  39%, 41% {
    transform: translate(-2px, 0);
  }
  10%, 25%, 40% {
    transform: translate(-14px, 4px) skew(14deg);
  }
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

/* Ticker — debt number prominence, centered and large */
.ticker-wrap {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) 0;
  text-align: center;
}

.ticker {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

.ticker--large {
  font-size: clamp(2rem, 8vw, 3.75rem);
  letter-spacing: 0.05em;
}

/* Footer — solid background so bg-lines don't show through; cleaner look */
.site-footer {
  position: relative;
  z-index: 2;
  margin-top: var(--space-2xl);
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.site-footer p {
  margin-bottom: 0.35rem;
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer strong {
  color: var(--text);
  font-weight: 600;
}

/* Entry animations (optional) */
.animate-fade-in {
  animation: fade-in 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Responsive: nav wraps on small screens */
@media (max-width: 640px) {
  .site-nav {
    height: auto;
    min-height: var(--nav-height);
    padding: 0 var(--space-md);
    overflow: visible;
  }
  .site-nav .nav-inner {
    position: relative;
    flex-direction: row;
    gap: 0;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    min-height: var(--nav-height);
    padding: 0 var(--space-md);
  }
  .site-nav__brand {
    max-width: calc(100% - 3.5rem);
    font-size: 1rem;
    line-height: 1.1;
  }
  .site-nav__toggle {
    display: inline-flex;
    width: 2.1rem;
    height: 2.1rem;
    border-color: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
  .site-nav__links {
    position: absolute;
    top: calc(100% - 0.2rem);
    right: 0;
    left: 0;
    width: auto;
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    padding: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.56);
    background: rgba(0, 0, 0, 0.96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15);
    z-index: 200;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav__links::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.2;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: screen;
  }
  .site-nav__links a {
    display: block;
    font-size: 0.92rem;
    padding: 0.62rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
  }
  .site-nav__links a:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.44);
  }
  .site-nav.is-open .site-nav__links {
    display: flex;
  }

  .main {
    padding: var(--space-3xl) var(--space-md);
  }

  .container {
    padding: 0 var(--space-md);
  }

  p {
    font-size: 0.96rem;
    line-height: 1.58;
  }

  h1 {
    font-size: 1.9rem;
  }

  .hero {
    padding: 0 0.25rem var(--space-2xl);
  }

  .hero__title-wrap {
    padding: 1.25rem 1.1rem;
  }

  .hero__title::before,
  .hero__title::after {
    display: none;
  }

  .section-divider {
    margin: var(--space-3xl) auto;
  }

  .section {
    padding-top: var(--space-lg);
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .compare-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    font-size: 0.875rem;
  }

  .chart-wrap {
    min-height: 220px;
  }

  .team-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0.5rem auto 0;
  }

  .btn + .btn {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .main {
    padding: var(--space-2xl) 0.75rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .site-nav .nav-inner {
    padding: 0 0.5rem;
  }

  .site-nav__links a {
    font-size: 0.86rem;
  }

  .site-footer {
    font-size: 0.76rem;
    padding: var(--space-md) 0.75rem;
  }

  .team-roster {
    grid-template-columns: 1fr;
  }

  .member-tile__photo-frame {
    width: 58px;
    height: 58px;
  }

  .ticker--large {
    letter-spacing: 0.02em;
  }
}
