@layer page {
/* ============================================================
   CONTRAST TOOL
   Full-viewport split layout -- two color halves with
   centered ratio overlay. Distinct from the standard tool shell.
   Ported from webdesign/draft/contrast.html.
   ============================================================ */

.contrast-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100dvh;
  padding-top: 56px;
}

.color-half {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  position: relative;
}

.half-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.half-sample {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-align: center;
  max-width: 20ch;
  margin-bottom: var(--space-6);
}

.half-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  opacity: 0.6;
}

.ratio-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  pointer-events: none;
}
.ratio-pill {
  background: color-mix(in oklch, oklch(0.06 0 0) 90%, transparent);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.ratio-number {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 100;
  color: var(--text-0);
  letter-spacing: -0.04em;
  line-height: 1;

  span {
    font-size: 0.45em;
    font-weight: 300;
    color: var(--text-2);
  }
}
.ratio-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-3);
}

.wcag-badges {
  display: flex;
  gap: var(--space-3);
}
.wcag-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  background: color-mix(in oklch, oklch(0.06 0 0) 80%, transparent);

  .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
  }
  &.pass {
    color: oklch(0.78 0.26 145);

    .dot { background: oklch(0.78 0.26 145); }
  }
  &.fail {
    color: oklch(0.65 0.22 25);

    .dot { background: oklch(0.65 0.22 25); }
  }
}

.contrast-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--gutter);
  background: color-mix(in oklch, oklch(0.06 0 0) 85%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  z-index: 10;
}

@media (width <= 600px) {
  .contrast-page {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .ratio-pill { padding: var(--space-4) var(--space-6); }
  .ratio-number { font-size: 2.5rem; }
}
}
@layer page {
/* ============================================================
   ERROR
   Centered error pages (404, 500, etc.) with ambient glow,
   gradient number, floating dots, and minimal footer bar.
   ============================================================ */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Ambient glow -- three-color halo */
.error-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 45% at 35% 48%, oklch(0.10 0.06 350 / 0.4), transparent 60%),
    radial-gradient(ellipse 45% 40% at 55% 52%, oklch(0.10 0.05 145 / 0.35), transparent 55%),
    radial-gradient(ellipse 55% 50% at 50% 45%, oklch(0.08 0.04 260 / 0.3), transparent 65%);
  pointer-events: none;
  animation: error-glow-drift 12s ease-in-out infinite alternate;
}

@keyframes error-glow-drift {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.08); }
}

.error-content {
  position: relative;
  max-width: 32rem;
}

/* The big number */
.error-number {
  font-size: clamp(8rem, 25vw, 20rem);
  font-weight: 100;
  letter-spacing: -0.06em;
  line-height: 0.85;
  margin-bottom: var(--space-4);
  background: linear-gradient(
    135deg,
    oklch(0.72 0.25 350),
    oklch(0.68 0.28 10),
    oklch(0.75 0.22 25),
    oklch(0.78 0.26 145),
    oklch(0.68 0.25 260),
    oklch(0.72 0.25 350)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: error-hue-shift 8s ease-in-out infinite;
}

@keyframes error-hue-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.error-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-3);
  margin-bottom: var(--space-6);
}

.error-message {
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--text-2);
  max-width: 32ch;
  margin: 0 auto var(--space-8);
  text-wrap: pretty;
}

/* CTA button */
.error-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-0);
  padding: var(--space-3) var(--space-8);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  transition: all var(--duration-normal) var(--ease-out-expo);

  &:hover {
    background: var(--text-0);
    color: var(--surface-0);
    border-color: var(--text-0);
    transform: translateY(-1px);
    box-shadow: 0 8px 32px oklch(0 0 0 / 0.4);
  }

  svg {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-fast);
  }
  &:hover svg { transform: translateX(-3px); }
}


}

/* Bottom bar */
.error-footer {
  padding: var(--space-6) clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border-subtle);
}
.error-footer-copy {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-weight: 200;

  a {
    color: var(--text-2);
    transition: color var(--duration-fast);

    &:hover { color: var(--text-0); }
  }
}
.error-footer-links {
  a {
    font-size: var(--text-xs);
    color: var(--text-3);
    transition: color var(--duration-fast);

    &:hover { color: var(--text-1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-glow { animation: none; opacity: 0.85; }
  .error-number { animation: none; background-position: 50% 50%; }
}
}
@layer page {
/* ============================================================
   LANDING
   Styles for the rich product landing page (splits variant).
   Full-viewport hero, alternating split sections with
   visual compositions, numbers band, and CTA.
   ============================================================ */

/* --- Hero (full viewport) --- */
.landing-hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--gutter);
  position: relative;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 100% 65% at 50% 40%, oklch(0.14 0.06 260 / 0.6) 0%, transparent 60%),
      radial-gradient(ellipse 50% 45% at 20% 65%, oklch(0.12 0.08 350 / 0.3) 0%, transparent 50%),
      radial-gradient(ellipse 50% 45% at 80% 55%, oklch(0.12 0.07 145 / 0.3) 0%, transparent 50%);
    pointer-events: none;
  }
}

/* Compact variant: keeps the big title but drops the full-viewport
   height so the content below sits within view. For hub pages that are
   not the homepage. */
.landing-hero.compact {
  min-height: 0;
  justify-content: flex-start;
  padding-block: calc(var(--nav-h) + var(--space-16)) var(--space-12);
}

.landing-hero-content {
  position: relative;
}
.landing-hero-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-2);
  margin-bottom: var(--space-8);

  /* Breadcrumb-style links: each segment ahead of the current page
     is a real <a>. Same visual rhythm as the original kicker, plus
     a hover affordance. */
  a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast);

    &:hover { color: var(--text-0); }
  }
}
.landing-hero-title {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 100;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-0);
  margin-bottom: clamp(1.5rem, 3vh, 3rem);

  em {
    font-style: normal;
    font-weight: 600;
    background: linear-gradient(135deg,
      oklch(0.78 0.28 350),
      oklch(0.82 0.26 55),
      oklch(0.80 0.26 145),
      oklch(0.75 0.28 260));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.landing-hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 300;
  color: var(--text-2);
  max-width: 34rem;
  margin: 0 auto clamp(2rem, 4vh, 4rem);
  text-wrap: balance;
}

/* Spectrum bar */
.landing-spectrum {
  display: flex;
  height: 3px;
  gap: 1px;
  margin-top: clamp(4rem, 8vh, 8rem);
  width: min(70%, 32rem);
  margin-inline: auto;

  span {
    flex: 1;
    border-radius: 2px;
  }
}

/* --- Split sections --- */
.landing-split {
  max-width: 80rem;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 12rem) var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 7rem);
  align-items: center;

  &.reverse {
    .landing-split-text { order: 2; }
    .landing-split-visual { order: 1; }
  }
}

.landing-split-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-text);
  margin-bottom: var(--space-4);
}
.landing-split-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 200;
  color: var(--text-0);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);

  strong { font-weight: 600; }
}
.landing-split-desc {
  color: var(--text-1);
  max-width: 30rem;
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
}

/* Visual side glow */
.landing-split-visual {
  position: relative;

  &::before {
    content: '';
    position: absolute;
    inset: -3rem;
    background: radial-gradient(
      ellipse 80% 70% at 50% 50%,
      oklch(from var(--accent) 0.12 0.06 h / 0.55) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
  }
  > * { position: relative; z-index: 1; }
}

/* --- Checklist --- */
.landing-checklist {
  list-style: none;
  margin-bottom: var(--space-8);

  li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-1);
  }
}
.landing-check {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  background: oklch(from var(--accent) l c h / 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-text);
  font-size: 0.65rem;
}

/* --- Code float --- */
.landing-code {
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1vw, 0.92rem);
  font-weight: 300;
  line-height: 2.2;
  color: var(--text-1);
  padding: var(--space-8) var(--space-6);
  background: oklch(from var(--accent) 0.07 0.006 h);
  border-radius: var(--radius-lg);
}

/* --- Color wheel (animated ring) --- */
.landing-wheel {
  width: clamp(280px, 100%, 400px);
  aspect-ratio: 1;
  position: relative;
  margin: 0 auto;
}
.landing-wheel-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    oklch(0.75 0.28 0), oklch(0.80 0.26 30), oklch(0.85 0.24 60),
    oklch(0.88 0.22 90), oklch(0.85 0.26 120), oklch(0.80 0.28 150),
    oklch(0.75 0.26 180), oklch(0.70 0.24 210), oklch(0.65 0.26 240),
    oklch(0.62 0.28 270), oklch(0.65 0.26 300), oklch(0.72 0.28 330),
    oklch(0.75 0.28 360));
  mask-image: radial-gradient(circle, transparent 58%, black 60%, black 84%, transparent 86%);
  -webkit-mask-image: radial-gradient(circle, transparent 58%, black 60%, black 84%, transparent 86%);
  animation: landing-wheel-spin 30s linear infinite;
}
@keyframes landing-wheel-spin { to { transform: rotate(360deg); } }
.landing-wheel-center {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-2);
  letter-spacing: 0.05em;
}
.landing-wheel-dots {
  position: absolute;
  inset: 0;
  animation: landing-dots-spin 20s linear infinite reverse;
}
@keyframes landing-dots-spin { to { transform: rotate(360deg); } }
.landing-wheel-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  box-shadow: 0 0 12px currentColor;
}

/* --- Palette strips --- */
.landing-palette {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.landing-palette-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
}
.landing-palette-strip {
  display: flex;
  gap: 2px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;

  span {
    flex: 1;
    transition: flex var(--duration-normal) var(--ease-out-expo);
  }
  &:hover span:nth-child(odd) { flex: 1.8; }
}

/* --- Contrast bars --- */
.landing-contrast {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.landing-contrast-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);

  .sample {
    font-size: var(--text-xl);
    font-weight: 400;
  }
  .score {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: var(--space-2);

    .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
    }
  }
}

/* --- Color mosaic --- */
.landing-mosaic {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
}
.landing-mosaic-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  transition: transform var(--duration-normal) var(--ease-out-expo);

  &:hover { transform: scale(1.2); z-index: 1; }
  &.wide { grid-column: span 2; aspect-ratio: 2/1; }
  &.tall { grid-row: span 2; aspect-ratio: auto; }
}

/* --- Feature icons --- */
.landing-feat-icons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}
.landing-feat-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 72px;

  span {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-2);
    text-align: center;
  }
}

/* --- Numbers band --- */
.landing-numbers {
  padding: clamp(3rem, 6vh, 5rem) var(--gutter);
  display: flex;
  justify-content: center;
  gap: clamp(3rem, 8vw, 10rem);
  flex-wrap: wrap;
}
.landing-num { text-align: center; }
.landing-num-value {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}
.landing-num-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  margin-top: var(--space-2);
}

/* --- CTA (full viewport) --- */
.landing-cta {
  min-height: 70dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(6rem, 14vh, 14rem) var(--gutter);
  position: relative;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 80% 60% at 50% 50%, oklch(0.10 0.05 145 / 0.4) 0%, transparent 60%),
      radial-gradient(ellipse 50% 40% at 30% 60%, oklch(0.08 0.06 260 / 0.25) 0%, transparent 50%);
    pointer-events: none;
  }

  h2 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 100;
    color: var(--text-0);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-4);

    strong { font-weight: 600; }
  }
  p {
    font-size: var(--text-lg);
    color: var(--text-2);
    margin-bottom: clamp(2rem, 4vh, 4rem);
    text-wrap: balance;
  }
}
.landing-cta-content { position: relative; }

/* --- Responsive --- */
@media (width <= 900px) {
  .landing-split { grid-template-columns: 1fr; gap: var(--space-12); }
  .landing-split.reverse .landing-split-text { order: 0; }
  .landing-split.reverse .landing-split-visual { order: 0; }
}
@media (width <= 600px) {
  .landing-numbers { gap: var(--space-8); }
  .landing-feat-icons { gap: var(--space-3); }
}
}
@layer page {
/* ============================================================
   LOGO PAGE
   The mark alone, centred, at display size. The wordmark sits
   top left where it always does. Nothing else on the page.
   ============================================================ */

body.ctx-logo {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Same position and sizing as the nav logo, without the nav. */
.logo-page-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--gutter);
  color: var(--text-0);
  text-decoration: none;

  .logo-mark     { height: 1.25rem; width: 1.25rem; }
  .logo-wordmark { height: 0.95rem; }
}

.logo-page {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--space-8) var(--gutter) var(--space-20);

  .logo-mark {
    inline-size: min(60vmin, 34rem);
    block-size: min(60vmin, 34rem);
  }
}
}
@layer page {
/* ============================================================
   MISC PAGES
   Styles for recipes, packages, sponsors, and other standalone
   pages.
   ============================================================ */

/* --- Filter pill ---
   Mono uppercase pill link. Last consumer: the "More:" topic row on
   the PHP index. Lived in blog.css until the blog filters were removed. */
.filter-pill {
  --fh: var(--hue-brand);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
  &:hover { color: oklch(0.80 0.24 var(--fh)); background: oklch(0.80 0.24 var(--fh) / 0.08); }
  &.active { color: oklch(0.06 0 0); background: oklch(0.80 0.24 var(--fh)); font-weight: 600; }
}

/* --- Recipes --- */
.recipe-card {
  position: relative;
  display: block;
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--duration-fast);

  &:hover {
    border-color: var(--border-default);
  }
}
.recipe-preview {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-1);
  background: var(--surface-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
  overflow-x: auto;
}

/* --- Packages --- */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6);
  padding: var(--space-8) var(--gutter);
  max-width: 72rem;
  margin-inline: auto;
}
.package-card {
  position: relative;
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.package-name {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-0);
  margin-bottom: var(--space-2);
}
.package-desc {
  font-size: var(--text-sm);
  color: var(--text-1);
  margin-bottom: var(--space-4);
}
.package-install {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-2);
  background: var(--surface-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  display: block;
}

/* --- Sponsor tiers --- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
  padding: var(--space-8) var(--gutter);
  max-width: 72rem;
  margin-inline: auto;
}
.tier-card {
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
}
.tier-price {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--text-0);
  margin-bottom: var(--space-1);
}
.tier-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: var(--space-4);
}
.tier-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
  margin-bottom: var(--space-6);

  li {
    font-size: var(--text-sm);
    color: var(--text-1);
    padding-left: var(--space-4);
    position: relative;

    &::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0.6em;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: var(--accent-text);
    }
  }
}

@media (width <= 768px) {
}
}
@layer page {
/* ============================================================
   PACKAGES
   Per-package cards (parsing / palette / contrast / gradient)
   plus a small dependency tree showing core + optional branches.
   Per-package hue (--pkg-hue) tints the LABEL only -- never a
   background or border.
   ============================================================ */

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}

.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-7);
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  transition: background var(--duration-fast);

  &:hover { background: var(--surface-2); }
}
.package-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.package-card__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(0.80 0.18 var(--pkg-hue, var(--hue-brand)));
}
.package-card__required {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.package-card__name {
  margin: 0;

  code {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--text-0);
    background: transparent;
    padding: 0;
  }
}
.package-card__desc {
  font-size: var(--text-sm);
  color: var(--text-1);
  line-height: 1.55;
  margin: 0;
}
.package-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.package-card__version { color: var(--text-3); }
.package-card__link {
  color: oklch(0.80 0.18 var(--pkg-hue, var(--hue-brand)));
  text-decoration: none;

  &:hover { color: oklch(0.88 0.20 var(--pkg-hue, var(--hue-brand))); }
}


/* Small dependency tree: core node up top, branches fanning below. */
.package-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: stretch;
}
.package-tree__core,
.package-tree__branch {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-1);
  border-radius: var(--radius-md);

  code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: oklch(0.85 0.16 var(--pkg-hue, var(--hue-brand)));
    background: transparent;
    padding: 0;
  }
}
.package-tree__core {
  align-self: center;
  min-width: 220px;
  justify-content: center;
}
.package-tree__branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}
}
@layer page {
.sitemap-page {
  width: 100%;
  max-width: calc(var(--space-24) * 10);

  h2 {
    color: var(--accent-text);
    font-size: var(--text-2xl);
    scroll-margin-block-start: calc(var(--nav-h) + var(--space-6));
  }

  a {
    text-decoration: none;

    &:hover {
      color: var(--accent-text);
    }
  }
}

.sitemap-sections {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sitemap-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--space-24) + var(--space-20))), 1fr));
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;

  li {
    min-width: 0;
  }

  a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
}
