/* TripScan variant 1 — editorial side-rail journal (Olive Terracotta) */
:root {
  --page: #efe0cd;
  --surface: #fffdf9;
  --surface-alt: #f5ebe0;
  --text: #3d1f1a;
  --muted: #607556;
  --accent: #b96a4c;
  --accent-alt: #7b2524;
  --ink-soft: #8a6f62;
  --rail-w: 280px;
  --canvas-max: 1480px;
  --radius: 18px;
  --radius-sm: 10px;
  --section-space: clamp(4rem, 8vw, 7rem);
  --font-display: Georgia, "Times New Roman", Times, 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;
  --shadow-soft: 0 18px 48px color-mix(in srgb, var(--accent-alt) 8%, transparent);
  --line: color-mix(in srgb, var(--text) 14%, transparent);
}

*, *::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:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%),
    linear-gradient(165deg, var(--page), color-mix(in srgb, var(--surface-alt) 70%, var(--page)));
}

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.02em;
  line-height: 1.08;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.4rem, 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);
  margin-bottom: 0.5rem;
}

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

/* Shell: side rail + balanced canvas */
.page-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.site-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  z-index: 40;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, var(--page));
  backdrop-filter: blur(10px);
}

.site-rail-header {
  position: static;
  background: transparent;
  border: 0;
}

.rail-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100vh;
  padding: 1.35rem 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

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

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

.brand small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.site-rail-header nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
}

.site-rail-header nav a {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.62rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

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

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

.header-cta, .button-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-alt) 55%, var(--accent)));
  color: var(--surface);
  border-color: color-mix(in srgb, var(--accent-alt) 40%, var(--accent));
}

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

.header-cta:hover, .button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.page-canvas {
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
}

.page-main {
  width: min(var(--canvas-max), 100%);
  padding-bottom: 2rem;
}

.section-inner {
  width: 100%;
  margin: 0 auto;
}

/* Hero — editorial stack */
.component-hero {
  padding: clamp(2.5rem, 6vw, 5rem) 0 var(--section-space);
}

.component-hero .hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.component-hero .hero-copy {
  max-width: 52rem;
}

.eyebrow, .section-kicker {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--accent-alt);
  font-family: var(--font-mono);
}

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  max-width: 44rem;
  color: var(--text);
}

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

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

.hero-visual {
  overflow: hidden;
  width: 100%;
  min-height: clamp(280px, 42vw, 520px);
  aspect-ratio: 16 / 10;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-alt) 80%, var(--accent) 6%);
  box-shadow: var(--shadow-soft);
}

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

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

.section-heading {
  max-width: 46rem;
  margin-bottom: 2.25rem;
}

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

/* Process — vertical timeline rail */
.component-process .process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
}

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

.component-process .process-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.35rem 0 1.35rem 0;
  background: transparent;
  border-radius: 0;
  position: relative;
}

.component-process .process-list li::after {
  content: none;
}

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

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

/* Geography — horizontal scroll cards on wide, stack on narrow */
.component-geography .geo-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.geo-chip {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

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

/* Card grids — bento rhythm */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  min-width: 0;
  padding: 1.45rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  grid-column: span 4;
}

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

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

.component-scenarios .card:nth-child(odd) { grid-column: span 5; }
.component-scenarios .card:nth-child(even) { grid-column: span 7; }

.card p { margin-bottom: 0; }

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

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

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

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

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

/* Guide — two-column chapters */
.component-guide .section-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

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

.guide-body {
  min-width: 0;
  display: grid;
  gap: 1rem;
}

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

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

/* FAQ */
.faq-list { max-width: none; }

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

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

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

/* Contact */
.component-contact .section-inner.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

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

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

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

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

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

/* Footer */
.site-footer {
  padding: 3.5rem 0 2rem;
  background: color-mix(in srgb, var(--accent-alt) 6%, var(--page));
  border-top: 1px solid var(--line);
  margin-top: var(--section-space);
}

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

.footer-brand { font-size: 1.35rem; color: var(--text); }

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

.site-footer a:hover { color: var(--accent-alt); }

/* Icon motion — slow ambient loops */
.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); } }

/* Wide desktop balance */
@media (min-width: 1600px) {
  :root {
    --canvas-max: 1560px;
    --rail-w: 300px;
  }

  .page-canvas {
    padding-inline: clamp(2rem, 4vw, 4rem);
  }
}

@media (min-width: 2000px) {
  :root { --canvas-max: 1680px; }
}

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

  .site-rail {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-inner {
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

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

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

  .brand { order: 1; }

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

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

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

  .card,
  .component-services .card,
  .component-benefits .card,
  .component-scenarios .card {
    grid-column: auto !important;
  }

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

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

/* Mobile */
@media (max-width: 640px) {
  .page-canvas { padding-inline: 0.85rem; }

  .rail-inner { padding: 0.75rem; }

  .site-rail-header nav { display: none; }

  .header-cta {
    margin-left: auto;
    padding: 0.65rem 0.9rem;
    font-size: 0.85rem;
  }

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

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

  .hero-visual { min-height: 240px; aspect-ratio: 4 / 3; }

  .cards-grid,
  .component-geography .geo-chips,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section { padding: 3.5rem 0; }

  .card { padding: 1.15rem; }

  .component-process .process-list::before { left: 18px; }
}

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

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

  .header-cta:hover,
  .button:hover {
    transform: none;
  }
}
