/* Slon14 variant 1 — sidebar rail + olive-terracotta editorial system */
:root {
  --page: #efe0cd;
  --surface: #faf6f0;
  --surface-alt: #e8dcc8;
  --text: #1a1410;
  --muted: #5c5348;
  --accent: #b96a4c;
  --accent-deep: #7b2524;
  --accent-olive: #607556;
  --accent-alt: #246f65;
  --line: color-mix(in srgb, var(--text) 14%, transparent);
  --radius: 10px;
  --radius-lg: 20px;
  --rail-w: clamp(240px, 18vw, 300px);
  --content-max: 1280px;
  --section-space: clamp(4rem, 8vw, 6.5rem);
  --font-display: Georgia, "Times New Roman", Times, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--page);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% 0%, color-mix(in srgb, var(--accent-olive) 12%, transparent), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 50%);
}

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;
  color: var(--accent-deep);
}

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

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

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

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

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

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

.rail-top {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}

.rail-brand {
  display: grid;
  grid-template-columns: min(64px, 15vw) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: min(64px, 100%);
  height: min(64px, 100%);
  aspect-ratio: 1;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  flex-shrink: 0;
}

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

.rail-brand-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-brand small,
.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

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

.rail-cta {
  align-self: stretch;
  text-align: center;
  white-space: nowrap;
}

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

.header-cta:hover,
.button-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

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

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

.page-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-flow {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 3vw, 3rem);
}

/* Hero — stacked editorial with visual band */
.layout-hero-stack.hero {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 var(--section-space);
}

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

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

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

.lead {
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  max-width: 52ch;
}

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

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

.hero-visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 240px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 80%, var(--accent-olive));
  border: 1px solid color-mix(in srgb, var(--accent-olive) 35%, transparent);
  overflow: hidden;
}

.hero-defs-cache {
  pointer-events: none;
  clip: rect(0, 0, 0, 0);
}

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

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

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

.fact-disclaimer {
  font-size: 0.78rem !important;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Stats band — horizontal ribbon */
.layout-stats-band .stats-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.layout-stats-band .stat {
  padding: 1.5rem 1.25rem;
  border-top: none;
  border-right: 1px solid var(--line);
}

.layout-stats-band .stat:last-child { border-right: none; }

.layout-stats-band .stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
}

.layout-stats-band .stat span {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin: 0.25rem 0;
}

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

.bento-grid .card {
  grid-column: span 6;
  min-width: 0;
}

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

.card {
  padding: 1.5rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--accent-deep) 8%, transparent);
}

.card p { margin-bottom: 0; }

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

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

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

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

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

/* Timeline process */
.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  position: relative;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent-olive), var(--accent));
  opacity: 0.35;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.35rem 0 1.35rem 0;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.timeline-list li:last-child { border-bottom: none; }

.timeline-list .step-icon {
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  background: var(--page);
}

/* Benefits & scenarios — masonry-like cards */
.layout-bento ~ .section .cards-grid,
.component-benefits .cards-grid,
.component-scenarios .cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

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

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

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

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

/* Guide two-column */
.guide-columns {
  columns: 2;
  column-gap: 2.5rem;
}

.chapter {
  break-inside: avoid;
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.chapter:last-child { border-bottom: none; }

/* Calculator panel */
.component-calculator .section-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 2.5rem;
  align-items: start;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-lg);
}

.calculator-form {
  display: grid;
  gap: 1rem;
}

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

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

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

output {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-deep);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0;
  max-width: none;
}

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

.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-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 2.5rem;
  align-items: start;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: color-mix(in srgb, var(--accent-alt) 8%, var(--surface));
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--accent-alt) 25%, transparent);
}

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

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

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 3rem clamp(1.25rem, 3vw, 3rem) 3.5rem;
  background: color-mix(in srgb, var(--accent-deep) 92%, var(--text));
  color: color-mix(in srgb, var(--surface) 88%, transparent);
  border-top: none;
}

.site-footer h3,
.site-footer strong.footer-brand {
  color: var(--surface);
  font-family: var(--font-display);
}

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

.site-footer a {
  display: block;
  color: color-mix(in srgb, var(--surface) 65%, transparent);
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

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

/* Icon motion — min 10s 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.9); opacity: 0.75; } }
@keyframes iconSlide { 50% { transform: translateX(4px); } }
@keyframes iconSpin { to { transform: rotate(360deg); } }

/* 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: 1rem clamp(1.25rem, 3vw, 3rem);
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .rail-top {
    flex: 1 1 auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
  }

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

  .rail-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.45rem 0.6rem;
    font-size: 0.76rem;
  }

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

  .rail-cta {
    flex: 0 0 auto;
    align-self: center;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
  }

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

  .bento-grid .card,
  .bento-grid .card:nth-child(n) {
    grid-column: span 12;
  }

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

  .layout-stats-band .stat:nth-child(2) { border-right: none; }
  .layout-stats-band .stat:nth-child(1),
  .layout-stats-band .stat:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }

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

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

  .guide-columns { columns: 1; }

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

/* Mobile */
@media (max-width: 600px) {
  .rail-brand {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .rail-nav { width: 100%; }

  .rail-cta { width: 100%; }

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

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

  .layout-stats-band .stats-band,
  .geo-chips,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .layout-stats-band .stat { border-right: none !important; border-bottom: 1px solid var(--line); }
  .layout-stats-band .stat:last-child { border-bottom: none; }

  .timeline-list::before { left: 16px; }
  .timeline-list li { grid-template-columns: 36px minmax(0, 1fr); gap: 0.85rem; }

  .section { padding: 3.5rem 0; }
}

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

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

  .card:hover { transform: none; }

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