:root {
  --bg-canvas: #faf6ef;
  --bg-surface: #efe7d8;
  --bg-surface-elevated: #e5dac6;
  --text-primary: #2b211a;
  --text-muted: #6b584c;
  --accent-primary: #c2562e;
  --accent-secondary: #7e3a1d;
  --accent-olive: #5d6638;
  --border-subtle: #d8cbb7;
  --border-strong: #2b211a;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 10px 25px -4px rgba(43, 33, 26, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  hyphens: auto;
  position: relative;
}

/* Background Atmospheric Glows */
body::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 55vw;
  height: 55vw;
  max-width: 650px;
  max-height: 650px;
  background: radial-gradient(circle, rgba(194, 86, 46, 0.08) 0%, rgba(93, 102, 56, 0.05) 50%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

p.lead {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease-kinetic);
}

a:hover {
  color: var(--accent-secondary);
}

/* Header & Navigation (Moves out of view on scroll) */
header {
  position: relative;
  width: 100%;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  z-index: 50;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-symbol {
  width: 32px;
  height: 32px;
  background-color: var(--accent-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.desktop-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.desktop-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  border-bottom-color: var(--accent-primary);
  color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mobile-dropdown {
  display: none;
  flex-direction: column;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-strong);
  padding: 1rem 1.5rem;
  gap: 0.85rem;
}

.mobile-dropdown.open {
  display: flex;
}

.mobile-dropdown a {
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* Layout Core */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.prose-block {
  max-width: 72ch;
  margin: 0 auto;
}

/* Hero Section */
.editorial-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  background: var(--bg-surface);
  padding: 0.35rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-subtle);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn-terracotta {
  display: inline-block;
  background-color: var(--accent-primary);
  color: #faf6ef;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.85rem 1.75rem;
  text-decoration: none;
  border: 1px solid var(--accent-primary);
  cursor: pointer;
  transition: all 0.25s var(--ease-kinetic);
}

.btn-terracotta:hover {
  background-color: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-block;
  background-color: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.85rem 1.75rem;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.25s var(--ease-kinetic);
}

.btn-outline:hover {
  background-color: var(--bg-surface);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Overlapping Image Trio */
.overlapping-images {
  position: relative;
  height: 380px;
  width: 100%;
}

.hero-img {
  position: absolute;
  object-fit: cover;
  border: 2px solid var(--bg-canvas);
  box-shadow: var(--shadow-elevation);
}

.hero-img-1 {
  width: 68%;
  height: 270px;
  top: 0;
  left: 0;
  z-index: 1;
}

.hero-img-2 {
  width: 58%;
  height: 240px;
  bottom: 0;
  right: 0;
  z-index: 2;
}

.hero-img-3 {
  width: 42%;
  height: 180px;
  top: 20%;
  left: 30%;
  z-index: 3;
  outline: 4px solid var(--bg-surface);
}

/* Circular Coordinate Badge */
.coord-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-canvas);
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.bento-col-4 {
  grid-column: span 4;
}

.bento-col-6 {
  grid-column: span 6;
}

.bento-col-8 {
  grid-column: span 8;
}

.bento-col-12 {
  grid-column: span 12;
}

.bento-tile {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  position: relative;
  transition: transform 0.25s var(--ease-kinetic), border-color 0.25s var(--ease-kinetic);
}

.bento-tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
}

.bento-metric {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.bento-metric-sub {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-primary);
}

/* Row Lists with Terracotta Glyphs */
.canal-row-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.canal-row-item {
  display: flex;
  gap: 1.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  align-items: flex-start;
  transition: background-color 0.2s var(--ease-kinetic);
}

.canal-row-item:hover {
  background-color: var(--bg-surface-elevated);
}

.canal-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background-color: var(--accent-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.canal-row-content h3 {
  margin-bottom: 0.35rem;
}

.canal-row-content p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Media Figures */
.media-figure {
  margin: 2.5rem 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
}

.media-figure img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.media-caption {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent-primary);
}

/* Engineering Comparison Tool */
.engineering-tool {
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  padding: 2.5rem 2rem;
  margin: 4rem 0;
}

.tool-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.city-select-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-kinetic);
}

.city-select-btn.active,
.city-select-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.tool-display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  background: var(--bg-canvas);
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
}

.tool-data-card {
  padding: 1rem;
  border-left: 3px solid var(--accent-olive);
}

.tool-data-card.highlight {
  border-left-color: var(--accent-primary);
}

.tool-data-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--text-muted);
}

.tool-data-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.35rem 0;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  background-color: var(--bg-surface);
}

th, td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: var(--bg-surface-elevated);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

/* Contact Message Tool & Forms */
.contact-form {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2.5rem;
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--accent-primary);
  border-color: var(--accent-primary);
}

.output-container {
  margin-top: 2rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  display: none;
}

.output-code {
  background: #2b211a;
  color: #efe7d8;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  margin: 1rem 0;
  max-height: 250px;
  overflow-y: auto;
}

/* FAQ Accordion */
.faq-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 3rem 0;
}

.faq-card {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 1.5rem 2rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-kinetic);
}

.faq-card:hover {
  border-color: var(--accent-primary);
}

.faq-card summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.faq-card summary::-webkit-details-marker {
  display: none;
}

.faq-card summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--accent-primary);
  font-weight: 700;
}

.faq-card[open] summary::after {
  content: "−";
}

.faq-card p {
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Scroll Reveal */
.reveal-init {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-kinetic), transform 0.6s var(--ease-kinetic);
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer (Standardized 3-Column Venetian Ochre) */
footer {
  background-color: var(--bg-surface);
  border-top: 2px solid var(--border-strong);
  padding: 4rem 1.5rem 3rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.footer-legal-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  gap: 1rem;
}

.footer-domain {
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

/* Responsive Queries */
@media (max-width: 1024px) {
  .bento-col-4, .bento-col-6, .bento-col-8 {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .editorial-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .bento-col-4, .bento-col-6, .bento-col-8, .bento-col-12 {
    grid-column: span 12;
  }
  
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .overlapping-images {
    height: 300px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 2rem 1rem 4rem;
  }
  
  .hero-img-1 {
    width: 80%;
    height: 200px;
  }
  
  .hero-img-2 {
    width: 75%;
    height: 180px;
  }
  
  .hero-img-3 {
    display: none;
  }
  
  .canal-row-item {
    flex-direction: column;
    gap: 0.75rem;
  }
}

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