:root {
  --page: #efe0cd;
  --surface: #f8f1de;
  --surface-ink: #4f220f;
  --text: #7b2524;
  --muted: #607556;
  --accent: #b96a4c;
  --accent-alt: #607556;
  --line: rgba(79, 34, 15, 0.18);
  --rail-w: 280px;
  --canvas-max: 1480px;
  --radius: 2px;
  --section-space: clamp(4rem, 8vw, 7rem);
  --font-display: Georgia, "Times New Roman", Times, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*,
*::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);
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.03em;
}

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

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

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

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

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
}

.side-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.5rem 1.25rem 1.5rem 1.5rem;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
  border-right: 1px dashed var(--line);
  z-index: 40;
  min-width: 0;
}

.rail-brand-row,
.rail-nav-row,
.rail-cta-row {
  display: flex;
  min-width: 0;
}

.rail-brand-row {
  align-items: center;
}

.rail-nav-row {
  flex: 1;
  align-items: flex-start;
}

.rail-cta-row {
  margin-top: auto;
}

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

.brand-logo {
  width: 56px;
  height: 56px;
  max-width: 64px;
  max-height: 64px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
}

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

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

.side-rail nav {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}

.side-rail nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-left: 2px solid transparent;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.header-cta {
  width: 100%;
  white-space: normal;
  text-align: center;
}

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

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

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

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

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

.hero-band {
  padding-top: clamp(2rem, 4vw, 3.5rem);
}

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

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

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

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

.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  max-width: 58ch;
}

.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.08em;
  text-transform: uppercase;
}

.hero-visual {
  overflow: hidden;
  width: min(100%, 640px);
  aspect-ratio: 3 / 2;
  justify-self: end;
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) * 2);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
}

.hero-visual svg,
.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-stack {
  display: grid;
  gap: 0;
}

.section {
  padding: var(--section-space) 0;
  border-top: 1px dashed var(--line);
}

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

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

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

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

.card {
  grid-column: span 4;
  min-width: 0;
  padding: 1.35rem 1.35rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 220ms ease, border-color 220ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.card p {
  margin-bottom: 0;
}

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

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

.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(3px);
  }
}

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

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

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

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

.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: step;
}

.process-list li {
  grid-column: span 4;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.process-list li:nth-child(4),
.process-list li:nth-child(5) {
  grid-column: span 6;
}

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

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

.geo-chip {
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

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

.geo-chip strong {
  font-family: var(--font-display);
  color: var(--surface-ink);
  margin-bottom: 0.45rem;
}

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

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

.chapter {
  padding: 1.75rem 0;
  border-top: 1px dashed var(--line);
}

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

.chapter p {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 72ch;
}

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

.faq-list {
  max-width: 920px;
  display: grid;
  gap: 0;
}

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

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--surface-ink);
}

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

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

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

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

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

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

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

.site-footer {
  margin-top: auto;
  padding: 3rem clamp(1.25rem, 3vw, 3rem) 3.5rem;
  background: color-mix(in srgb, var(--surface) 84%, var(--page));
  border-top: 1px dashed var(--line);
}

.footer-grid {
  width: min(100%, var(--canvas-max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 1fr;
  gap: 2rem;
}

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

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

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

.component-scenarios .cards-grid .card:last-child {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 1rem;
}

.component-scenarios .cards-grid .card:last-child .card-icon {
  grid-row: span 4;
}

@media (min-width: 1800px) {
  :root {
    --rail-w: 300px;
    --canvas-max: 1680px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  }

  .cards-grid .card {
    grid-column: span 3;
  }

  .component-services .cards-grid .card:nth-child(4),
  .component-services .cards-grid .card:nth-child(5) {
    grid-column: span 3;
  }

  .component-services .cards-grid .card:last-child {
    grid-column: span 6;
  }
}

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

  .side-rail {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1rem;
    padding: 0.85rem 1rem;
    border-right: 0;
    border-bottom: 1px dashed var(--line);
  }

  .rail-brand-row {
    flex: 1 1 auto;
    min-width: 180px;
  }

  .rail-nav-row {
    flex: 1 1 100%;
    order: 3;
  }

  .side-rail nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .side-rail nav a {
    text-align: center;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 0.45rem 0.35rem;
  }

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

  .rail-cta-row {
    margin-top: 0;
    flex: 0 0 auto;
  }

  .header-cta {
    width: auto;
    white-space: nowrap;
  }

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

  .hero-visual {
    justify-self: stretch;
  }

  .cards-grid .card,
  .process-list li {
    grid-column: span 6;
  }

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

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

@media (max-width: 640px) {
  .main-flow {
    padding: 0 0.9rem;
  }

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

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

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

  .cards-grid .card,
  .process-list li,
  .process-list li:nth-child(4),
  .process-list li:nth-child(5),
  .component-services .cards-grid .card:nth-child(4),
  .component-services .cards-grid .card:nth-child(5),
  .component-scenarios .cards-grid .card:last-child {
    grid-column: span 12;
    display: block;
  }

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

  .section {
    padding: 3.5rem 0;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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