:root {
  --bg-paper: #f7f5f0;
  --text-ink: #111111;
  --accent-red: #d62828;
  --radius: 20px;
  --border: 1px solid var(--text-ink);
  --font-head: Georgia, serif;
  --font-body: system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1200px;
}

/* Reset & Basics */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-family: var(--font-body);
  background: var(--bg-paper);
  color: var(--text-ink);
  line-height: 1.6;
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  overflow-wrap: anywhere;
  hyphens: auto;
  position: relative;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 1rem;
}
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
p { margin-bottom: 1.25rem; max-width: 72ch; }
a { color: var(--text-ink); text-decoration: none; transition: color 0.3s var(--ease); }
a:hover { color: var(--accent-red); }

/* Layout & Containers */
.container {
  width: calc(100% - 2rem);
  max-width: var(--max-width);
  margin: 0 auto;
}
.section { padding: 5rem 0; position: relative; }
.text-center { text-align: center; margin-left: auto; margin-right: auto; }
.long-form { margin: 0 auto; max-width: 72ch; }

/* Header & Nav */
.site-header {
  position: relative;
  margin: 1rem auto;
  width: calc(100% - 2rem);
  max-width: var(--max-width);
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg-paper);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  z-index: 100;
}
.brand {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: bold;
}
.desktop-nav { display: flex; gap: 1.5rem; align-items: center; }
.desktop-nav a { font-weight: 500; font-size: 0.95rem; }
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-ink);
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-paper);
  border: var(--border);
  border-radius: var(--radius);
  margin-top: 0.5rem;
  padding: 1.5rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 99;
}
.mobile-menu.active { display: flex; }

/* Buttons & Links */
.btn-primary {
  display: inline-block;
  background: var(--accent-red);
  color: var(--bg-paper);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: 1px solid var(--accent-red);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
  cursor: pointer;
  text-align: center;
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--text-ink);
  color: var(--bg-paper);
  border-color: var(--text-ink);
}
.link-underline {
  position: relative;
  font-weight: 600;
  display: inline-block;
}
.link-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--accent-red);
  transition: width 0.3s var(--ease);
}
.link-underline:hover::after { width: 100%; }

/* Hero Section */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  margin-bottom: 4rem;
}
.hero-render {
  width: 100%;
  height: 80vh;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
  position: relative;
}
.hero-render img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-pane {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-paper);
  border: var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 450px;
  z-index: 10;
}
.hero-pane .benefits {
  list-style: none;
  margin: 1.5rem 0 2rem;
  padding: 0;
}
.hero-pane .benefits li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
}
.hero-pane .benefits li::before {
  content: "•";
  color: var(--accent-red);
  position: absolute;
  left: 0;
  font-size: 1.25rem;
  line-height: 1;
}

/* Alternating Split Pane */
.split-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 6rem;
}
.split-pane.reverse .pane-text { order: 2; }
.split-pane.reverse .pane-img { order: 1; }
.pane-img {
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  min-height: 400px;
}
.pane-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Cards & Grids */
.grid-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.card {
  border: var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  background: var(--bg-paper);
  transition: transform 0.4s var(--ease);
}
.card:hover { transform: translateY(-5px); }
.card-title { font-family: var(--font-head); font-size: 1.5rem; margin-bottom: 1rem; }
.card-img {
  border: var(--border);
  border-radius: calc(var(--radius) / 2);
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 1.5rem;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg-paper);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
th, td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: var(--border);
}
th {
  font-family: var(--font-head);
  font-weight: normal;
  background: rgba(17, 17, 17, 0.05);
}
tr:last-child td { border-bottom: none; }

/* Background Glow (Radial) */
.bg-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  background: var(--accent-red);
  filter: blur(120px);
  opacity: 0.1;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.glow-right { right: -10vw; top: 20%; }
.glow-left { left: -10vw; bottom: 10%; }

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s var(--ease); }
.reveal.reveal-visible { opacity: 1; transform: translateY(0); }

/* Message Tool (Prefab Configurator) */
.config-tool {
  border: var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  background: var(--bg-paper);
  max-width: 800px;
  margin: 0 auto;
}
.config-step { display: none; }
.config-step.active { display: block; animation: fadeIn 0.4s var(--ease); }
@keyframes fadeIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }
.config-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.option-btn {
  border: var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg-paper);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: left;
  transition: all 0.3s var(--ease);
}
.option-btn:hover, .option-btn.selected {
  border-color: var(--accent-red);
  background: rgba(214, 40, 40, 0.05);
}
.config-nav { display: flex; justify-content: space-between; margin-top: 2rem; }
.btn-secondary {
  background: transparent;
  border: var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
.result-box {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: monospace;
  white-space: pre-wrap;
  margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
  border-top: var(--border);
  padding: 4rem 0 2rem;
  margin-top: 6rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}
.footer-col h4 { font-family: var(--font-body); font-weight: 600; margin-bottom: 1.25rem; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col ul li a { font-size: 0.9rem; color: #555; }
.footer-col ul li a:hover { color: var(--accent-red); }
.footer-bottom {
  border-top: 1px solid rgba(17,17,17,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #666;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-pane { left: 1rem; max-width: 400px; }
  .split-pane { gap: 2rem; }
}
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  .desktop-nav { display: none; }
  .mobile-toggle { display: block; }
  .split-pane, .split-pane.reverse { grid-template-columns: 1fr; gap: 2rem; }
  .split-pane.reverse .pane-text { order: 1; }
  .split-pane.reverse .pane-img { order: 2; }
  .pane-img { min-height: 250px; }
  .hero { flex-direction: column; min-height: auto; margin-bottom: 2rem; }
  .hero-render { height: 50vh; }
  .hero-pane { position: static; transform: none; width: 100%; max-width: 100%; margin-top: -2rem; border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
