/* EdgeTrack site styles.
   Colours are tokens on :root: a bright light set (default when the system is light),
   a lifted dark set (default when the system is dark), and manual overrides via data-theme.
   Glass surfaces have a solid fallback for browsers without backdrop-filter.
   Buttons and cards use small radii. Pills are used only on small supporting elements. */

:root {
  --bg: #0e1a2c;
  --bg-glow: rgba(46, 230, 200, 0.16);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --surface-solid: #16243a;
  --border: rgba(255, 255, 255, 0.16);
  --text: #f1f7ff;
  --muted: #b5c4d8;
  --accent: #2ee6c8;
  --accent-ink: #03241f;
  --accent-2: #38bdf8;
  --accent-glow: rgba(46, 230, 200, 0.22);
  --warm: #fbbf24;
  --gain: #4ade80;
  --loss: #fb7185;
  --focus: #7dfbe3;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.30);
  --radius: 12px;
  --max: 1120px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2fbfa;
    --bg-glow: rgba(20, 184, 166, 0.22);
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: #ffffff;
    --surface-solid: #ffffff;
    --border: rgba(12, 74, 68, 0.14);
    --text: #0b1f2a;
    --muted: #3d5563;
    --accent: #08877a;
    --accent-ink: #ffffff;
    --accent-2: #0369a1;
    --accent-glow: rgba(20, 184, 166, 0.20);
    --warm: #b45309;
    --gain: #047857;
    --loss: #b91c1c;
    --focus: #08877a;
    --shadow: 0 18px 40px rgba(11, 31, 42, 0.10);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f2fbfa;
  --bg-glow: rgba(20, 184, 166, 0.22);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --surface-solid: #ffffff;
  --border: rgba(12, 74, 68, 0.14);
  --text: #0b1f2a;
  --muted: #3d5563;
  --accent: #08877a;
  --accent-ink: #ffffff;
  --accent-2: #0369a1;
  --accent-glow: rgba(20, 184, 166, 0.20);
  --warm: #b45309;
  --gain: #047857;
  --loss: #b91c1c;
  --focus: #08877a;
  --shadow: 0 18px 40px rgba(11, 31, 42, 0.10);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1a2c;
  --bg-glow: rgba(46, 230, 200, 0.16);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --surface-solid: #16243a;
  --border: rgba(255, 255, 255, 0.16);
  --text: #f1f7ff;
  --muted: #b5c4d8;
  --accent: #2ee6c8;
  --accent-ink: #03241f;
  --accent-2: #38bdf8;
  --accent-glow: rgba(46, 230, 200, 0.22);
  --warm: #fbbf24;
  --gain: #4ade80;
  --loss: #fb7185;
  --focus: #7dfbe3;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.30);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  z-index: 200;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

main { flex: 1; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--surface-solid);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

/* Buttons: rectangles with a small radius */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, filter 200ms ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }

/* Small pill elements */
.theme-toggle,
.pill,
.tag {
  border-radius: 999px;
}
.theme-toggle {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle { white-space: nowrap; }

.tag {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid transparent;
  margin: 0 0 12px;
}

/* Glass surfaces */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    backdrop-filter: blur(14px) saturate(125%);
  }
}

/* Sections */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--border); }

.eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }

.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 24px;
}

.muted { color: var(--muted); }

/* Hero */
.hero {
  position: relative;
  padding: 72px 0 56px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 80%;
  background: radial-gradient(60% 60% at 30% 30%, var(--bg-glow), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  gap: 40px;
  align-items: center;
  grid-template-columns: 1fr;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.hero-note { font-size: 0.9rem; color: var(--muted); margin: 0; }

.hero-visual { padding: 20px; }
.hero-visual svg { width: 100%; height: auto; }

/* Illustration line that draws in once it is on screen */
.draw-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.is-drawn .draw-line,
.tab-panel.is-active .draw-line {
  animation: drawLine 1.4s 0.2s ease forwards;
}
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* Cards and grids */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.card { padding: 22px; }
.card .icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 14px;
}
.card p { margin: 0; color: var(--muted); }

/* Linked hover: one control lifts the cards it relates to */
.link-group .card {
  transition: transform 240ms ease, border-color 240ms ease;
}
.link-group.is-linked .card {
  transform: translateY(-4px);
  border-color: var(--accent);
}

/* Three short points on the home page */
.points { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 24px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; padding: 22px; }
.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  margin-bottom: 12px;
}
.steps p { margin: 0; color: var(--muted); }

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

/* Tabs: interactive sections. Pill switcher, rectangular panels. */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 24px;
  max-width: 100%;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.tab-panel[hidden] { display: none; }
.tab-panel.is-active { animation: panelIn 320ms ease both; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.tab-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.tab-layout .glass { padding: 24px; }
.tab-layout ul { padding-left: 20px; color: var(--muted); margin: 0; }
.tab-layout li { margin-bottom: 6px; }
.chart-card svg { width: 100%; height: auto; margin-bottom: 8px; }
.chart-card figcaption { color: var(--muted); font-size: 0.85rem; }

/* Pricing */
.price-card { padding: 28px; }
.price-card .amount { font-size: 2rem; font-weight: 700; margin: 8px 0; }
.price-card ul { padding-left: 20px; color: var(--muted); }

/* FAQ */
.faq details {
  padding: 18px 22px;
  margin-bottom: 12px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
}
.faq details[open] summary::after { content: "-"; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* Notices (draft legal pages and pre-launch placeholders) */
.notice {
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  margin-bottom: 24px;
  color: var(--muted);
}
.notice strong { color: var(--text); }

.prose { max-width: 72ch; }
.prose h2 { margin-top: 36px; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 20px; }

/* Cursor glow: a soft light that follows the pointer over interactive elements only.
   Set up by site.js; only shown for fine pointers and when motion is allowed. */
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 1;
}
.cursor-glow.is-on { opacity: 1; }

/* Logo intro: plays once per session on the home page. Skippable. */
.intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg);
  transition: opacity 500ms ease, visibility 0s linear 500ms;
}
.intro.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-stage {
  display: flex;
  align-items: center;
  gap: 18px;
}
.intro-stage img { width: 96px; height: 96px; border-radius: 22px; }
.intro-stage .pg { animation: introIn 700ms 100ms ease both; }
.intro-bar {
  width: 96px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left center;
  animation: introBar 600ms 900ms ease both;
}
.intro-stage .em { animation: introIn 700ms 1500ms ease both; }
.intro-word {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  animation: introIn 600ms 2000ms ease both;
}
.intro-by {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  animation: introIn 600ms 2300ms ease both;
}
.intro-skip {
  position: absolute;
  right: 16px;
  top: 16px;
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
@keyframes introIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes introBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--surface-solid);
}
.footer-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: start;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.site-footer p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* 404 */
.center-page { text-align: center; padding: 96px 0; }

/* Wider layouts from tablet up */
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .points { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr auto; }
  .tab-layout { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
}

/* Phones: collapse the nav into a toggle */
.nav-cta-mobile { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-primary { display: none; }
  .nav-cta-mobile { display: block; }
  .nav-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }
  .nav-list.is-open { display: flex; }
  .nav-list a { display: block; padding: 12px 0; font-size: 1rem; }
  .site-header .container { position: relative; }
  .tabs { border-radius: 14px; }
  .tab { padding: 8px 12px; font-size: 0.9rem; }
}

/* Motion: none when reduced motion is requested. Drawn lines show in their final state. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .draw-line { stroke-dashoffset: 0; }
  .intro { display: none; }
  .cursor-glow { display: none; }
}
