/* TripScan variant 1 — atlas-rail editorial layout (olive-terracotta / lumora-inspired) */

:root {
  --page: #efe0cd;
  --page-alt: #f8f1de;
  --surface: #ffffff;
  --surface-muted: #f3ece3;
  --text: #4f220f;
  --muted: #607556;
  --accent: #b96a4c;
  --accent-alt: #7b2524;
  --line: #d4c4b0;
  --line-strong: #b0ba98;
  --radius: 14px;
  --radius-lg: 22px;
  --section-space: clamp(4rem, 8vw, 7rem);
  --rail-width: clamp(220px, 18vw, 280px);
  --content-max: min(1280px, calc(100% - clamp(2rem, 5vw, 4rem)));
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::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.65;
  font-family: var(--font-body);
  background: var(--page);
  color: var(--text);
  background-image:
    linear-gradient(165deg, color-mix(in srgb, var(--line-strong) 18%, transparent), transparent 42%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 47px,
      color-mix(in srgb, var(--line) 35%, transparent) 47px,
      color-mix(in srgb, var(--line) 35%, transparent) 48px
    );
}

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);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
}

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

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

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

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

/* ── Page shell: sidebar rail + main canvas ── */

.page-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 2160px;
  margin: 0 auto;
}

.page-main {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, var(--page));
}

.site-rail {
  position: sticky;
  top: 0;
  align-self: start;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-height: 100vh;
  max-height: 100vh;
  padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.5rem);
  background: color-mix(in srgb, var(--page-alt) 88%, var(--surface));
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.rail-brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.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%;
}

.brand-text {
  min-width: 0;
  line-height: 1.2;
}

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

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

.rail-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rail-nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-color: var(--line);
}

.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.88rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.header-cta {
  width: 100%;
  margin-top: auto;
  white-space: nowrap;
}

.button-primary,
.header-cta {
  background: var(--accent);
  color: var(--surface);
}

.button-primary:hover,
.header-cta:hover {
  background: var(--accent-alt);
  border-color: var(--accent-alt);
}

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

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-alt);
}

/* ── Section rhythm ── */

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

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

.section:nth-child(even) {
  background: color-mix(in srgb, var(--surface-muted) 55%, transparent);
}

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

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  max-width: 52ch;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
}

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

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

/* ── Hero: editorial stack over visual band ── */

.hero {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 calc(var(--section-space) * 0.85);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 90%, transparent), transparent 55%),
    radial-gradient(ellipse 80% 60% at 85% 15%, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}

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

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

.geo-line {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-visual {
  order: 2;
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, var(--page-alt));
  box-shadow:
    0 24px 48px color-mix(in srgb, var(--text) 8%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
}

.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;
}

/* ── Process: vertical timeline rail ── */

.component-process .section-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.component-process .section-heading {
  position: sticky;
  top: 1.5rem;
  margin-bottom: 0;
}

.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.process-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.step-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-radius: 12px;
}

.step-icon svg {
  width: 26px;
  height: 26px;
}

/* ── Card grids: bento on wide, stack on narrow ── */

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

.card {
  min-width: 0;
  padding: 1.4rem 1.35rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 4%, transparent);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 16px 36px color-mix(in srgb, var(--text) 7%, transparent);
}

.cards-grid .card:nth-child(1),
.cards-grid .card:nth-child(4),
.cards-grid .card:nth-child(7) {
  grid-column: span 4;
}

.cards-grid .card:nth-child(2),
.cards-grid .card:nth-child(5) {
  grid-column: span 4;
}

.cards-grid .card:nth-child(3),
.cards-grid .card:nth-child(6) {
  grid-column: span 4;
}

.component-benefits .cards-grid .card {
  grid-column: span 6;
}

.component-benefits .cards-grid .card:nth-child(3),
.component-benefits .cards-grid .card:nth-child(4) {
  grid-column: span 6;
}

.card p { margin-bottom: 0; }

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

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

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

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

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

/* Icon motion */
.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.92); opacity: 0.78; } }
@keyframes iconSlide { 50% { transform: translateX(3px); } }
@keyframes iconSpin { to { transform: rotate(360deg); } }

/* ── Geography chips ── */

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

.geo-chip {
  padding: 1.25rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-alt);
  border-radius: var(--radius);
}

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

.geo-chip strong {
  color: var(--text);
  margin-bottom: 0.45rem;
}

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

/* ── Guide: sticky intro + chapter ledger ── */

.component-guide .section-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  max-width: min(1320px, var(--content-max));
}

.component-guide .section-heading {
  position: sticky;
  top: 1.25rem;
  margin-bottom: 0;
}

.guide-body {
  min-width: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.chapter {
  min-width: 0;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.chapter h3 {
  color: var(--text);
}

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

/* ── FAQ ── */

.component-faq .section-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.component-faq .section-heading {
  position: sticky;
  top: 1.25rem;
  margin-bottom: 0;
}

.faq-list {
  max-width: none;
}

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

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}

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

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

/* ── Contact ── */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--text) 5%, 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) 18%, transparent);
  background: var(--page-alt);
  color: var(--text);
  padding: 0.8rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
}

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

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

/* ── Footer ── */

.site-footer {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  background: color-mix(in srgb, var(--text) 92%, var(--accent-alt));
  color: color-mix(in srgb, var(--page-alt) 92%, white);
  border-top: 3px solid var(--accent);
}

.site-footer p,
.site-footer a,
.site-footer h3 {
  color: inherit;
}

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

.footer-brand {
  font-size: 1.45rem;
  font-family: var(--font-display);
}

.site-footer a {
  display: block;
  margin: 0.35rem 0;
  opacity: 0.82;
}

.site-footer a:hover {
  opacity: 1;
  color: var(--page-alt);
}

.footer-coverage {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ── Wide desktop balance (1440–2160) ── */

@media (min-width: 1440px) {
  .page-shell {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  }

  .section-inner,
  .hero-grid {
    width: min(1280px, calc(100% - 4rem));
    margin-left: auto;
    margin-right: auto;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  }
}

@media (min-width: 1800px) {
  .section-inner,
  .hero-grid {
    width: min(1360px, calc(100% - 5rem));
  }
}

/* ── Tablet ── */

@media (max-width: 1100px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .site-rail {
    position: relative;
    min-height: auto;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

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

  .rail-nav {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    order: 3;
  }

  .rail-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .header-cta {
    width: auto;
    margin-top: 0;
    flex: 0 0 auto;
  }

  .page-main {
    border-left: none;
  }

  .component-process .section-inner,
  .component-guide .section-inner,
  .component-faq .section-inner {
    grid-template-columns: 1fr;
  }

  .component-process .section-heading,
  .component-guide .section-heading,
  .component-faq .section-heading {
    position: static;
  }

  .cards-grid .card,
  .component-benefits .cards-grid .card {
    grid-column: span 6 !important;
  }

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

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

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

/* ── Mobile ── */

@media (max-width: 640px) {
  .section-inner {
    width: min(100% - 1.75rem, 1180px);
  }

  .hero {
    padding-top: 2rem;
  }

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

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

  .hero-copy {
    order: 1;
  }

  .cards-grid .card,
  .component-benefits .cards-grid .card {
    grid-column: span 12 !important;
  }

  .geo-chips,
  .footer-grid,
  .process-list {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: clamp(2rem, 11vw, 2.75rem);
  }

  h2 {
    font-size: clamp(1.65rem, 8vw, 2.2rem);
  }

  .section {
    padding: 3.5rem 0;
  }
}

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

  .card,
  .button,
  .header-cta,
  .rail-nav a {
    transition: none !important;
  }

  .card:hover {
    transform: none;
  }

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