/* Laocoon-inspired craft layout — system fonts only */
:root {
  --page: #0a0705;
  --surface: #150c06;
  --surface-raised: #22140b;
  --text: #fff6ed;
  --muted: #9a8b7e;
  --accent: #d98a3f;
  --accent-alt: #4a7fb5;
  --line: rgba(255, 246, 237, 0.12);
  --glow: rgba(255, 146, 69, 0.22);
  --radius: 18px;
  --radius-lg: 28px;
  --rail-w: clamp(220px, 16vw, 300px);
  --content-max: 1480px;
  --section-space: clamp(3.5rem, 6vw, 6.5rem);
  --font-display: Georgia, "Times New Roman", 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;
  font-family: var(--font-body);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 12% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    radial-gradient(ellipse 60% 40% at 88% 110%, color-mix(in srgb, var(--accent-alt) 10%, transparent), transparent 50%),
    var(--page);
}

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 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.8vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
}

h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.25;
}

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

/* Shell: side rail + canvas */
.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;
  height: 100vh;
  padding: clamp(1rem, 2vw, 1.75rem);
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 92%, var(--surface));
  backdrop-filter: blur(12px);
  z-index: 40;
}

.rail-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
  min-height: 0;
}

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

.page-main {
  flex: 1;
  width: min(var(--content-max), calc(100% - clamp(1.5rem, 4vw, 4rem)));
  margin: 0 auto;
}

/* Brand row in rail */
.brand {
  display: grid;
  grid-template-columns: minmax(0, 64px) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1rem;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 64px;
  max-height: 64px;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

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

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

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

.site-rail nav a {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

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

.header-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #8b5a2b));
  color: var(--page);
  white-space: nowrap;
  max-width: 100%;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 800;
  transition: transform 0.2s, box-shadow 0.2s;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 68%, var(--accent-alt)));
  color: var(--page);
}

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

.button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--glow); }

/* Flow blocks */
.flow-block {
  padding-block: var(--section-space);
  border-bottom: 1px solid var(--line);
}

.flow-block:last-child { border-bottom: 0; }

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

.section-heading {
  max-width: 920px;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
}

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

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

.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  max-width: 640px;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

/* Hero */
.layout-hero .hero-grid {
  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; order: 1; }

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

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

.hero-visual {
  order: 2;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent));
  box-shadow: 0 24px 64px color-mix(in srgb, var(--accent) 12%, transparent);
}

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

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

.layout-services .card {
  grid-column: span 4;
  min-width: 0;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform 0.25s, border-color 0.25s;
}

.layout-services .card:nth-child(1),
.layout-services .card:nth-child(4) { grid-column: span 6; }

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

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

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

.layout-process .process-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem 0 1.25rem 0;
  min-width: 0;
}

.layout-process .step-icon {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin: 0;
}

/* Benefits + scenarios — staggered cards */
.layout-benefits .cards-grid,
.layout-scenarios .cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.layout-benefits .card:nth-child(odd),
.layout-scenarios .card:nth-child(odd) {
  transform: translateY(0.75rem);
}

.card {
  min-width: 0;
  padding: 1.35rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.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: 12px;
}

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

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

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

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

.geo-chip {
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, var(--page));
}

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

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

/* Guide — two-column chapters */
.layout-guide .guide-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.layout-guide .chapter {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  min-width: 0;
}

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

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

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

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

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

/* Contact */
.layout-contact .contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 1rem;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.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.85rem;
  border-radius: calc(var(--radius) * 0.65);
}

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

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

/* Footer */
.site-footer {
  margin-top: auto;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 4rem);
  background: color-mix(in srgb, var(--surface) 85%, var(--page));
  border-top: 1px solid var(--line);
}

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

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

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

/* 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.88); opacity: 0.72; } }
@keyframes iconSlide { 50% { transform: translateX(3px); } }
@keyframes iconSpin { to { transform: rotate(360deg); } }

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

  .site-rail {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .brand { flex: 1 1 200px; }

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

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

  .layout-hero .hero-grid { grid-template-columns: 1fr; }
  .layout-services .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-services .card,
  .layout-services .card:nth-child(1),
  .layout-services .card:nth-child(4) { grid-column: span 1; }
  .layout-guide .guide-body { grid-template-columns: 1fr; }
  .layout-faq .faq-list { grid-template-columns: 1fr; }
  .layout-contact .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
  .page-main { width: calc(100% - 1.5rem); }

  .rail-stack { flex-direction: column; align-items: stretch; }

  .site-rail nav { flex-direction: column; }

  .header-cta { margin-left: 0; width: 100%; }

  .layout-benefits .cards-grid,
  .layout-scenarios .cards-grid,
  .layout-geography .geo-chips,
  .footer-grid { grid-template-columns: 1fr; }

  .layout-benefits .card:nth-child(odd),
  .layout-scenarios .card:nth-child(odd) { transform: none; }

  .layout-services .cards-grid { grid-template-columns: 1fr; }

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

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