:root {
  color-scheme: dark;
  --space: rgb(3 8 20);
  --space-soft: rgb(7 15 34);
  --panel: rgb(10 20 44 / 0.82);
  --panel-strong: rgb(12 24 52 / 0.96);
  --line: rgb(149 184 255 / 0.18);
  --line-strong: rgb(174 196 255 / 0.38);
  --text: rgb(239 244 255);
  --muted: rgb(172 188 220);
  --blue: #3a76f0;
  --blue-soft: rgb(134 179 255);
  --cyan: #12d9c4;
  --gold: #f2c782;
  --shadow: 0 24px 72px rgb(0 0 0 / 0.45);
  --radius: 20px;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-inline-size: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-block-size: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 8%, rgb(58 118 240 / 0.16), transparent 36rem),
    radial-gradient(circle at 86% 18%, rgb(18 217 196 / 0.12), transparent 34rem),
    radial-gradient(circle at 50% 90%, rgb(242 199 130 / 0.08), transparent 38rem),
    linear-gradient(180deg, rgb(3 7 18), var(--space) 55%, rgb(4 10 24));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgb(142 171 255 / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgb(142 171 255 / 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 0.7), transparent 88%);
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

code,
pre {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  color: rgb(196 226 255);
  font-size: 0.92em;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  inset-block-start: -100px;
  inset-inline-start: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--gold);
  color: #081020;
  font-weight: 700;
}

.skip-link:focus {
  inset-block-start: 1rem;
}

/* ------------------------------------------------------------------
   Responsive Header & Native Popover Navigation
   ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  z-index: 100;
  inset-block-start: 0;
  backdrop-filter: blur(14px);
  background: rgb(4 10 24 / 0.84);
  border-block-end: 1px solid var(--line);
}

.site-header.is-measuring * {
  transition: none !important;
}

.header-inner {
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.site-brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-brand strong {
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.site-brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.site-nav {
  display: flex;
  align-items: center;
}

.menu-button {
  anchor-name: --menu-button;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.menu-button:hover {
  border-color: var(--cyan);
}

.site-menu {
  list-style: none;
  position: fixed;
  inset: auto;
  /* Fallback offset before anchor() for browsers without CSS Anchor Positioning */
  inset-block-start: 4.75rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: 1rem;
  inline-size: min(84dvw, 22rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 6rem);
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

@supports not selector(:popover-open) {
  [popover]:not(.\:popover-open) {
    display: none;
  }
}

.site-menu:is(:popover-open, .\:popover-open) {
  display: grid;
  gap: 0.2rem;
}

.site-menu a {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 140ms ease, color 140ms ease;
}

.site-menu a:hover,
.site-menu a:focus-visible {
  background: rgb(58 118 240 / 0.16);
  color: var(--text);
}

.site-header.is-wide .menu-button {
  display: none;
}

.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.site-header.is-wide .site-menu::backdrop {
  display: none;
}

/* ------------------------------------------------------------------
   Layout & Hero
   ------------------------------------------------------------------ */

.section-shell {
  max-inline-size: 1180px;
  margin-inline: auto;
  padding-inline: 1.25rem;
  padding-block: 3.25rem;
}

.hero {
  padding-block-start: 2rem;
}

.hero-banner {
  margin: 0 0 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  background: #040915;
}

.hero-banner img {
  inline-size: 100%;
}

.hero-intro {
  max-inline-size: 820px;
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1 span {
  color: var(--blue-soft);
}

h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
}

.hero-lead {
  margin: 0 auto 1.4rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-block-end: 2.25rem;
}

.pill {
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.pill-cyan {
  border-color: rgb(18 217 196 / 0.45);
  color: var(--cyan);
}

.pill-blue {
  border-color: rgb(58 118 240 / 0.55);
  color: var(--blue-soft);
}

.pill-gold {
  border-color: rgb(242 199 130 / 0.45);
  color: var(--gold);
}

/* Install spotlight */
.install-spotlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
  align-items: center;
  padding: 1.65rem;
  border-radius: var(--radius);
  border: 1px solid rgb(18 217 196 / 0.35);
  background: linear-gradient(135deg, rgb(12 25 56 / 0.92), rgb(8 18 40 / 0.86));
  box-shadow: var(--shadow);
}

.install-copy p:last-child {
  margin-block-end: 0;
  color: var(--muted);
}

/* Code cards */
.code-card {
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgb(4 9 22 / 0.92);
  overflow: hidden;
  margin-block-start: 0.85rem;
}

.install-spotlight .code-card {
  margin-block-start: 0;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  border-block-end: 1px solid var(--line);
  background: rgb(14 26 54 / 0.75);
  font-size: 0.78rem;
  color: var(--muted);
}

.copy-btn {
  padding: 0.25rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: rgb(24 44 88 / 0.7);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.code-card pre {
  margin: 0;
  padding: 0.95rem 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}

.copy-status {
  display: block;
  min-block-size: 0;
  padding-inline: 1rem;
  font-size: 0.78rem;
  color: var(--cyan);
}

.copy-status:not(:empty) {
  padding-block: 0.35rem;
  border-block-start: 1px solid var(--line);
}

/* ------------------------------------------------------------------
   Section Headings & Cards
   ------------------------------------------------------------------ */

.section-heading {
  max-inline-size: 760px;
  margin-block-end: 1.75rem;
}

.section-heading p:last-child {
  margin-block-end: 0;
  color: var(--muted);
}

.feature-grid,
.watch-grid,
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.15rem;
}

.choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.feature-card {
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.card-kicker {
  display: inline-block;
  margin-block-end: 0.45rem;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------
   Accessible AI Client Tabs (single-row scroll + non-color indicator)
   ------------------------------------------------------------------ */

.tablist {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  border-block-end: 1px solid var(--line);
  scroll-snap-type: inline proximity;
  scrollbar-width: thin;
}

[role="tab"] {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  padding: 0.75rem 1.05rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

[role="tab"]:hover {
  color: var(--text);
}

[role="tab"][aria-selected="true"] {
  color: var(--cyan);
}

/* Non-color shape indicator via border-block-end (preserved in forced-colors) */
[role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 3px solid var(--cyan);
}

.tab-panels {
  display: grid;
}

[role="tabpanel"] {
  grid-area: 1 / 1;
}

/* Padding/background on inner wrapper, never on hidden=until-found panel itself */
.panel-card {
  margin-block-start: 1rem;
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel-card p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.panel-note {
  margin-block-start: 0.85rem !important;
  margin-block-end: 0 !important;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------
   Privacy Sandbox & Responsive Tables
   ------------------------------------------------------------------ */

.privacy-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 1.35rem;
  align-items: start;
}

.sandbox-card,
.lock-callout {
  padding: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.policy-column {
  display: grid;
  gap: 1.25rem;
}

.preset-fieldset {
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.preset-fieldset legend {
  padding-inline: 0.4rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preset-fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.preset-fieldset input[type="checkbox"] {
  accent-color: var(--cyan);
}

.sandbox-inputs {
  display: grid;
  gap: 0.75rem;
  margin-block-end: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field textarea,
.search-field input {
  inline-size: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgb(4 9 22 / 0.9);
  color: var(--text);
}

.sandbox-output {
  border-radius: 14px;
  border: 1px solid rgb(18 217 196 / 0.4);
  background: rgb(4 9 22 / 0.95);
  overflow: hidden;
}

.sandbox-output pre {
  margin: 0;
  padding: 0.95rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
}

.hit-badge {
  color: var(--cyan);
  font-weight: 700;
}

/* Tool filter controls */
.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 1rem;
}

.search-field {
  flex: 1 1 260px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-btn {
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.filter-btn.is-active {
  border-color: var(--cyan);
  background: rgb(18 217 196 / 0.14);
  color: var(--cyan);
}

/* Responsive Data Tables with Container Queries */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 75dvh);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  container-type: inline-size;
}

.responsive-table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: start;
  font-size: 0.9rem;
}

.responsive-table caption {
  padding: 0.85rem 1rem;
  text-align: start;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gold);
  border-block-end: 1px solid var(--line);
}

.responsive-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--panel-strong);
}

.responsive-table th,
.responsive-table td {
  padding: 0.72rem 1rem;
  border-block-end: 1px solid var(--line);
  vertical-align: top;
}

.responsive-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.responsive-table tbody th {
  font-weight: 600;
  white-space: nowrap;
}

.responsive-table tbody td {
  color: var(--muted);
}

.responsive-table tr.is-hidden {
  display: none;
}

.ignore-table {
  --label-2: "Enforced Scope";
}

.tools-table {
  --label-2: "Category";
  --label-3: "Description";
}

@container (width < 600px) {
  .responsive-table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    margin: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgb(6 13 30 / 0.85);
    overflow: hidden;
  }

  .responsive-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 1;
    background: var(--panel-strong);
    white-space: normal;
  }

  .responsive-table td {
    border-block-end: 0;
  }

  .responsive-table td:nth-child(2)::before {
    content: var(--label-2) ": ";
    color: var(--gold);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
  }

  .responsive-table td:nth-child(3)::before {
    content: var(--label-3) ": ";
    color: var(--gold);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
  }
}

/* Footer */
.site-footer {
  border-block-start: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer a:hover {
  color: var(--cyan);
}

@media (forced-colors: active) {
  [role="tab"][aria-selected="true"]::after {
    border-block-end-color: Highlight;
  }
  .filter-btn.is-active {
    border-color: Highlight;
  }
}
