/* TripScan variant 1 — ridge editorial atlas layout system */

:root {
  --page: #eceae4;
  --surface: #faf9f6;
  --surface-ink: #1a1a18;
  --surface-muted: #5c5a56;
  --text: #121210;
  --muted: #6b6862;
  --accent: #8b4518;
  --accent-alt: #2d6a5a;
  --rule: color-mix(in srgb, var(--text) 14%, transparent);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --section-space: clamp(4rem, 8vw, 7rem);
  --rail-width: 280px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, 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.62;
  font-family: var(--font-body);
  background: var(--page);
  color: var(--text);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, color-mix(in srgb, var(--accent-alt) 6%, transparent) 39px, color-mix(in srgb, var(--accent-alt) 6%, transparent) 40px),
    radial-gradient(ellipse 80% 50% at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%);
}

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;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  line-height: 0.98;
  margin-bottom: 1.25rem;
}

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

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

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

/* Shell: fixed rail + flowing main */
.page-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.page-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  z-index: 40;
  border-right: 1px dashed var(--rule);
  background: color-mix(in srgb, var(--surface) 92%, var(--page));
}

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

/* Header as vertical rail */
.site-header {
  position: static;
  backdrop-filter: none;
  height: 100%;
}

.header-inner {
  width: 100%;
  min-height: 100%;
  padding: 1.75rem 1.35rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.75rem;
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}

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

.brand small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

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

.site-header nav a {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
}

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

.header-cta {
  margin-top: auto;
  width: 100%;
  text-align: center;
}

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

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

.button-secondary {
  background: transparent;
  border-color: var(--rule);
  color: var(--text);
}

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

.section-inner {
  width: min(1080px, calc(100% - clamp(1.5rem, 4vw, 3rem)));
  margin: 0 auto;
}

/* Hero: stacked ridge layout */
.hero {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 var(--section-space);
  border-bottom: 1px dashed var(--rule);
}

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--accent);
  color: var(--accent);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  max-width: 62ch;
  color: var(--text);
  opacity: 0.88;
}

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

.geo-line {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.hero-visual {
  width: 100%;
  max-width: none;
  min-height: clamp(280px, 42vw, 480px) !important;
  aspect-ratio: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 90%, var(--accent-alt));
  box-shadow: 0 18px 48px color-mix(in srgb, var(--text) 8%, transparent);
  position: relative;
}

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

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 18px,
    color-mix(in srgb, var(--accent-alt) 5%, transparent) 18px,
    color-mix(in srgb, var(--accent-alt) 5%, transparent) 19px
  );
  opacity: 0.45;
  z-index: 1;
}

/* Sections */
.section {
  padding: var(--section-space) 0;
  border-bottom: 1px dashed var(--rule);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  margin-bottom: 2.25rem;
  max-width: none;
}

.section-heading > .section-kicker {
  grid-row: 1 / span 2;
  align-self: start;
  margin: 0;
}

.section-heading > h2,
.section-heading > p {
  grid-column: 2;
}

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

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

.card {
  grid-column: span 4;
  min-width: 0;
  padding: 1.35rem 1.4rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--rule);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:nth-child(3n+1) { grid-column: span 5; }
.card:nth-child(3n+2) { grid-column: span 4; }
.card:nth-child(3n)   { grid-column: span 3; }

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

.card p { margin-bottom: 0; }

.card-icon,
.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.85rem;
  color: var(--accent);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: var(--radius-sm);
}

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

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

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

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

/* Process (empty list preserved) */
.process-list {
  list-style: none;
  padding: 2rem;
  margin: 0;
  min-height: 120px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 80%, var(--page));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

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

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

.geo-chip strong {
  display: block;
  font-family: var(--font-display);
  margin-bottom: 0.65rem;
}

.geo-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Guide — alternating chapters */
.guide-body {
  display: grid;
  gap: 0;
}

.chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem 2.5rem;
  padding: 1.75rem 0;
  border-top: 1px dashed var(--rule);
}

.chapter:first-child { border-top: none; padding-top: 0; }

.chapter:nth-child(even) {
  direction: rtl;
}

.chapter:nth-child(even) > * {
  direction: ltr;
}

.chapter h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  align-self: start;
}

.chapter p,
.chapter ul {
  margin: 0;
}

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

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

.faq-list details {
  border-bottom: 1px dashed var(--rule);
  padding: 0.85rem 0;
}

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

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

.faq-list p {
  padding-right: 0.5rem;
  font-size: 0.92rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 2.5rem;
  align-items: start;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 4%);
  border: 1px solid var(--rule);
}

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

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

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

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

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

/* Footer */
.site-footer {
  padding: 3.5rem 0 4rem;
  background: color-mix(in srgb, var(--text) 92%, var(--accent));
  color: color-mix(in srgb, var(--surface) 88%, white);
  border-top: none;
}

.site-footer p,
.site-footer a {
  color: color-mix(in srgb, var(--surface) 72%, transparent);
}

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

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

.site-footer h3 {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--surface) 55%, transparent);
  margin-bottom: 0.75rem;
}

.site-footer a {
  display: block;
  margin: 0.3rem 0;
}

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

.footer-coverage {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: 0.75rem;
}

/* Icon motion */
.icon-draw path { stroke-dasharray: 34 8; animation: iconDraw 6s linear infinite; }
.icon-pulse { transform-box: fill-box; transform-origin: center; animation: iconPulse 6s ease-in-out infinite; }
.icon-slide { animation: iconSlide 6s ease-in-out infinite; }
.icon-spin { transform-box: fill-box; transform-origin: center; animation: iconSpin 10s 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); } }

/* Donor body token overrides — layout only, preserve donor class */
body.donor-layout-tripc86-top {
  --page: #eceae4;
  --surface: #faf9f6;
  --text: #121210;
  --muted: #6b6862;
  --accent: #8b4518;
  --accent-alt: #2d6a5a;
}

body.donor-layout-tripc86-top main .card {
  background: var(--surface);
  color: var(--text);
}

body.donor-layout-tripc86-top main .card h3,
body.donor-layout-tripc86-top main .card strong {
  color: var(--text);
}

body.donor-layout-tripc86-top main .card p,
body.donor-layout-tripc86-top main .card small {
  color: var(--muted);
}

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

  .page-rail {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 50;
    border-right: none;
    border-bottom: 1px dashed var(--rule);
  }

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

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

  .site-header nav a {
    border-left: none;
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.4rem 0.65rem;
  }

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

  .cards-grid,
  .card,
  .card:nth-child(3n+1),
  .card:nth-child(3n+2),
  .card:nth-child(3n) {
    grid-column: span 6;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading > .section-kicker {
    grid-row: auto;
  }

  .section-heading > h2,
  .section-heading > p {
    grid-column: 1;
  }

  .chapter,
  .chapter:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }

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

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

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

/* Mobile */
@media (max-width: 640px) {
  .header-inner,
  .section-inner {
    width: min(100% - 1.5rem, 1080px);
  }

  .site-header nav { display: none; }

  .cards-grid,
  .card,
  .card:nth-child(3n+1),
  .card:nth-child(3n+2),
  .card:nth-child(3n) {
    grid-column: span 12;
  }

  .geo-chips {
    grid-template-columns: 1fr;
  }

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

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

  h1 {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }
}

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

  .card,
  .button,
  .header-cta {
    transition: 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;
  }

  .hero-visual .route-main,
  .hero-visual .city-halo,
  .brand-logo {
    animation: none !important;
  }
}
