/* Self-hosted Victor Mono (latin 400/500/700) — same files as Watcher public fonts */
@font-face {
  font-family: "Victor Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/victor-mono/victor-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Victor Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/victor-mono/victor-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Victor Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/victor-mono/victor-mono-latin-700-normal.woff2") format("woff2");
}

/* Admin Halaska-style tokens (wiki/ui/color_palette.md — admin tinted neutrals) */
:root {
  --orange: #ff6633;
  --orange-dark: #e65519;
  --primary: #f66d1d;
  --primary-soft: #fff7ed;
  --canvas: #fefcfb;
  --white: #fffbfa;
  --highlight: #f5ece9;
  --highlight90: #efe4e0;
  --ornamental: #a18e88;
  --cement: #8f827d;
  --graphite: #6e615c;
  --charcoal: #38312e;
  --success: #2f7a52;
  --success-soft: #e8f5ee;
  --warning: #b35624;
  --warning-soft: #faf0e8;
  --danger: #b04a45;
  --danger-soft: #f8eceb;
  --info: #4a6170;
  --shadow-hard: 4px 4px 0 0 #38312e;
  --shadow-normal: 2px 2px 0 0 #38312e;
  --btn-shadow: 2px 2px 0 var(--charcoal);
  --font: "Victor Mono", "Courier New", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--charcoal);
  background: var(--canvas);
  line-height: 1.5;
  min-height: 100vh;
  padding-top: 4.75rem;
}

a {
  color: var(--orange);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--orange-dark);
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

/* —— Header (fixed admin topbar) —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--cement);
  background: var(--white);
  box-shadow: 0 1px 0 var(--ornamental);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0;
}

.brand {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--charcoal);
  flex: 0 1 auto;
  cursor: default;
}

.brand span {
  color: var(--orange);
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
}

.header-nav a {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.32rem 0.55rem;
  color: var(--graphite);
  border-radius: 0;
}

.header-nav a:hover {
  border-color: var(--cement);
  color: var(--charcoal);
  background: var(--highlight);
}

.header-nav a[aria-current="page"] {
  border-color: var(--charcoal);
  background: var(--primary-soft);
  color: var(--orange-dark);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex: 0 1 auto;
  margin-left: auto;
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--charcoal);
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-normal);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--charcoal);
}

.btn-primary:hover {
  background: var(--orange-dark);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--cement);
}

.btn-secondary:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--graphite);
  border-color: transparent;
  box-shadow: none;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.btn-ghost:hover {
  color: var(--orange);
  transform: none;
  box-shadow: none;
}

/* —— Hero —— */
.hero {
  padding: 0.5rem 0 0.25rem;
}

.hero-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--graphite);
}

.hero-kicker a {
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 0.65rem;
  letter-spacing: -0.03em;
  color: var(--charcoal);
}

.hero h1::before {
  content: "// ";
  color: var(--ornamental);
  font-weight: 500;
}

.lede {
  max-width: 66ch;
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--graphite);
}

.lede strong {
  color: var(--charcoal);
}

.article-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--primary-soft);
  border: 1px solid var(--cement);
  border-left: 3px solid var(--primary);
}

.article-callout p {
  margin: 0;
  flex: 1 1 16rem;
  font-size: 0.82rem;
  color: var(--graphite);
}

.article-callout strong {
  color: var(--charcoal);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.chip {
  border: 1px solid var(--cement);
  background: var(--highlight90);
  color: var(--charcoal);
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 0;
}

.chip-accent {
  background: var(--primary-soft);
  border-color: var(--orange);
  color: var(--orange-dark);
}

/* —— Intro hub cards —— */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.hub-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--cement);
  background: var(--white);
  padding: 1rem;
  border-radius: 0;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.hub-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow-normal);
  color: inherit;
}

.hub-card h2 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--charcoal);
}

.hub-card h2::before {
  content: "> ";
  color: var(--orange);
}

.hub-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--graphite);
}

.hub-card .hub-cta {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--orange);
}

.page-hero h1::before {
  content: "// ";
  color: var(--ornamental);
  font-weight: 500;
}

/* —— Panels (aw-admin-panel) —— */
.panel {
  background: var(--white);
  border: 1px solid var(--cement);
  border-radius: 0;
  padding: 1rem 1.1rem 1.15rem;
  margin: 1.1rem 0;
  box-shadow: none;
}

.panel h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--charcoal);
}

.panel h2::before {
  content: "> ";
  color: var(--orange);
}

.panel p,
.panel .note {
  margin: 0 0 0.75rem;
  color: var(--graphite);
  font-size: 0.84rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.stat {
  border: 1px solid var(--cement);
  padding: 0.6rem 0.65rem;
  background: var(--highlight);
  border-radius: 0;
}

.stat strong {
  display: block;
  font-size: 1.25rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.stat span {
  font-size: 0.7rem;
  color: var(--graphite);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* —— Controls —— */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--graphite);
}

input[type="search"],
select {
  font: inherit;
  border: 1px solid var(--cement);
  border-radius: 0;
  padding: 0.45rem 0.55rem;
  min-width: 12rem;
  background: var(--white);
  color: var(--charcoal);
}

input[type="search"]:focus,
select:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
  border-color: var(--orange);
}

/* —— Tables (aw-admin-table) —— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--cement);
  border-radius: 0;
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 640px;
  text-align: left;
}

.compact-table {
  min-width: 0;
}

.compact-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 0.75rem;
  background: var(--highlight90);
  color: var(--charcoal);
  border-bottom: 1px solid var(--cement);
}

th,
td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--ornamental);
  white-space: nowrap;
}

th {
  background: var(--highlight90);
  color: var(--charcoal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--cement);
  cursor: pointer;
  user-select: none;
}

th:hover {
  background: var(--highlight);
  color: var(--orange-dark);
}

th[aria-sort="ascending"]::after {
  content: " ↑";
  color: var(--orange);
}

th[aria-sort="descending"]::after {
  content: " ↓";
  color: var(--orange);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: var(--highlight);
}

.bucket-good {
  color: var(--success);
  font-weight: 700;
}

.bucket-needs {
  color: var(--warning);
  font-weight: 700;
}

.bucket-poor {
  color: var(--danger);
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 0;
}

.badge-good {
  background: var(--success-soft);
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
}

.badge-needs {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 25%, transparent);
}

.badge-poor {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

/* —— Tabs (Filament-ish) —— */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.tab {
  font: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  border: 1px solid var(--cement);
  background: var(--white);
  color: var(--graphite);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
}

.tab:hover {
  border-color: var(--orange);
  color: var(--charcoal);
}

.tab[aria-selected="true"] {
  background: var(--primary);
  color: var(--white);
  border-color: var(--charcoal);
  box-shadow: var(--btn-shadow);
}

/* —— Explore / charts —— */
.explore-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chart-card,
.explainer-card {
  border: 1px solid var(--cement);
  background: var(--white);
  padding: 0.85rem;
  border-radius: 0;
}

.chart-card {
  background: var(--highlight);
}

.chart-title,
.explainer-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  color: var(--charcoal);
}

.chart-blurb {
  margin: 0 0 0.7rem;
  color: var(--graphite);
  font-size: 0.78rem;
}

.chart-shell {
  position: relative;
  height: 300px;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--ornamental);
  padding: 0.5rem;
}

.chart-shell-wide {
  height: 280px;
}

.secondary-chart {
  margin-top: 0.25rem;
}

.explainer-card p {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  color: var(--charcoal);
}

.explainer-bullets {
  margin: 0 0 0.85rem;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: var(--graphite);
  list-style: disc;
}

.explainer-bullets li {
  margin-bottom: 0.3rem;
  list-style: disc;
}

.text-cta {
  font-size: 0.78rem;
  font-weight: 700;
}

.cohort-table-wrap {
  margin: 0.75rem 0;
}

.source-link {
  margin-top: 0.75rem !important;
}

/* —— FAQ —— */
.faq details {
  border: 1px solid var(--cement);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
  background: var(--white);
  border-radius: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--charcoal);
}

.faq details[open] {
  background: var(--highlight);
}

.faq details p {
  margin: 0.55rem 0 0;
  color: var(--graphite);
  font-size: 0.84rem;
}

/* —— CTA band —— */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  background: var(--charcoal);
  color: var(--white);
  border: 1px solid var(--charcoal);
  box-shadow: var(--shadow-hard);
  padding: 1rem 1.1rem;
  margin: 1.35rem 0;
}

.cta-band p {
  margin: 0;
  max-width: 52ch;
  font-size: 0.86rem;
  color: #f5ece9;
}

.cta-band .btn-primary {
  box-shadow: 3px 3px 0 0 var(--orange);
}

.cta-band .btn-secondary {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--ornamental);
}

/* —— Footer —— */
.site-footer {
  margin: 1.75rem auto 1.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--cement);
  font-size: 0.75rem;
  color: var(--graphite);
  text-align: center;
}

.site-footer p {
  margin: 0 auto;
  max-width: 60ch;
}

@media (max-width: 960px) {
  .header-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  body {
    padding-top: 6.5rem;
  }

  html {
    scroll-padding-top: 7rem;
  }
}

@media (max-width: 860px) {
  .explore-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  input[type="search"],
  select {
    min-width: 100%;
  }

  .chart-shell,
  .chart-shell-wide {
    height: 260px;
  }

  .header-actions {
    width: 100%;
    margin-left: 0;
  }

  body {
    padding-top: 8.5rem;
  }

  html {
    scroll-padding-top: 9rem;
  }
}
