/* =====================================================================
 * Trail Status Pro — Marketing site
 * Mobile-first. Predictable gutters. Hard ceilings on widths so nothing
 * can overflow. Same palette as admin-web.
 * ===================================================================== */

:root {
  /* Surfaces — warm-tinted near-black */
  --bg:           #0a0a07;
  --surface:      #14140f;
  --surface-2:    #1d1d17;
  --surface-hi:   #25251d;
  --border:       #2b2b22;
  --border-hi:    #3a3a30;

  /* Text */
  --text:         #f3f1e5;
  --text-dim:     #a8a698;
  --text-mute:    #686659;

  /* Brand */
  --olive:        #c4b454;
  --olive-hover:  #d4c464;
  --olive-soft:   rgba(196, 180, 84, 0.12);
  --olive-strong: rgba(196, 180, 84, 0.25);
  --orange:       #e88a2f;

  /* Status semantic */
  --open:         #5fb86b;
  --closed:       #e34c4c;
  --partial:      #d4a017;

  /* Type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
          "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;

  /* Layout — single source of truth */
  --container: 1180px;
  --gutter: clamp(20px, 4vw, 36px);
  --section-y: clamp(56px, 8vw, 96px);
  --stack-gap: clamp(36px, 5vw, 56px);
}

/* ---------------------------------------------------------------------
 * Reset + base — mobile-first, no overflow surprises
 * ------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at center, rgba(196,180,84,0.04) 1px, transparent 1px),
    radial-gradient(ellipse at top, rgba(196,180,84,0.06), transparent 60%);
  background-size: 28px 28px, auto;
  background-attachment: fixed;
  min-height: 100vh;
}

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

a { color: var(--olive); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--olive-hover); }

::selection { background: var(--olive-strong); color: var(--text); }

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  font-weight: 700;
  text-wrap: balance;
}

/* Fluid type — no breakpoint cliffs */
h1 { font-size: clamp(2.2rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.8rem); }
h4 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }

p { color: var(--text-dim); }

.lede {
  color: var(--text-dim);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  max-width: 56ch;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------
 * Layout primitives
 * ------------------------------------------------------------------- */

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

section {
  padding-block: var(--section-y);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.section-header h2 { margin-bottom: 14px; }
.section-header .lede { margin-inline: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
  background: var(--olive-soft);
  border: 1px solid var(--olive-strong);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--olive);
  box-shadow: 0 0 0 4px var(--olive-soft);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------
 * Buttons + store badges
 * ------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--sans);
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--olive);
  color: #1a1607;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 22px rgba(196,180,84,0.18);
}
.btn-primary:hover { background: var(--olive-hover); color: #1a1607; transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-hi);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--olive-strong); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.store-badge:hover { border-color: var(--olive); background: var(--surface-2); color: var(--text); }
.store-badge .store-line { display: flex; flex-direction: column; line-height: 1.1; }
.store-badge .store-line small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.store-badge .store-line strong { font-weight: 600; font-size: 0.95rem; }
.store-badge svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--olive); }
.store-badge.coming-soon { opacity: 0.86; }
.store-badge.coming-soon strong::after {
  content: " · coming soon";
  font-weight: 500;
  color: var(--text-mute);
  font-size: 0.85em;
}

/* ---------------------------------------------------------------------
 * Sticky header — collapses to 2-row layout under 860px
 * ------------------------------------------------------------------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(10, 10, 7, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

header.top .row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px var(--gutter);
  max-width: var(--container);
  margin-inline: auto;
  flex-wrap: wrap;
}

header.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: auto;
}
header.top .brand img { height: 36px; width: auto; }
header.top .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
header.top .brand-text strong {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
header.top .brand-text small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  white-space: nowrap;
}

header.top nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
header.top nav a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: color .15s ease;
}
header.top nav a:hover { color: var(--text); }

header.top .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
header.top .actions .btn { padding: 9px 16px; font-size: 0.88rem; }

/* Mobile header: nav drops to a 2nd row that scrolls horizontally */
@media (max-width: 860px) {
  header.top nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  header.top nav::-webkit-scrollbar { display: none; }
  header.top .brand-text small { display: none; }
}

@media (max-width: 480px) {
  header.top .actions .btn-ghost { display: none; }
  header.top .brand img { height: 30px; }
}

/* ---------------------------------------------------------------------
 * Hero — stacks on mobile, splits at 900px
 * ------------------------------------------------------------------- */

.hero {
  padding-top: clamp(40px, 7vw, 80px);
  padding-bottom: clamp(20px, 3vw, 40px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--stack-gap);
  /* Top-align on desktop so the taller phone column doesn't push the
   * text column into the middle with dead space above the eyebrow.
   * On mobile (single column) align-items is moot. */
  align-items: start;
}

.hero h1 { margin-bottom: 18px; }
.hero .lede { margin-bottom: 28px; }

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.hero-buttons .btn { min-width: 0; flex: 0 1 auto; }

.mini-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.mini-stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r);
}
.mini-stat strong {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 6px;
}
.mini-stat span { font-size: 0.92rem; color: var(--text-dim); }

.hero-phone {
  position: relative;
  max-width: 380px;
  margin-inline: auto;
  width: 100%;
}
.phone-frame {
  position: relative;
  border-radius: var(--r-2xl);
  overflow: hidden;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--olive-soft),
    0 20px 60px rgba(0,0,0,0.55);
}
.phone-frame img { width: 100%; }

.floating-card {
  /* Mobile default: stacks under the phone, normal flow */
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}
.floating-card .fc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.floating-card .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--open);
  box-shadow: 0 0 0 4px rgba(95,184,107,0.15);
  flex-shrink: 0;
}
.floating-card h4 { font-size: 0.95rem; }
.floating-card p { font-size: 0.88rem; color: var(--text-dim); }

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(40px, 5vw, 64px);
  }
  .mini-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-phone { margin: 0 0 0 auto; }
  .floating-card {
    position: absolute;
    bottom: -28px;
    left: -16px;
    width: 240px;
    margin-top: 0;
  }
}

/* ---------------------------------------------------------------------
 * Feature grid — 1 col mobile, 2 col tablet, 3 col desktop
 * ------------------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.feature-card {
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  transition: border-color .2s ease, transform .2s ease;
}
.feature-card:hover { border-color: var(--olive-strong); transform: translateY(-2px); }

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  background: var(--olive-soft);
  border: 1px solid var(--olive-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--olive);
  margin-bottom: 16px;
}
.feature-icon svg { width: 20px; height: 20px; }

.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 0.95rem; }

@media (min-width: 720px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------------
 * Showcase (split image + bullets) — stacks on mobile
 * ------------------------------------------------------------------- */

.showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--stack-gap);
  align-items: center;
}

.showcase-text h2 { margin-bottom: 14px; }
.showcase-text .lede { margin-bottom: 22px; }

.bullets {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bullet {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.bullet-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--olive-soft);
  color: var(--olive);
  border: 1px solid var(--olive-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
}
.bullet-mark svg { width: 12px; height: 12px; }
.bullet-text strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 0.95rem;
}
.bullet-text span { color: var(--text-dim); font-size: 0.92rem; }

.showcase-image {
  border-radius: var(--r-2xl);
  overflow: hidden;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  max-width: 100%;
}
.showcase-image img { width: 100%; }

@media (min-width: 900px) {
  .showcase { grid-template-columns: 1fr 1fr; }
  /* Visual reversal — image first on desktop without rtl trickery */
  .showcase.reverse .showcase-image { order: 1; }
  .showcase.reverse .showcase-text { order: 2; }
}

/* ---------------------------------------------------------------------
 * Gallery — phone screenshot grid
 * ------------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.gallery-card {
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease;
}
.gallery-card:hover { border-color: var(--olive-strong); transform: translateY(-2px); }
.gallery-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--border);
}
.gallery-body { padding: 18px; }
.gallery-body h4 { margin-bottom: 6px; }
.gallery-body p { color: var(--text-dim); font-size: 0.92rem; }

@media (min-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------------
 * Video showcase
 * ------------------------------------------------------------------- */

.video-frame {
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border-radius: var(--r-2xl);
  border: 1px solid var(--border-hi);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------------------------------------------------------------------
 * CTA block
 * ------------------------------------------------------------------- */

.cta {
  text-align: center;
  padding: clamp(40px, 7vw, 80px) var(--gutter);
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border-hi);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, var(--olive-soft), transparent 55%);
  pointer-events: none;
}
.cta > * { position: relative; z-index: 1; }
.cta h2 { margin-bottom: 14px; }
.cta .lede { margin: 0 auto 22px; }
.cta .store-row { justify-content: center; }
.cta .hero-buttons { justify-content: center; margin-bottom: 0; }

/* ---------------------------------------------------------------------
 * FAQ
 * ------------------------------------------------------------------- */

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin-inline: auto;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.faq-item h4 { margin-bottom: 6px; color: var(--text); }
.faq-item p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------------------------------------------------------------------
 * Footer — stacks tight on mobile, fans out at 600+ then 900+
 * ------------------------------------------------------------------- */

footer.site {
  border-top: 1px solid var(--border);
  padding-block: clamp(40px, 6vw, 60px);
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.footer-brand img { height: 48px; width: auto; margin-bottom: 14px; }
.footer-brand p {
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 360px;
}
.footer-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 12px;
  font-weight: 600;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { color: var(--text-dim); font-size: 0.92rem; }
.footer-col ul a:hover { color: var(--text); }

.footer-base {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}

/* ---------------------------------------------------------------------
 * Doc pages (privacy / terms)
 * ------------------------------------------------------------------- */

.doc-wrap {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.doc-wrap h1 { margin-bottom: 10px; }
.doc-meta {
  font-family: var(--mono);
  color: var(--text-mute);
  font-size: 0.82rem;
  margin-bottom: 36px;
}
.doc-wrap h2 {
  font-size: 1.25rem;
  margin: 32px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.doc-wrap h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.doc-wrap p, .doc-wrap li {
  color: var(--text-dim);
  font-size: 0.96rem;
  line-height: 1.7;
}
.doc-wrap p + p { margin-top: 12px; }
.doc-wrap ul, .doc-wrap ol {
  padding-left: 22px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-wrap strong { color: var(--text); font-weight: 600; }
.doc-wrap code {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  font-size: 0.85em;
  color: var(--olive);
}

/* ---------------------------------------------------------------------
 * Reveal on scroll
 * ------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1);
  /* Fail-safe: if JS never adds .show (no JS, slow JS, ad blocker,
   * Reader-mode-style stripping), auto-reveal at 1.2s so the image
   * never stays permanently invisible. The animation still triggers
   * via JS in the normal case because that runs well under 1.2s. */
  animation: revealFallback 1ms ease 1.2s forwards;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

@keyframes revealFallback {
  to { opacity: 1; transform: translateY(0); }
}

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