/* ============================================================
   OCCAM — base layer on top of the v3 OCCAMl design system.
   Only truly shared primitives live here; each exploration page
   adds its own direction-specific styling on top.
   ============================================================ */

html.theme-switching, html.theme-switching * { transition: none !important; }

/* NOTE: no global scroll-behavior:smooth — the scene pages' JS tween owns programmatic
   glides (smooth + tween = every scrollTo frame re-animated by the browser = jitter). */
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--app-bg);
  /* the layered environment wash from the DS, fixed to the viewport.
     Set as a real background-image (not body::before) so an opaque body bg
     can't propagate to the canvas and swallow the wash. */
  background-image: var(--body-background);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* .gs pages (landing / privacy) paint their own continuous atmosphere via
   .gs-atmo; drop the token wash there so the two violet pools don't stack. */
body.gs { background-image: none; }
::selection { background: var(--accent-soft); color: var(--text-main); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* ---- containers ---- */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 32px; }
.wrap-narrow { max-width: 980px; }
@media (max-width: 767px) { .wrap { padding-inline: 20px; } }

/* ---- eyebrow / labels ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0;
}
.eyebrow-muted { color: var(--text-muted); }

/* ---- mono helpers ---- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   HEADER — unified frosted chrome (shared skeleton)
   ============================================================ */
.occ-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--shell-bg);
  background-image: var(--rim-light);
  border-bottom: 1px solid var(--app-border);
  backdrop-filter: blur(var(--blur-shell));
  -webkit-backdrop-filter: blur(var(--blur-shell));
  transition: background-color var(--transition-base), border-color var(--transition-base);
}
.occ-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}
.occ-brand { display: inline-flex; align-items: center; gap: 11px; }
.occ-brand-glyph {
  width: 30px; height: 30px;
  display: inline-flex;
  color: var(--text-primary);
  transition: color var(--transition-base);
}
.occ-brand-glyph svg { width: 100%; height: 100%; display: block; fill: currentColor; }
a.metric-chip { cursor: pointer; }
a.metric-chip:hover { transform: translateY(-1px); border-color: var(--app-border-strong); background-color: var(--chip-surface-hover-bg); box-shadow: var(--control-hover-shadow); }
.occ-brand-word {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.occ-brand-word .dim { color: var(--text-muted); font-weight: 500; }

.occ-nav { display: flex; align-items: center; gap: 4px; }
.occ-nav a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color var(--transition-base), background-color var(--transition-base);
}
.occ-nav a:hover { color: var(--text-primary); background-color: var(--ghost-hover-bg); }
.occ-header-actions { display: flex; align-items: center; gap: 10px; }
/* site-chrome contract: section anchors | divider | cross-page links */
.occ-nav .nav-sep { display: inline-block; vertical-align: middle; width: 1px; height: 14px; background: var(--app-border-strong); margin-inline: 6px; flex-shrink: 0; }
.occ-nav a.nav-page { display: inline-flex; align-items: center; gap: 5px; }
.occ-nav a.nav-page svg { width: 11px; height: 11px; color: var(--text-subtle); transition: color var(--transition-base); }
.occ-nav a.nav-page:hover svg { color: currentColor; }
.occ-session-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.occ-session-actions[hidden],
[data-session-signed-in][hidden],
[data-session-signed-out][hidden] {
  display: none !important;
}
.occ-account {
  position: relative;
  display: inline-flex;
}
.occ-account-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--chip-surface-bg);
  box-shadow: var(--control-shadow);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: border-color var(--transition-base), background-color var(--transition-base);
}
.occ-account-trigger:hover,
.occ-account-trigger:focus-visible {
  border-color: var(--app-border-strong);
  background: var(--chip-surface-hover-bg);
}
.occ-account-trigger:focus-visible,
.occ-account-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.occ-account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.occ-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.occ-account-avatar img[hidden],
.occ-account-avatar [data-session-initials][hidden] {
  display: none;
}
.occ-account-chevron {
  width: 13px;
  height: 13px;
  color: var(--text-subtle);
  transition: transform var(--transition-base);
}
.occ-account-trigger[aria-expanded="true"] .occ-account-chevron {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .occ-account-trigger,
  .occ-account-chevron,
  .occ-account-item {
    transition: none;
  }
}
.occ-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: 270px;
  padding: 8px;
  border: 1px solid var(--app-border-strong);
  border-radius: var(--r-card);
  background-color: var(--modal-surface-bg);
  background-image: linear-gradient(var(--modal-surface-bg), var(--modal-surface-bg)), var(--rim-light);
  box-shadow: var(--shadow-xl);
  box-sizing: border-box;
}
.occ-account-menu[hidden] {
  display: none;
}
.occ-account-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 10px 12px;
}
.occ-account-identity .occ-account-avatar {
  width: 38px;
  height: 38px;
  font-size: 12px;
}
.occ-account-copy {
  min-width: 0;
}
.occ-account-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.occ-account-email {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.occ-account-provider {
  margin-top: 5px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}
.occ-account-separator {
  height: 1px;
  margin: 4px 6px;
  background: var(--app-border-subtle);
}
.occ-account-item {
  appearance: none;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-mini);
  background: none;
  box-sizing: border-box;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.occ-account-item:hover {
  background: var(--control-surface-hover-bg);
  color: var(--text-primary);
}
.occ-account-item-danger {
  color: var(--brand-red);
}
.occ-account-item:disabled {
  cursor: wait;
  opacity: 0.55;
}
@media (max-width: 860px) { .occ-nav { display: none; } }

/* ---- theme toggle ---- */
.theme-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background-color: var(--control-surface-bg);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--control-shadow);
  transition: transform var(--transition-fast), border-color var(--transition-base),
    background-color var(--transition-base), color var(--transition-base);
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--app-border-strong); transform: translateY(-1px); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
.theme-light .theme-toggle .icon-sun { display: block; }
.theme-light .theme-toggle .icon-moon { display: none; }

/* ============================================================
   BUTTONS — marketing accent CTA (DS extension) + ghost
   ============================================================ */
.occ-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), border-color var(--transition-base),
    background-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}
.occ-btn-accent {
  background-color: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 8px 24px -10px rgba(var(--accent-rgb), 0.7);
}
.occ-btn-accent:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.14) inset, 0 12px 30px -10px rgba(var(--accent-rgb), 0.85); }
.occ-btn-accent:active { transform: scale(0.98); }
.occ-btn-ghost {
  background-color: var(--control-surface-bg);
  color: var(--text-primary);
  border-color: var(--app-border);
  box-shadow: var(--control-shadow);
}
.occ-btn-ghost:hover { transform: translateY(-1px); border-color: var(--app-border-strong); background-color: var(--control-surface-hover-bg); }
.occ-btn-sm { height: 38px; padding: 0 16px; font-size: 12px; }

/* ============================================================
   METRIC CHIPS — proof rail (terminal style)
   ============================================================ */
.metric-rail { display: flex; flex-wrap: wrap; gap: 10px; }
.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background-color: var(--chip-surface-bg);
  box-shadow: var(--control-shadow);
}
.metric-chip .val { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.metric-chip .lbl { font-size: 12px; color: var(--text-muted); }
.metric-chip .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--brand-emerald); box-shadow: 0 0 10px rgba(var(--brand-emerald-rgb), 0.5); }
.metric-chip .star { width: 13px; height: 13px; color: var(--accent); }

/* ============================================================
   WAITLIST FORM (shared baseline)
   ============================================================ */
.wl-form { display: flex; flex-direction: column; gap: 14px; }
.wl-row { display: flex; gap: 10px; }
.wl-input {
  flex: 1;
  height: 48px;
  background-color: var(--input-surface-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--r-field);
  padding: 0 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}
.wl-input::placeholder { color: var(--text-subtle); }
.wl-input:focus { border-color: var(--field-border-focus); background-color: var(--input-focus-bg); box-shadow: var(--field-focus-shadow); }
.wl-note { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.wl-trust { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.wl-trust li { font-size: 11.5px; color: var(--text-secondary); border: 1px solid var(--app-border-subtle); background: var(--dashboard-neutral-badge-bg); padding: 5px 11px; border-radius: 999px; }
.wl-success { font-size: 13px; color: var(--brand-emerald); }

/* ============================================================
   FOOTER (shared skeleton)
   ============================================================ */
.occ-footer { border-top: 1px solid var(--app-border); margin-top: 96px; }
.occ-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; padding: 56px 0 64px; }
.occ-footer h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); margin: 0 0 14px; font-weight: 500; }
.occ-footer .col { display: flex; flex-direction: column; gap: 10px; }
.occ-footer .col a { font-size: 13px; color: var(--text-secondary); transition: color var(--transition-base); }
.occ-footer .col a:hover { color: var(--text-primary); }
.occ-footer .legal { font-size: 12px; color: var(--text-subtle); }

/* ============================================================
   MOTION — reveal on scroll
   ============================================================ */
.reveal { opacity: 1; }
.reveal.in { animation: occ-rise 0.55s var(--ease-calm) both; }
.reveal.no-anim { animation: none; }
@keyframes occ-rise { from { transform: translateY(16px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal.in { animation: none; transform: none; } }

/* section rhythm */
.section { padding-block: 88px; }
.section-tight { padding-block: 56px; }
.divider { height: 1px; background: var(--app-border); border: 0; margin: 0; }

/* ============================================================
   MOBILE <768px (TJ contract: target 393, floor 360) — native primitives shared by the .gs pages
   ============================================================ */
@media (max-width: 767px) {
  .theme-toggle { width: 44px; height: 44px; }
  .occ-btn-sm { height: 44px; }
  /* 360 floor: keep header ≤ viewport — hero + join scene carry the waitlist CTA */
  .occ-header-actions { gap: 8px; }
  .occ-account-trigger { height: 44px; }
  .occ-account-menu {
    position: fixed;
    top: 72px;
    right: 12px;
    width: min(300px, calc(100vw - 24px));
  }
  .occ-account-item { min-height: 44px; }
}
@media (max-width: 480px) {
  .occ-header-actions .occ-btn-accent { display: none; }
}
@media (max-width: 380px) {
  .occ-brand-word { display: none; }
}
@media (max-width: 767px) {
  /* horizontal snap rail — the mobile home for desktop card grids (one card per swipe, next peeks) */
  .m-rail { display: flex !important; grid-template-columns: none !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding: 4px 20px 18px; margin-inline: -20px; scroll-padding-inline: 20px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .m-rail::-webkit-scrollbar { display: none; }
  .m-rail > * { flex: 0 0 82%; scroll-snap-align: center; max-width: none !important; }
  /* footer link touch comfort (spacing values live in each page's own <768 block — page styles out-cascade this file) */
  .gs-footer-nav a { padding-block: 6px; }
}
