/* ==========================================================================
   JKM Aerospace — site styles
   Design tokens first, then layout, components, and page-specific rules.
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Inter,
    Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
    Inter, Roboto, Helvetica, Arial, sans-serif;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  --space-section: clamp(4rem, 9vw, 7.5rem);
  --container: 1140px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light theme (default) */
:root,
:root[data-theme='light'] {
  color-scheme: light;

  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-muted: #eef3f9;
  --surface-glass: rgba(255, 255, 255, 0.72);

  --text: #0b1a2b;
  --text-muted: #55677e;
  --text-faint: #7a8ba1;

  --border: rgba(11, 26, 43, 0.1);
  --border-strong: rgba(11, 26, 43, 0.18);

  --brand: #0a63c9;
  --brand-strong: #084a99;
  --brand-soft: rgba(10, 99, 201, 0.1);
  --accent: #10b3c6;

  --shadow-sm: 0 1px 2px rgba(11, 26, 43, 0.06), 0 4px 12px rgba(11, 26, 43, 0.05);
  --shadow-md: 0 12px 32px rgba(11, 26, 43, 0.1);
  --shadow-lg: 0 28px 70px rgba(11, 26, 43, 0.16);

  --hero-glow-a: rgba(10, 99, 201, 0.28);
  --hero-glow-b: rgba(16, 179, 198, 0.24);
  --grid-line: rgba(11, 26, 43, 0.06);
}

/* Dark theme */
:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #060a13;
  --bg-elevated: #0d1522;
  --surface: #0e1826;
  --surface-muted: #131f31;
  --surface-glass: rgba(10, 17, 28, 0.72);

  --text: #e9eff8;
  --text-muted: #a2b1c6;
  --text-faint: #7f8ea4;

  --border: rgba(233, 239, 248, 0.1);
  --border-strong: rgba(233, 239, 248, 0.2);

  --brand: #4d9bff;
  --brand-strong: #7db6ff;
  --brand-soft: rgba(77, 155, 255, 0.14);
  --accent: #35d6e8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 34px 80px rgba(0, 0, 0, 0.55);

  --hero-glow-a: rgba(77, 155, 255, 0.26);
  --hero-glow-b: rgba(53, 214, 232, 0.18);
  --grid-line: rgba(233, 239, 248, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    color-scheme: dark;

    --bg: #060a13;
    --bg-elevated: #0d1522;
    --surface: #0e1826;
    --surface-muted: #131f31;
    --surface-glass: rgba(10, 17, 28, 0.72);

    --text: #e9eff8;
    --text-muted: #a2b1c6;
    --text-faint: #7f8ea4;

    --border: rgba(233, 239, 248, 0.1);
    --border-strong: rgba(233, 239, 248, 0.2);

    --brand: #4d9bff;
    --brand-strong: #7db6ff;
    --brand-soft: rgba(77, 155, 255, 0.14);
    --accent: #35d6e8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 34px 80px rgba(0, 0, 0, 0.55);

    --hero-glow-a: rgba(77, 155, 255, 0.26);
    --hero-glow-b: rgba(53, 214, 232, 0.18);
    --grid-line: rgba(233, 239, 248, 0.05);
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 5.2vw, 3.9rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 650;
}
h3 {
  font-size: 1.22rem;
  font-weight: 640;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

a:hover {
  color: var(--brand-strong);
}

img,
svg {
  max-width: 100%;
}

ul,
ol {
  padding-left: 1.2rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.muted {
  color: var(--text-muted);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  background: var(--surface-glass);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  border-radius: var(--radius-sm);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 660;
  letter-spacing: -0.02em;
  font-size: 1.06rem;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.primary-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.96rem;
  font-weight: 520;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.primary-nav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.primary-nav a[aria-current='page'] {
  color: var(--brand);
  background: var(--brand-soft);
}

.theme-toggle {
  margin-left: 0.4rem;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.icon-moon {
  display: none;
}

:root[data-theme='dark'] .icon-sun {
  display: none;
}
:root[data-theme='dark'] .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .icon-sun {
    display: none;
  }
  :root[data-theme='auto'] .icon-moon {
    display: block;
  }
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] .nav-toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: grid;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1.25rem;
    left: 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease),
      visibility 0.2s;
  }

  .primary-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .primary-nav a {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
  }

  .theme-toggle {
    margin: 0.3rem 0 0;
    width: 100%;
    border-radius: var(--radius-sm);
  }
}

/* --------------------------------------------------------------------------
   Buttons, badges, chips
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.99rem;
  font-weight: 580;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-md);
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--brand);
}

.btn-ghost {
  padding-inline: 0.4rem;
  color: var(--brand);
  font-weight: 560;
}

.btn[aria-disabled='true'] {
  pointer-events: none;
  opacity: 0.55;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.02em;
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-available {
  color: #0f8a5f;
  border-color: rgba(15, 138, 95, 0.28);
  background: rgba(15, 138, 95, 0.1);
}

.badge-beta {
  color: #9a6300;
  border-color: rgba(154, 99, 0, 0.28);
  background: rgba(154, 99, 0, 0.1);
}

.badge-coming-soon {
  color: var(--brand);
  border-color: var(--border-strong);
  background: var(--brand-soft);
}

:root[data-theme='dark'] .badge-available {
  color: #4bd6a0;
}
:root[data-theme='dark'] .badge-beta {
  color: #f0b749;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .badge-available {
    color: #4bd6a0;
  }
  :root[data-theme='auto'] .badge-beta {
    color: #f0b749;
  }
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  padding-block: var(--space-section);
}

.section-tight {
  padding-block: clamp(3rem, 6vw, 4.5rem);
}

.section-head {
  max-width: 44rem;
  margin-bottom: 3rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-bottom: 0;
}

.section-alt {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 10vw, 8rem) clamp(3.5rem, 8vw, 6rem);
}

.hero::before {
  content: '';
  position: absolute;
  inset: -35% -10% auto -10%;
  height: 70vh;
  background: radial-gradient(45% 55% at 22% 35%, var(--hero-glow-a), transparent 70%),
    radial-gradient(40% 50% at 78% 25%, var(--hero-glow-b), transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(70% 60% at 50% 25%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 25%, #000, transparent 75%);
  pointer-events: none;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-inner {
  max-width: 50rem;
}

.hero-visual {
  display: grid;
  place-items: center;
}

.hero-visual .device-frame {
  width: min(100%, 15.5rem);
  transform: rotate(2.5deg);
  transition: transform 0.5s var(--ease);
}

.hero-visual .device-frame:hover {
  transform: rotate(0deg) translateY(-6px);
}

.hero-screen {
  gap: 0.6rem;
  align-content: center;
}

.hero-screen img {
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.hero-screen strong {
  display: block;
  margin-top: 0.9rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }
}

.hero p.lead {
  font-size: clamp(1.07rem, 1.9vw, 1.28rem);
  color: var(--text-muted);
  max-width: 38rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-top: 2.5rem;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.page-hero {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.page-hero h1 {
  margin-bottom: 0.4rem;
}

.app-hero {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.app-hero h1 {
  margin-bottom: 0.35rem;
}

@media (max-width: 640px) {
  .app-hero {
    flex-direction: column;
  }
}

.page-hero p.lead {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 44rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Cards and grids
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
}

/* For grids inside a narrower column, such as an app page feature list. */
.grid-tight {
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
}

.card {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.card h3 {
  margin-bottom: 0.45rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: inherit;
}

.app-card:hover {
  color: inherit;
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  flex: none;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  background: var(--surface-muted);
}

.app-icon-lg {
  width: 92px;
  height: 92px;
  border-radius: 22px;
}

.app-card-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.app-card-title h3 {
  margin: 0;
}

.app-card-title span {
  font-size: 0.82rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.app-card p {
  color: var(--text-muted);
  margin: 0;
}

.app-card-foot {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.arrow {
  color: var(--brand);
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}

.card-link:hover .arrow {
  transform: translateX(3px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.15rem;
}

.app-facts {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.app-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.app-facts > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.app-facts dt {
  color: var(--text-faint);
  font-size: 0.9rem;
}

.app-facts dd {
  margin: 0;
  text-align: right;
  font-size: 0.93rem;
  font-weight: 540;
}

code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.stat span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Call to action panel */
.cta-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(2.25rem, 5vw, 3.5rem);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--brand-soft), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.cta-panel h2 {
  margin-bottom: 0.5rem;
}

.cta-panel p {
  color: var(--text-muted);
  max-width: 38rem;
  margin-inline: auto;
}

.cta-panel .btn-row {
  justify-content: center;
  margin-top: 1.75rem;
}

/* Split layout for app detail pages */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.device-frame {
  position: relative;
  margin-inline: auto;
  width: min(100%, 17.5rem);
  aspect-ratio: 9 / 19.5;
  border-radius: 2.6rem;
  padding: 0.7rem;
  background: linear-gradient(160deg, var(--surface-muted), var(--surface));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.device-frame-lg {
  width: min(100%, 22.5rem);
  border-radius: 2.85rem;
  padding: 0.85rem;
}

.device-screen {
  height: 100%;
  border-radius: 2rem;
  border: 1px solid var(--border);
  background: linear-gradient(170deg, var(--brand-soft), var(--surface-muted));
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.device-frame-lg .device-screen {
  border-radius: 2.15rem;
  gap: 0.45rem;
  font-size: 0.95rem;
}

.device-screen-media {
  padding: 0;
  overflow: hidden;
  background: var(--surface-muted);
}

.device-screen-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder-label {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-muted);
}

.media-placeholder-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.media-gallery {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1rem;
  width: 100%;
}

.media-gallery-stage {
  position: relative;
  width: min(100%, 22.5rem);
}

.media-slide {
  margin: 0;
}

.media-slide[hidden] {
  display: none;
}

.media-nav {
  position: absolute;
  top: calc(50% - 1.75rem);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: color-mix(in srgb, var(--text) 42%, transparent);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
  opacity: 0.55;
}

.media-nav:hover,
.media-nav:focus-visible {
  opacity: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  outline: none;
}

.media-nav-prev {
  left: 0.15rem;
}

.media-nav-next {
  right: 0.15rem;
}

.media-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.media-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-faint) 55%, transparent);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.media-dot.is-active {
  background: var(--brand);
  transform: scale(1.15);
}

.media-dot:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.placeholder-note {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.placeholder-note p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Prose (legal and long-form pages)
   -------------------------------------------------------------------------- */

.prose-layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding-bottom: var(--space-section);
}

@media (max-width: 960px) {
  .prose-layout {
    grid-template-columns: 1fr;
  }
}

.toc {
  position: sticky;
  top: 6rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.93rem;
}

@media (max-width: 960px) {
  .toc {
    position: static;
  }
}

.toc h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.85rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
  color: var(--text-muted);
}

.toc a {
  color: var(--text-muted);
}

.toc a:hover {
  color: var(--brand);
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-size: 1.42rem;
  margin-top: 2.75rem;
  padding-top: 0.25rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.08rem;
  margin-top: 1.9rem;
}

.prose p,
.prose li {
  color: var(--text-muted);
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.callout {
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--brand);
  background: var(--surface-muted);
  margin: 1.75rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-warning {
  border-left-color: #d98324;
}

.contact-block {
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.contact-block p {
  margin-bottom: 0.35rem;
}

.contact-block p:last-child {
  margin-bottom: 0;
}

/* Legal index table */
.legal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.97rem;
}

.legal-table th,
.legal-table td {
  padding: 0.95rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.legal-table thead th {
  background: var(--surface-muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}

.legal-table tbody tr:last-child td {
  border-bottom: 0;
}

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

/* FAQ */
.faq {
  display: grid;
  gap: 0.85rem;
}

details.faq-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.1rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

details.faq-item summary {
  cursor: pointer;
  font-weight: 580;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: '+';
  color: var(--brand);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}

details.faq-item[open] summary::after {
  transform: rotate(45deg);
}

details.faq-item p {
  color: var(--text-muted);
  margin: 0.85rem 0 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  padding-top: clamp(3rem, 6vw, 4.5rem);
  padding-bottom: 2.25rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  }
}

.footer-brand .brand-logo {
  margin-bottom: 0.9rem;
}

.footer-legal-name {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.footer-brand p {
  font-size: 0.94rem;
  max-width: 22rem;
}

.footer-col h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.94rem;
}

.footer-col a {
  color: var(--text-muted);
}

.footer-col a:hover {
  color: var(--brand);
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-bottom p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

/* Only hidden when scripting is available, so content still shows without JS. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
