/* =============================================================
   BIOTSPHERE — Revamped Stylesheet
   Replaces css/styles.css
   Bootstrap 5.1.3 is loaded via JS bundle in index.html
   ============================================================= */

/* ---- Google Fonts (Space Grotesk + Inter) ---- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ---- Design tokens ---- */
:root {
  --navy:       #0a1628;
  --navy-mid:   #112240;
  --teal:       #0d9488;
  --teal-light: #14b8a8;
  --foam:       #f0f7f7;
  --silt:       #8a9aaa;
  --amber:      #f59e0b;
  --white:      #ffffff;
  --text-dark:  #1a2e40;
  --text-mid:   #4a6070;
  --text-light: #8a9aaa;
  --section-pad: 5rem;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand {
  font-family: 'Space Grotesk', sans-serif;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-light); }

img { max-width: 100%; height: auto; }

/* ---- Navbar ---- */
#mainNav {
  background: rgba(10, 22, 40, 0.97);
  backdrop-filter: blur(8px);
  padding: 1rem 0;
  transition: padding 0.3s ease, background 0.3s ease;
  border-bottom: 1px solid rgba(13, 148, 136, 0.2);
}

#mainNav .navbar-brand {
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#mainNav .navbar-brand span {
  color: var(--teal);
}

#mainNav .nav-link {
  color: rgba(255,255,255,0.75) !important;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem !important;
  transition: color 0.2s;
}

#mainNav .nav-link:hover {
  color: var(--teal-light) !important;
}

#mainNav .navbar-toggler {
  border-color: rgba(13,148,136,0.4);
  color: var(--white);
}

#mainNav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ---- Hero / Masthead ---- */
.masthead {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 60%, #0d3d38 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 8rem 0 4rem;
}

/* Animated river wave — the signature element */
.masthead::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='%23f0f7f7' fill-opacity='1' d='M0,64 C240,100 480,20 720,64 C960,108 1200,20 1440,64 L1440,120 L0,120 Z'/%3E%3C/svg%3E") no-repeat bottom center;
  background-size: cover;
}

/* Subtle grid overlay */
.masthead::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(13,148,136,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,148,136,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.masthead .container { position: relative; z-index: 2; }

.masthead-eyebrow {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-light);
  margin-bottom: 1.25rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(13,148,136,0.3);
  border-radius: 2px;
}

.masthead h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.masthead h1 em {
  font-style: normal;
  color: var(--teal-light);
}

.masthead-lead {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 560px;
}

.masthead-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.masthead-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.masthead-stat-label {
  font-size: 0.75rem;
  color: var(--silt);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

.btn-teal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--teal);
  color: var(--white);
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
  border: none;
}

.btn-teal:hover {
  background: var(--teal-light);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline-teal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: rgba(255,255,255,0.8);
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.25);
  transition: border-color 0.2s, color 0.2s;
}

.btn-outline-teal:hover {
  border-color: var(--teal-light);
  color: var(--teal-light);
}

/* ---- Section base ---- */
.section {
  padding: var(--section-pad) 0;
}

.section-foam { background: var(--foam); }
.section-white { background: var(--white); }
.section-navy { background: var(--navy); }

.section-label {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-title-light {
  color: var(--white);
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-mid);
  max-width: 600px;
  line-height: 1.75;
}

/* Teal accent rule under section headers */
.section-rule {
  width: 40px;
  height: 3px;
  background: var(--teal);
  border: none;
  margin: 1rem 0 2rem;
  border-radius: 2px;
}

/* ---- Feature list (Technology / Monitoring / Consulting) ---- */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.65;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.3rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.feature-list li:last-child { border-bottom: none; }

/* ---- Section image ---- */
.section-img {
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(10,22,40,0.12);
  width: 100%;
  height: auto;
}

/* ---- Live data section ---- */
.live-data-section {
  background: var(--foam);
  padding: var(--section-pad) 0;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: 'Space Grotesk', sans-serif;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-live    { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.status-live .status-dot { background: #10b981; animation: pulse 2s infinite; }
.status-offline { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.status-offline .status-dot { background: #f59e0b; }
.status-error   { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.status-error .status-dot { background: #ef4444; }
.status-loading { background: #e0f2fe; border-color: #7dd3fc; color: #0c4a6e; }
.status-loading .status-dot { background: #38bdf8; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

.chart-group-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  border-left: 3px solid var(--teal);
  padding-left: 0.75rem;
  margin-bottom: 0;
}

.chart-card {
  background: var(--white);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  height: 100%;
}

.chart-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.chart-unit {
  margin-left: auto;
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.78rem;
}

.chart-wrapper { position: relative; height: 180px; }
.chart-wrapper-wide { height: 220px; }

.chart-latest {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: right;
  font-family: 'Space Grotesk', sans-serif;
}

.chart-latest span {
  font-weight: 600;
  color: var(--teal);
}

/* ---- Contact section ---- */
.contact-section {
  background: var(--navy);
  padding: var(--section-pad) 0;
}

.contact-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-align: center;
  height: 100%;
  transition: border-color 0.2s;
}

.contact-card:hover {
  border-color: rgba(13,148,136,0.4);
}

.contact-card .icon {
  font-size: 1.5rem;
  color: var(--teal);
  margin-bottom: 1rem;
}

.contact-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.75rem;
}

.contact-card p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: 0.95rem;
}

.contact-card a {
  color: var(--teal-light);
}

/* ---- Footer ---- */
.footer {
  background: #060e1a;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.04em;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  #mainNav .navbar-collapse {
    background: var(--navy);
    padding: 1rem;
    border-top: 1px solid rgba(13,148,136,0.2);
    margin-top: 0.5rem;
  }
}

@media (max-width: 768px) {
  :root { --section-pad: 3rem; }
  .masthead { padding: 7rem 0 3rem; min-height: auto; }
  .masthead-stats { gap: 1.5rem; }
  .chart-wrapper { height: 150px; }
  .chart-wrapper-wide { height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none !important; }
  html { scroll-behavior: auto; }
}
