/* TripScan variant 1 — copper-strata rail atlas (laocoon-inspired) */

:root {
  --page: #0a0f14;
  --surface: #141c24;
  --surface-alt: #1a232d;
  --text: #f3ece2;
  --muted: #9aa3ad;
  --accent: #c8874a;
  --accent-alt: #3d6f9b;
  --line: color-mix(in srgb, var(--text) 14%, transparent);
  --radius: 18px;
  --radius-pill: 999px;
  --rail-w: 248px;
  --shell-max: 1680px;
  --section-space: clamp(3.5rem, 6vw, 6.5rem);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-soft: 0 18px 48px color-mix(in srgb, #000 42%, transparent);
}

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

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

body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  max-width: 100vw;
  font-family: var(--font-body);
  line-height: 1.62;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 12% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 58%),
    radial-gradient(ellipse 60% 40% at 88% 0%, color-mix(in srgb, var(--accent-alt) 14%, transparent), transparent 52%),
    var(--page);
}

body.donor-layout-tripc86-top {
  background-image:
    radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 34%),
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--accent-alt) 12%, transparent), transparent 38%),
    linear-gradient(180deg, #0a0f14 0%, #0d1218 100%);
}

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

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

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

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

h1 {
  font-size: clamp(2.1rem, 4.2vw, 4.4rem);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.65rem, 2.8vw, 2.85rem);
  margin-bottom: 0.85rem;
}

h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  margin-bottom: 0.55rem;
}

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

.page-shell {
  display: flex;
  align-items: stretch;
  width: min(var(--shell-max), 100%);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
}

.side-rail {
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  max-width: var(--rail-w);
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, var(--page));
  z-index: 20;
}

.rail-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
  max-height: 100vh;
  padding: 1.15rem 1rem 1.35rem;
  min-width: 0;
  overflow: hidden;
}

.rail-inner .header-inner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  flex: 1 1 auto;
  overflow: hidden;
}

.brand {
  display: grid;
  grid-template-columns: minmax(0, 48px) minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.15;
}

.brand > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

.rail-inner nav {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.rail-inner nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.78rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-alt) 70%, transparent);
  white-space: normal;
  overflow-wrap: anywhere;
}

.rail-inner nav a:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.header-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #8b5a2b));
  color: #1a1208;
  font-weight: 800;
  font-size: 0.78rem;
  white-space: normal;
  text-align: center;
  flex-shrink: 0;
}

.page-canvas {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: clip;
}

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

.section-inner {
  width: min(1180px, calc(100% - clamp(1.25rem, 3.2vw, 2.75rem)));
  max-width: 100%;
  margin: 0 auto;
  min-width: 0;
}

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

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

.section-heading > p {
  font-size: clamp(0.98rem, 1.35vw, 1.08rem);
}

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

.lead {
  font-size: clamp(1rem, 1.55vw, 1.22rem);
  max-width: 62ch;
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
}

.hero-panel {
  padding-top: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.hero-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: center;
  min-width: 0;
}

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.65rem 0 1rem;
  max-width: 100%;
}

.button,
.header-cta {
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0.78rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.86rem;
  text-align: center;
  white-space: normal;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #6b4423));
  color: #1a1208;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

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

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

.hero-visual {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-alt));
  box-shadow: var(--shadow-soft);
}

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

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

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

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

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

.card {
  min-width: 0;
  max-width: 100%;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface-alt) 92%, var(--accent-alt)), var(--surface));
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 28%, transparent);
}

.card p {
  margin-bottom: 0;
}

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

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

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

.section-timeline .process-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.section-timeline .process-list li {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.section-timeline .step-icon {
  margin-bottom: 0;
}

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

.geo-chip {
  min-width: 0;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

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

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

.section-chapters .guide-body {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.chapter {
  min-width: 0;
  padding: 1.1rem 1.15rem;
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: color-mix(in srgb, var(--surface-alt) 88%, transparent);
}

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

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

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

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
  padding-right: 1rem;
}

.section-contact-split .contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  min-width: 0;
}

.contact-form {
  display: grid;
  gap: 0.85rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  min-width: 0;
}

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

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0.78rem 0.85rem;
  border-radius: calc(var(--radius) - 4px);
  font: inherit;
}

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

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

.site-footer {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, var(--page));
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  min-width: 0;
}

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

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

/* Icon motion — slow, viewport-safe */
.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(2px); }
}

@keyframes iconSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
  :root {
    --rail-w: 220px;
  }

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

  .section-timeline .process-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .section-bento .card:nth-child(n) {
    grid-column: auto;
  }
}

@media (max-width: 1024px) {
  .page-shell {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  .side-rail {
    position: relative;
    width: 100%;
    max-width: 100%;
    flex: none;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-inner {
    height: auto;
    max-height: none;
    padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
    overflow: visible;
  }

  .rail-inner .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand cta"
      "nav nav";
    align-items: center;
    gap: 0.75rem 1rem;
    overflow: visible;
  }

  .brand {
    grid-area: brand;
    grid-template-columns: minmax(0, 44px) minmax(0, 1fr);
  }

  .rail-inner nav {
    grid-area: nav;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    overflow: visible;
  }

  .rail-inner nav a {
    flex: 1 1 calc(50% - 0.45rem);
    min-width: 0;
  }

  .header-cta {
    grid-area: cta;
    width: auto;
    max-width: 11rem;
    padding-inline: 0.9rem;
  }

  .page-canvas {
    max-width: 100%;
    width: 100%;
  }

  .section-inner {
    width: min(100%, calc(100% - clamp(1.25rem, 4vw, 2rem)));
  }

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

  .section-timeline .process-list,
  .section-regions .geo-chips,
  .section-contact-split .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .section-inner {
    width: calc(100% - 1.5rem);
  }

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

  .rail-inner nav a {
    flex-basis: 100%;
  }

  .header-cta {
    max-width: 100%;
  }
}

@media (min-width: 1440px) {
  .section-inner {
    width: min(1240px, calc(100% - 3rem));
  }

  .hero-stack {
    gap: 3rem;
  }
}

@media (min-width: 1920px) {
  :root {
    --shell-max: 1720px;
  }

  .section-inner {
    width: min(1320px, calc(100% - 3.5rem));
  }
}

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

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