:root {
  --page: #f3f3f5;
  --surface: #ffffff;
  --surface-alt: #dad7f7;
  --text: #00012f;
  --muted: #4a4d6a;
  --accent: #8b60ff;
  --accent-deep: #15004f;
  --accent-alt: #6b4fd4;
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --radius: 16px;
  --radius-sm: 8px;
  --rail-w: clamp(240px, 18vw, 300px);
  --content-max: 1280px;
  --section-space: clamp(4rem, 8vw, 7rem);
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  line-height: 1.55;
  font-family: var(--font-body);
  background: var(--page);
  color: var(--text);
}

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

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

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.2rem, 4.8vw, 4.6rem);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.75rem, 3.2vw, 3rem);
  margin-bottom: 0.85rem;
}

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

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

.page-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, var(--page));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.rail-inner {
  width: min(var(--content-max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.85rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  max-width: 64px;
  max-height: 64px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  overflow: hidden;
  flex: 0 0 auto;
}

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

.brand small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
}

.side-rail nav {
  display: none;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.side-rail nav a {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}

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

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.header-cta {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: auto;
}

.header-cta,
.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-color: var(--accent-deep);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.button:hover,
.header-cta:hover {
  transform: translateY(-2px);
}

.main-stage {
  min-width: 0;
}

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

.section {
  padding: var(--section-space) 0;
}

.section:nth-of-type(even) {
  background: color-mix(in srgb, var(--surface) 70%, var(--page));
}

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

.lead {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  max-width: 42rem;
  color: var(--muted);
}

.fact-disclaimer {
  font-size: 0.78rem !important;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hero {
  padding: clamp(2.5rem, 6vw, 5rem) 0 var(--section-space);
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 42%),
    linear-gradient(165deg, var(--page), color-mix(in srgb, var(--surface-alt) 35%, var(--page)));
}

.hero-layout {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.hero-copy { min-width: 0; }

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.75rem 0 1rem;
}

.geo-line {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--muted);
}

.hero-visual {
  overflow: hidden;
  width: 100%;
  min-height: 0 !important;
  aspect-ratio: 3 / 2;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 64px color-mix(in srgb, var(--accent-deep) 12%, transparent);
}

.hero-visual img,
.hero-visual > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-heading {
  max-width: 52rem;
  margin-bottom: 2rem;
}

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

.stats-band {
  padding: clamp(2rem, 4vw, 3rem) 0;
  background: var(--text);
  color: #fff;
}

.stats-band h2,
.stats-band p { color: color-mix(in srgb, #fff 78%, transparent); }

.stats-band .fact-disclaimer {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: color-mix(in srgb, #fff 85%, transparent) !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1.25rem 1rem;
  border-top: 2px solid var(--accent);
  background: color-mix(in srgb, #fff 4%, transparent);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.stat strong {
  display: block;
  font-size: 2rem;
  font-family: var(--font-mono);
  color: var(--accent);
}

.stat span { font-weight: 700; color: #fff; }

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

.services-bento {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.services-bento .card {
  grid-column: span 4;
}

.services-bento .card:nth-child(1),
.services-bento .card:nth-child(4) {
  grid-column: span 6;
}

.card {
  min-width: 0;
  padding: 1.35rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent-deep) 10%, transparent);
}

.card p { margin-bottom: 0; }

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

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

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

.card small {
  display: block;
  color: var(--muted);
  margin-top: 0.45rem;
  font-size: 0.82rem;
}

.process-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  position: relative;
}

.process-timeline::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 20%, transparent));
}

.process-timeline li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0 1.25rem 0;
  min-width: 0;
}

.step-icon {
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  background: var(--surface);
}

.calculator-panel {
  background: linear-gradient(145deg, var(--accent-deep), color-mix(in srgb, var(--accent-deep) 80%, #000));
  color: #fff;
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(1.5rem, 4vw, 3rem);
}

.calculator-panel .section-kicker,
.calculator-panel h2 { color: #fff; }

.calculator-panel p { color: color-mix(in srgb, #fff 78%, transparent); }

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.calculator-form {
  display: grid;
  gap: 1rem;
  background: color-mix(in srgb, #000 22%, transparent);
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, #fff 12%, transparent);
}

.component-geography {
  background: var(--text) !important;
  color: #fff;
}

.component-geography p,
.component-geography span {
  color: color-mix(in srgb, #fff 72%, transparent);
}

.component-geography .section-kicker { color: var(--accent); }

.geo-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.geo-chip {
  padding: 1.1rem 1.2rem;
  border: 1px solid color-mix(in srgb, #fff 16%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, #fff 5%, transparent);
}

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

.geo-chip span {
  color: color-mix(in srgb, #fff 70%, transparent);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.chapter {
  min-width: 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.faq-list { max-width: 100%; }

.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list p { padding-right: 1.5rem; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-form,
.calculator-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  background: var(--surface);
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.contact-form label { color: var(--muted); }

input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--page);
  color: var(--text);
  padding: 0.82rem;
  border-radius: var(--radius-sm);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

output {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 800;
}

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

.benefits-masonry,
.scenarios-masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.site-footer {
  padding: 3.5rem 0;
  background: color-mix(in srgb, var(--text) 94%, #000);
  color: color-mix(in srgb, #fff 78%, transparent);
  border-top: 1px solid color-mix(in srgb, #fff 10%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand {
  font-size: 1.4rem;
  color: #fff;
}

.site-footer h3 {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
}

.site-footer a {
  display: block;
  color: color-mix(in srgb, #fff 65%, transparent);
  margin: 0.35rem 0;
}

.icon-draw path { stroke-dasharray: 34 8; animation: iconDraw 12s linear infinite; }
.icon-pulse { transform-box: fill-box; transform-origin: center; animation: iconPulse 12s ease-in-out infinite; }
.icon-slide { animation: iconSlide 12s ease-in-out infinite; }
.icon-spin { transform-box: fill-box; transform-origin: center; animation: iconSpin 14s linear infinite; }

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

@media (min-width: 1100px) {
  .page-shell {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    max-width: 2160px;
    margin: 0 auto;
  }

  .side-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    border-bottom: none;
    border-right: 1px solid var(--line);
  }

  .rail-inner {
    width: auto;
    height: 100%;
    margin: 0;
    padding: 1.5rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
    white-space: normal;
  }

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

  .side-rail nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    flex: 1;
  }

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

  .header-cta {
    margin-left: 0;
    width: 100%;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
    gap: clamp(2rem, 4vw, 4rem);
  }

  .section-inner {
    width: min(calc(100% - 3rem), calc(var(--content-max) - var(--rail-w) * 0.15));
  }
}

@media (max-width: 1099px) {
  .side-rail nav { display: none; }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services-bento .card,
  .services-bento .card:nth-child(1),
  .services-bento .card:nth-child(4) { grid-column: span 6; }
  .calculator-grid,
  .contact-grid,
  .guide-grid,
  .benefits-masonry,
  .scenarios-masonry,
  .geo-chips,
  .footer-grid { grid-template-columns: 1fr; }
  .hero-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .section-inner { width: min(100% - 1.5rem, var(--content-max)); }
  .services-bento .card,
  .services-bento .card:nth-child(1),
  .services-bento .card:nth-child(4) { grid-column: span 12; }
  .stats-grid { grid-template-columns: 1fr; }
  .section { padding: 3.5rem 0; }
  .brand-logo { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-icon, .step-icon, .card-icon svg, .step-icon svg,
  .card-icon path, .step-icon path, .card { animation: none !important; transition: none !important; }
  .button:hover, .header-cta:hover, .card:hover { transform: none; }
}
