/* Forma-inspired travel atlas — wide balanced layout system */
:root {
  --page: #f3f3f5;
  --surface: #ffffff;
  --surface-alt: #dad7f7;
  --text: #00012f;
  --muted: #4a4f6a;
  --accent: #8b60ff;
  --accent-deep: #15004f;
  --accent-alt: #5a8cff;
  --rail-w: clamp(240px, 16vw, 300px);
  --canvas-pad: clamp(1.25rem, 2.8vw, 4rem);
  --section-space: clamp(4rem, 7vw, 7rem);
  --radius: 16px;
  --radius-pill: 52px;
  --max-canvas: min(100%, 1920px);
}

*, *::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.6;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  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 {
  font-size: clamp(2.4rem, 4.8vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

h2 {
  font-size: clamp(1.85rem, 3.2vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  font-weight: 400;
}

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

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

/* ── Page shell: side rail + full-width canvas ── */
.page-frame {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

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

.page-main {
  width: 100%;
}

/* ── Side rail ── */
.site-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  z-index: 40;
  background: color-mix(in srgb, var(--page) 92%, var(--surface));
  border-right: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.rail-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
  padding: clamp(1rem, 2vw, 1.75rem);
  min-width: 0;
}

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

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  max-width: 64px;
  max-height: 64px;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
}

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

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

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.rail-nav a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) * 0.75);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  background: var(--surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.rail-cta,
.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  max-width: 100%;
}

.rail-cta {
  margin-top: auto;
  width: 100%;
}

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

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

/* ── Canvas inner: centered, full-width balanced ── */
.canvas-inner,
.section-inner {
  width: 100%;
  max-width: var(--max-canvas);
  margin-inline: auto;
  padding-inline: var(--canvas-pad);
}

/* ── Hero ── */
.atlas-hero {
  padding: clamp(2.5rem, 5vw, 5rem) 0 var(--section-space);
  background:
    radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%),
    linear-gradient(160deg, var(--page), color-mix(in srgb, var(--surface-alt) 35%, var(--page)));
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: center;
  width: 100%;
}

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

.eyebrow,
.section-kicker {
  display: block;
  font-size: 0.72rem;
  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: 52ch;
  color: var(--muted);
}

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

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

.hero-visual {
  overflow: hidden;
  width: 100%;
  min-height: clamp(280px, 38vw, 520px);
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--surface);
  justify-self: stretch;
}

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

.hero-visual:has(img)::before,
.hero-visual:has(img)::after,
.hero-visual:has(svg)::before,
.hero-visual:has(svg)::after { display: none !important; }

/* Map animations (preserved from source) */
.route-shell { fill: none; stroke: #66686b; stroke-width: 2; opacity: 0.34; }
.route-main {
  fill: none;
  stroke: url(#routeGradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10 14;
  animation: routeFlow 12s linear infinite;
}
.contour { fill: none; stroke: #43d6c2; stroke-width: 1.4; opacity: 0.24; }
.city-point { fill: #eff9ef; stroke: #f0ebdb; stroke-width: 3; }
.city-point-selected { fill: #af8134; stroke: #111827; stroke-width: 4; }
.city-halo {
  fill: url(#mapGlow);
  transform-box: fill-box;
  transform-origin: center;
  animation: cityPulse 10s ease-out var(--delay, 0s) infinite;
}
.city-label {
  fill: #111827;
  font: 600 18px system-ui, Arial, sans-serif;
  paint-order: stroke;
  stroke: #f0ebdb;
  stroke-width: 5px;
  stroke-linejoin: round;
}

@keyframes routeFlow { to { stroke-dashoffset: -108; } }
@keyframes cityPulse {
  0% { transform: scale(0.4); opacity: 0.8; }
  75%, 100% { transform: scale(1.7); opacity: 0; }
}

/* ── Sections ── */
.atlas-band {
  padding: var(--section-space) 0;
  width: 100%;
}

.atlas-band-alt {
  background: color-mix(in srgb, var(--surface-alt) 28%, var(--page));
}

.section-heading {
  max-width: 72ch;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

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

/* Cards mosaic — fills canvas width */
.cards-mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  width: 100%;
}

.card {
  min-width: 0;
  padding: clamp(1.1rem, 2vw, 1.5rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.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) 25%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 12px;
}

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

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

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

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

.card-value {
  display: block;
  margin-top: 0.85rem;
  color: var(--accent-deep);
  font-size: 1.05rem;
  font-weight: 700;
}

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

/* Process rail — 5 columns on wide */
.process-rail {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  width: 100%;
}

.process-rail li {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.process-rail .step-icon { margin-bottom: 0; flex: 0 0 auto; }

/* Geography matrix */
.geo-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  width: 100%;
}

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

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

.geo-chip span {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.45rem;
}

/* Guide — two-column on wide */
.guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  width: 100%;
}

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

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

/* FAQ */
.faq-list {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
}

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

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

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

/* Contact split — balanced 50/50 */
.contact-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  width: 100%;
}

.contact-form {
  display: grid;
  gap: 1rem;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

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

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

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

.tripscan-disclaimer {
  font-size: 0.82rem !important;
  border-left: 3px solid var(--accent);
  padding: 0.6rem 0.8rem;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

/* Footer — full canvas width */
.site-footer {
  padding: clamp(2.5rem, 4vw, 4rem) 0;
  background: color-mix(in srgb, var(--surface) 85%, var(--page));
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  width: 100%;
}

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

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

.footer-coverage {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Ultra-wide: use full 2160px canvas deliberately ── */
@media (min-width: 1440px) {
  :root {
    --canvas-pad: clamp(2rem, 3.5vw, 5rem);
    --max-canvas: min(100%, calc(100vw - var(--rail-w) - 2rem));
  }

  .hero-stage {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  }

  .cards-mosaic {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .atlas-band-scenarios .cards-mosaic {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1800px) {
  .hero-stage {
    grid-template-columns: minmax(0, 1fr) minmax(520px, 1.2fr);
    gap: 5rem;
  }

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

/* ── Tablet ── */
@media (max-width: 1100px) {
  .page-frame {
    grid-template-columns: 1fr;
  }

  .site-rail {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 50;
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  }

  .rail-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem var(--canvas-pad);
    height: auto;
  }

  .rail-brand { flex: 0 1 auto; }

  .rail-nav {
    flex: 1 1 auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    order: 3;
    width: 100%;
  }

  .rail-cta {
    margin-top: 0;
    width: auto;
    margin-left: auto;
    order: 2;
  }

  .hero-stage {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 320px;
    max-width: 100%;
  }

  .cards-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .geo-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-columns {
    grid-template-columns: 1fr;
  }

  .faq-list {
    grid-template-columns: 1fr;
  }

  .contact-split {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Mobile ── */
@media (max-width: 560px) {
  :root {
    --canvas-pad: 1rem;
    --section-space: 3.5rem;
  }

  .rail-nav { display: none; }

  .rail-inner {
    justify-content: space-between;
  }

  .rail-cta {
    padding: 0.6rem 0.9rem;
    font-size: 0.75rem;
  }

  h1 { font-size: clamp(2rem, 12vw, 3.2rem); }
  h2 { font-size: clamp(1.6rem, 8vw, 2.2rem); }

  .cards-mosaic,
  .process-rail,
  .geo-matrix,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual { min-height: 240px; }

  .card { padding: 1.1rem; }
}

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

  .route-main,
  .city-halo,
  .card-icon,
  .step-icon,
  .card-icon svg,
  .step-icon svg,
  .card-icon path,
  .step-icon path,
  .card {
    animation: none !important;
    transition: none !important;
  }
}
