/*
2026-07-13- init v0
CDX-alh-routes-client.css, version: 0.0.0
CDX=true
Professional client-facing evolution of the ALH routes index.
*/

:root {
  color-scheme: dark;
  --ink: #121512;
  --surface: #191d1a;
  --surface-raised: #202520;
  --paper: #f4f5f1;
  --muted: #a9b0a8;
  --line: rgba(244, 245, 241, 0.14);
  --line-strong: rgba(244, 245, 241, 0.25);
  --green: #65bc7b;
  --green-deep: #2f6f42;
  --gutter: clamp(1.25rem, 5.5vw, 5.5rem);
  --sans: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Roboto Mono", "IBM Plex Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body.route-index {
  min-height: 100%;
  margin: 0;
  background: var(--ink);
}

body.route-index {
  min-height: 100svh;
  overflow-x: hidden;
  padding: clamp(2rem, 5vw, 5rem) var(--gutter) clamp(4rem, 8vw, 7rem);
  color: var(--paper);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 92% 5%, rgba(101, 188, 123, 0.12), transparent 30rem),
    linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 45%),
    var(--ink);
}

body.route-index::before {
  content: "ALH";
  position: absolute;
  top: clamp(2rem, 5vw, 5rem);
  right: var(--gutter);
  padding-left: 1.1rem;
  border-left: 2px solid var(--green);
  color: var(--muted);
  font: 700 0.72rem/1.4 var(--mono);
  letter-spacing: 0.18em;
}

.route-index main {
  width: min(100%, 76rem);
  margin-inline: auto;
}

.route-index h1 {
  max-width: 11ch;
  margin: clamp(7rem, 16vh, 10rem) 0 0;
  font: 650 clamp(3.1rem, 8vw, 7rem)/0.96 var(--sans);
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
  animation: client-rise 620ms cubic-bezier(.22, 1, .36, 1) both;
}

.route-index h1::after {
  content: ".";
  color: var(--green);
}

.route-index .muted {
  max-width: 44rem;
  margin: 1.35rem 0 clamp(3rem, 7vh, 5.5rem);
  color: var(--muted);
  font: 450 clamp(0.95rem, 1.4vw, 1.12rem)/1.75 var(--sans);
  animation: client-rise 620ms 90ms cubic-bezier(.22, 1, .36, 1) both;
}

.route-index table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.24);
  animation: client-rise 620ms 180ms cubic-bezier(.22, 1, .36, 1) both;
}

.route-index th,
.route-index td {
  padding: clamp(1rem, 2vw, 1.45rem);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.route-index th {
  color: var(--muted);
  font: 700 0.68rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--surface-raised);
}

.route-index td {
  color: rgba(244, 245, 241, 0.82);
  font: 450 clamp(0.86rem, 1vw, 0.98rem)/1.55 var(--sans);
}

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

.route-index tbody tr {
  transition: background-color 180ms ease;
}

.route-index tbody tr:hover {
  background: rgba(101, 188, 123, 0.055);
}

.route-index a {
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
}

.route-index a::after {
  content: "\2197";
  display: inline-block;
  margin-left: 0.45rem;
  color: var(--green);
  transition: transform 180ms ease;
}

.route-index a:hover::after {
  transform: translate(0.15rem, -0.15rem);
}

.route-index a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 0.3rem;
}

.route-index .theme-switcher {
  position: fixed;
  z-index: 10;
  top: 1.25rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.5rem 0.6rem 0.5rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(25, 29, 26, 0.9);
  box-shadow: 0 0.8rem 2.6rem rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.route-index .theme-switcher__label,
.route-index .theme-switcher output {
  color: var(--muted);
  font: 700 0.62rem/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.route-index .theme-switcher button {
  min-height: 2.15rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 999px;
  color: #0e1811;
  font: 750 0.68rem/1 var(--sans);
  letter-spacing: 0.03em;
  background: var(--green);
  cursor: pointer;
}

.route-index .theme-switcher button:hover {
  background: #7dcc90;
}

.route-index .theme-switcher button:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 0.2rem;
}

@keyframes client-rise {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  body.route-index {
    padding-top: 1.25rem;
  }

  body.route-index::before {
    top: 5.5rem;
  }

  .route-index h1 {
    max-width: 100%;
    margin-top: 7.5rem;
    font-size: clamp(2.45rem, 11vw, 3.35rem);
  }

  .route-index .theme-switcher__label {
    display: none;
  }

  .route-index .theme-switcher output {
    overflow: hidden;
    max-width: 8.5rem;
    text-overflow: ellipsis;
  }

  .route-index table,
  .route-index thead,
  .route-index tbody,
  .route-index tr,
  .route-index th,
  .route-index td {
    display: block;
  }

  .route-index thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .route-index tbody tr {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
  }

  .route-index tbody tr:last-child {
    border-bottom: 0;
  }

  .route-index td {
    padding: 0.45rem 1rem;
    border: 0;
  }

  .route-index td::before {
    display: block;
    margin-bottom: 0.16rem;
    color: var(--muted);
    font: 700 0.6rem/1.3 var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .route-index td:nth-child(1)::before { content: "slug"; }
  .route-index td:nth-child(2)::before { content: "description"; }
  .route-index td:nth-child(3)::before { content: "source"; }
}

@media (prefers-reduced-motion: reduce) {
  .route-index *,
  .route-index *::before,
  .route-index *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
