/* Fast Scan Design System — Swiss Indigo & Porcelain / Deep Space Midnight */
:root {
  color-scheme: light dark;

  /* Brand — Exact FastScanTheme.swift RGB palette */
  --fs-accent: #3f46e5;
  --fs-accent-fill: #3f46e5;
  --fs-accent-pressed: #3135c8;
  --fs-accent-soft: rgba(63, 70, 229, 0.10);
  --fs-accent-ring: rgba(63, 70, 229, 0.28);
  --fs-studio-accent: #818cf8;
  --fs-studio-accent-bright: #a5b4fc;
  --fs-deep-indigo: #232774;
  --fs-violet: #6d28d9;
  --fs-violet-soft: rgba(109, 40, 217, 0.10);
  --fs-emerald: #059669;
  --fs-emerald-soft: rgba(5, 150, 105, 0.11);
  --fs-amber: #b45309;
  --fs-amber-bright: #f59e0b;
  --fs-amber-soft: rgba(180, 83, 9, 0.11);
  --fs-crimson: #e11d48;

  /* Surfaces — Cool Porcelain */
  --fs-canvas: #f6f7fb;
  --fs-surface: #ffffff;
  --fs-surface-elevated: #ffffff;
  --fs-surface-subtle: #eceff8;
  --fs-border: #e1e5f0;
  --fs-border-strong: #cdd4e6;
  --fs-nav-bg: rgba(246, 247, 251, 0.80);

  /* Studio Dark Stage (shared across themes for optical tech hero & vault band) */
  --fs-studio-canvas: #07080d;
  --fs-studio-surface: #111422;
  --fs-studio-elevated: #171a2b;
  --fs-studio-border: rgba(129, 140, 248, 0.18);
  --fs-studio-border-soft: rgba(255, 255, 255, 0.08);
  --fs-studio-ink: #f3f5fc;
  --fs-studio-muted: #9aa3c0;

  /* Ink */
  --fs-ink: #111424;
  --fs-ink-secondary: #5d647a;
  --fs-ink-tertiary: #7c849d;

  /* Geometry & Motion */
  --radius-chip: 10px;
  --radius-card: 18px;
  --radius-card-lg: 24px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(17, 20, 36, 0.04), 0 10px 30px -12px rgba(17, 20, 36, 0.08);
  --shadow-card-hover: 0 4px 12px rgba(17, 20, 36, 0.06), 0 20px 44px -16px rgba(63, 70, 229, 0.16);

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

  --container-max: 1160px;
  --nav-height: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fs-accent: #818cf8;
    --fs-accent-fill: #4f46e5;
    --fs-accent-pressed: #6366f1;
    --fs-accent-soft: rgba(129, 140, 248, 0.16);
    --fs-accent-ring: rgba(129, 140, 248, 0.36);
    --fs-violet: #a78bfa;
    --fs-violet-soft: rgba(167, 139, 250, 0.16);
    --fs-emerald: #34d399;
    --fs-emerald-soft: rgba(52, 211, 153, 0.16);
    --fs-amber: #fbbf24;
    --fs-amber-soft: rgba(251, 191, 36, 0.16);
    --fs-crimson: #fb7185;

    --fs-canvas: #090a10;
    --fs-surface: #121420;
    --fs-surface-elevated: #171a29;
    --fs-surface-subtle: #1b1f30;
    --fs-border: #252a40;
    --fs-border-strong: #323956;
    --fs-nav-bg: rgba(9, 10, 16, 0.80);

    --fs-ink: #f3f5fc;
    --fs-ink-secondary: #949cb8;
    --fs-ink-tertiary: #737b97;

    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 16px 36px -18px rgba(0, 0, 0, 0.65);
    --shadow-card-hover: 0 1px 0 rgba(129, 140, 248, 0.14) inset, 0 24px 52px -18px rgba(0, 0, 0, 0.80);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --fs-accent: #818cf8;
  --fs-accent-fill: #4f46e5;
  --fs-accent-pressed: #6366f1;
  --fs-accent-soft: rgba(129, 140, 248, 0.16);
  --fs-accent-ring: rgba(129, 140, 248, 0.36);
  --fs-violet: #a78bfa;
  --fs-violet-soft: rgba(167, 139, 250, 0.16);
  --fs-emerald: #34d399;
  --fs-emerald-soft: rgba(52, 211, 153, 0.16);
  --fs-amber: #fbbf24;
  --fs-amber-soft: rgba(251, 191, 36, 0.16);
  --fs-crimson: #fb7185;

  --fs-canvas: #090a10;
  --fs-surface: #121420;
  --fs-surface-elevated: #171a29;
  --fs-surface-subtle: #1b1f30;
  --fs-border: #252a40;
  --fs-border-strong: #323956;
  --fs-nav-bg: rgba(9, 10, 16, 0.80);

  --fs-ink: #f3f5fc;
  --fs-ink-secondary: #949cb8;
  --fs-ink-tertiary: #737b97;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 16px 36px -18px rgba(0, 0, 0, 0.65);
  --shadow-card-hover: 0 1px 0 rgba(129, 140, 248, 0.14) inset, 0 24px 52px -18px rgba(0, 0, 0, 0.80);
}

:root[data-theme="light"] {
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-family: var(--font-sans);
  background: var(--fs-canvas);
  color: var(--fs-ink);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--fs-canvas);
  color: var(--fs-ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--fs-accent);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--fs-accent);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--fs-accent-fill);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Sticky Glass Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: var(--fs-nav-bg);
  border-bottom: 1px solid var(--fs-border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--fs-ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(18, 21, 62, 0.28);
  flex-shrink: 0;
}

.brand-name {
  font-size: 17px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fs-ink-secondary);
  transition: color 0.16s ease;
  padding: 6px 2px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--fs-ink);
}

.nav-links a[aria-current="page"] {
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--fs-border);
  background: var(--fs-surface);
  color: var(--fs-ink-secondary);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.icon-btn:hover {
  color: var(--fs-ink);
  border-color: var(--fs-border-strong);
}

.nav-toggle {
  display: none;
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 auto 0;
  z-index: 95;
  background: var(--fs-surface);
  border-bottom: 1px solid var(--fs-border);
  padding: 16px 24px 24px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.18);
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-drawer a {
  display: block;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--fs-ink);
  font-size: 15px;
  font-weight: 500;
}

.mobile-drawer a:hover,
.mobile-drawer a[aria-current="page"] {
  background: var(--fs-surface-subtle);
  color: var(--fs-accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn--lg {
  padding: 14px 26px;
  font-size: 15px;
}

.btn--primary {
  background: var(--fs-accent-fill);
  color: #ffffff;
  box-shadow: 0 8px 24px -8px rgba(63, 70, 229, 0.55);
}

.btn--primary:hover {
  background: var(--fs-accent-pressed);
  color: #ffffff;
  box-shadow: 0 12px 28px -8px rgba(63, 70, 229, 0.65);
}

.btn--secondary {
  background: var(--fs-surface);
  color: var(--fs-ink);
  border-color: var(--fs-border-strong);
}

.btn--secondary:hover {
  border-color: var(--fs-accent);
  color: var(--fs-accent);
}

.btn--studio-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fs-studio-ink);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn--studio-ghost:hover {
  background: rgba(129, 140, 248, 0.14);
  border-color: rgba(129, 140, 248, 0.45);
  color: #ffffff;
}

/* Badges & Eyebrows */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--fs-accent-soft);
  color: var(--fs-accent);
}

.eyebrow--studio {
  background: rgba(129, 140, 248, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: var(--fs-studio-accent-bright);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22);
}

/* Shared Footer */
.site-footer {
  border-top: 1px solid var(--fs-border);
  background: var(--fs-surface);
  padding: 64px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(140px, 1fr));
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--fs-border);
}

.footer-tagline {
  margin: 14px 0 18px;
  font-size: 14px;
  color: var(--fs-ink-secondary);
  max-width: 340px;
}

.footer-address {
  font-style: normal;
  font-size: 13px;
  line-height: 1.65;
  color: var(--fs-ink-tertiary);
}

.footer-address strong {
  color: var(--fs-ink-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.footer-col h3 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fs-ink-tertiary);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--fs-ink-secondary);
  transition: color 0.15s ease;
}

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

.footer-bottom {
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--fs-ink-tertiary);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-legal-links a {
  color: var(--fs-ink-tertiary);
}

.footer-legal-links a:hover {
  color: var(--fs-accent);
}

/* In-App Embed Mode (?embed=1) for WKWebView / Sheet Presentation */
html.embed-mode .site-nav,
html.embed-mode .mobile-drawer,
html.embed-mode .site-footer,
html.embed-mode .doc-back-home {
  display: none !important;
}

html.embed-mode .doc-hero {
  padding-top: 28px;
}

/* Responsive */
@media (max-width: 900px) {
  .nav-links,
  .nav-cta-desktop {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 600px) {
  .container {
    padding-inline: 18px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
