/**
 * Marketing shell — dual-theme design tokens + scroll reveal.
 * Canonical variables for nav (site-nav.js) and landing (index.html).
 */

:root {
  /* Motion — shared with marketing pages (scroll-reveal.js, index choreography) */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-reveal-duration: 0.68s;
  --motion-stagger-step: 55ms;

  --accent: #5eead4;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --accent-hover: #99f6e4;
  --accent-secondary: #818cf8;
  --bg: #0e0e10;
  --bg-elevated: #161618;
  --bg-card: #161618;
  --border: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-primary: #f3f4f6;
  --text-secondary: rgba(255, 255, 255, 0.68);
  --text-tertiary: rgba(255, 255, 255, 0.42);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --max-w: 1280px;
  --section-py: 112px;
  --gutter-x: 40px;
  --gutter-x-wide: 48px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 10px 36px rgba(0, 0, 0, 0.32);
  --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.38);
  --site-nav-bg: rgba(14, 14, 16, 0.76);
  --site-nav-bg-scrolled: rgba(14, 14, 16, 0.94);
  --site-nav-border: rgba(255, 255, 255, 0.06);
  --site-nav-shadow: none;
  --cta-gradient: linear-gradient(135deg, #5eead4 0%, #818cf8 100%);
  --cta-gradient-hover: linear-gradient(135deg, #99f6e4 0%, #a78bfa 100%);
  --cta-ink: #08111d;
  --focus-ring: 0 0 0 3px rgba(94, 234, 212, 0.18);
  --modal-overlay: rgba(0, 0, 0, 0.72);
  --modal-panel: linear-gradient(180deg, rgba(24, 24, 27, 0.98), rgba(12, 12, 14, 0.98));
}

html.light {
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --accent-hover: #0f766e;
  --accent-secondary: #6366f1;
  --bg: #f6f5f3;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.05);
  --text-primary: #0f172a;
  --text-secondary: rgba(15, 23, 42, 0.65);
  --text-tertiary: rgba(15, 23, 42, 0.42);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 14px 40px rgba(0, 0, 0, 0.09);
  --site-nav-bg: rgba(255, 255, 255, 0.82);
  --site-nav-bg-scrolled: rgba(255, 255, 255, 0.95);
  --site-nav-border: rgba(15, 23, 42, 0.07);
  --site-nav-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
  --cta-gradient: linear-gradient(135deg, #0d9488 0%, #6366f1 100%);
  --cta-gradient-hover: linear-gradient(135deg, #0f766e 0%, #4f46e5 100%);
  --cta-ink: #ffffff;
  --focus-ring: 0 0 0 3px rgba(13, 148, 136, 0.18);
  --modal-overlay: rgba(15, 23, 42, 0.45);
  --modal-panel: #ffffff;
}

/* ─── Scroll-triggered reveal (paired with js/scroll-reveal.js) ─── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--motion-reveal-duration) var(--ease-out-expo),
    transform var(--motion-reveal-duration) var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── Nav scroll state (base .site-nav layout lives in site-nav.js) ─── */
.site-nav.site-nav--scrolled {
  background: var(--site-nav-bg-scrolled) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}
html.light .site-nav.site-nav--scrolled {
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

/* ─── Universal focus ring (accessible, theme-aware) ─── */
:where(button, a, input, select, textarea, [role='button'], [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  white-space: nowrap;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--cta-gradient);
  color: var(--cta-ink);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(94, 234, 212, 0.18);
}
.btn--primary:hover {
  background: var(--cta-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(94, 234, 212, 0.24);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
html.light .btn--ghost {
  background: #ffffff;
  border-color: #dbe4ef;
  color: #0f172a;
}
html.light .btn--ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn--soft {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn--soft:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-primary);
}
html.light .btn--soft {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}
html.light .btn--soft:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ─── Form fields ─────────────────────────────────────── */
.field-label {
  display: grid;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.field-input,
.field-textarea,
.field-select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.field-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}
.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.42);
  box-shadow: var(--focus-ring);
}
html.light .field-input,
html.light .field-textarea,
html.light .field-select {
  background: #ffffff;
  border-color: #dbe4ef;
  color: #0f172a;
}
html.light .field-input:focus,
html.light .field-textarea:focus,
html.light .field-select:focus {
  border-color: rgba(13, 148, 136, 0.45);
}

/* ─── Modal shell ─────────────────────────────────────── */
.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--modal-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal-shell.open {
  display: flex;
}
.modal-shell__panel {
  width: min(560px, 100%);
  border-radius: var(--radius-lg);
  padding: 26px;
  background: var(--modal-panel);
  border: 1px solid var(--border);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.55);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
html.light .modal-shell__panel {
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  border-color: #e2e8f0;
}
.modal-shell__title {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.modal-shell__lede {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 18px;
}
.modal-shell__form {
  display: grid;
  gap: 12px;
}
.modal-shell__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-shell__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .modal-shell__row {
    grid-template-columns: 1fr;
  }
}

/* ─── Preview tile (padded gradient frame for media) ─── */
.preview-tile {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: linear-gradient(
    145deg,
    rgba(94, 234, 212, 0.1) 0%,
    rgba(129, 140, 248, 0.08) 50%,
    rgba(8, 10, 14, 0.92) 100%
  );
  border: 1px solid rgba(94, 234, 212, 0.18);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.preview-tile__inner {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(8, 10, 14, 0.6);
}
html.light .preview-tile {
  background: linear-gradient(
    145deg,
    rgba(13, 148, 136, 0.08) 0%,
    rgba(99, 102, 241, 0.06) 50%,
    #ffffff 100%
  );
  border-color: rgba(13, 148, 136, 0.18);
}
html.light .preview-tile__inner {
  background: #f8fafc;
}

/* ─── Value-prop strip (promoted from index.html) ───── */
.value-prop-strip {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.value-prop-strip > .value-prop-card {
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 10px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.value-prop-strip > .value-prop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(94, 234, 212, 0.22);
}
.value-prop-card__kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.value-prop-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.value-prop-card__copy {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}
@media (max-width: 768px) {
  .value-prop-strip {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }
}

/* ─── Page header band (eyebrow → h1 → lede) ───────── */
.page-header-band {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 28px;
  display: grid;
  gap: 12px;
}
.page-header-band__eyebrow {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.page-header-band__title {
  font-size: clamp(2.2rem, 4.2vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0;
  color: var(--text-primary);
}
.page-header-band__lede {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  max-width: 56ch;
}
.page-header-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
@media (max-width: 768px) {
  .page-header-band {
    padding: 40px 16px 22px;
  }
}

/* ─── Toast (canonical) ───────────────────────────────── */
.cl-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  background: rgba(24, 24, 27, 0.96);
  color: #f1f5f9;
  border: 1px solid rgba(94, 234, 212, 0.22);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.25s ease;
  z-index: 250;
}
.cl-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
html.light .cl-toast {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(13, 148, 136, 0.28);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.16);
}

/* ─── Empty state panel ───────────────────────────────── */
.empty-panel {
  max-width: 420px;
  margin: 56px auto;
  padding: 36px 28px;
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  display: grid;
  gap: 12px;
  justify-items: center;
}
.empty-panel__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-panel__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}
.empty-panel__copy {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.55;
}

/* ─── Rail edge fade (apply on a wrapper around .rail-track) ─── */
.rail-edge-mask {
  position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}

/* ─── Detail loading, skeleton, error (concept/item and similar) ─── */
@keyframes cl-sk-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.error-state {
  display: grid;
  place-items: center;
  min-height: min(60vh, 640px);
  padding: min(10vh, 64px) 24px;
}

.loading-state {
  max-width: 1100px;
  padding: 8px 0 32px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}
@media (min-width: 900px) {
  .loading-state {
    grid-template-columns: 1.25fr 1fr;
    align-items: start;
  }
}
.loading-state__hero {
  display: grid;
  gap: 14px;
}
.loading-state__aside {
  display: grid;
  gap: 12px;
}
.loading-state__preview {
  height: min(320px, 42vh);
  min-height: 200px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.loading-state__preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 36%, rgba(148, 163, 184, 0.08) 50%, transparent 64%);
  animation: cl-sk-sweep 1.8s ease-in-out infinite;
}
html.light .loading-state__preview {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
}

.ux-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.1);
}
.ux-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.06) 50%, transparent 62%);
  animation: cl-sk-sweep 1.75s ease-in-out infinite;
}
html.light .ux-skeleton {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
}
html.light .ux-skeleton::after {
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.65) 50%, transparent 62%);
}
.ux-skeleton--text {
  height: 18px;
  margin-bottom: 12px;
  width: 100%;
}
.ux-skeleton--row {
  height: 72px;
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  width: 100%;
}
.ux-skeleton--avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
}

.error-pro {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(32px, 6vw, 48px) clamp(22px, 4vw, 36px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.97), rgba(12, 12, 14, 0.98));
  box-shadow: var(--shadow-card);
}
html.light .error-pro {
  background: #fff;
  border-color: #dbe4ef;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}
.error-pro__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(94, 234, 212, 0.16);
}
html.light .error-pro__icon {
  border-color: rgba(13, 148, 136, 0.18);
}
.error-pro h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.error-pro p {
  margin: 0 0 22px;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.95rem;
}
.error-pro__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.error-pro__row a,
.error-pro__row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.error-pro__primary {
  background: var(--cta-gradient);
  color: var(--cta-ink);
  box-shadow: 0 8px 22px rgba(94, 234, 212, 0.15);
  text-decoration: none;
}
.error-pro__primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.error-pro__ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.error-pro__ghost:hover {
  color: var(--text-primary);
  border-color: rgba(94, 234, 212, 0.25);
}
html.light .error-pro__ghost {
  border-color: #dbe4ef;
}
.error-pro__hint {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .loading-state__preview::after,
  .ux-skeleton::after {
    animation: none !important;
  }
  .error-pro__primary:hover {
    transform: none;
  }
}
