/* ─────────────────────────────────────────────────────────────
   Airtap subpage shared styles
   Mirrors the chat-built home page (index.html) so subpages and
   the home page feel like the same site without touching index.html.
   ────────────────────────────────────────────────────────────── */

:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #FAF8F4;
  --bg-tertiary: #F5F2EC;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6862;
  --text-muted: #9A958C;
  --border: #EAE6DD;
  --accent-cream: #FAEEDA;
  --accent-cream-border: #BA7517;
  --accent-amber-text: #412402;
  --accent-amber-deep: #633806;
  --green-bg: #EAF3DE;
  --green-text: #173404;
  --rose-bg: #FAECE7;
  --rose-text: #4A1B0C;
  --teal-bg: #E1F5EE;
  --teal-text: #04342C;
  --blue-bg: #E6F1FB;
  --blue-text: #042C53;
  --plum-bg: #FBEAF0;
  --plum-text: #4B1528;
  --escalation-1: #FAC775;
  --escalation-2: #EF9F27;
  --escalation-3: #BA7517;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.display { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

/* ── Header ────────────────────────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600; font-size: 20px; letter-spacing: -0.02em;
  color: var(--text-primary); text-decoration: none;
}
nav.site ul {
  display: flex; align-items: center; gap: 28px; list-style: none;
}
nav.site a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: color 0.15s ease;
}
nav.site a:hover { color: var(--text-primary); }
nav.site a.current { color: var(--text-primary); }
/* Buttons inside the nav need their button colors back — `nav.site a`
   would otherwise win against `.btn-primary` on color. */
nav.site a.btn-primary { color: var(--bg-primary); }
nav.site a.btn-primary:hover { color: var(--bg-primary); }
nav.site a.btn-ghost { color: var(--text-primary); }

.btn {
  font-family: inherit; font-weight: 500; font-size: 14px;
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--text-primary); color: var(--bg-primary);
  padding: 10px 18px; border-radius: var(--radius-md);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.btn-ghost {
  background: transparent; color: var(--text-primary);
  padding: 10px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-secondary); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero { padding: 88px 0 64px; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-cream); color: var(--accent-amber-text);
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500; margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--accent-amber-text); }
.hero p.lede {
  font-size: 18px; color: var(--text-secondary);
  max-width: 620px; margin: 0 auto 36px; line-height: 1.55;
}
.hero-ctas {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}

/* ── Hero video (legacy /old home) ─────────────────────────── */
.hero-video {
  margin: 32px auto 36px;
  max-width: 280px;
  padding: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.06);
}
.hero-video video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #0E0E0E;
}

/* ── Generic section frame ────────────────────────────────── */
.section { padding: 64px 0; }
.section-tinted {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head { text-align: center; margin-bottom: 40px; }
.eyebrow {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.08em;
  margin-bottom: 8px; text-transform: uppercase;
}
.section-head h2 {
  font-size: clamp(28px, 3.5vw, 40px); margin-bottom: 12px;
}
.section-head p {
  color: var(--text-secondary); max-width: 560px; margin: 0 auto;
  font-size: 16px;
}

/* ── Card grids ────────────────────────────────────────────── */
.grid-3, .grid-4, .grid-2 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.04); }
.card .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 13px; font-weight: 700; margin-bottom: 12px;
}
.card .title {
  font-weight: 600; margin-bottom: 6px; font-size: 15px;
}
.card p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}

.badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 12px; margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.badge-rose { background: var(--rose-bg); color: var(--rose-text); }
.badge-blue { background: var(--blue-bg); color: var(--blue-text); }
.badge-teal { background: var(--teal-bg); color: var(--teal-text); }
.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-plum { background: var(--plum-bg); color: var(--plum-text); }
.badge-amber { background: var(--accent-cream); color: var(--accent-amber-text); }

/* ── Long-form prose (legal pages) ────────────────────────── */
.prose { max-width: 760px; margin: 0 auto; padding: 64px 28px 96px; }
.prose h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 700;
  font-size: clamp(32px, 4.5vw, 48px); letter-spacing: -0.025em;
  line-height: 1.1; margin-bottom: 8px;
}
.prose .effective {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 32px;
  letter-spacing: 0.02em;
}
.prose h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 700;
  font-size: 28px; letter-spacing: -0.02em; line-height: 1.2;
  margin: 56px 0 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.prose h3 {
  font-weight: 600; font-size: 17px; margin: 32px 0 8px;
}
.prose h4 {
  font-weight: 600; font-size: 15px; color: var(--accent-amber-text);
  margin: 24px 0 6px; letter-spacing: 0.005em;
}
.prose p, .prose li {
  font-size: 15px; line-height: 1.7; color: var(--text-secondary);
}
.prose p { margin-bottom: 14px; }
.prose ul { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose .upper {
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-amber-text);
  background: var(--accent-cream);
  border: 1px solid var(--accent-cream-border);
  padding: 14px 18px; border-radius: var(--radius-md);
  margin-bottom: 28px;
}
.prose .toc {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px; margin: 28px 0 40px;
}
.prose .toc h4 { color: var(--text-primary); margin: 0 0 8px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.prose .toc ul { list-style: none; margin: 0; columns: 2; column-gap: 24px; }
.prose .toc li { margin-bottom: 4px; }
.prose .toc a { color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.prose .toc a:hover { color: var(--text-primary); }

/* ── Legal page ───────────────────────────────────────────── */
.legal-page {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 64px;
  padding-top: 56px;
  padding-bottom: 96px;
}
.legal-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legal-toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}
.legal-toc a:hover { color: var(--text-primary); }
.legal-content {
  max-width: 760px;
}
.legal-anchor {
  scroll-margin-top: 96px;
}
.legal-content h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.legal-content .effective {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}
.legal-upper {
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.legal-section {
  margin: 0 0 40px;
}
.legal-section h2 {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 12px;
}
.legal-section h3 {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.35;
  margin: 20px 0 8px;
}
.legal-section p,
.legal-section li {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}
.legal-section p { margin-bottom: 12px; }
.legal-section ul,
.legal-section ol {
  margin: 0 0 14px 22px;
}
.legal-section li { margin-bottom: 6px; }
.legal-section strong { color: var(--text-primary); font-weight: 600; }
.legal-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 64px 0;
}

/* ── Demo gallery (see-it-in-action) ─────────────────────── */
.demo-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.demo-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.demo-card .embed {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #0E0E0E; display: block; overflow: hidden;
  text-decoration: none; color: inherit;
}
.demo-card .embed iframe,
.demo-card .embed video,
.demo-card .embed img {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  object-fit: cover; display: block;
}
.demo-card .embed video { object-fit: contain; background: #0E0E0E; }
.demo-card a.embed:hover img { opacity: 0.92; }
.demo-card .embed .play-btn {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(14, 14, 14, 0.7);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease;
  border: 1px solid rgba(255,255,255,0.18);
}
.demo-card a.embed:hover .play-btn {
  transform: translate(-50%, -50%) scale(1.06);
  background: rgba(14, 14, 14, 0.85);
}
.demo-card .embed .youtube-tag {
  position: absolute; bottom: 8px; right: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: #fff; background: rgba(0,0,0,0.55);
  padding: 3px 7px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.demo-card .body { padding: 16px 18px 18px; }
.demo-card .body .meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; color: var(--text-secondary);
  letter-spacing: 0.02em; margin-bottom: 6px;
}
.demo-card .body h3 {
  font-size: 16px; font-weight: 600; line-height: 1.3;
  margin-bottom: 6px; color: var(--text-primary);
}
.demo-card .body p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}
.demo-filters {
  display: flex; justify-content: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 36px;
}
.demo-filter {
  font-size: 13px; padding: 6px 14px;
  background: var(--bg-tertiary); color: var(--text-secondary);
  border-radius: 18px; cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.demo-filter.active {
  background: var(--accent-cream); color: var(--accent-amber-text);
  border-color: var(--accent-cream-border); font-weight: 600;
}

/* ── Closer & footer (match home page) ────────────────────── */
.closer {
  background: #0E0E0E; color: #fff;
  text-align: center; padding: 88px 28px;
}
.closer h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 700;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.2;
  letter-spacing: -0.02em; margin-bottom: 6px;
}
.closer h2 .muted { color: rgba(255,255,255,0.5); }
.closer .btn {
  background: #fff; color: #0E0E0E;
  padding: 14px 28px; border-radius: var(--radius-md);
  margin-top: 28px; font-size: 15px; font-weight: 600;
}
.closer .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,255,255,0.15); }

footer.site {
  padding: 32px 0;
  color: var(--text-muted); font-size: 13px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-copy {
  flex: 0 0 auto;
  text-align: left;
}
.footer-link-row {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-left: auto;
}
.footer-socials,
.footer-legal {
  display: flex; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.footer-socials {
  justify-content: flex-start;
}
.footer-legal {
  justify-content: flex-end;
}
.footer-socials a,
.footer-legal a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 13px;
}
.footer-socials a:hover,
.footer-legal a:hover { color: var(--text-primary); }
.footer-social {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}
.footer-social svg {
  width: 18px; height: 18px;
}

/* Legacy-site links — secondary row, smaller and muted */
footer.site nav.legacy {
  margin-top: -2px;
  margin-bottom: 18px;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}
footer.site nav.legacy a {
  color: var(--text-muted);
  font-size: 12px;
}
footer.site nav.legacy a:hover { color: var(--text-secondary); }
footer.site nav.legacy .legacy-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  align-self: center;
  padding-right: 4px;
}

/* ── Architecture diagram (Technology page) ───────────────── */
.diagram-frame {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 0 auto;
  max-width: 920px;
}
.tech-diagram {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 760px) {
  .diagram-frame { padding: 14px; }
}

/* ── Legacy banner (only on /old/ pages) ───────────────────── */
.legacy-banner {
  background: var(--accent-cream);
  color: var(--accent-amber-text);
  border-bottom: 1px solid var(--accent-cream-border);
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 16px;
}
.legacy-banner a {
  color: var(--accent-amber-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legacy-banner a:hover { color: var(--text-primary); }

/* ── Language switcher ────────────────────────────────────── */
.lang-switcher { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary);
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-md); cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lang-btn:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--text-muted); }
.lang-btn[aria-expanded="true"] { background: var(--bg-secondary); color: var(--text-primary); }
.lang-menu {
  /* `display: block` and zeroed gap explicitly override the parent
     `nav.site ul { display: flex; gap: 28px; }` rule which would otherwise
     cascade into this nested UL and lay the items out horizontally. */
  display: block;
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 160px; padding: 6px 0; margin: 0; gap: 0;
  background: var(--bg-primary); list-style: none;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}
.lang-switcher .lang-menu {
  display: block;
  gap: 0;
}
.lang-switcher .lang-btn[aria-expanded="true"] + .lang-menu,
.lang-switcher:focus-within .lang-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.lang-menu li { display: block; }
.lang-menu a {
  display: block; padding: 8px 14px;
  font-size: 14px; color: var(--text-secondary); text-decoration: none;
  white-space: nowrap;
  transition: background 0.1s ease, color 0.1s ease;
}
.lang-menu a:hover { background: var(--bg-secondary); color: var(--text-primary); }
.lang-menu a.current { color: var(--text-primary); font-weight: 600; }
@media (max-width: 760px) {
  .lang-menu { right: auto; left: 0; }
}

/* ── Reveal animation ─────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 760px) {
  .header-inner {
    padding: 16px 0;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .logo {
    flex: 0 0 auto;
  }
  .logo img {
    height: 24px !important;
    width: auto !important;
  }
  header.site nav.site {
    flex: 1 1 auto;
    min-width: 0;
  }
  header.site nav.site > ul {
    display: flex; width: auto; align-items: center;
    justify-content: flex-end; gap: 8px; flex-wrap: nowrap;
    min-width: 0;
  }
  header.site nav.site > ul > li { display: flex; align-items: center; }
  nav.site a { font-size: 13px; }
  nav.site a.btn-primary {
    padding: 7px 10px;
    border-radius: var(--radius-md);
    white-space: nowrap;
  }
  .lang-btn {
    padding: 6px 8px;
    font-size: 13px;
  }
  .lang-menu { right: 0; left: auto; }
  .hero { padding: 60px 0 48px; }
  .section { padding: 56px 0; }
  .grid-2, .grid-3, .grid-4, .demo-grid { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
  header.site .header-inner {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .footer-inner {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .footer-link-row {
    width: auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin-left: auto;
  }
  .footer-socials {
    justify-content: flex-end;
    gap: 8px;
  }
  .footer-copy {
    text-align: left;
    font-size: 12px;
    line-height: 1.35;
  }
  .footer-legal {
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .footer-legal a {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .legal-page {
    display: block;
    padding-top: 40px;
    padding-bottom: 72px;
  }
  .legal-toc {
    position: static;
    flex-direction: row;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
  }
  .prose .toc ul { columns: 1; }
  .prose { padding: 48px 22px 72px; }
}

@media (max-width: 380px) {
  .container { padding: 0 16px; }
  header.site .header-inner {
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 8px;
  }
  .logo img { height: 22px !important; }
  header.site nav.site > ul { gap: 6px; }
  nav.site a { font-size: 12px; }
  nav.site a.btn-primary { padding: 7px 9px; }
  .lang-btn {
    padding: 6px 7px;
    font-size: 12px;
  }
  .footer-inner { gap: 10px; }
  .footer-link-row { gap: 8px; }
  .footer-legal { gap: 8px; }
}
