/* ============================================================
   TrailSight — marketing site styles
   Dark, enterprise-security aesthetic. Self-contained, no deps.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:            #0B1220;
  --bg-alt:        #0E1726;
  --surface:       #131F38;
  --surface-2:     #16243f;
  --border:        rgba(140, 165, 200, 0.16);
  --border-strong: rgba(140, 165, 200, 0.28);

  /* Brand */
  --primary:       #1E3A5F;
  --accent:        #D9B65C;   /* brand gold */
  --accent-2:      #5B9DF9;   /* salesforce-ish blue (used sparingly) */
  --accent-ink:    #211803;   /* text on gold */

  /* Text */
  --text:          #EAF1FB;
  --text-soft:     #C3D0E2;
  --muted:         #93A4C0;

  /* Severity */
  --sev-crit:      #FF6B6B;
  --sev-high:      #F8A65A;
  --sev-med:       #F2D26A;
  --sev-low:       #56D7A6;
  --sev-blind:     #8FA2FF;

  /* Metrics */
  --maxw:          1140px;
  --radius:        12px;
  --radius-sm:     8px;
  --gap:           24px;
  --shadow:        0 18px 48px -24px rgba(0, 0, 0, 0.7);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", "Consolas", "Liberation Mono", monospace;
}

/* ----------------------------- Reset ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--text); line-height: 1.18; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 650; }
h3 { font-size: 1.18rem; font-weight: 620; }
p  { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; }

/* ----------------------------- A11y ----------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----------------------------- Layout ----------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 .8rem;
}
.section-lead {
  font-size: 1.08rem;
  color: var(--text-soft);
  max-width: 62ch;
  margin-bottom: 2.4rem;
}
.footnote { font-size: 0.82rem; color: var(--muted); margin-top: .8rem; }

/* ----------------------------- Buttons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-weight: 600; font-size: 0.98rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -10px rgba(212, 175, 85, 0.55); }
.btn-primary:hover { background: #E6C879; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 9px 16px; font-size: 0.92rem; }
.btn-lg { padding: 14px 28px; font-size: 1.04rem; }

/* ----------------------------- Header ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { flex: none; display: block; object-fit: contain; }
.brand-name { font-size: 1.18rem; letter-spacing: -0.02em; }

.main-nav { display: flex; align-items: center; }
.nav-menu { list-style: none; display: flex; align-items: center; gap: 1.5rem; }
.nav-menu a:not(.btn) { color: var(--text-soft); font-size: 0.96rem; font-weight: 500; }
.nav-menu a:not(.btn):hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 10px; cursor: pointer;
}
.nav-toggle-bar { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
.nav-toggle-bar + .nav-toggle-bar { margin-top: 4px; }

/* ----------------------------- Hero ----------------------------- */
.hero { padding: clamp(48px, 7vw, 92px) 0 clamp(56px, 8vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 60% at 78% 8%, rgba(212, 175, 85, 0.12), transparent 60%),
    radial-gradient(50% 50% at 12% 0%, rgba(212, 175, 85, 0.06), transparent 55%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero-copy { max-width: 38rem; }
.lead { font-size: 1.16rem; color: var(--text-soft); margin: 1.2rem 0 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.8rem; }
.hero-trust {
  list-style: none; display: flex; flex-wrap: wrap; gap: 1.2rem;
  font-size: 0.86rem; color: var(--muted);
}
.hero-trust li { position: relative; padding-left: 1.1rem; }
.hero-trust li::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* Panels (mockups) */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.panel-title { margin-left: 8px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.panel-body { padding: 14px; }

.findings-panel .finding-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px; border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text-soft);
}
.findings-panel .finding-row + .finding-row { margin-top: 2px; }
.findings-panel .finding-row:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.finding-text { line-height: 1.35; }

.flow-panel { margin-top: 16px; }
.flow-panel .flow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 16px 14px 4px;
}
.flow-node {
  font-family: var(--mono); font-size: 0.74rem; color: var(--text-soft);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 9px;
  background: rgba(255, 255, 255, 0.02); white-space: nowrap;
}
.flow-node-sf { border-color: rgba(91, 157, 249, 0.5); color: #cfe0ff; }
.flow-node-ts { border-color: rgba(212, 175, 85, 0.55); color: #F0DDA8; }
.flow-arrow { flex: none; opacity: 0.9; }
.flow-caption { font-size: 0.8rem; color: var(--muted); padding: 4px 14px 14px; margin: 0; }

/* Severity badges */
.sev {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; border: 1px solid currentColor;
  min-width: 42px;
}
.sev-crit  { color: var(--sev-crit);  background: rgba(255, 107, 107, 0.10); }
.sev-high  { color: var(--sev-high);  background: rgba(248, 166, 90, 0.10); }
.sev-med   { color: var(--sev-med);   background: rgba(242, 210, 106, 0.10); }
.sev-low   { color: var(--sev-low);   background: rgba(86, 215, 166, 0.10); }

/* ----------------------------- Cards ----------------------------- */
.card-grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color .18s ease, transform .18s ease, background-color .18s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card h3 { margin-bottom: .5rem; }
.card p { margin: 0; color: var(--text-soft); font-size: 0.97rem; }
.card em { color: var(--text); font-style: italic; }

/* Detection cards */
.detect { display: flex; flex-direction: column; }
.detect-ico {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(212, 175, 85, 0.10); border: 1px solid var(--border);
  color: var(--text);
}
.detect-ico svg { width: 24px; height: 24px; fill: none; }

/* ----------------------------- Pillars ----------------------------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.pillar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.pillar-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pillar-head h3 { margin: 0; }
.ico { width: 30px; height: 30px; flex: none; color: var(--text); }
.pillar > p { color: var(--text-soft); margin-bottom: .9rem; }

.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li {
  position: relative; padding-left: 28px; font-size: 0.94rem; color: var(--text-soft); line-height: 1.45;
}
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 7px;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(212, 175, 85, 0.14);
}
.ticks-lg li { font-size: 1rem; padding-left: 30px; margin-bottom: 4px; }
.ticks-lg strong { color: var(--text); }

/* Source chips */
.sources { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }
.sources-label { color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }
.chip-row { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px;
}

/* ----------------------------- Steps ----------------------------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); counter-reset: step; }
.step {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.step-num {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  font-family: var(--mono); font-weight: 700; font-size: 0.95rem;
  color: var(--accent); background: rgba(212, 175, 85, 0.12);
  border: 1px solid var(--border-strong);
  margin-bottom: 14px;
}
.step h3 { margin-bottom: .4rem; }
.step p { margin: 0; font-size: 0.95rem; color: var(--text-soft); }

/* ----------------------------- Outcomes ----------------------------- */
.outcome {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 24px 26px;
}
.outcome h3 { margin-bottom: .4rem; }
.outcome p { margin: 0; color: var(--text-soft); font-size: 0.97rem; }

/* ----------------------------- Finding cards ----------------------------- */
.finding-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.finding-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.finding-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.finding-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sev.sev-crit, .sev.sev-high, .sev.sev-med, .sev.sev-low { padding: 4px 10px; min-width: 0; font-size: 0.68rem; }
.finding-tag { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.02em; }
.finding-card h3 { font-size: 1.08rem; margin-bottom: .6rem; }
.finding-desc { color: var(--text-soft); font-size: 0.95rem; margin-bottom: .8rem; }
.finding-why { font-size: 0.92rem; color: var(--muted); margin: 0; }
.finding-why strong { color: var(--text-soft); }

/* ----------------------------- Regulated ----------------------------- */
.reg-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.reg-note { margin-top: 1.4rem; font-size: 0.85rem; color: var(--muted); }
.coverage-panel { width: 100%; }
.coverage-body { display: grid; gap: 14px; padding: 20px 18px; }
.cov-row { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 12px; }
.cov-label { font-family: var(--mono); font-size: 0.78rem; color: var(--text-soft); }
.cov-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.cov-fill { display: block; height: 100%; border-radius: 999px; }
.f-crit { background: var(--sev-crit); } .f-high { background: var(--sev-high); }
.f-med { background: var(--sev-med); } .f-low { background: var(--sev-low); } .f-blind { background: var(--sev-blind); }
.coverage-foot { font-size: 0.78rem; color: var(--muted); padding: 0 18px 16px; margin: 0; }

/* ----------------------------- CTA band ----------------------------- */
.cta-band {
  padding: clamp(56px, 8vw, 92px) 0;
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(212, 175, 85, 0.14), transparent 60%),
    var(--bg-alt);
  border-top: 1px solid var(--border);
}
.cta-inner { text-align: center; max-width: 44rem; }
.cta-inner h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.cta-inner p { color: var(--text-soft); font-size: 1.08rem; margin-bottom: 1.8rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ----------------------------- Footer ----------------------------- */
.site-footer { background: var(--bg); border-top: 1px solid var(--border); padding: 48px 0 40px; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; align-items: start; }
.footer-tag { color: var(--muted); font-size: 0.9rem; margin: .7rem 0 0; max-width: 24ch; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: var(--text-soft); font-size: 0.94rem; }
.footer-nav a:hover { color: var(--text); text-decoration: none; }
.footer-contact { text-align: left; }
.footer-email { font-weight: 600; font-size: 1rem; }
.footer-legal { color: var(--muted); font-size: 0.84rem; margin: .8rem 0 0; }
.footer-legal.subtle { font-size: 0.78rem; opacity: 0.8; }

/* ----------------------------- Reveal animation ----------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { order: 2; }
  .pillars { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .reg-grid { grid-template-columns: 1fr; gap: 32px; }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu li { width: 100%; }
  .nav-menu a:not(.btn) { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-menu .btn { width: 100%; margin-top: 12px; }

  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .finding-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-cta .btn, .cta-actions .btn { flex: 1 1 auto; }
}

/* ----------------------------- Reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
