/* Alloy Documentation
   Liquid layout · light-dark() theming · CSS nesting · @layer · CSS grid */

@layer reset, tokens, base, layout, components, web-awesome, utilities;

/* ── Layer: reset ────────────────────────────────── */

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    height: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

/* ── Layer: tokens ───────────────────────────────── */

@layer tokens {
  :root {
    color-scheme: light dark;

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-xs: 0.8rem;
    --font-size-lg: 1.15rem;
    --font-size-h1: 2rem;
    --font-size-h2: 1.5rem;
    --font-size-h3: 1.2rem;
    --font-size-hero: 2.75rem;
    --font-size-logo: 1.5rem;
    --line-height: 1.6;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 5rem;

    /* Radii */
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;

    /* Layout */
    --sidebar-width: 280px;
    --toc-width: 220px;
    --content-max-width: 1440px;
    --header-height: 54px;

    /* Shadows */
    --shadow-btn: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-btn-hover: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);

    /* Colors — all via light-dark() */
    --color-bg: light-dark(#ffffff, #18181b);
    --color-text: light-dark(#1a1a2e, #e4e4e7);
    --color-text-muted: light-dark(#6b7280, #a1a1aa);
    --color-text-faint: light-dark(#6b7280, #71717a);
    --color-primary: light-dark(#2563eb, #60a5fa);
    --color-primary-hover: light-dark(#1d4ed8, #93bbfd);
    --color-primary-subtle: light-dark(rgba(37, 99, 235, 0.25), rgba(96, 165, 250, 0.25));
    --color-border: light-dark(#e5e7eb, #2e2e33);
    --color-border-strong: light-dark(#d1d5db, #3f3f46);
    --color-surface: light-dark(#f9fafb, #1c1c20);
    --color-code-bg: light-dark(#f3f4f6, #27272a);
    --color-code-block-bg: light-dark(#f3f4f6, #1e1e22);
    --color-blockquote: light-dark(#4b5563, #a1a1aa);

    /* alloy-code component theming */
    --alloy-code-bg: light-dark(#f6f8fa, #0d1117);
    --alloy-code-color: light-dark(#1f2328, #e4e4e7);
    --alloy-code-header-bg: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.05));
    --alloy-code-border: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));

    /* v2 landing page */
    --color-primary-light: light-dark(#3b82f6, #93c5fd);
    --color-text-heading: light-dark(#1e293b, #e4e4e7);
    --color-slate: light-dark(#64748b, #475569);
  }
}

/* ── Layer: base ─────────────────────────────────── */

@layer base {
  body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background: var(--color-bg);
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: max-content;
    overflow-wrap: break-word;
  }

  a {
    color: var(--color-primary);
    text-decoration-line: underline;
    text-decoration-style: dashed;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--color-text-muted);
    text-underline-offset: max(5px, 0.28em);
    transition: text-decoration-color 0.15s ease, text-underline-offset 0.15s ease;

    &:hover {
      text-decoration-style: solid;
      text-decoration-color: var(--color-primary);
      text-underline-offset: max(6px, 0.32em);
    }

    &:visited {
      color: var(--color-primary);
    }
  }

  img {
    max-width: 100%;
    height: auto;
  }

  code {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    background: var(--color-code-bg);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
  }

  pre {
    background: var(--color-code-block-bg);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: var(--space-lg);
    line-height: 1.5;

    & code {
      background: none;
      padding: 0;
      font-size: 0.85rem;
      white-space: pre;
    }
  }

  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);

    & th, & td {
      padding: var(--space-sm) 0.75rem;
      border: 1px solid var(--color-border);
      text-align: left;
      font-size: var(--font-size-sm);
    }

    & th {
      background: var(--color-code-bg);
      font-weight: 600;
    }
  }

  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Layer: layout ───────────────────────────────── */

@layer layout {
  .site-header {
    padding: var(--space-md);
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 100;

    @media (min-width: 769px) {
      padding: var(--space-md) var(--space-xl);
    }
  }

  .top-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);

    @media (min-width: 769px) {
      gap: var(--space-xl);
    }
  }

  .docs-layout {
    display: grid;
    grid-template-columns: 1fr;

    @media (min-width: 769px) {
      grid-template-columns: var(--sidebar-width) 1fr;
    }

    @media (min-width: 1025px) {
      grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
    }
  }

  .toc-sidebar {
    display: none;
    padding: var(--space-xl) var(--space-lg);

    @media (min-width: 1025px) {
      display: block;
      position: sticky;
      top: var(--header-height);
      height: calc(100vh - var(--header-height));
      overflow-y: auto;
    }
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: var(--space-lg);
    padding-top: var(--space-md);
    border-right: 1px solid var(--color-border);
    background: var(--color-surface);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 200;

    &.open {
      transform: translateX(0);
    }

    @media (min-width: 769px) {
      position: sticky;
      top: var(--header-height);
      height: calc(100vh - var(--header-height));
      transform: none;
      transition: none;
      z-index: auto;
      padding-top: var(--space-lg);
    }
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;

    &.open {
      display: block;
    }

    @media (min-width: 769px) {
      display: none !important;
    }
  }

  .content {
    padding: var(--space-lg);
    min-width: 0;

    @media (min-width: 769px) {
      padding: var(--space-xl) var(--space-2xl);
    }

    & article {
      max-width: var(--content-max-width);

      & h1 {
        font-size: var(--font-size-h1);
        margin-bottom: var(--space-md);
      }

      & h2 {
        font-size: var(--font-size-h2);
        margin-top: var(--space-2xl);
        margin-bottom: 0.75rem;
      }

      & h3 {
        font-size: var(--font-size-h3);
        margin-top: var(--space-xl);
        margin-bottom: var(--space-sm);
      }

      & p {
        margin-bottom: var(--space-md);
      }

      & ul, & ol {
        margin-bottom: var(--space-md);
        padding-left: var(--space-lg);
      }

      & li {
        margin-bottom: var(--space-xs);
      }

      & blockquote {
        border-left: 4px solid var(--color-border-strong);
        padding: var(--space-xs) var(--space-md);
        margin: 0 0 var(--space-md) 0;
        color: var(--color-blockquote);
        font-style: italic;
      }

      & hr {
        border: none;
        border-top: 1px solid var(--color-border);
        margin: var(--space-xl) 0;
      }
    }
  }

  .page-content {
    padding: var(--space-lg);

    @media (min-width: 769px) {
      padding: var(--space-xl) var(--space-2xl);
    }
  }

  .site-footer {
    text-align: center;
    padding: var(--space-xl) var(--space-2xl);
    color: var(--color-text-faint);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-border);

    & a {
      color: var(--color-text-faint);
    }
  }
}

/* ── Layer: components ───────────────────────────── */

@layer components {
  .logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-logo);
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;

    &:hover {
      text-decoration: none;
    }

    & .logo-icon {
      width: 48px;
      height: auto;
      fill: light-dark(black, white);
    }
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;

    @media (min-width: 769px) {
      display: none;
    }
  }

  .nav-links {
    display: flex;
    gap: var(--space-md);
    margin-left: auto;

    @media (min-width: 769px) {
      gap: var(--space-xl);
    }

    & a {
      color: var(--color-text-muted);
      font-size: 0.95rem;
      text-decoration: none;

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

    & .nav-text-link {
      @media (max-width: 379px) {
        display: none;
      }
    }

    & .github-link {
      display: flex;
      align-items: center;
      gap: var(--space-xs);
    }

    & .latest-release {
      display: none;
      font-size: 0.75rem;
      font-weight: 600;
      padding: 0.1em 0.5em;
      border-radius: var(--radius-sm);
      border: 1px solid var(--color-border);

      @media (min-width: 480px) {
        display: inline;
      }
    }
  }

  .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    line-height: 1;
    padding: var(--space-xs) var(--space-sm);
    margin-left: auto;
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-md);
    -webkit-tap-highlight-color: transparent;

    &:hover {
      color: var(--color-text);
      background: var(--color-code-bg);
    }

    @media (min-width: 769px) {
      display: none;
    }
  }

  .sidebar-nav {
    & h3 {
      font-size: var(--font-size-xs);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--color-text-faint);
      margin-top: var(--space-lg);
      margin-bottom: var(--space-sm);

      &:first-child {
        margin-top: 0;
      }

      & a {
        color: inherit;
        text-decoration: none;
      }
    }

    & ul {
      list-style: none;
    }

    & li {
      margin-bottom: 0.125rem;

      & a {
        display: block;
        padding: var(--space-xs) 0.75rem;
        border-radius: var(--radius-md);
        color: var(--color-text);
        font-size: var(--font-size-sm);
        text-decoration: none;

        &:hover {
          background: var(--color-code-bg);
        }
      }
    }
  }

  .toc-nav {
    & h3 {
      font-size: var(--font-size-xs);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--color-text-faint);
      margin-bottom: var(--space-sm);
    }

    & ul {
      list-style: none;
      border-left: 2px solid var(--color-border);
    }

    & li a {
      display: block;
      padding: var(--space-xs) 0.75rem;
      font-size: var(--font-size-sm);
      color: var(--color-text-muted);
      text-decoration: none;
      border-left: 3px solid transparent;
      margin-left: -2px;
      transition: color 0.15s ease, border-left-color 0.15s ease;

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

      &.active {
        color: var(--color-primary);
        border-left-color: var(--color-primary);
      }
    }

    & .toc-child a {
      padding-left: 1.5rem;
    }
  }

  .btn {
    display: inline-block;
    padding: 0.6rem var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: all 0.15s ease;

    &:hover {
      text-decoration: none;
      transform: translateY(-1px);
    }
  }

  .btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-btn);

    &:hover {
      background: var(--color-primary-hover);
      color: #fff;
      box-shadow: var(--shadow-btn-hover);
    }
  }

  .btn-secondary {
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
    background: transparent;

    &:hover {
      background: var(--color-code-bg);
      color: var(--color-text);
    }
  }

  .landing-page {
    & .menu-toggle {
      display: none;
    }

    & .hero {
      position: relative;
      width: 100% !important;
      padding: 6rem 1rem 4rem !important;
      overflow: hidden;
      isolation: isolate;

      @media (min-width: 769px) {
        padding: 8rem 2rem 6rem !important;
      }
    }
  }

  .hero-logo {
    display: block;
    margin: 0 auto var(--space-sm);
    width: 128px;
    height: auto;
    fill: light-dark(black, white);
  }

  /* ── Landing ──────────────────────────────────────── */

  .hero-bg {
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
      radial-gradient(ellipse 80% 60% at 20% 40%, color-mix(in srgb, var(--color-primary) 15%, transparent), transparent),
      radial-gradient(ellipse 60% 50% at 80% 30%, color-mix(in srgb, var(--color-slate) 15%, transparent), transparent),
      radial-gradient(ellipse 70% 40% at 50% 80%, color-mix(in srgb, var(--color-primary) 8%, transparent), transparent);
  }

  .hero-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
      linear-gradient(color-mix(in srgb, var(--color-primary) 5%, transparent) 1px, transparent 1px),
      linear-gradient(90deg, color-mix(in srgb, var(--color-primary) 5%, transparent) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  }

  .hero-lines {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    animation: linesSwing 36s ease-in-out infinite;
    transform-origin: center center;

    &::before,
    &::after {
      content: '';
      position: absolute;
      width: 200%;
      height: 1px;
      background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-primary) 15%, transparent), transparent);
    }

    &::before {
      top: 35%;
      left: -50%;
    }

    &::after {
      top: 65%;
      left: -50%;
    }
  }

  @keyframes linesSwing {
    0% { transform: rotate(-12deg) translateX(0); }
    25% { transform: rotate(-9deg) translateX(15px); }
    50% { transform: rotate(-14deg) translateX(5px); }
    75% { transform: rotate(-10deg) translateX(-10px); }
    100% { transform: rotate(-12deg) translateX(0); }
  }

  .hero-inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;

    & .hero-logo {
      width: 96px;
      margin-bottom: var(--space-lg);
      filter: drop-shadow(0 0 30px color-mix(in srgb, var(--color-primary) 30%, transparent));
      animation: logoPulse 4s ease-in-out infinite;
    }
  }

  @keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 30px color-mix(in srgb, var(--color-primary) 30%, transparent)); }
    50% { filter: drop-shadow(0 0 50px color-mix(in srgb, var(--color-primary) 50%, transparent)); }
  }

  .hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--color-text-heading) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    @media (min-width: 769px) {
      font-size: 3.5rem;
    }
  }

  .hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 560px;
    margin-inline: auto;

    @media (min-width: 769px) {
      font-size: 1.2rem;
    }
  }

  .hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;

    & .btn-primary {
      background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
      border: none;
      padding: 0.75rem 2rem;
      font-size: 1rem;
      border-radius: var(--radius-lg);
      box-shadow: 0 4px 15px color-mix(in srgb, var(--color-primary) 30%, transparent);
      transition: all 0.2s ease;

      &:hover {
        box-shadow: 0 6px 25px color-mix(in srgb, var(--color-primary) 45%, transparent);
        transform: translateY(-2px);
      }
    }

    & .btn-secondary {
      padding: 0.75rem 2rem;
      font-size: 1rem;
      border-radius: var(--radius-lg);
      border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
      background: light-dark(rgba(255, 255, 255, 0.8), transparent);
      color: var(--color-text-heading);

      &:hover {
        background: light-dark(var(--color-bg), var(--color-code-bg));
        border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
      }
    }
  }

  .speed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-lg);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 500;

    & svg {
      width: 14px;
      height: 14px;
      fill: currentColor;
    }
  }

  .features {
    padding: var(--space-2xl) 1rem var(--space-3xl);
    max-width: 1280px;
    margin: 0 auto;

    @media (min-width: 769px) {
      padding: var(--space-3xl) 2rem var(--space-4xl);
    }
  }

  .features-heading {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;

    @media (min-width: 769px) {
      font-size: 2rem;
    }
  }

  .features-sub {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2xl);
    font-size: 1.05rem;
  }

  .features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;

    @media (min-width: 600px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (min-width: 900px) {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .feature-card {
    padding: 2.25rem 2rem;
    background: var(--color-bg);
    transition: background 0.2s ease;

    &:hover {
      background: var(--color-surface);
    }

    & h3 {
      font-size: 1.1rem;
      font-weight: 600;
      margin-bottom: 0.5rem;
      letter-spacing: -0.01em;
    }

    & p {
      font-size: 0.95rem;
      color: var(--color-text-muted);
      line-height: 1.6;
      margin: 0;
    }
  }

  .feature-card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: var(--color-primary);

    & svg {
      width: 20px;
      height: 20px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
  }

  .install {
    padding: var(--space-2xl) 1rem var(--space-4xl);
    max-width: 640px;
    margin: 0 auto;
    text-align: center;

    & h2 {
      font-size: 1.6rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      letter-spacing: -0.02em;
    }

    & .install-sub {
      color: var(--color-text-muted);
      margin-bottom: var(--space-lg);
    }
  }

  .terminal {
    background: var(--alloy-code-bg);
    border: 1px solid light-dark(rgba(0, 0, 0, 0.1), color-mix(in srgb, var(--color-primary) 15%, transparent));
    border-radius: 10px;
    overflow: hidden;
    text-align: left;
    margin-bottom: var(--space-lg);

    & pre {
      margin: 0;
      padding: 1.25rem 1.5rem;
      background: transparent;
      color: var(--alloy-code-color);
      font-size: 0.9rem;
      line-height: 1.8;
      border-radius: 0;
    }

    & code {
      background: none;
      padding: 0;
      color: inherit;
      font-size: inherit;
    }

    & .prompt {
      color: var(--color-primary);
      user-select: none;
    }
  }

  .terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.03));
    border-bottom: 1px solid light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.06));
  }

  .terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.15));
  }

  .install-links {
    font-size: 0.9rem;
    color: var(--color-text-muted);

    & a {
      color: var(--color-primary);
    }
  }

  /* ── Releases ─────────────────────────────────────── */

  .release-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);

    @media (min-width: 480px) {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .release-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    text-decoration: none;
    color: var(--color-text-heading);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: background 0.15s ease, border-color 0.15s ease;

    &:hover {
      text-decoration: none;
      background: var(--color-code-bg);
      border-color: var(--color-border-strong);
    }

    & svg {
      width: 24px;
      height: 24px;
      fill: none;
      stroke: var(--color-primary);
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
  }

  .release-tile-label {
    font-weight: 600;
    font-size: var(--font-size-lg);
    letter-spacing: -0.01em;
  }

  .release-entry {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--color-border);

    &:first-of-type {
      padding-top: 0;
    }

    &:last-child {
      border-bottom: none;
    }

    & h2 {
      margin-top: 0 !important;
      display: inline;
      font-size: var(--font-size-h2);
    }

    & time {
      display: block;
      color: var(--color-text-faint);
      font-size: var(--font-size-sm);
      margin: var(--space-xs) 0 var(--space-sm);
    }
  }

  .release-entry-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    flex-wrap: wrap;
  }

  .release-badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    background: var(--color-surface);
  }

  .release-badge-latest {
    border-color: var(--color-primary-subtle);
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  }

  .release-github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
  }

  #hero-shader {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    mix-blend-mode: screen;
    pointer-events: none;

    @media (prefers-color-scheme: light) {
      opacity: 0.2;
      mix-blend-mode: soft-light;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero-inner .hero-logo,
    .hero-lines {
      animation: none !important;
    }

    #hero-shader {
      display: none;
    }
  }
}

/* ── Layer: web-awesome ──────────────────────────── */

@layer web-awesome {
  alloy-code:not(:defined) {
    display: block;
    position: relative;
    margin-bottom: var(--space-lg, 1.5rem);

    & pre {
      margin: 0;
      padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
      border-radius: var(--radius-lg, 6px);
      line-height: 1.5;
      font-size: 0.85rem;
      background: var(--alloy-code-bg, #0d1117);
      color: var(--alloy-code-color, #e4e4e7);
      overflow-x: auto;
    }
  }

  .shiki,
  .shiki span {
    color: light-dark(var(--shiki-light), var(--shiki-dark));
    font-style: light-dark(var(--shiki-light-font-style, inherit), var(--shiki-dark-font-style, inherit));
    text-decoration: light-dark(var(--shiki-light-text-decoration, none), var(--shiki-dark-text-decoration, none));
  }

  wa-tab-group {
    --indicator-color: var(--color-primary);
    --track-color: transparent;

    &::part(tabs) {
      border-bottom: none;
    }
  }

  wa-tab {
    &::part(base) {
      color: var(--color-text-muted);
    }

    &[active]::part(base) {
      color: var(--color-primary);
    }
  }
}

/* ── Layer: utilities ────────────────────────────── */

@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
