:root {
  --bg-midnight: #160f2e;
  --bg-card: rgba(30, 21, 62, 0.72);
  --bg-card-hover: rgba(43, 30, 88, 0.85);
  --border-glass: rgba(224, 64, 155, 0.28);
  --border-cyan: rgba(34, 211, 238, 0.35);
  --magenta: #e0409b;
  --magenta-glow: rgba(224, 64, 155, 0.4);
  --cyan: #22d3ee;
  --cyan-glow: rgba(34, 211, 238, 0.35);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --radius-micro: 4px;
}

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

body {
  background-color: var(--bg-midnight);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(224, 64, 155, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 65%, rgba(34, 211, 238, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(147, 51, 234, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
}

h1, h2, h3, h4, .serif-font {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  letter-spacing: -0.01em;
  color: #ffffff;
}

/* Slim Top Alert Banner */
.notice-banner {
  background: linear-gradient(90deg, #100a24, #2d1348, #0b2238);
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notice-banner a {
  color: var(--magenta);
  text-decoration: none;
  font-weight: 600;
  margin-left: 8px;
}
.notice-banner a:hover {
  text-decoration: underline;
}

/* Masthead Navigation */
header.masthead {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 15, 46, 0.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand-symbol {
  width: 28px;
  height: 28px;
  border: 1px solid var(--cyan);
  border-radius: var(--radius-micro);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--magenta);
  font-size: 14px;
  font-weight: bold;
}
.brand-name {
  font-family: Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand-name span {
  color: var(--cyan);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
  position: relative;
  padding: 4px 0;
}
.nav-link:hover, .nav-link.active {
  color: var(--cyan);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--magenta);
}

/* Action Button */
.btn-wire {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius-micro);
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: center;
}
.btn-wire:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 0 12px var(--magenta-glow);
}
.btn-magenta {
  border-color: var(--magenta);
  color: #fff;
  background: rgba(224, 64, 155, 0.18);
}
.btn-magenta:hover {
  background: var(--magenta);
  color: #fff;
  box-shadow: 0 0 15px var(--magenta-glow);
}

/* Layout Containers */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* Hero Compact Ribbon */
.hero-ribbon {
  padding: 36px 0 24px;
  border-bottom: 1px solid rgba(224, 64, 155, 0.18);
  margin-bottom: 30px;
}
.hero-tag {
  color: var(--magenta);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: inline-block;
}
.hero-ribbon h1 {
  font-size: 2.35rem;
  line-height: 1.18;
  margin-bottom: 14px;
}
.hero-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 820px;
  margin-bottom: 20px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

/* Bento Tile Card */
.bento-tile {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-micro);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s;
}
.bento-tile:hover {
  border-color: var(--border-cyan);
}
.bento-tile.highlight {
  border-color: var(--cyan);
  background: rgba(30, 21, 62, 0.88);
}
.tile-head {
  margin-bottom: 14px;
}
.tile-meta {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}
.tile-title {
  font-size: 1.4rem;
  margin-bottom: 8px;
  line-height: 1.25;
}
.tile-body {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}
.tile-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Image Wraps */
.bento-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-micro);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
  filter: contrast(1.1) brightness(0.92);
}
.bento-img-sm {
  height: 140px;
}

/* Data Metric Counter */
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.metric-box {
  background: rgba(18, 12, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-micro);
  padding: 12px;
  text-align: center;
}
.metric-val {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  color: var(--cyan);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}
.metric-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Section Header Separator */
.section-title-wrap {
  margin: 34px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.section-title-wrap h2 {
  font-size: 1.65rem;
}
.section-counter {
  font-family: Georgia, serif;
  color: var(--magenta);
  font-size: 0.9rem;
}

/* Interactive Companion Planting Analyzer */
.tool-box {
  background: rgba(20, 14, 42, 0.9);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-micro);
  padding: 22px;
  margin: 18px 0;
}
.tool-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.tool-select {
  background: #100b24;
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-micro);
  font-size: 0.88rem;
  cursor: pointer;
}
.tool-select:focus {
  outline: none;
  border-color: var(--cyan);
}
.analyzer-results {
  background: rgba(14, 9, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-micro);
  padding: 18px;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.res-card {
  padding: 12px;
  background: rgba(25, 18, 52, 0.65);
  border-left: 2px solid var(--magenta);
  border-radius: 2px;
}
.res-card.good {
  border-left-color: var(--cyan);
}
.res-card h4 {
  font-size: 0.84rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.res-card.good h4 {
  color: #7dd3fc;
}
.res-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Blueprint Download Modal Box */
.blueprint-card {
  background: linear-gradient(135deg, rgba(224, 64, 155, 0.12), rgba(34, 211, 238, 0.15));
  border: 1px solid var(--cyan);
  border-radius: var(--radius-micro);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Bento Footer */
footer.bento-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #110b24;
  margin-top: 60px;
  padding: 40px 0 24px;
}
.footer-bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.footer-tile {
  background: rgba(22, 15, 46, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-micro);
  padding: 18px;
}
.footer-tile h4 {
  font-size: 0.84rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-tile ul {
  list-style: none;
}
.footer-tile ul li {
  margin-bottom: 8px;
}
.footer-tile a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.2s;
}
.footer-tile a:hover {
  color: #ffffff;
}
.legal-p {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 8px;
}
.footer-base {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-base a {
  color: var(--cyan);
  text-decoration: none;
}

/* Modal styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 6, 22, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-window {
  background: #191035;
  border: 1px solid var(--cyan);
  border-radius: var(--radius-micro);
  max-width: 500px;
  width: 100%;
  padding: 26px;
  position: relative;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.input-wire {
  width: 100%;
  background: rgba(10, 6, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-micro);
  padding: 10px 12px;
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.input-wire:focus {
  outline: none;
  border-color: var(--cyan);
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 {
    grid-column: span 12;
  }
  .footer-bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .footer-bento-grid {
    grid-template-columns: 1fr;
  }
  .nav-wrap {
    flex-direction: column;
    gap: 12px;
  }
  .metric-row {
    grid-template-columns: 1fr;
  }
}

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