/* Slon12 variant 1 — rail-canvas layout (dantora-style inspired) */

:root {
  --page: #eff4f2;
  --surface: #f8fffb;
  --surface-deep: #e5f1ed;
  --text: #1a2e28;
  --muted: #5a7268;
  --accent: #246f65;
  --accent-alt: #8ecf3a;
  --accent-warm: #cf3c2a;
  --radius-sm: 8px;
  --radius-md: 24px;
  --radius-lg: 48px;
  --rail-width: clamp(220px, 16vw, 280px);
  --content-max: min(1320px, 100%);
  --section-space: clamp(64px, 8vw, 104px);
  --gutter: clamp(20px, 3vw, 48px);
  --font-display: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-width: 0;
  max-width: 100vw;
  overflow-x: clip;
  line-height: 1.55;
  font-family: var(--font-body);
  background: var(--page);
  color: var(--text);
}

body.donor-layout-slon9-c-c-ru {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  grid-template-rows: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 36%),
    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 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 300;
  margin-bottom: 1.25rem;
  overflow-wrap: anywhere;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 300;
  margin-bottom: 0.85rem;
  overflow-wrap: anywhere;
}

h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.25;
  font-weight: 500;
  overflow-wrap: anywhere;
}

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

/* ── Side rail ── */
.site-rail {
  position: sticky;
  top: 0;
  align-self: start;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.25rem;
  width: var(--rail-width);
  max-width: var(--rail-width);
  height: 100vh;
  height: 100dvh;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(0.75rem, 1.5vw, 1.25rem);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-right: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
  contain: layout style;
}

.rail-brand-row {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.2;
}

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

.brand small {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.brand-logo {
  display: block;
  width: clamp(40px, 4.5vw, 56px);
  height: clamp(40px, 4.5vw, 56px);
  max-width: 64px;
  max-height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

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

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  align-self: stretch;
}

.rail-nav a {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: clamp(0.72rem, 0.85vw, 0.82rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

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

.header-cta,
.rail-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(0.78rem, 0.9vw, 0.88rem);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.header-cta,
.rail-cta {
  align-self: stretch;
  background: var(--accent);
  color: #fff;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

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

/* ── Main canvas ── */
.page-canvas {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  contain: inline-size;
}

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

.section-inner {
  width: min(var(--content-max), calc(100% - var(--gutter) * 2));
  max-width: 100%;
  margin-inline: auto;
  padding-inline: 0;
}

/* ── Hero ── */
.layout-band-hero {
  padding: clamp(2rem, 5vw, 4rem) 0 var(--section-space);
}

.layout-hero-stack {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.hero-copy {
  min-width: 0;
  max-width: 100%;
}

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

.lead {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  max-width: 56ch;
  color: var(--muted);
}

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

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

.hero-visual {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--surface-deep);
  contain: paint;
}

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

/* Prevent embedded SVG motion from reporting out-of-viewport bounds */
.hero-visual svg [class*="motion-"],
.hero-visual svg .spin,
.hero-visual svg .draw,
.brand-logo svg [class*="motion-"] {
  animation: none !important;
  transform: none !important;
}

/* ── Sections ── */
.layout-band {
  padding: var(--section-space) 0;
}

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

.section-heading {
  max-width: 68ch;
  margin-bottom: 2rem;
}

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

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.1rem);
  max-width: 100%;
}

.card {
  min-width: 0;
  max-width: 100%;
  padding: clamp(1.1rem, 2vw, 1.5rem);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, var(--page));
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  overflow: hidden;
}

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

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

.card-label {
  display: block;
  color: var(--accent-warm);
  font-size: 0.72rem;
  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;
}

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

/* Process */
.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.2vw, 1rem);
  max-width: 100%;
}

.process-list li {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  overflow: hidden;
}

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

/* Geography */
.geo-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.2vw, 1rem);
  max-width: 100%;
}

.geo-chip {
  min-width: 0;
  max-width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

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

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

/* Guide */
.guide-body {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 1.25rem;
}

.chapter {
  min-width: 0;
  max-width: 100%;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border-left: 3px solid var(--accent);
  overflow: hidden;
}

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

/* FAQ */
.faq-list {
  max-width: min(900px, 100%);
}

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

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

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

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  max-width: 100%;
}

.contact-form {
  display: grid;
  gap: 0.85rem;
  background: var(--surface);
  padding: clamp(1.1rem, 2vw, 1.5rem);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  min-width: 0;
  max-width: 100%;
}

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

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

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

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

/* Footer */
.site-footer {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  background: color-mix(in srgb, var(--surface-deep) 80%, var(--page));
  border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
  max-width: 100%;
}

.footer-grid > div {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

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

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

/* Icon motion — contained, no horizontal escape */
.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: translateY(2px); }
}

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

/* Wide desktop balance */
@media (min-width: 1600px) {
  :root {
    --content-max: min(1380px, calc(100% - var(--gutter) * 2));
  }

  .section-inner {
    width: min(var(--content-max), calc(100% - var(--gutter) * 2));
  }
}

@media (min-width: 2000px) {
  :root {
    --content-max: min(1480px, calc(100% - var(--gutter) * 2));
    --gutter: clamp(32px, 4vw, 72px);
  }
}

/* Tablet */
@media (max-width: 1100px) {
  body.donor-layout-slon9-c-c-ru {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .site-rail {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    grid-template-rows: auto auto auto;
    grid-template-columns: 1fr;
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
    padding: 0.85rem var(--gutter);
    gap: 0.75rem;
  }

  .rail-brand-row {
    justify-content: space-between;
  }

  .rail-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .rail-cta {
    width: 100%;
  }

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

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

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

  .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) {
  :root {
    --gutter: 16px;
    --section-space: 56px;
  }

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

  h1 {
    font-size: clamp(1.75rem, 9vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

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

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

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

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