/* Helion-inspired layout — side rail + content canvas. Mobile-first overflow containment. */

:root {
  --page: #02040d;
  --surface: #060c22;
  --surface-raised: #0d1430;
  --text: #ffffff;
  --muted: #9fb8ff;
  --muted-soft: #4d5a8a;
  --accent: #3a5cff;
  --accent-alt: #ff5fa8;
  --line: #12266b;
  --radius: 14px;
  --rail-w: 248px;
  --content-max: 1320px;
  --section-space: clamp(3.5rem, 6vw, 6.5rem);
  --font-display: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  line-height: 1.6;
  font-family: var(--font-body);
  background: var(--page);
  color: var(--text);
  background-image:
    radial-gradient(1200px 700px at 85% -5%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    radial-gradient(900px 500px at 0% 100%, color-mix(in srgb, var(--accent-alt) 8%, transparent), transparent 50%);
}

body, button, input, select, textarea { font: inherit; }

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h1 {
  font-size: clamp(1.85rem, 5.2vw, 4.25rem);
  line-height: 1.02;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.45rem, 3.2vw, 2.75rem);
  line-height: 1.08;
  margin-bottom: 0.85rem;
}

h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.2;
}

p { color: var(--muted); overflow-wrap: anywhere; }

/* ── Shell: rail + main ── */
.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.page-main {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.page-content {
  min-width: 0;
  max-width: 100%;
}

/* ── Side rail (desktop) / top bar (mobile) ── */
.site-rail {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.75rem clamp(0.85rem, 3vw, 1.25rem);
  background: color-mix(in srgb, var(--page) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  backdrop-filter: blur(12px);
  min-width: 0;
  max-width: 100%;
}

.rail-brand-row {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.brand > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand small {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--muted-soft);
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-logo {
  display: block;
  width: clamp(36px, 8vw, 48px);
  height: clamp(36px, 8vw, 48px);
  max-width: 64px;
  max-height: 64px;
  border-radius: 10px;
  object-fit: contain;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-logo svg { width: 100%; height: 100%; }

.rail-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.rail-nav a {
  font-size: clamp(0.68rem, 2vw, 0.74rem);
  color: var(--muted);
  padding: 0.45rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.rail-nav a:hover {
  color: var(--text);
  border-color: var(--accent);
}

.rail-cta-wrap {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: clamp(0.78rem, 2.2vw, 0.88rem);
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

.header-cta {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-alt)));
  color: var(--text);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #1a2a6e));
  color: var(--text);
}

.button-secondary {
  background: transparent;
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  color: var(--text);
}

/* ── Hero (vexon side-rail composition) ── */
.hero {
  padding: clamp(1.5rem, 4vw, 3rem) clamp(0.85rem, 3vw, 2rem) var(--section-space);
  min-width: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: end;
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  min-width: 0;
}

.hero-copy {
  min-width: 0;
  max-width: 100%;
  order: 2;
}

.hero-visual {
  order: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--surface);
}

.hero-visual svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
}

.eyebrow,
.section-kicker {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  margin-bottom: 0.85rem;
  color: var(--accent-alt);
}

.lead {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.5rem 0 1rem;
  max-width: 100%;
}

.geo-line {
  font-size: 0.78rem;
  color: var(--muted-soft);
}

/* ── Sections ── */
.section {
  padding: var(--section-space) clamp(0.85rem, 3vw, 2rem);
  min-width: 0;
  max-width: 100%;
}

.section-inner {
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  min-width: 0;
}

.section-heading {
  max-width: 68ch;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.section-heading > p { font-size: 1rem; }

.fact-disclaimer {
  font-size: 0.76rem !important;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--accent-alt);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  overflow-wrap: anywhere;
}

/* ── Cards & grids ── */
.cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  min-width: 0;
}

.card {
  min-width: 0;
  max-width: 100%;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
}

.card p { margin-bottom: 0; }

.card-icon,
.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.85rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 10px;
  flex-shrink: 0;
}

.card-icon svg,
.step-icon svg {
  width: 26px;
  height: 26px;
  overflow: visible;
}

.card-label {
  display: block;
  color: var(--accent-alt);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.55rem;
}

.card small {
  display: block;
  color: var(--muted-soft);
  margin-top: 0.35rem;
}

/* ── Process timeline ── */
.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  min-width: 0;
}

.process-list li {
  display: flex;
  gap: 0.85rem;
  padding: clamp(1rem, 2vw, 1.25rem);
  background: var(--surface-raised);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  min-width: 0;
}

.process-list li > div { min-width: 0; }

.step-icon { margin-bottom: 0; }

/* ── Stats band ── */
.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  min-width: 0;
}

.stat {
  padding: 1rem 1.1rem;
  border-top: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  min-width: 0;
}

.stat strong {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.stat span { font-weight: 700; }

.stat p { font-size: 0.82rem; margin: 0.35rem 0 0; }

/* ── Geography ── */
.geo-chips {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  min-width: 0;
}

.geo-chip {
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}

.geo-chip strong,
.geo-chip span { display: block; }

.geo-chip span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Guide chapters ── */
.guide-body {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.chapter {
  padding: clamp(1rem, 2.5vw, 1.35rem);
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface) 88%, var(--page));
  border-radius: 0 var(--radius) var(--radius) 0;
  min-width: 0;
}

.chapter li {
  color: var(--muted);
  margin: 0.4rem 0;
}

/* ── FAQ ── */
.faq-list {
  max-width: 100%;
  min-width: 0;
}

.faq-list details {
  border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  padding: 0.85rem 0;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
  overflow-wrap: anywhere;
  padding-right: 0.5rem;
}

.faq-list p {
  padding-right: 0.5rem;
  overflow-wrap: anywhere;
}

/* ── Forms ── */
.contact-grid,
.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  min-width: 0;
}

.contact-form,
.calculator-form {
  display: grid;
  gap: 0.85rem;
  background: var(--surface-raised);
  padding: clamp(1rem, 2.5vw, 1.35rem);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  min-width: 0;
  max-width: 100%;
}

.contact-form label,
.calculator-form label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
  min-width: 0;
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  background: var(--page);
  color: var(--text);
  padding: 0.75rem;
  border-radius: calc(var(--radius) * 0.65);
}

textarea {
  min-height: 100px;
  resize: vertical;
  max-width: 100%;
}

output {
  font-size: 1.05rem;
  color: var(--accent-alt);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.form-message { color: var(--accent-alt); margin: 0; }

/* ── Footer ── */
.site-footer {
  padding: clamp(2rem, 4vw, 3.5rem) clamp(0.85rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--surface) 85%, var(--page));
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  min-width: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  min-width: 0;
}

.footer-brand { font-size: 1.25rem; }

.site-footer a {
  display: block;
  color: var(--muted);
  margin: 0.3rem 0;
  overflow-wrap: anywhere;
}

/* ── Icon motion (desktop only, slow loops) ── */
@media (min-width: 721px) and (prefers-reduced-motion: no-preference) {
  .icon-draw path { stroke-dasharray: 34 8; animation: iconDraw 12s linear infinite; }
  .icon-pulse { animation: iconPulse 12s ease-in-out infinite; }
  .icon-slide { animation: iconSlide 12s ease-in-out infinite; }
  .icon-spin { animation: iconSpin 14s linear infinite; }
}

@keyframes iconDraw { to { stroke-dashoffset: -84; } }
@keyframes iconPulse { 50% { transform: scale(0.92); opacity: 0.78; } }
@keyframes iconSlide { 50% { transform: translateX(2px); } }
@keyframes iconSpin { to { transform: rotate(360deg); } }

/* ── Tablet ── */
@media (min-width: 721px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .geo-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .contact-grid,
  .calculator-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
  }

  .hero-copy { order: 1; }
  .hero-visual { order: 2; }
}

/* ── Desktop side rail ── */
@media (min-width: 1101px) {
  .page-shell {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    min-height: 100vh;
  }

  .site-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 1.25rem 1rem;
    border-bottom: none;
    border-right: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    overflow-y: auto;
    overflow-x: clip;
  }

  .rail-brand-row {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .rail-nav {
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 auto;
    padding: 1rem 0;
  }

  .rail-nav a {
    border-radius: var(--radius);
    text-align: left;
  }

  .rail-cta-wrap {
    flex: 0 0 auto;
    width: 100%;
  }

  .header-cta {
    width: 100%;
  }

  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .process-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .geo-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1441px) {
  :root { --content-max: 1480px; --rail-w: 260px; }

  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(2rem, 4vw, 4rem);
  }
}

@media (min-width: 1800px) {
  :root { --content-max: 1680px; }
}

/* Clip embedded SVG motion so transforms never bleed past the viewport */
.hero-visual,
.brand-logo {
  overflow: hidden;
  contain: paint;
}

@media (max-width: 1100px) {
  .hero-visual svg *,
  .brand-logo svg * {
    animation: none !important;
    transform: none !important;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card-icon, .step-icon, .card-icon svg, .step-icon svg, .card-icon path, .step-icon path {
    animation: none !important;
  }
}
