/* beamize.app: one stylesheet for every page.
   Dark only (night lab). No inline styles anywhere, so the CSP can stay at style-src 'self'.
   Kickers stay in sentence case: Apple names must never be set in capitals. */

@layer reset, tokens, base, layout, components, pages;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
  ul[class], ol[class] { padding: 0; list-style: none; }
  img, svg, video { display: block; max-width: 100%; height: auto; }
  button, input, select { font: inherit; color: inherit; }
}

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

    --night-0: #090A22;
    --night-1: #0E0C2B;
    --night-2: #1F1A63;
    --ink: #141235;

    --indigo: #4D45E6;
    --indigo-deep: #332E9E;
    --cyan: #7AD3F7;
    --accent: #7FD9FA;
    --beam: #59D9FF;

    --text: #F4F4FA;
    --text-soft: #C9C8E0;
    --text-mute: #9C9AC0;
    --warn: #FFC861;

    --glass: rgba(255, 255, 255, .05);
    --glass-strong: rgba(255, 255, 255, .08);
    --line: rgba(255, 255, 255, .10);

    --radius-s: 12px;
    --radius-m: 20px;
    --radius-l: 28px;

    --container: 1200px;
    --prose: 68ch;
    --gutter: 16px;
    --section: clamp(72px, 10vw, 140px);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-apple: cubic-bezier(.32, .72, 0, 1);
  }
  @media (min-width: 600px) { :root { --gutter: 24px; } }
}

@layer base {
  html { scroll-padding-top: 88px; }
  body {
    min-height: 100vh;
    background: var(--night-0);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.08;
    text-wrap: balance;
  }
  p, li, dd { text-wrap: pretty; }
  a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  code, kbd { font-family: var(--font-mono); font-size: .92em; }
  strong { color: var(--text); font-weight: 650; }
  hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
  .nowrap { white-space: nowrap; }
  .visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .skip-link {
    position: absolute; left: var(--gutter); top: -100px; z-index: 100;
    padding: 10px 16px; border-radius: var(--radius-s);
    background: var(--cyan); color: var(--ink); font-weight: 650; text-decoration: none;
  }
  .skip-link:focus { top: 12px; }
}

@layer layout {
  .container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
  .prose-container { width: min(100% - 2 * var(--gutter), var(--prose)); margin-inline: auto; }
  .section { padding-block: var(--section); }
  .section + .section { padding-top: 0; }
}

@layer components {
  /* Header */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(9, 10, 34, .78);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--line);
  }
  .site-header .container { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; }
  @media (min-width: 860px) { .site-header .container { gap: 24px; } }
  .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
  .brand img { width: 32px; height: 32px; }
  .nav { display: none; margin-left: auto; gap: 4px; }
  .nav a { color: var(--text-soft); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .9375rem; }
  .nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--glass); }
  .header-cta { margin-left: auto; gap: 0; }
  @media (min-width: 860px) {
    .nav { display: flex; }
    .header-cta { margin-left: 8px; }
    .menu { display: none; }
  }
  /* The panel hangs from the header's right edge, not from the button, so it never leaves the screen. */
  .menu { position: static; }
  .menu summary {
    list-style: none; cursor: pointer; padding: 10px 14px; min-height: 44px;
    border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-size: .9375rem;
  }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] summary { background: var(--glass-strong); }
  .menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); width: min(100%, 320px);
    display: grid; padding: 8px; border-radius: var(--radius-m);
    background: var(--night-1); border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  }
  .menu-panel a { color: var(--text); text-decoration: none; padding: 12px 14px; border-radius: var(--radius-s); }
  .menu-panel a:hover { background: var(--glass); }
  @media (max-width: 420px) { .header-cta .btn-label-long { display: none; } }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 20px; border-radius: 999px;
    font-weight: 650; font-size: 1rem; text-decoration: none; white-space: nowrap;
    transition: transform .3s var(--ease-out), background-color .3s var(--ease-out);
  }
  .btn:hover { text-decoration: none; transform: translateY(-1px); }
  .btn-primary { background: var(--cyan); color: var(--ink); }
  .btn-primary:hover { background: #A2E2FA; }
  .btn-glass { background: var(--glass-strong); color: var(--text); border: 1px solid var(--line); }
  .btn-glass:hover { background: rgba(255, 255, 255, .12); }
  .btn-small { min-height: 40px; padding: 8px 16px; font-size: .9375rem; }

  /* Kickers, chips, lede */
  .kicker { color: var(--accent); font-weight: 650; font-size: .9375rem; letter-spacing: 0; margin-bottom: 14px; }
  .lede { color: var(--text-soft); font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.5; max-width: 40em; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px; font-size: .875rem;
    color: var(--text-soft); background: var(--glass); border: 1px solid var(--line);
  }

  /* Section heads */
  .section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
  .section-head h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
  .section-head p { color: var(--text-soft); margin-top: 16px; font-size: 1.125rem; }
  .section-head.center { margin-inline: auto; text-align: center; }

  /* Cards */
  .grid { display: grid; gap: 16px; }
  @media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
  .card {
    position: relative; padding: 28px; border-radius: var(--radius-l);
    background: var(--glass); border: 1px solid var(--line);
  }
  .card h3 { font-size: 1.375rem; margin-bottom: 10px; }
  .card p { color: var(--text-soft); }
  .card p + p, .callout p + p { margin-top: 10px; }
  .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
  .section-head.center + .cta-row, .center .cta-row { justify-content: center; }
  .card .badge { position: absolute; top: 24px; right: 24px; }
  .badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .8125rem; font-weight: 650; color: var(--ink); background: var(--cyan);
  }
  .icon-tile {
    display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px;
    border-radius: 14px; background: var(--night-2); color: var(--accent);
  }
  .icon-tile svg { width: 26px; height: 26px; }

  /* Tables (two interfaces, prices) */
  .table-wrap { overflow-x: auto; border-radius: var(--radius-m); border: 1px solid var(--line); }
  table { width: 100%; border-collapse: collapse; font-size: 1rem; }
  th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
  thead th { color: var(--text-mute); font-weight: 600; font-size: .875rem; background: var(--glass); }
  tbody tr:last-child td { border-bottom: 0; }
  td code { color: var(--accent); }

  /* Pricing */
  .plans { display: grid; gap: 16px; align-items: stretch; }
  @media (min-width: 760px) { .plans { grid-template-columns: repeat(2, 1fr); } }
  .plan { display: flex; flex-direction: column; padding: 32px; border-radius: var(--radius-l); background: var(--glass); border: 1px solid var(--line); }
  .plan.featured { background: var(--indigo-deep); border-color: rgba(127, 217, 250, .35); }
  .plan h3 { font-size: 1.5rem; }
  .plan .price { font-family: var(--font-display); font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; margin: 16px 0 4px; }
  .plan .price small { font-size: 1rem; font-weight: 500; color: var(--text-soft); letter-spacing: 0; }
  .plan .price-note { color: var(--text-soft); font-size: .9375rem; }
  .plan ul { margin: 20px 0 28px; padding: 0; list-style: none; display: grid; gap: 10px; }
  .plan li { position: relative; padding-left: 28px; color: var(--text); }
  .plan li::before {
    content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 9px;
    border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
  }
  .plan .btn { margin-top: auto; align-self: flex-start; }
  .plan-terms { color: var(--text-soft); font-size: .9375rem; margin-top: 20px; max-width: 72ch; }
  .beta-note { margin-top: 12px; color: var(--accent); font-size: .9375rem; }

  /* FAQ */
  .faq { display: grid; gap: 12px; max-width: 860px; }
  .faq details { border-radius: var(--radius-m); background: var(--glass); border: 1px solid var(--line); }
  .faq summary {
    cursor: pointer; list-style: none; padding: 20px 56px 20px 24px; position: relative;
    font-weight: 650; font-size: 1.0625rem; min-height: 44px;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after {
    content: ""; position: absolute; right: 26px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
    border-right: 2px solid var(--text-soft); border-bottom: 2px solid var(--text-soft);
    transform: rotate(45deg); transition: transform .3s var(--ease-out);
  }
  .faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
  .faq details > div { padding: 0 24px 22px; color: var(--text-soft); }
  .faq details > div p + p { margin-top: 10px; }

  /* Callouts */
  .callout { padding: 20px 24px; border-radius: var(--radius-m); background: var(--glass); border: 1px solid var(--line); }
  .callout-title { font-weight: 650; margin-bottom: 6px; }
  .callout.note { border-color: rgba(127, 217, 250, .35); }
  .callout.warn { border-color: rgba(255, 200, 97, .45); }
  .callout.warn .callout-title { color: var(--warn); }

  /* Footer */
  .site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; color: var(--text-soft); font-size: .9375rem; }
  .footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(2, 1fr); }
  @media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
  .footer-brand { grid-column: 1 / -1; }
  @media (min-width: 760px) { .footer-brand { grid-column: auto; } }
  .footer-brand p { margin-top: 12px; max-width: 30ch; }
  .footer-col h2 { font-size: .9375rem; font-family: var(--font); letter-spacing: 0; color: var(--text); margin-bottom: 12px; }
  .footer-col ul { display: grid; gap: 8px; padding: 0; list-style: none; }
  .footer-col a { color: var(--text-soft); text-decoration: none; }
  .footer-col a:hover { color: var(--text); text-decoration: underline; }
  .footer-legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 8px; color: var(--text-mute); font-size: .875rem; }
}

@layer pages {
  /* Home hero */
  .hero { position: relative; padding: clamp(48px, 9vw, 120px) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
  .hero::before {
    content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none;
    background: radial-gradient(60% 50% at 50% 30%, rgba(77, 69, 230, .35), transparent 70%);
  }
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
  @media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); } }
  .hero + .section { padding-top: clamp(40px, 6vw, 80px); }
  .hero h1 { font-size: clamp(2.5rem, 6.2vw, 4.25rem); margin-bottom: 22px; }
  @media (min-width: 980px) { .hero h1 { font-size: clamp(3rem, 4.6vw, 4.25rem); } }
  .hero h1 .line2 { color: var(--accent); }
  .hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 16px; }
  .hero .requirements { color: var(--text-mute); font-size: .9375rem; }
  .hero .chips { margin-top: 28px; }

  .stage { position: relative; display: grid; gap: 16px; }
  .stage-panel {
    position: relative; border-radius: var(--radius-l); overflow: hidden;
    background: #000; border: 1px solid var(--line);
    box-shadow: 0 40px 100px rgba(0, 0, 0, .55), 0 0 0 1px rgba(127, 217, 250, .06);
  }
  .stage-panel figcaption {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; font-size: .8125rem; color: var(--text-mute); background: var(--night-1); border-top: 1px solid var(--line);
  }
  .agent-pane {
    border-radius: var(--radius-m); background: var(--night-1); border: 1px solid var(--line);
    font-family: var(--font-mono); font-size: .8125rem; line-height: 1.6; color: var(--text-soft);
  }
  .agent-pane header { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text-mute); font-family: var(--font); font-size: .8125rem; }
  .agent-pane header span.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--night-2); }
  .agent-pane ol { padding: 12px 16px 14px; display: grid; gap: 4px; }
  .agent-pane li { display: flex; flex-wrap: wrap; gap: 0 10px; min-width: 0; }
  .agent-pane .tool { flex: none; }
  .agent-pane .hint { min-width: 0; overflow-wrap: anywhere; }
  .agent-pane .tool { color: var(--accent); }
  .agent-pane .hint { color: var(--text-mute); }

  /* Legal and support pages */
  .doc { padding: clamp(40px, 7vw, 88px) 0 var(--section); }
  .doc-head { margin-bottom: 40px; }
  .doc-head h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: 12px; }
  .doc-head .updated { color: var(--text-mute); font-size: .9375rem; }
  .lang-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
  .lang-switch a { text-decoration: none; color: var(--text); min-height: 36px; }
  .lang-switch a:hover { background: var(--glass-strong); }
  .prose { color: var(--text-soft); }
  .prose p, .prose li, .prose dd, .prose td { overflow-wrap: anywhere; }
  .prose h2 { color: var(--text); font-size: clamp(1.5rem, 3vw, 2rem); margin: 56px 0 14px; }
  .prose h3 { color: var(--text); font-size: 1.1875rem; margin: 32px 0 10px; letter-spacing: -0.01em; }
  .prose p, .prose ul, .prose ol, .prose dl, .prose .callout, .prose .table-wrap { margin-top: 14px; }
  .prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: 8px; }
  .prose li::marker { color: var(--text-mute); }
  .prose dl { display: grid; gap: 4px 24px; }
  @media (min-width: 640px) { .prose dl { grid-template-columns: max-content 1fr; } }
  .prose dt { color: var(--text-mute); }
  .prose dd { color: var(--text); }
  .prose .summary { margin-top: 0; }
  .prose .summary ul { margin-top: 10px; }
  .prose pre {
    margin-top: 14px; padding: 16px 18px; overflow-x: auto; border-radius: var(--radius-s);
    background: var(--night-1); border: 1px solid var(--line); font-size: .875rem; line-height: 1.6; color: var(--text);
  }
  .lang-block + .lang-block { margin-top: 72px; padding-top: 56px; border-top: 1px solid var(--line); }
  .toc { margin-top: 24px; padding: 20px 24px; border-radius: var(--radius-m); background: var(--glass); border: 1px solid var(--line); }
  .toc ol { margin-top: 8px; columns: 2 220px; column-gap: 32px; padding-left: 1.2em; }
  .toc li { margin-bottom: 6px; break-inside: avoid; }

  /* 404 */
  .not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: var(--section) 0; }
  .not-found h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin-bottom: 14px; }
  .not-found p { color: var(--text-soft); }
  .not-found .btn { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .skip-link, .lang-switch { display: none; }
  .prose, .prose h2, .prose h3, .prose dd { color: #000; }
  a { color: #3B33C9; }
}
