/* ===========================================================
   TripMingle — Design Tokens
   Metaphor: two riders' paths, drawn separately, converge into
   one matched route, then keep moving — the ride is in progress.
   Amber = you, Teal = your mingler, Coral = the matched ride.
=========================================================== */

:root {
  --ink:        #101826;
  --ink-soft:   #1B2740;
  --ink-softer: #24325199;
  --paper:      #EEF1EC;
  --paper-dim:  #E2E6DF;
  --line:       #C9CFC6;
  --amber:      #F2A93B;
  --teal:       #2FA98C;
  --coral:      #F2545B;
  --text-dark:  #101826;
  --text-light: #F5F3EC;
  --text-muted: #6B7280;

  --grad-brand: linear-gradient(120deg, var(--amber), var(--coral));
  --grad-cool:  linear-gradient(120deg, var(--teal), var(--coral));

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius: 14px;
  --max-w: 1120px;
  --ease: cubic-bezier(.65,0,.35,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text-dark);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; }
a { color: inherit; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); font-size: 0.85em; letter-spacing: 0.02em; }

/* Small decorative kicker bar — replaces text labels, keeps hierarchy */
.kicker-bar {
  display: block;
  width: 34px;
  height: 4px;
  border-radius: 4px;
  background: var(--grad-brand);
  margin: 0 auto 18px;
}
.kicker-bar.left { margin: 0 0 18px; }
.kicker-bar.on-dark { background: var(--grad-cool); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(238, 241, 236, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201,207,198,0.6);
  transition: box-shadow .3s ease, background .3s ease, border-color .3s ease;
}
.nav.nav-scrolled {
  background: rgba(238, 241, 236, 0.97);
  box-shadow: 0 10px 30px rgba(16,24,38,0.08);
  border-color: transparent;
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text-dark);
}
.nav-logo .brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: block;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14);
}
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.nav-links a {
  text-decoration: none; color: var(--text-muted); transition: color .15s;
  position: relative; padding-bottom: 4px;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--coral);
  transition: width .25s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text-dark); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta {
  background: var(--ink); color: var(--text-light) !important;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  text-decoration: none !important; display: inline-block;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,38,0.25); }

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: var(--text-light); padding: 100px 0 0; position: relative; overflow: hidden; }
.hero::before, .hero::after {
  content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  filter: blur(120px); opacity: 0.24; z-index: 0; pointer-events: none;
}
.hero::before { background: var(--amber); top: -150px; left: -130px; }
.hero::after  { background: var(--teal); bottom: -120px; right: -110px; }
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; padding-bottom: 80px; }

.hero-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-particles span { position: absolute; width: 6px; height: 6px; border-radius: 50%; opacity: 0.5; animation: float 7s ease-in-out infinite; }
.hero-particles span:nth-child(1){ top: 18%; left: 8%;  background: var(--amber); animation-delay: 0s; }
.hero-particles span:nth-child(2){ top: 62%; left: 14%; background: var(--teal);  animation-delay: 1.2s; width:4px; height:4px;}
.hero-particles span:nth-child(3){ top: 30%; left: 46%; background: var(--coral); animation-delay: 2.1s; }
.hero-particles span:nth-child(4){ top: 78%; left: 52%; background: var(--amber); animation-delay: .6s; width:5px;height:5px;}
.hero-particles span:nth-child(5){ top: 12%; left: 82%; background: var(--teal);  animation-delay: 1.8s; }
.hero-particles span:nth-child(6){ top: 70%; left: 88%; background: var(--coral); animation-delay: 2.6s; width:4px;height:4px;}
@keyframes float { 0%, 100% { transform: translateY(0) translateX(0); opacity: .35; } 50% { transform: translateY(-18px) translateX(6px); opacity: .8; } }

.hero h1 { font-size: clamp(2.4rem, 4.6vw, 3.7rem); color: var(--text-light); }
.hero h1 .hl {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.hero p.lead { font-size: 1.15rem; color: #C7CDDB; max-width: 46ch; }
.btn-row { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--coral); color: #16131A; }
.btn-primary:hover { box-shadow: 0 14px 28px rgba(242,84,91,0.38); }
.btn-outline { border-color: #3A4560; color: var(--text-light); }
.btn-outline:hover { box-shadow: 0 14px 28px rgba(245,243,236,0.12); border-color: #5A6788; }

.route-art { width: 100%; height: auto; position: relative; z-index: 2; }
.route-art .path-a, .route-art .path-b { stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw 1.4s var(--ease) forwards; }
.route-art .path-a { animation-delay: .3s; }
.route-art .path-b { animation-delay: .6s; }
.route-art .path-merge { stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 1s var(--ease) 1.3s forwards; }
.route-art .flow { stroke-dasharray: 3 11; opacity: 0; animation: fadeIn .5s ease forwards, flow 1.4s linear infinite; }
.route-art .flow-a { animation-delay: 1.7s, 1.7s; }
.route-art .flow-b { animation-delay: 2s, 2s; }
@keyframes flow { to { stroke-dashoffset: -140; } }
.route-art .pt { opacity: 0; transform-origin: center; animation: pop .5s var(--ease) forwards; }
.route-art .pt-a { animation-delay: .2s; }
.route-art .pt-b { animation-delay: .5s; }
.route-art .pt-merge { animation-delay: 1.15s; }
.route-art .pt-end { animation-delay: 2.2s; }
.route-art .ring { opacity: 0; transform-origin: center; animation: ping 2.4s ease-out 1.4s infinite; }
.route-art .lbl { opacity: 0; animation: fadeIn .6s ease forwards; }
.route-art .lbl-a { animation-delay: .3s; }
.route-art .lbl-b { animation-delay: .6s; }
.route-art .lbl-m { animation-delay: 2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes ping { 0% { opacity: .55; transform: scale(1); } 75%, 100% { opacity: 0; transform: scale(2.6); } }

/* Wave divider between hero and page */
.wave-divider { display: block; width: 100%; position: relative; z-index: 2; margin-top: -2px; }

/* scroll cue */
.scroll-cue {
  position: relative; z-index: 2; display: flex; justify-content: center; padding-bottom: 14px;
}
.scroll-cue span {
  width: 22px; height: 34px; border: 2px solid #4A5A82; border-radius: 14px; position: relative; display: block;
}
.scroll-cue span::before {
  content: ''; position: absolute; top: 6px; left: 50%; width: 3px; height: 7px; border-radius: 2px;
  background: var(--coral); transform: translateX(-50%);
  animation: scrollcue 1.6s ease infinite;
}
@keyframes scrollcue { 0% { opacity: 1; top: 6px; } 70% { opacity: 0; top: 18px; } 100% { opacity: 0; top: 6px; } }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
.section-head p { color: var(--text-muted); }

/* Marquee of example matches */
.marquee-section { padding: 40px 0 56px; overflow: hidden; }
.marquee-mask { overflow: hidden; position: relative; }
.marquee-mask::before, .marquee-mask::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 70px; z-index: 2; pointer-events: none;
}
.marquee-mask::before { left: 0; background: linear-gradient(to right, var(--paper), transparent); }
.marquee-mask::after { right: 0; background: linear-gradient(to left, var(--paper), transparent); }
.marquee-track { display: flex; gap: 16px; width: max-content; animation: marquee 32s linear infinite; }
.marquee-mask:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.chip {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px 10px 12px;
  font-size: 0.88rem;
}
.chip .chip-dot { display: inline-flex; align-items: center; gap: 3px; }
.chip .chip-dot i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.chip .chip-dot i:first-child { background: var(--amber); }
.chip .chip-dot i:last-child { background: var(--teal); }
.chip .chip-tag {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--coral);
  background: rgba(242,84,91,0.1); padding: 2px 7px; border-radius: 999px; margin-left: 4px;
}

/* Interactive demo widget */
.demo { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: center; }
.demo-controls { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.control { margin-bottom: 24px; }
.control-label { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 10px; }
.control-value { font-family: var(--font-mono); color: var(--coral); font-weight: 600; }
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--amber), var(--coral));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ink); cursor: pointer;
  box-shadow: 0 2px 6px rgba(16,24,38,0.3);
  transition: transform .15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); cursor: pointer;
}
.demo-note { font-size: 0.82rem; color: var(--text-muted); margin: 4px 0 0; }

.demo-visual { display: flex; justify-content: center; }
.demo-phone {
  width: 280px; background: var(--ink); border-radius: 34px; padding: 16px;
  box-shadow: 0 30px 60px rgba(16,24,38,0.25);
  position: relative;
}
.demo-phone::before {
  content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 5px; border-radius: 4px; background: #2A3552;
}
.demo-screen { background: var(--paper); border-radius: 22px; padding: 22px 16px 18px; margin-top: 18px; }
.demo-screen svg { width: 100%; display: block; }
.demo-caption {
  text-align: center; font-size: 0.85rem; color: var(--ink); margin-top: 12px; font-weight: 600;
  transition: opacity .25s ease;
}
.demo-caption .n { color: var(--coral); font-family: var(--font-mono); }

/* Steps connected by a route line */
.steps { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.steps::before {
  content: ''; position: absolute; top: 34px; left: 4%; right: 4%; height: 2px;
  background: linear-gradient(to right, var(--amber), var(--coral), var(--teal));
  transform: scaleX(0); transform-origin: left; transition: transform 1.5s var(--ease) .15s; z-index: 0;
}
.steps.is-visible::before { transform: scaleX(1); }
.step {
  position: relative; z-index: 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.step:hover { transform: translateY(-5px); box-shadow: 0 14px 28px rgba(16,24,38,0.1); }
.step .num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 10px; }
.step h4 { font-size: 1rem; margin-bottom: 6px; }
.step p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
.step:nth-child(1) .num, .step:nth-child(2) .num { color: var(--amber); }
.step:nth-child(3) .num { color: var(--coral); }
.step:nth-child(4) .num, .step:nth-child(5) .num { color: var(--teal); }

/* Feature grid with tilt-on-hover (JS sets --rx/--ry) */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; perspective: 900px; }
.feature {
  --rx: 0deg; --ry: 0deg;
  position: relative; overflow: hidden; padding: 26px; border-radius: var(--radius); background: var(--paper-dim);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .12s ease, box-shadow .25s var(--ease);
}
.feature:hover { box-shadow: 0 20px 38px rgba(16,24,38,0.14); }
.feature::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--coral);
  transition: width .3s var(--ease);
}
.feature:hover::after { width: 100%; }
.feature .icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; font-family: var(--font-mono); font-weight: 700; color: #fff;
  transition: transform .3s var(--ease);
}
.feature:hover .icon { transform: rotate(-6deg) scale(1.08); }
.feature h3 { font-size: 1.05rem; }
.feature p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

/* Rules */
.rules { background: var(--ink-soft); color: var(--text-light); border-radius: 20px; }
.rules .wrap { padding: 56px 24px; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.rules-grid div { border: 1px solid #303C58; border-radius: 12px; padding: 20px; transition: transform .25s var(--ease), border-color .25s var(--ease); }
.rules-grid div:hover { transform: translateY(-4px); border-color: #4A5A82; }
.rules-grid .tag { font-family: var(--font-mono); font-size: 0.75rem; padding: 3px 8px; border-radius: 999px; display: inline-block; margin-bottom: 10px; }
.tag-accept { background: rgba(47,169,140,0.18); color: var(--teal); }
.tag-reject { background: rgba(242,84,91,0.18); color: var(--coral); }
.tag-lock   { background: rgba(242,169,59,0.18); color: var(--amber); }

/* CTA band */
.cta-band { position: relative; overflow: hidden; text-align: center; background: var(--paper-dim); border-radius: 20px; padding: 64px 24px; }
.cta-band::before {
  content: ''; position: absolute; inset: -60%;
  background: conic-gradient(from 0deg, var(--amber), var(--coral), var(--teal), var(--amber));
  opacity: 0.08; animation: spin 22s linear infinite; z-index: 0;
}
.cta-band > * { position: relative; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.cta-band h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }

/* ---------- Footer ---------- */
footer { background: var(--ink); color: #97A0B8; padding: 56px 0 28px; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid #263049; }
.footer-grid h5 { color: var(--text-light); font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { text-decoration: none; color: #97A0B8; transition: color .15s ease; }
.footer-grid a:hover { color: var(--text-light); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; flex-wrap: wrap; gap: 12px; }

/* ---------- Legal-page layout ---------- */
.legal-hero { background: var(--ink); color: var(--text-light); padding: 64px 0 44px; }
.legal-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.legal-hero .updated { color: #97A0B8; font-family: var(--font-mono); font-size: 0.85rem; }
.legal-body { padding: 56px 0 90px; }
.legal-body .wrap { max-width: 820px; }
.legal-body h2 { font-size: 1.3rem; margin-top: 2.2em; padding-top: 0.4em; border-top: 1px solid var(--line); }
.legal-body h2:first-of-type { border-top: none; margin-top: 0; }
.legal-body h3 { font-size: 1.05rem; margin-top: 1.4em; }
.legal-body p, .legal-body li { color: #2B3345; }
.legal-body ul { padding-left: 1.2em; }
.legal-body .callout { background: var(--paper-dim); border-left: 3px solid var(--coral); padding: 16px 18px; border-radius: 8px; font-size: 0.92rem; }
.toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 36px; }
.toc h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; font-size: 0.92rem; }

/* Support extras */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.support-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.support-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(16,24,38,0.08); }
.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item h4 { font-size: 1rem; margin-bottom: 6px; }
.faq-item p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-1 { transition-delay: .05s; } .reveal-2 { transition-delay: .12s; } .reveal-3 { transition-delay: .19s; }
.reveal-4 { transition-delay: .26s; } .reveal-5 { transition-delay: .33s; } .reveal-6 { transition-delay: .40s; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .demo { grid-template-columns: 1fr; }
  .demo-visual { order: -1; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps::before { display: none; }
  .features { grid-template-columns: 1fr 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .support-grid { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .demo-phone { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .route-art path, .route-art .pt { opacity: 1 !important; stroke-dashoffset: 0 !important; }
  .marquee-track { animation: none !important; }
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--coral); outline-offset: 2px;
}
