/* ============================================================
   Faceoff Design System — CSS
   OKLCH color space · 8pt grid · Inter font · Cascade Layers
   Dark mode baseline · WCAG 2.2 accessible
   ============================================================ */

@charset "UTF-8";

@layer reset, base, tokens, components, utilities;

/* ── Google Fonts ──────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@6..144,100..900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ╔══════════════════════════════════════════╗
   ║  RESET                                  ║
   ╚══════════════════════════════════════════╝ */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  html {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
  }
  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  ul,
  ol {
    list-style: none;
    padding-left: 0;
  }
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }
  input,
  button,
  textarea,
  select {
    font: inherit;
  }
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }
  #root,
  #__next {
    isolation: isolate;
  }
}

/* ╔══════════════════════════════════════════╗
   ║  TOKENS                                 ║
   ╚══════════════════════════════════════════╝ */
@layer tokens {
  :root {
    /* ── Color: dark baseline ───────────────── */
    --bg-base: oklch(12% 0.04 265); /* #0A0E27 */
    --bg-surface: oklch(16% 0.05 265); /* #131836 */
    --bg-surface-highlight: oklch(21% 0.06 265); /* #1C2345 */
    --bg-overlay: oklch(10% 0.04 265 / 90%);

    /* ── Accents ──────────────────────────────── */
    --neon-cyan: oklch(90% 0.18 195); /* #00f5ff */
    --neon-coral: oklch(62% 0.25 5); /* #ff006e */
    --electric-purple: oklch(45% 0.18 295); /* #764ba2 */

    /* ── Text ───────────────────────────────── */
    --text-primary: oklch(97% 0.01 265); /* #FAFBFC */
    --text-secondary: oklch(68% 0.04 265); /* #94A3B8 */
    --text-muted: oklch(52% 0.03 265);

    /* ── Borders ────────────────────────────── */
    --border-light: rgba(255 255 255 / 8%);
    --border-medium: rgba(255 255 255 / 14%);

    /* ── Semantic ───────────────────────────── */
    --color-success: oklch(72% 0.18 145);
    --color-warning: oklch(80% 0.18 80);
    --color-error: oklch(60% 0.25 25);
    --color-info: oklch(78% 0.15 220);

    /* ── CTA gradient ───────────────────────── */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #00f5ff 0%, #764ba2 100%);
    --gradient-coral: linear-gradient(135deg, #ff006e 0%, #764ba2 100%);

    /* ── Spacing: 8pt grid ──────────────────── */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    --space-2xl: 64px;
    --space-3xl: 96px;

    /* ── Typography ─────────────────────────── */
    --font-body: "Google Sans Flex", "Inter", system-ui, -apple-system, sans-serif;
    --font-display: "Google Sans Flex", "Inter", system-ui, -apple-system, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    /* ── Radii ──────────────────────────────── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* ── Shadows ────────────────────────────── */
    --shadow-sm: 0 1px 2px rgba(0 0 0 / 30%);
    --shadow-md:
      0 4px 12px rgba(0 0 0 / 30%), inset 0 1px 1px rgba(255 255 255 / 12%);
    --shadow-lg: 0 8px 32px rgba(0 0 0 / 40%);
    --shadow-glow-cyan: 0 0 20px oklch(90% 0.18 195 / 30%);
    --shadow-glow-purple: 0 0 20px oklch(45% 0.18 295 / 40%);

    /* ── Transitions ────────────────────────── */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* ── Z-index ────────────────────────────── */
    --z-base: 0;
    --z-raised: 10;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-toast: 400;
  }

  /* Light mode (opt-in via data-theme or prefers-color-scheme) */
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
      --bg-base: #fafbfc;
      --bg-surface: #f1f5f9;
      --bg-surface-highlight: #e2e8f0;
      --text-primary: #0a0e27;
      --text-secondary: #475569;
      --text-muted: #94a3b8;
      --border-light: rgba(0 0 0 / 8%);
      --border-medium: rgba(0 0 0 / 14%);
    }
  }
}

/* ╔══════════════════════════════════════════╗
   ║  BASE                                   ║
   ╚══════════════════════════════════════════╝ */
@layer base {
  html {
    font-family: var(--font-body);
    font-optical-sizing: auto;
    font-size: 16px;
    color-scheme: dark light;
  }

  body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  main {
    flex: 1;
  }

  a {
    color: var(--neon-cyan);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
    &:focus-visible {
      outline: 2px solid var(--neon-cyan);
      outline-offset: 4px;
      border-radius: var(--radius-sm);
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    font-optical-sizing: auto;
  }

  h1 {
    font-size: var(--text-5xl);
    letter-spacing: -0.03em;
  }
  h2 {
    font-size: var(--text-4xl);
    letter-spacing: -0.02em;
  }
  h3 {
    font-size: var(--text-3xl);
    letter-spacing: -0.01em;
  }
  h4 {
    font-size: var(--text-2xl);
  }
  h5 {
    font-size: var(--text-xl);
  }
  h6 {
    font-size: var(--text-lg);
  }

  p {
    color: var(--text-secondary);
    max-width: 65ch;
    margin-inline: auto;
  }

  code,
  pre {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.9em;
  }

  pre {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    overflow-x: auto;
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ╔══════════════════════════════════════════╗
   ║  COMPONENTS                             ║
   ╚══════════════════════════════════════════╝ */
@layer components {
  /* ── Site Nav ──────────────────────────── */
  .site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(12px);

    &__brand {
      display: flex;
      align-items: center;
      text-decoration: none;
      flex-shrink: 0;

      img {
        display: block;
        height: 48px;
        width: auto;
      }
    }

    &__links {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      list-style: none;
      padding-left: 0;
    }

    &__link {
      color: var(--text-secondary);
      font-size: var(--text-sm);
      font-weight: 500;
      transition: color var(--transition-base);
      min-height: 24px;
      display: flex;
      align-items: center;

      &:hover {
        color: var(--text-primary);
      }
      &.active {
        color: var(--neon-cyan);
      }
    }
  }

  /* ── Buttons ───────────────────────────── */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition:
      transform var(--transition-base),
      box-shadow var(--transition-base),
      opacity var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    min-height: 24px;

    /* Sizes: 3:1 padding ratio */
    &--sm {
      padding: 8px 22px;
      font-size: var(--text-sm);
      border-radius: var(--radius-full);
      letter-spacing: 0.01em;
    }
    &--md {
      padding: 12px 32px;
      font-size: var(--text-base);
      border-radius: var(--radius-full);
      letter-spacing: 0.01em;
    }
    &--lg {
      padding: 15px 40px;
      font-size: var(--text-lg);
      border-radius: var(--radius-full);
      font-weight: 600;
      letter-spacing: 0.01em;
    }

    /* Variants */
    &--primary {
      background: var(--gradient-primary);
      color: white;
      box-shadow: var(--shadow-md);
    }
    &--cta {
      background: var(--gradient-accent);
      color: var(--bg-base);
      font-weight: 700;
      box-shadow: var(--shadow-glow-cyan);
    }
    &--coral {
      background: var(--gradient-coral);
      color: white;
      box-shadow: 0 4px 12px oklch(62% 0.25 5 / 40%);
    }
    &--ghost {
      background: transparent;
      color: var(--text-secondary);
      border: 1px solid var(--border-medium);
    }
    &--danger {
      background: var(--color-error);
      color: white;
    }

    /* States */
    &:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: var(--shadow-lg);
    }
    &:active:not(:disabled) {
      transform: scale(0.96);
    }
    &:focus-visible {
      outline: 2px solid currentColor;
      outline-offset: 4px;
    }
    &:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
  }

  /* ── Cards ─────────────────────────────── */
  .card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    background-image: linear-gradient(
      180deg,
      rgba(255 255 255 / 5%) 0%,
      rgba(255 255 255 / 1%) 100%
    );

    &--highlight {
      border-color: oklch(45% 0.18 295 / 40%);
      box-shadow: var(--shadow-glow-purple);
    }

    &--accent {
      border-color: oklch(90% 0.18 195 / 30%);
      box-shadow: var(--shadow-glow-cyan);
    }

    &__header {
      margin-bottom: var(--space-3);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    &__title {
      font-size: var(--text-lg);
      font-weight: 600;
    }

    &__body {
      color: var(--text-secondary);
    }
  }

  /* ── Bento Grid ────────────────────────── */
  .bento {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));

    &--dashboard {
      grid-template-columns: repeat(4, 1fr);
      grid-auto-rows: minmax(120px, auto);

      @container (max-width: 900px) {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    &__cell {
      background: var(--bg-surface);
      border: 1px solid var(--border-light);
      border-radius: var(--radius-lg);
      padding: var(--space-3);

      &--wide {
        grid-column: span 2;
      }
      &--tall {
        grid-row: span 2;
      }
      &--hero {
        grid-column: span 2;
        grid-row: span 2;
      }
    }
  }

  /* ── KPI Card ──────────────────────────── */
  .kpi {
    &__label {
      font-size: var(--text-xs);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin-bottom: var(--space-1);
    }

    &__value {
      font-size: var(--text-4xl);
      font-weight: 700;
      line-height: 1;
      background: var(--gradient-accent);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    &__sub {
      font-size: var(--text-sm);
      color: var(--text-secondary);
      margin-top: var(--space-1);
    }
  }

  /* ── Forms ─────────────────────────────── */
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;

    &:has(:invalid:not(:placeholder-shown)) {
      .form-group__label {
        color: var(--color-error);
      }
    }

    &__label {
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--text-secondary);
    }

    &__hint {
      font-size: var(--text-xs);
      color: var(--text-muted);
    }

    &__error {
      font-size: var(--text-xs);
      color: var(--color-error);
      display: none;
    }

    &:has([aria-invalid="true"]) .form-group__error {
      display: block;
    }
  }

  .input {
    width: 100%;
    padding: 10px var(--space-2);
    background: var(--bg-surface-highlight);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition:
      border-color var(--transition-base),
      box-shadow var(--transition-base);

    &::placeholder {
      color: var(--text-muted);
    }

    &:focus {
      outline: none;
      border-color: var(--neon-cyan);
      box-shadow: 0 0 0 3px oklch(90% 0.18 195 / 15%);
    }

    &:focus-visible {
      outline: 2px solid var(--neon-cyan);
      outline-offset: 2px;
    }

    &[aria-invalid="true"] {
      border-color: var(--color-error);
      box-shadow: 0 0 0 3px oklch(60% 0.25 25 / 15%);
    }
  }

  select.input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: var(--space-4);
  }

  textarea.input {
    resize: vertical;
    min-height: 120px;
  }

  /* ── Tables ────────────────────────────── */
  .table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
  }

  .table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);

    th,
    td {
      padding: var(--space-2);
      text-align: left;
    }
    th {
      background: var(--bg-surface-highlight);
      color: var(--text-secondary);
      font-weight: 600;
      text-transform: uppercase;
      font-size: var(--text-xs);
      letter-spacing: 0.06em;
    }
    td {
      border-bottom: 1px solid var(--border-light);
    }
    tr:last-child td {
      border-bottom: none;
    }
    tr:hover td {
      background: var(--bg-surface-highlight);
    }
  }

  /* ── Badges ────────────────────────────── */
  .badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);

    &--success {
      background: oklch(72% 0.18 145 / 15%);
      color: var(--color-success);
    }
    &--warning {
      background: oklch(80% 0.18 80 / 15%);
      color: var(--color-warning);
    }
    &--error {
      background: oklch(60% 0.25 25 / 15%);
      color: var(--color-error);
    }
    &--info {
      background: oklch(78% 0.15 220 / 15%);
      color: var(--color-info);
    }
    &--muted {
      background: var(--bg-surface-highlight);
      color: var(--text-muted);
    }
  }

  /* ── Alerts ────────────────────────────── */
  .alert {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    border-left: 3px solid;
    font-size: var(--text-sm);

    &--success {
      background: oklch(72% 0.18 145 / 10%);
      border-color: var(--color-success);
      color: var(--color-success);
    }
    &--warning {
      background: oklch(80% 0.18 80 / 10%);
      border-color: var(--color-warning);
      color: var(--color-warning);
    }
    &--error {
      background: oklch(60% 0.25 25 / 10%);
      border-color: var(--color-error);
      color: var(--color-error);
    }
    &--info {
      background: oklch(78% 0.15 220 / 10%);
      border-color: var(--color-info);
      color: var(--color-info);
    }
  }

  /* ── Modal / Glassmorphism ─────────────── */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    max-width: 520px;
    width: 90%;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: var(--z-modal);
  }

  /* ── Auth Box ──────────────────────────── */
  .auth-box {
    max-width: 440px;
    margin: var(--space-3xl) auto;
    padding: var(--space-8);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    background-image: linear-gradient(
      135deg,
      rgba(118 75 162 / 8%) 0%,
      rgba(0 245 255 / 4%) 100%
    );

    &__title {
      font-size: var(--text-2xl);
      font-weight: 700;
      margin-bottom: var(--space-2);
    }

    &__subtitle {
      color: var(--text-secondary);
      font-size: var(--text-sm);
      margin-bottom: var(--space-6);
    }

    &__form {
      display: flex;
      flex-direction: column;
      gap: var(--space-4);
    }

    &__divider {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      color: var(--text-muted);
      font-size: var(--text-xs);
      margin: var(--space-4) 0;

      &::before,
      &::after {
        content: "";
        flex: 1;
        border-top: 1px solid var(--border-light);
      }
    }

    &__sso {
      display: flex;
      gap: var(--space-2);
      flex-wrap: wrap;
    }
  }

  /* ── Page Header ───────────────────────── */
  .page-header {
    padding: var(--space-8) 0 var(--space-6);

    &__eyebrow {
      font-size: var(--text-xs);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--neon-cyan);
      margin-bottom: var(--space-2);
    }

    &__title {
      margin-bottom: var(--space-4);
    }

    &__sub {
      font-size: var(--text-lg);
      color: var(--text-secondary);
      max-width: 60ch;
    }
  }

  /* ── Container ─────────────────────────── */
  .container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--space-4);
  }

  .container--narrow {
    max-width: 800px;
  }
  .container--wide {
    max-width: 1440px;
  }

  /* ── Tabs ──────────────────────────────── */
  .tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-4);

    &__tab {
      padding: var(--space-2) var(--space-3);
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--text-secondary);
      border: none;
      background: none;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      transition:
        color var(--transition-base),
        border-color var(--transition-base);
      min-height: 24px;

      &.active,
      &[aria-selected="true"] {
        color: var(--neon-cyan);
        border-bottom-color: var(--neon-cyan);
      }

      &:hover:not(.active) {
        color: var(--text-primary);
      }
      &:focus-visible {
        outline: 2px solid var(--neon-cyan);
        outline-offset: 2px;
      }
    }
  }

  /* ── Sidebar Layout ────────────────────── */
  .with-sidebar {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 220px 1fr;
    align-items: start;

    @container (max-width: 768px) {
      grid-template-columns: 1fr;
    }
  }

  .sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-3);

    &__nav {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    &__link {
      display: flex;
      align-items: center;
      gap: var(--space-1);
      padding: 8px 12px;
      border-radius: var(--radius-md);
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--text-secondary);
      text-decoration: none;
      transition:
        background var(--transition-fast),
        color var(--transition-fast);
      min-height: 24px;

      &:hover {
        background: var(--bg-surface-highlight);
        color: var(--text-primary);
      }
      &.active {
        background: oklch(90% 0.18 195 / 10%);
        color: var(--neon-cyan);
      }
    }
  }

  /* ── Empty State ───────────────────────── */
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-8);
    text-align: center;
    color: var(--text-secondary);

    &__icon {
      font-size: 3rem;
      opacity: 0.4;
    }

    &__title {
      font-size: var(--text-xl);
      font-weight: 600;
      color: var(--text-primary);
    }

    &__body {
      font-size: var(--text-sm);
      max-width: 40ch;
    }
  }

  /* ── Loading shimmer ───────────────────── */
  .shimmer {
    background: linear-gradient(
      90deg,
      var(--bg-surface) 0%,
      var(--bg-surface-highlight) 50%,
      var(--bg-surface) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--radius-md);

    @media (prefers-reduced-motion: reduce) {
      animation: none;
      background: var(--bg-surface);
    }
  }

  @keyframes shimmer {
    0% {
      background-position: 200% center;
    }
    100% {
      background-position: -200% center;
    }
  }

  /* ── Pricing Cards ─────────────────────── */
  .pricing-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .pricing-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    position: relative;
    transition:
      transform var(--transition-slow),
      box-shadow var(--transition-slow);

    &:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-glow-purple);
    }

    &--featured {
      border-color: oklch(45% 0.18 295 / 60%);
      box-shadow: var(--shadow-glow-purple);

      &::before {
        content: "Most Popular";
        position: absolute;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--gradient-primary);
        color: white;
        font-size: var(--text-xs);
        font-weight: 700;
        padding: 2px 16px;
        border-radius: var(--radius-full);
        white-space: nowrap;
      }
    }

    &__name {
      font-size: var(--text-sm);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-secondary);
    }
    &__price {
      font-size: var(--text-5xl);
      font-weight: 700;
      line-height: 1;
    }
    &__period {
      font-size: var(--text-sm);
      color: var(--text-secondary);
    }
    &__features {
      flex: 1;
    }
    &__feature {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: var(--text-sm);
      color: var(--text-secondary);
      padding: 4px 0;
    }
    &__check {
      color: var(--color-success);
      flex-shrink: 0;
    }
  }

  /* ── Hero Section ──────────────────────── */
  .hero {
    padding: calc(var(--space-3xl) * 1.8) 0 calc(var(--space-3xl) * 1.4);
    text-align: center;
    position: relative;
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(
        ellipse 80% 60% at 50% -20%,
        oklch(45% 0.18 295 / 25%) 0%,
        transparent 70%
      );
      pointer-events: none;
    }

    &__eyebrow {
      display: inline-block;
      font-size: var(--text-xs);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      color: var(--neon-cyan);
      background: oklch(90% 0.18 195 / 10%);
      border: 1px solid oklch(90% 0.18 195 / 25%);
      padding: 4px 16px;
      border-radius: var(--radius-full);
      margin-bottom: var(--space-6);
    }

    &__title {
      font-family: var(--font-display);
      font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
      font-weight: 700;
      letter-spacing: -0.04em;
      line-height: 1.05;
      margin-bottom: var(--space-8);
    }

    &__gradient-text {
      background: var(--gradient-accent);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    &__sub {
      font-size: clamp(var(--text-lg), 2vw, var(--text-xl));
      color: var(--text-secondary);
      max-width: 52ch;
      line-height: 1.7;
      margin: 0 auto var(--space-8);
      text-align: center;
      display: block;
      width: 100%;
    }

    &__cta-group {
      display: flex;
      gap: var(--space-3);
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: var(--space-6);
    }

    &__social-proof {
      font-size: var(--text-xs);
      color: var(--text-muted);
      text-align: center;
      width: 100%;
      max-width: none;
    }
  }

  /* ── Footer ────────────────────────────── */
  .site-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
  }

  /* ── HTMX loading indicator ────────────── */
  .htmx-indicator {
    opacity: 0;
    transition: opacity var(--transition-base);
    &.htmx-request {
      opacity: 1;
    }
  }

  .htmx-request .htmx-indicator {
    opacity: 1;
  }

  /* ── Code block for API keys / output ──── */
  .code-block {
    background: var(--bg-base);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    font-family: "JetBrains Mono", monospace;
    font-size: var(--text-sm);
    color: var(--neon-cyan);
    word-break: break-all;
    position: relative;
  }

  /* ── View Transitions ──────────────────── */
  @view-transition {
    navigation: auto;
  }

  /* ── Scroll-driven progress ────────────── */
  @supports (animation-timeline: scroll()) {
    .scroll-progress {
      position: fixed;
      top: 0;
      left: 0;
      width: 0%;
      height: 3px;
      background: var(--gradient-accent);
      z-index: var(--z-toast);
      animation: progress-bar linear;
      animation-timeline: scroll();
      animation-range: 0% 100%;
    }

    @keyframes progress-bar {
      to {
        width: 100%;
      }
    }
  }
}

/* ╔══════════════════════════════════════════╗
   ║  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;
  }

  .flex {
    display: flex;
  }
  .grid {
    display: grid;
  }
  .block {
    display: block;
  }
  .hidden {
    display: none;
  }

  .gap-1 {
    gap: var(--space-1);
  }
  .gap-2 {
    gap: var(--space-2);
  }
  .gap-3 {
    gap: var(--space-3);
  }
  .gap-4 {
    gap: var(--space-4);
  }

  .items-center {
    align-items: center;
  }
  .justify-between {
    justify-content: space-between;
  }
  .justify-center {
    justify-content: center;
  }
  .flex-col {
    flex-direction: column;
  }
  .flex-wrap {
    flex-wrap: wrap;
  }

  .mt-1 {
    margin-top: var(--space-1);
  }
  .mt-2 {
    margin-top: var(--space-2);
  }
  .mt-3 {
    margin-top: var(--space-3);
  }
  .mt-4 {
    margin-top: var(--space-4);
  }
  .mb-2 {
    margin-bottom: var(--space-2);
  }
  .mb-3 {
    margin-bottom: var(--space-3);
  }
  .mb-4 {
    margin-bottom: var(--space-4);
  }

  .text-center {
    text-align: center;
  }
  .text-sm {
    font-size: var(--text-sm);
  }
  .text-xs {
    font-size: var(--text-xs);
  }
  .text-muted {
    color: var(--text-muted);
  }
  .text-secondary {
    color: var(--text-secondary);
  }
  .text-success {
    color: var(--color-success);
  }
  .text-error {
    color: var(--color-error);
  }
  .text-cyan {
    color: var(--neon-cyan);
  }

  .w-full {
    width: 100%;
  }
  .max-w-prose {
    max-width: 65ch;
  }

  .p-3 {
    padding: var(--space-3);
  }
  .p-4 {
    padding: var(--space-4);
  }
  .py-4 {
    padding-block: var(--space-4);
  }
  .py-6 {
    padding-block: var(--space-6);
  }

  .rounded {
    border-radius: var(--radius-md);
  }
  .rounded-lg {
    border-radius: var(--radius-lg);
  }

  .border {
    border: 1px solid var(--border-light);
  }

  .font-mono {
    font-family: "JetBrains Mono", monospace;
  }
  .font-bold {
    font-weight: 700;
  }
  .font-semibold {
    font-weight: 600;
  }

  /* ── Explicit nav list reset (belt + suspenders) ───── */
  .site-nav__links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    padding-inline-start: 0;
    max-width: none;
    margin-inline: 0;
  }
  .site-nav__links > li {
    list-style: none;
  }

  /* ── Auth box paragraph fix ───────────────── */
  .auth-box__subtitle {
    max-width: none;
    margin-inline: 0;
  }

  /* ── Card body paragraph fix ─────────────── */
  .card__body {
    max-width: none;
    margin-inline: 0;
  }

  /* ── Button variant overrides (flat selectors guarantee nesting resolves) ── */
  .btn--sm   { padding: 8px 22px;  font-size: var(--text-sm);  border-radius: var(--radius-full); }
  .btn--md   { padding: 12px 32px; font-size: var(--text-base); border-radius: var(--radius-full); }
  .btn--lg   { padding: 15px 40px; font-size: var(--text-lg);  border-radius: var(--radius-full); font-weight: 600; }

  .btn--primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
  }
  .btn--cta {
    background: var(--gradient-accent);
    color: var(--bg-base);
    font-weight: 700;
    box-shadow: var(--shadow-glow-cyan);
  }
  .btn--coral {
    background: var(--gradient-coral);
    color: white;
    box-shadow: 0 4px 12px oklch(62% 0.25 5 / 40%);
  }
  .btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
  }
  .btn--danger {
    background: var(--color-error);
    color: white;
  }

  .btn--cta:hover:not(:disabled),
  .btn--primary:hover:not(:disabled) {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
  }
}
