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

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef3f2;
  --text: #18201f;
  --muted: #64706f;
  --card: #ffffff;
  --border: #d8e0df;
  --button-dark: #18201f;
  --button-light: #ffffff;
  --accent: #0f766e;
  --accent-warm: #b54708;
  --accent-danger: #b42318;
  --chart-temp: #c2410c;
  --chart-humidity: #0f766e;
  --chart-soil: #3f7d20;
  --shadow-soft: 0 18px 44px rgba(24, 32, 31, 0.08);
  --shadow-hover: 0 22px 52px rgba(24, 32, 31, 0.12);
  --radius: 8px;
  --background: var(--bg);
  --card-background: var(--card);
  --site-width: 1440px;
  --site-gutter: calc(100% - 48px);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(216, 224, 223, 0.82);
  background: rgba(245, 247, 248, 0.92);
  backdrop-filter: blur(14px);
}

.navbar {
  width: min(var(--site-width), var(--site-gutter));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-logo:hover {
  color: var(--accent);
}

.hero {
  width: min(var(--site-width), var(--site-gutter));
  margin: 0 auto;
  padding: 76px 0 88px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
  position: relative;
  overflow: visible;
}

.hero-text {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin-bottom: 18px;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero h1 {
  font-size: 5.8rem;
  line-height: 0.96;
  letter-spacing: 0;
  margin-bottom: 24px;
  max-width: 11ch;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-description {
  font-size: 1.22rem;
  max-width: 720px;
  margin-bottom: 32px;
  color: #33403f;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.5s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--button-dark);
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--button-dark);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--button-light);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.btn:focus-visible,
.nav-links a:focus-visible,
.nav-logo:focus-visible,
.project-card-link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 3px;
}

.btn-primary:focus-visible {
  color: #ffffff;
}

.hero-image {
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.section-container {
  width: min(var(--site-width), var(--site-gutter));
  margin: 0 auto;
}

.home-sensor-section {
  padding: 24px 0 92px;
}

.home-sensor-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 28px;
  align-items: stretch;
}

.home-sensor-copy {
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-sensor-copy .section-title {
  max-width: 9ch;
}

.home-sensor-actions {
  margin-top: 22px;
}

.home-sensor-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
  max-width: 440px;
}

.home-sensor-metric {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.home-sensor-metric strong {
  display: block;
  font-size: 2.65rem;
  line-height: 1;
}

.home-sensor-metric span {
  color: var(--muted);
  font-size: 0.94rem;
}

.home-sensor-visual {
  position: relative;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(24, 32, 31, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 31, 0.04) 1px, transparent 1px),
    var(--surface);
  background-size: 44px 44px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.home-sensor-visual::after {
  content: none;
}

.home-sensor-visual > * {
  position: relative;
  z-index: 1;
}

.mini-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.mini-chart-header h3 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.mini-chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.94rem;
}

.mini-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.mini-chart-legend i {
  width: 24px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}

.mini-chart-legend .temp-key {
  background: var(--chart-temp);
}

.mini-chart-legend .humidity-key {
  background: var(--chart-humidity);
}

.mini-chart-wrap {
  height: clamp(260px, 32vw, 380px);
  min-height: 260px;
}

#home-sensor-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.home-chart-status {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.intro-section,
.quick-links,
.profiles-section {
  padding: 80px 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.intro-card,
.link-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 12px 30px rgba(24, 32, 31, 0.05);
}

.intro-card h2 {
  font-size: 2rem;
  margin-bottom: 14px;
  line-height: 1.1;
}

.intro-card p {
  font-size: 1.08rem;
  color: var(--text);
}

.section-title {
  font-size: 3rem;
  line-height: 1.05;
  margin-bottom: 14px;
}

.section-subtitle {
  max-width: 760px;
  font-size: 1.12rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.link-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(15, 118, 110, 0.38);
}

.card-label {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.link-card h3 {
  font-size: 1.7rem;
  line-height: 1.15;
  margin-bottom: 12px;
}

.link-card p {
  font-size: 1.02rem;
  color: var(--text);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 52px;
  }

  .home-sensor-grid {
    grid-template-columns: 1fr;
  }

  .home-sensor-copy {
    padding: 0;
  }

  .hero-image {
    justify-content: flex-start;
  }

  .hero-image img {
    max-width: 520px;
  }

  .intro-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 4.6rem;
    max-width: 10ch;
  }
}

@media (max-width: 640px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
  }

  .nav-links {
    gap: 4px;
  }

  .hero {
    width: min(var(--site-width), 92%);
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero-description {
    font-size: 1.08rem;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .btn {
    width: 100%;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .home-sensor-metrics {
    grid-template-columns: 1fr;
  }

  .home-sensor-visual {
    padding: 18px;
  }

  .mini-chart-header {
    flex-direction: column;
  }

  .intro-card h2,
  .link-card h3 {
    font-size: 1.5rem;
  }
}

.publications-section {
  padding: 30px 0 90px;
}

.publications-list {
  display: grid;
  gap: 22px;
}

.publication-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 10px 26px rgba(24, 32, 31, 0.04);
}

.publication-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(15, 118, 110, 0.32);
}

.publication-card h3 {
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.publication-authors {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
}

.publication-meta {
  font-size: 1rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .publication-card {
    padding: 22px;
  }

  .publication-card h3 {
    font-size: 1.2rem;
  }
}

.featured-projects {
  padding: 86px 0;
  border-top: 1px solid rgba(216, 224, 223, 0.72);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.8s ease 0.6s both;
  box-shadow: 0 12px 30px rgba(24, 32, 31, 0.06);
}

.project-card:nth-child(2) {
  animation-delay: 0.7s;
}

.project-card:nth-child(3) {
  animation-delay: 0.8s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 118, 110, 0.35);
}

.project-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.project-card:hover img {
  transform: scale(1.02);
}

.project-content {
  padding: 22px;
}

.project-content h3 {
  font-size: 1.35rem;
  line-height: 1.22;
  margin-bottom: 10px;
}

.project-content p {
  font-size: 1rem;
  color: #33403f;
}

.btn:hover {
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}


.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.social-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
  box-shadow: 0 10px 26px rgba(24, 32, 31, 0.04);
}

.social-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(15, 118, 110, 0.32);
}

.social-label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.social-card h3 {
  font-size: 1.4rem;
}

@media (max-width: 900px) {
  .social-grid {
    grid-template-columns: 1fr;
  }
}

.social-primary {
  background: var(--button-dark);
  color: #ffffff;
  border: none;
}

.social-primary .social-label {
  color: rgba(255, 255, 255, 0.7);
}

.social-secondary {
  background: var(--card);
  color: var(--text);
}

.social-primary:hover {
  transform: translateY(-4px);
  opacity: 0.95;
}

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

.social-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  padding: 26px;
  border-radius: var(--radius);
}

.social-card h3 {
  margin-top: 6px;
  line-height: 1.2;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ========== Projects Page Styles ========== */

.page-hero {
  padding: 56px 0 42px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.page-title {
  font-size: 3.6rem;
  line-height: 1.04;
  margin-bottom: 14px;
}

.page-subtitle {
  max-width: 800px;
  font-size: 1.15rem;
  color: var(--muted);
  margin-top: 16px;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.projects-full-section {
  padding: 56px 0 82px;
}

.projects-full-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.project-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: var(--radius);
}

.project-card-full {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 12px 30px rgba(24, 32, 31, 0.06);
}

.project-card-link:hover .project-card-full {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 118, 110, 0.38);
}

.project-card-full img {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
}

.project-card-full-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card-full-content h3 {
  font-size: 1.24rem;
  line-height: 1.25;
  margin-bottom: 12px;
}

.project-card-full-content p {
  font-size: 1rem;
  color: #33403f;
  margin-bottom: 16px;
  flex-grow: 1;
}

.read-more {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 700;
}

.project-card-link:hover .read-more {
  color: var(--accent-warm);
}

.project-card-streamlit {
  background: var(--button-dark);
  border-color: var(--button-dark);
}

.project-card-link:hover .project-card-streamlit {
  background: #111716;
}

.project-card-streamlit .project-card-full-content {
  color: #ffffff;
}

.project-card-streamlit .project-card-full-content h3,
.project-card-streamlit .project-card-full-content p {
  color: #ffffff;
}

.project-card-streamlit .read-more {
  color: rgba(255, 255, 255, 0.8);
}

.project-card-link:hover .project-card-streamlit .read-more {
  color: #ffffff;
}

@media (max-width: 1024px) {
  .projects-full-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .projects-full-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-title {
    font-size: 2.2rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .project-card-full img {
    height: 180px;
  }
}

/* Random Gallery Section */
.random-gallery {
  padding: 60px 0;
  background: var(--background);
}

.random-gallery .section-container {
  width: min(var(--site-width), var(--site-gutter));
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.random-gallery .section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  color: var(--text);
}

.random-photo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

#random-photo {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease;
}

#random-photo:hover {
  transform: scale(1.05);
}

/* Gallery Page */
.gallery-section {
  padding: 60px 0;
  background: var(--background);
}

.gallery-section .section-container {
  width: min(var(--site-width), var(--site-gutter));
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.slideshow-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.slideshow-container img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.slideshow-container .prev,
.slideshow-container .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 16px;
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  transition: background 0.3s ease;
}

.slideshow-container .prev:hover,
.slideshow-container .next:hover {
  background: rgba(0, 0, 0, 0.8);
}

.slideshow-container .prev {
  left: 20px;
}

.slideshow-container .next {
  right: 20px;
}

.album-section {
  padding: 60px 0;
  background: var(--background);
}

.album-header {
  max-width: 900px;
  margin: 0 auto 32px;
  text-align: left;
}

.album-header .eyebrow {
  margin-bottom: 12px;
}

.album-header h2 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.1;
}

.album-header .section-subtitle {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1rem;
  max-width: 760px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.album-grid img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(24, 32, 31, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.album-grid img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  padding: 24px;
  backdrop-filter: blur(6px);
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
}

.lightbox-container img {
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-prev {
  left: -80px;
}

.lightbox-next {
  right: -80px;
}

@media (max-width: 768px) {
  .lightbox-prev {
    left: 16px;
    right: auto;
    top: auto;
    bottom: 20px;
    transform: none;
  }

  .lightbox-next {
    right: 16px;
    left: auto;
    top: auto;
    bottom: 20px;
    transform: none;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
  }
}

.lightbox-caption {
  margin-top: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.album-placeholder {
  text-align: center;
  padding: 60px 20px;
  background: var(--card-background);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.album-placeholder p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .gallery-grid,
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }

  .gallery-grid img,
  .album-grid img {
    height: 200px;
  }

  #random-photo {
    max-height: 300px;
  }
}


/* ========== Sensor Dashboard ========== */
.sensor-page-hero {
  padding-top: 52px;
}

.sensor-hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  align-items: start;
}

.sensor-eyebrow {
  opacity: 1;
  animation: none;
}

.sensor-dashboard-section {
  padding: 42px 0 90px;
}

.sensor-status-card,
.sensor-metric-card,
.sensor-panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(24, 32, 31, 0.05);
}

.sensor-status-card {
  padding: 24px;
}

.sensor-status-card h3 {
  font-size: 1.55rem;
  line-height: 1.1;
  margin-bottom: 10px;
}

.sensor-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.sensor-metric-card {
  padding: 22px;
}

.sensor-metric-card h2 {
  font-size: 2.55rem;
  line-height: 1;
  margin-bottom: 8px;
}

.soil-moisture-dry {
  color: var(--accent-danger);
}

.soil-moisture-medium {
  color: var(--accent-warm);
}

.soil-moisture-wet {
  color: var(--chart-soil);
}

.sensor-panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.sensor-controls-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.5fr);
  gap: 18px;
  margin-bottom: 18px;
}

.sensor-panel-card {
  padding: 22px;
}

.sensor-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sensor-panel-head h3 {
  font-size: 1.25rem;
  line-height: 1.15;
}

.sensor-chart-grid {
  grid-template-columns: minmax(0, 1fr);
}

.sensor-chart-panel {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.sensor-chart-actions,
.sensor-range-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sensor-chart-controls,
.custom-range-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.custom-range-fields[hidden],
.custom-frequency-fields[hidden] {
  display: none;
}

.sensor-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sensor-control-group label,
.sensor-control-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.sensor-range-group {
  grid-column: 1 / -1;
}

.sensor-inline-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sensor-input,
.sensor-select {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.sensor-input:focus,
.sensor-select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
  outline-offset: 1px;
}

.sensor-input {
  min-width: 160px;
}

.sensor-select {
  cursor: pointer;
}

.sensor-select-compact {
  min-width: 120px;
}

.range-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.range-btn:hover {
  border-color: rgba(15, 118, 110, 0.38);
  background: var(--surface-soft);
  color: var(--accent);
}

.range-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.sensor-chart {
  width: 100%;
  height: 260px;
  display: block;
  overflow: visible;
}

.sensor-chart-container {
  position: relative;
  width: 100%;
  height: clamp(430px, 52vh, 620px);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 1px solid rgba(216, 224, 223, 0.72);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 12px;
}

#sensor-chart {
  width: 100%;
  height: 100%;
}

.chart-activity-key {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 12px;
}

.pump-activity-swatch {
  width: 38px;
  height: 14px;
  border: 1px solid rgba(47, 122, 47, 0.18);
  border-radius: 6px;
  background: rgba(47, 122, 47, 0.11);
}

.sensor-chart-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 26px;
  background: var(--bg);
  border-radius: 0;
  border: 0;
}

.sensor-chart-panel:fullscreen .sensor-chart-container {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  align-items: stretch;
}

.sensor-chart-panel:fullscreen .sensor-panel-head {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.sensor-chart-panel:fullscreen .sensor-chart-controls,
.sensor-chart-panel:fullscreen .custom-range-fields {
  flex: 0 0 auto;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 10px 18px;
  margin-bottom: 10px;
}

.sensor-chart-panel:fullscreen .custom-frequency-fields {
  grid-column: auto;
}

.sensor-chart-panel:fullscreen .sensor-range-group {
  grid-column: 2;
}

.sensor-chart-panel:fullscreen .range-btn,
.sensor-chart-panel:fullscreen .sensor-input,
.sensor-chart-panel:fullscreen .sensor-select {
  min-height: 34px;
}

.sensor-chart-panel:fullscreen .range-btn {
  padding: 0 14px;
}

.sensor-chart-panel:fullscreen .sensor-panel-head h3 {
  font-size: 1.35rem;
}

.sensor-chart-panel:fullscreen .card-label,
.sensor-chart-panel:fullscreen .sensor-control-group label,
.sensor-chart-panel:fullscreen .sensor-control-label {
  font-size: 0.78rem;
}

.sensor-grid-line {
  stroke: rgba(47, 41, 40, 0.12);
  stroke-width: 1;
}

.sensor-axis-label,
.sensor-chart-empty {
  font-size: 14px;
  fill: var(--muted);
}

.sensor-chart-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sensor-chart-line-temp {
  stroke: var(--chart-temp);
}

.sensor-chart-line-humidity {
  stroke: var(--chart-humidity);
}

.sensor-chart-fill {
  opacity: 0.16;
}

.sensor-chart-fill-temp {
  fill: var(--chart-temp);
}

.sensor-chart-fill-humidity {
  fill: var(--chart-humidity);
}

.sensor-table-panel {
  margin-bottom: 24px;
}

.sensor-refresh-btn {
  min-height: 44px;
  padding: 0 18px;
}

.sensor-table-wrap {
  overflow-x: auto;
}

.sensor-table {
  width: 100%;
  border-collapse: collapse;
}

.sensor-table th,
.sensor-table td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid rgba(216, 224, 223, 0.82);
  font-size: 0.98rem;
}

.sensor-table th {
  color: var(--muted);
  font-weight: 600;
}

.sensor-api-hint code {
  background: var(--surface-soft);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.92rem;
}

.sensor-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(216, 224, 223, 0.82);
}

.pagination-btn {
  min-height: 40px;
  padding: 0 16px;
}

.pagination-info {
  font-size: 0.95rem;
  color: var(--muted);
  min-width: 120px;
  text-align: center;
}

.water-usage-card {
  margin-bottom: 24px;
}

.water-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}

.water-usage-stat h2 {
  font-size: 2.55rem;
  line-height: 1;
  margin: 8px 0;
}

.tank-progress {
  width: 100%;
  height: 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
  overflow: hidden;
  margin-bottom: 18px;
}

.tank-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--chart-soil);
  transition: width 0.25s ease, background 0.25s ease;
}

.tank-progress-close {
  background: var(--accent-warm);
}

.tank-progress-refill {
  background: var(--accent-danger);
}

.water-usage-settings {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.water-usage-settings label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.dashboard-controls-grid {
  align-items: start;
}

.dashboard-status-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
}

.dashboard-schedule-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
}

.dashboard-input-compact {
  width: min(100%, 190px);
}

.dashboard-info-box {
  min-height: 90px;
  padding: 18px;
  border: 1px solid rgba(216, 224, 223, 0.82);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.dashboard-info-box-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.panel-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.schedule-form-container {
  display: grid;
  gap: 16px;
}

.schedule-form-row {
  display: grid;
  gap: 8px;
}

.schedule-form-row > label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.day-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.day-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.schedule-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

.schedule-status-enabled {
  background: rgba(47, 122, 47, 0.12);
  color: var(--chart-soil);
}

.schedule-status-disabled {
  background: rgba(180, 43, 43, 0.12);
  color: var(--accent-danger);
}

.schedule-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-action-buttons .btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

@media (max-width: 980px) {
  .sensor-hero-grid,
  .sensor-stats-grid,
  .sensor-panels-grid,
  .dashboard-status-grid,
  .dashboard-schedule-grid,
  .sensor-controls-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sensor-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .sensor-range-selector {
    width: 100%;
    justify-content: flex-start;
  }

  .sensor-metric-card,
  .sensor-panel-card,
  .sensor-status-card {
    padding: 20px;
  }

  .sensor-pagination {
    flex-direction: column;
    gap: 10px;
  }

  .pagination-btn {
    width: 100%;
  }

  .pump-controls {
    flex-direction: column;
  }

  .dashboard-input-compact {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .sensor-chart-panel:fullscreen {
    padding: 18px 16px 22px;
    overflow: auto;
  }

  .sensor-chart-panel:fullscreen .sensor-chart-controls,
  .sensor-chart-panel:fullscreen .custom-range-fields {
    grid-template-columns: 1fr;
  }

  .sensor-chart-panel:fullscreen .sensor-range-group {
    grid-column: 1;
  }

  .sensor-chart-panel:fullscreen .sensor-chart-container {
    min-height: 520px;
  }
}

/* Pump Control Styles */
.pump-status {
  margin-bottom: 1rem;
}

.pump-status-display {
  font-size: 1.35rem;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  margin: 0.5rem 0;
}

.pump-status-on {
  background-color: rgba(63, 125, 32, 0.14);
  color: var(--chart-soil);
}

.pump-status-off {
  background-color: rgba(180, 35, 24, 0.12);
  color: var(--accent-danger);
}

.pump-status-unknown {
  background-color: var(--surface-soft);
  color: var(--muted);
}

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

.pump-button-active-on {
  color: #ffffff !important;
  background-color: var(--chart-soil) !important;
  border-color: var(--chart-soil) !important;
}

.pump-button-active-off {
  color: #ffffff !important;
  background-color: var(--accent-danger) !important;
  border-color: var(--accent-danger) !important;
}

.pump-button-inactive {
  opacity: 0.8;
}

.pump-button-active-on:hover,
.pump-button-active-off:hover {
  transform: translateY(-1px);
}

.error-message {
  color: var(--accent-danger);
  margin-top: 1rem;
}

body.control-auth-open {
  overflow: hidden;
}

.control-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 32, 31, 0.48);
}

.control-auth-modal[hidden] {
  display: none;
}

.control-auth-dialog {
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-hover);
}

.control-auth-dialog h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.control-auth-description {
  margin-bottom: 16px;
  color: var(--muted);
}

.control-auth-form {
  display: grid;
  gap: 12px;
}

.control-auth-input {
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.control-auth-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
  outline-offset: 2px;
}

.control-auth-error {
  min-height: 1.2em;
  color: var(--accent-danger);
  font-size: 0.92rem;
}

.control-auth-error:empty {
  display: none;
}

.control-auth-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ========== Forest Green Portfolio Redesign ========== */
:root {
  --bg: #f4f8f2;
  --bg-soft: #eef5ec;
  --surface: #ffffff;
  --surface-soft: #f8fbf7;
  --text: #172017;
  --muted: #687568;
  --border: #dce7da;
  --primary: #2f7d4f;
  --primary-dark: #1f5f3b;
  --primary-soft: #dfeee4;
  --accent: #d88945;
  --danger: #c94b4b;
  --blue: #3a7ca5;
  --shadow: 0 18px 45px rgba(36, 67, 44, 0.08);
  --shadow-soft: 0 10px 25px rgba(36, 67, 44, 0.06);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --container: 1440px;
  --card: var(--surface);
  --card-background: var(--surface);
  --background: var(--bg);
  --button-dark: var(--primary-dark);
  --button-light: var(--surface);
  --chart-temp: var(--accent);
  --chart-humidity: var(--blue);
  --chart-soil: var(--primary);
  --site-width: var(--container);
  --site-gutter: calc(100% - 64px);
}

html {
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(47, 125, 79, 0.13), transparent 34%),
    radial-gradient(circle at 94% 8%, rgba(216, 137, 69, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

h1,
h2,
h3,
.page-title,
.section-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}

.section-container,
.navbar,
.hero {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(220, 231, 218, 0.84);
  background: rgba(248, 251, 247, 0.86);
  backdrop-filter: blur(18px);
}

.navbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  min-width: max-content;
  color: var(--primary-dark);
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1 1 auto;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-dark);
  background: rgba(47, 125, 79, 0.08);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  border-radius: var(--radius-sm);
  background: var(--primary);
}

.nav-dashboard {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(47, 125, 79, 0.18);
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-dashboard:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  border: 1px solid var(--primary);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(47, 125, 79, 0.18);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.eyebrow,
.card-label,
.social-label {
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  align-items: center;
  gap: 72px;
  padding-block: 92px 96px;
}

.hero h1 {
  max-width: 820px;
  font-size: 76px;
  line-height: 0.98;
}

.hero-highlight {
  color: var(--primary);
}

.hero-description {
  max-width: 760px;
  margin-top: 28px;
  color: #39473a;
  font-size: 1.18rem;
}

.hero-buttons {
  margin-top: 34px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
  margin-top: 34px;
}

.hero-stat,
.home-sensor-metric,
.sensor-metric-card,
.sensor-status-card,
.sensor-panel-card,
.publication-card,
.project-card,
.project-card-full,
.social-card,
.intro-card,
.link-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
}

.hero-stat {
  padding: 18px;
}

.hero-stat strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1.2rem;
  line-height: 1.2;
}

.hero-stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.portrait-card {
  position: relative;
  justify-content: flex-end;
}

.portrait-card img {
  width: min(100%, 520px);
  max-width: none;
  border: 1px solid rgba(220, 231, 218, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-floating-card {
  position: absolute;
  right: 0;
  bottom: 34px;
  width: min(290px, 72%);
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-floating-card span {
  display: block;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-floating-card p {
  margin-top: 8px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.section-title {
  font-size: 48px;
  line-height: 1.08;
}

.section-subtitle,
.page-subtitle {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.1rem;
}

.page-hero {
  padding: 70px 0 48px;
  border-bottom: 1px solid rgba(220, 231, 218, 0.84);
  background: transparent;
}

.page-title {
  font-size: 68px;
  line-height: 1;
}

.dashboard-overview-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(280px, 0.8fr) minmax(420px, 1.15fr);
  gap: 24px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.home-sensor-section {
  padding: 0 0 96px;
  background: transparent;
  position: relative;
  z-index: 10;
}

.home-sensor-copy {
  padding: 10px 0;
}

.home-sensor-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: none;
  margin: 0;
}

.home-sensor-metric {
  padding: 18px;
}

.home-sensor-metric strong {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
}

.metric-temperature {
  border-top: 4px solid var(--accent);
}

.metric-humidity,
.metric-samples {
  border-top: 4px solid var(--blue);
}

.metric-soil {
  border-top: 4px solid var(--primary);
}

.metric-pump {
  border-top: 4px solid var(--danger);
}

.home-sensor-visual {
  min-width: 0;
  padding: 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(47, 125, 79, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 125, 79, 0.05) 1px, transparent 1px),
    var(--surface);
  background-size: 44px 44px;
  box-shadow: var(--shadow-soft);
}

.mini-chart-header h3 {
  color: var(--text);
  font-size: 1.35rem;
}

.home-chart-status {
  color: var(--muted);
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-link {
  color: var(--primary-dark);
  font-weight: 800;
}

.featured-projects,
.profiles-section {
  padding: 92px 0;
  background: transparent;
  position: relative;
  z-index: 10;
}

.projects-grid,
.projects-full-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.project-card-link {
  height: 100%;
  border-radius: var(--radius-md);
}

.project-card,
.project-card-full {
  height: 100%;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.project-card-link:hover .project-card-full,
.project-card-link:hover .project-card,
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.project-card img,
.project-card-full img {
  width: 100%;
  height: 190px;
  aspect-ratio: auto;
  object-fit: cover;
}

.project-content,
.project-card-full-content {
  padding: 20px;
}

.project-content h3,
.project-card-full-content h3 {
  margin: 10px 0 10px;
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.25;
}

.project-content p,
.project-card-full-content p {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.project-category {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.project-tags span,
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.read-more {
  margin-top: 16px;
  color: var(--primary-dark);
  font-weight: 800;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.filter-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.publications-section,
.projects-full-section,
.album-section {
  padding: 58px 0 96px;
}

.publications-list {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-soft);
}

.publication-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  box-shadow: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.publication-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-soft);
}

.publication-icon {
  position: relative;
  width: 42px;
  height: 48px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-soft);
}

.publication-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  border-bottom-left-radius: 6px;
  background: var(--surface);
}

.publication-body h3 {
  margin: 0 0 6px;
  font-size: 1.18rem;
  line-height: 1.3;
}

.publication-authors,
.publication-meta {
  color: var(--muted);
}

.publication-link {
  color: var(--primary-dark);
  font-weight: 800;
  white-space: nowrap;
}

.album-header {
  max-width: var(--container);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-flow: dense;
  gap: 20px;
}

.album-grid img {
  width: 100%;
  height: 270px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
  transition: transform 0.24s ease, filter 0.24s ease, box-shadow 0.24s ease;
}

.album-grid img:nth-child(5n + 1) {
  grid-row: span 2;
  height: 560px;
}

.album-grid img:hover {
  filter: brightness(1.04);
  transform: scale(1.015);
  box-shadow: var(--shadow);
}

.sensor-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.55fr);
  gap: 28px;
  align-items: stretch;
}

.sensor-status-card {
  padding: 28px;
}

.connection-status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 7px rgba(47, 125, 79, 0.12);
}

.sensor-dashboard-section {
  padding: 48px 0 100px;
}

.sensor-stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.sensor-metric-card {
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.metric-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

.sensor-metric-card h2 {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.35rem;
}

.sensor-metric-card p,
.sensor-status-card p {
  color: var(--muted);
}

.sensor-panels-grid,
.sensor-controls-grid,
.dashboard-status-grid,
.dashboard-schedule-grid {
  gap: 22px;
}

.sensor-panel-card {
  padding: 26px;
}

.sensor-panel-head h3 {
  font-size: 1.35rem;
}

.sensor-chart-panel {
  border-radius: var(--radius-lg);
}

.sensor-chart-container {
  min-height: 420px;
  padding: 18px;
  border-color: var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.sensor-input,
.sensor-select,
.range-btn {
  border-radius: var(--radius-sm);
}

.range-btn {
  background: var(--surface);
  font-weight: 800;
}

.range-btn.active {
  background: var(--primary);
  border-color: var(--primary);
}

.range-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.sensor-table th,
.sensor-table td {
  border-bottom-color: var(--border);
}

.dashboard-info-box {
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.pump-status-display {
  border-radius: var(--radius-md);
}

.pump-status-on,
.schedule-status-enabled {
  background: rgba(47, 125, 79, 0.13);
  color: var(--primary-dark);
}

.pump-status-off,
.schedule-status-disabled,
.error-message {
  color: var(--danger);
}

.pump-button-active-on {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.pump-button-active-off {
  background-color: var(--danger) !important;
  border-color: var(--danger) !important;
}

.tank-progress {
  border-color: var(--border);
  background: var(--bg-soft);
}

.tank-progress-fill {
  background: var(--primary);
}

.tank-progress-close {
  background: var(--accent);
}

.tank-progress-refill {
  background: var(--danger);
}

.control-auth-dialog {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

@media (max-width: 1240px) {
  .hero,
  .dashboard-overview-card,
  .sensor-hero-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .projects-full-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sensor-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --site-gutter: calc(100% - 40px);
  }

  .navbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-block: 14px;
  }

  .nav-links {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .hero {
    gap: 42px;
    padding-block: 64px 72px;
  }

  .hero h1,
  .page-title {
    font-size: 52px;
  }

  .section-title {
    font-size: 40px;
  }

  .hero-stats,
  .home-sensor-metrics,
  .sensor-stats-grid,
  .projects-grid,
  .projects-full-grid,
  .sensor-controls-grid,
  .sensor-panels-grid,
  .dashboard-status-grid,
  .dashboard-schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .publication-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .publication-link {
    grid-column: 2;
  }
}

/* Compact the dashboard readings section so it balances with pump controls. */
.dashboard-controls-grid {
  align-items: stretch;
  grid-template-columns: minmax(320px, 0.92fr) minmax(520px, 1.08fr);
}

.dashboard-controls-grid > .sensor-panel-card {
  height: 100%;
}

.dashboard-controls-grid .sensor-table th,
.dashboard-controls-grid .sensor-table td {
  padding: 10px 9px;
  font-size: 0.88rem;
}

.dashboard-controls-grid .sensor-pagination {
  margin-top: 12px;
  padding-top: 12px;
}

@media (max-width: 980px) {
  .dashboard-controls-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --site-gutter: calc(100% - 40px);
  }

  body {
    font-size: 16px;
  }

  .section-container,
  .navbar,
  .hero {
    padding-inline: 20px;
  }

  .nav-dashboard,
  .nav-links a {
    min-height: 38px;
  }

  .hero h1,
  .page-title {
    font-size: 42px;
  }

  .section-title {
    font-size: 34px;
  }

  .hero-buttons,
  .hero-actions {
    flex-direction: column;
  }

  .btn,
  .nav-dashboard {
    width: 100%;
  }

  .hero-stats,
  .home-sensor-metrics,
  .sensor-stats-grid,
  .projects-grid,
  .projects-full-grid,
  .sensor-controls-grid,
  .sensor-panels-grid,
  .dashboard-status-grid,
  .dashboard-schedule-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-overview-card,
  .publications-list {
    padding: 18px;
    border-radius: var(--radius-md);
  }

  .album-grid {
    grid-template-columns: 1fr;
  }

  .album-grid img,
  .album-grid img:nth-child(5n + 1) {
    height: 260px;
    grid-row: auto;
  }

  .sensor-chart-container {
    min-height: 340px;
    padding: 10px;
  }
}

/* ========== Forest Green Polish Pass ========== */
.site-header {
  background: rgba(248, 252, 247, 0.82);
  backdrop-filter: blur(16px);
}

.navbar {
  min-height: 72px;
}

.nav-links a {
  min-height: 36px;
  padding-inline: 11px;
  background: transparent;
}

.nav-links a.active {
  background: rgba(47, 125, 79, 0.1);
}

.nav-links a.active::after {
  left: 18px;
  right: 18px;
  bottom: 4px;
  height: 2px;
}

.nav-dashboard {
  min-height: 40px;
  padding-inline: 16px;
  font-size: 0.92rem;
  box-shadow: 0 10px 20px rgba(47, 125, 79, 0.16);
}

.btn {
  min-height: 46px;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
}

.btn-primary {
  box-shadow: 0 12px 24px rgba(47, 125, 79, 0.18);
}

.btn-secondary {
  border-color: rgba(47, 125, 79, 0.32);
}

/* .home-hero sticky styles now handled in Hero Zone block below */

.hero-text > * {
  animation: fadeInUp 0.6s ease both;
}

.hero-text > :nth-child(2) {
  animation-delay: 0.06s;
}

.hero-text > :nth-child(3) {
  animation-delay: 0.12s;
}

.hero-text > :nth-child(4),
.hero-text > :nth-child(5) {
  animation-delay: 0.18s;
}

.hero-visual {
  isolation: isolate;
  min-height: 560px;
  background-image:
    radial-gradient(ellipse 180px 58px at 0% 50%, transparent 68%, rgba(47, 125, 79, 0.11) 68.5%, rgba(47, 125, 79, 0.11) 69.5%, transparent 70%),
    radial-gradient(ellipse 230px 74px at 0% 50%, transparent 70%, rgba(104, 117, 104, 0.12) 70.5%, rgba(104, 117, 104, 0.12) 71.4%, transparent 72%),
    radial-gradient(ellipse 160px 48px at 0% 50%, transparent 68%, rgba(47, 125, 79, 0.09) 68.5%, rgba(47, 125, 79, 0.09) 69.5%, transparent 70%);
  background-position:
    -96px 132px,
    -138px 226px,
    -74px 330px;
  background-repeat: no-repeat;
  background-size:
    260px 120px,
    320px 150px,
    230px 100px;
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(47, 125, 79, 0.12);
  border-radius: var(--radius-sm);
}

.hero-visual::before {
  width: 520px;
  height: 250px;
  right: -38px;
  top: 62px;
  transform: rotate(-18deg);
}

.hero-visual::after {
  width: 440px;
  height: 190px;
  right: 56px;
  bottom: 84px;
  border-color: rgba(104, 117, 104, 0.14);
  transform: rotate(14deg);
}

.portrait-card img {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(220, 231, 218, 0.96);
  border-radius: 30px;
  object-position: center;
  box-shadow: 0 28px 70px rgba(36, 67, 44, 0.16);
  animation: portraitFloat 7s ease-in-out infinite;
  will-change: transform;
}

.hero-floating-card {
  z-index: 2;
  right: -8px;
  bottom: 52px;
  padding: 18px;
  border-radius: 22px;
  box-shadow: 0 20px 44px rgba(36, 67, 44, 0.16);
}

@keyframes portraitFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

.floating-card-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.floating-card-label svg,
.stat-icon svg,
.metric-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-floating-card i {
  display: block;
  width: 70%;
  height: 4px;
  margin-top: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--primary), var(--primary-soft));
}

.hero-stat {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  border-radius: 22px;
}

.hero-stat .stat-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.hero-stat strong,
.hero-stat span:not(.stat-icon) {
  margin: 0;
}

.dashboard-overview-card {
  grid-template-columns: minmax(230px, 0.55fr) minmax(500px, 1.15fr) minmax(360px, 1fr);
  gap: 22px;
  margin-top: 0;
  padding: 24px;
}

.home-sensor-copy {
  align-self: center;
}

.home-sensor-copy .section-title {
  max-width: 12ch;
  font-size: 2.35rem;
}

.home-sensor-copy .section-subtitle {
  margin-bottom: 18px;
  font-size: 1rem;
}

.home-sensor-metrics {
  align-self: stretch;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-sensor-metric {
  display: flex;
  min-height: 178px;
  padding: 16px;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 22px;
}

.home-sensor-metric .metric-icon,
.sensor-metric-card .metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.home-sensor-metric > span:not(.metric-icon) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.home-sensor-metric strong {
  margin-top: 6px;
  font-size: 1.7rem;
}

.home-sensor-metric p {
  min-height: 2.4em;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.metric-spark {
  display: block;
  width: 100%;
  height: 18px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, transparent 0 28%, currentColor 29% 34%, transparent 35% 49%, currentColor 50% 55%, transparent 56%),
    linear-gradient(90deg, rgba(220, 231, 218, 0.8), rgba(220, 231, 218, 0.34));
  color: rgba(47, 125, 79, 0.32);
  opacity: 0.8;
}

.metric-temperature .metric-icon,
.metric-temperature .metric-spark {
  color: var(--accent);
}

.metric-humidity .metric-icon,
.metric-humidity .metric-spark {
  color: var(--blue);
}

.metric-soil .metric-icon,
.metric-soil .metric-spark {
  color: var(--primary);
}

.metric-pump .metric-icon,
.metric-pump .metric-spark {
  color: var(--danger);
}

.home-sensor-visual {
  border-radius: 24px;
  background:
    linear-gradient(rgba(47, 125, 79, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 125, 79, 0.04) 1px, transparent 1px),
    var(--surface);
  background-size: 38px 38px;
}

.mini-chart-wrap {
  height: 260px;
  min-height: 220px;
}

.home-chart-status {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 14px;
  background: rgba(248, 251, 247, 0.78);
}

.project-card,
.project-card-full,
.social-card {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
}

.social-card.social-primary {
  border-color: transparent;
  background: var(--button-dark);
  color: #ffffff;
}

.social-card.social-primary .social-label {
  color: rgba(255, 255, 255, 0.76);
}

.project-card-link:hover .project-card,
.project-card-link:hover .project-card-full,
.social-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 125, 79, 0.35);
  box-shadow: 0 20px 46px rgba(36, 67, 44, 0.12);
}

.project-card img,
.project-card-full img {
  height: 205px;
}

.project-content,
.project-card-full-content {
  gap: 0;
}

.project-tags {
  margin-top: auto;
  padding-top: 14px;
}

.project-tags span {
  background: rgba(223, 238, 228, 0.76);
  color: var(--primary-dark);
}

.publication-card {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 15px 18px;
  border-radius: 18px;
}

.publication-icon {
  width: 32px;
  height: 38px;
  border-width: 1.5px;
  border-radius: 8px;
}

.publication-icon::after {
  width: 10px;
  height: 10px;
}

.publication-body h3 {
  font-size: 1.05rem;
}

.publication-link {
  color: var(--muted);
  transition: color 0.18s ease, transform 0.18s ease;
}

.publication-card:hover .publication-link {
  color: var(--primary-dark);
  transform: translateX(3px);
}

.album-section {
  padding-block: 40px;
}

.album-section .section-container {
  padding-top: 26px;
  padding-bottom: 30px;
  border: 1px solid rgba(220, 231, 218, 0.78);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow-soft);
}

.album-grid img {
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(36, 67, 44, 0.08);
}

.album-grid img:hover {
  filter: brightness(1.04) saturate(1.03);
  transform: translateY(-2px) scale(1.01);
}

.sensor-metric-card {
  border-radius: 22px;
}

.sensor-metric-card .metric-icon {
  margin-bottom: 14px;
}

.sensor-metric-card h2 {
  font-size: 2.15rem;
}

.sensor-metric-card:has(#pump-state.pump-status-on) {
  border-top-color: var(--primary);
}

.sensor-metric-card:has(#pump-state.pump-status-on) .metric-icon {
  color: var(--primary);
}

.sensor-chart-panel {
  padding: 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
}

.sensor-chart-controls,
.custom-range-fields {
  gap: 12px;
}

.sensor-input,
.sensor-select,
.range-btn {
  min-height: 42px;
  border-color: rgba(220, 231, 218, 0.98);
  box-shadow: 0 6px 14px rgba(36, 67, 44, 0.03);
}

.range-btn.active {
  box-shadow: 0 10px 20px rgba(47, 125, 79, 0.16);
}

.sensor-chart-container {
  min-height: 440px;
  padding: 20px;
  background:
    linear-gradient(rgba(47, 125, 79, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 125, 79, 0.035) 1px, transparent 1px),
    var(--surface-soft);
  background-size: 42px 42px;
}

@media (max-width: 1240px) {
  .dashboard-overview-card {
    grid-template-columns: 1fr;
  }

  .home-sensor-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-visual {
    min-height: 0;
  }

  .hero-visual::before,
  .hero-visual::after {
    opacity: 0.55;
  }

  .home-sensor-metrics,
  .sensor-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-floating-card {
    right: 10px;
    bottom: 24px;
  }

  .home-sensor-metrics {
    grid-template-columns: 1fr;
  }

  .home-sensor-metric {
    min-height: 150px;
  }

  .publication-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .publication-link {
    grid-column: 2;
  }
}

/* ================================================================
   Pot-led homepage redesign
   ================================================================ */
:root {
  --bg: #f6f9f4;
  --bg-soft: #edf4ee;
  --surface: #ffffff;
  --surface-soft: #f7faf6;
  --text: #15201a;
  --muted: #5d6c63;
  --border: #d8e4da;
  --primary: #27694b;
  --primary-dark: #174c35;
  --primary-soft: #e1efe7;
  --accent: #b86a32;
  --accent-soft: #f4e2d3;
  --danger: #b64235;
  --blue: #2f718c;
  --shadow: 0 24px 60px rgba(34, 58, 43, 0.12);
  --shadow-soft: 0 12px 30px rgba(34, 58, 43, 0.08);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 999px;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 360px),
    linear-gradient(135deg, #f7faf5 0%, #edf5ef 48%, #faf7f1 100%);
}

.site-header {
  border-bottom-color: rgba(216, 228, 218, 0.72);
  background: rgba(250, 252, 248, 0.9);
}

.hero-zone {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid rgba(216, 228, 218, 0.74);
  background:
    linear-gradient(rgba(39, 105, 75, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 105, 75, 0.04) 1px, transparent 1px),
    linear-gradient(132deg, rgba(255, 255, 255, 0.9) 0%, rgba(236, 246, 239, 0.72) 52%, rgba(250, 244, 236, 0.82) 100%);
  background-size: 72px 72px, 72px 72px, auto;
}

.hero-zone::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(39, 105, 75, 0.055));
  pointer-events: none;
}

.home-hero {
  position: relative;
  display: flex;
  width: 100%;
  max-width: none;
  min-height: calc(100svh - 72px);
  margin: 0;
  padding: 0;
  gap: 0;
  flex-direction: column;
  background: transparent;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(var(--container), var(--site-gutter));
  margin: 0 auto;
  padding: clamp(48px, 5vw, 76px) 0 clamp(28px, 3.4vw, 44px);
  flex: 1;
  grid-template-columns: minmax(250px, 0.78fr) minmax(270px, 0.82fr) minmax(420px, 1.1fr);
  gap: clamp(28px, 4vw, 58px);
  align-items: center;
}

.hero-text {
  z-index: 3;
}

.hero-text .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--primary-dark);
}

.hero-text .eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  border-radius: var(--radius-sm);
  background: var(--accent);
}

.hero h1 {
  max-width: 9.8ch;
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(3.45rem, 4.2vw, 5.05rem);
  line-height: 0.95;
}

.hero-highlight {
  color: var(--primary);
}

.hero-description {
  max-width: 620px;
  margin-bottom: 28px;
  color: #35443b;
  font-size: clamp(1.02rem, 1vw, 1.18rem);
  line-height: 1.75;
}

.hero-buttons {
  gap: 12px;
}

.hero-buttons .btn {
  min-height: 44px;
  padding-inline: 16px;
  font-size: 0.92rem;
}

.btn,
.nav-dashboard {
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover,
.nav-dashboard:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(39, 105, 75, 0.24);
}

.hero-visual {
  min-height: 0;
  background: none;
}

.hero-visual::before,
.hero-visual::after {
  content: none;
}

.portrait-card {
  align-self: center;
  justify-content: flex-start;
}

.portrait-card img {
  width: min(100%, 380px);
  max-width: none;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  box-shadow: 0 26px 52px rgba(30, 54, 39, 0.16);
}

.hero-floating-card {
  right: clamp(-8px, -1.4vw, -20px);
  bottom: 42px;
  width: min(270px, 78%);
  padding: 16px 18px;
  border: 1px solid rgba(216, 228, 218, 0.82);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(30, 54, 39, 0.14);
  backdrop-filter: blur(16px);
}

.floating-card-label {
  color: var(--primary-dark);
}

.hero-floating-card i {
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-soft));
}

.hero-plant-col {
  position: relative;
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  min-height: clamp(450px, 42vw, 600px);
}

.plant-stage {
  position: relative;
  width: min(100%, 460px);
  height: clamp(430px, 40vw, 600px);
  isolation: isolate;
}

.plant-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6%;
  width: 76%;
  height: 88%;
  z-index: -2;
  transform: translateX(-50%);
  border-left: 1px solid rgba(39, 105, 75, 0.16);
  border-right: 1px solid rgba(184, 106, 50, 0.14);
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.56) 48%, transparent),
    linear-gradient(180deg, rgba(39, 105, 75, 0.05), rgba(184, 106, 50, 0.06));
}

.plant-stage::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 2%;
  height: 8%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(73, 45, 24, 0.18);
  filter: blur(16px);
}

#plant-canvas {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: block;
  width: auto;
  height: min(100%, 600px);
  aspect-ratio: 688 / 1032;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  background: transparent;
  filter: none;
}

.plant-canvas-glow {
  display: none;
}

#plant-leaves {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-hero > .hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(var(--container), var(--site-gutter));
  max-width: none;
  margin: 0 auto clamp(26px, 4vw, 46px);
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  border-top: 0;
}

.hero-stat,
.home-sensor-metric,
.sensor-metric-card,
.sensor-status-card,
.sensor-panel-card,
.publication-card,
.project-card,
.project-card-full,
.social-card,
.intro-card,
.link-card,
.dashboard-overview-card,
.home-sensor-visual,
.publications-list {
  border-radius: var(--radius-lg);
}

.hero-stat {
  min-height: 86px;
  padding: 18px;
  border-color: rgba(216, 228, 218, 0.84);
  background: rgba(255, 255, 255, 0.72);
}

.hero-stat .stat-icon {
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent);
}

.hero-stat strong {
  color: var(--primary-dark);
}

.home-sensor-section {
  padding-top: clamp(42px, 6vw, 82px);
}

.dashboard-overview-card,
.project-card,
.project-card-full,
.social-card {
  background: rgba(255, 255, 255, 0.82);
}

.project-card-link:hover .project-card,
.project-card-link:hover .project-card-full,
.social-card:hover {
  border-color: rgba(184, 106, 50, 0.34);
}

@media (max-width: 1180px) {
  .hero-inner {
    grid-template-columns: minmax(260px, 0.78fr) minmax(360px, 1fr);
  }

  .portrait-card {
    display: none;
  }

  .hero-plant-col {
    order: 1;
  }

  .hero-text {
    order: 2;
  }
}

@media (max-width: 900px) {
  .home-hero {
    min-height: 0;
  }

  .hero-inner {
    grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1fr);
    gap: 32px;
    padding-top: 48px;
  }

  .hero-text {
    order: 2;
  }

  .hero-plant-col {
    order: 1;
    min-height: 430px;
  }

  .plant-stage {
    height: 430px;
  }

  .home-hero > .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-zone {
    background-size: 48px 48px, 48px 48px, auto;
  }

  .navbar {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding-block: 12px;
  }

  .nav-dashboard {
    width: auto;
    min-height: 38px;
    padding-inline: 14px;
    flex: 0 0 auto;
  }

  .nav-links {
    order: 3;
    display: grid;
    flex-basis: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-links a {
    justify-content: center;
    padding-inline: 8px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 24px;
    padding-bottom: 30px;
  }

  .hero h1 {
    max-width: 10ch;
    font-size: clamp(2.7rem, 13vw, 3.45rem);
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-text {
    order: 2;
  }

  .hero-plant-col {
    order: 1;
    min-height: 280px;
  }

  .plant-stage {
    width: min(100%, 330px);
    height: 280px;
  }

  .portrait-card img {
    width: 100%;
  }

  .portrait-card {
    order: 3;
  }

  .hero-floating-card {
    right: 12px;
    bottom: 18px;
    width: min(270px, calc(100% - 24px));
  }

  .home-hero > .hero-stats {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   Center-rail homepage layout
   ================================================================ */
:root {
  --home-rail-width: clamp(280px, 24vw, 430px);
  --home-side-gap: clamp(28px, 3.6vw, 64px);
}

.home-scroll-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(rgba(39, 105, 75, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 105, 75, 0.034) 1px, transparent 1px),
    linear-gradient(135deg, #f8fbf6 0%, #eef6f0 45%, #faf6ef 100%);
  background-size: 72px 72px, 72px 72px, auto;
}

.home-scroll-stage::before {
  content: none;
}

.home-center-rail {
  --plant-start: clamp(120px, 15vh, 190px);
  --plant-end-padding: 140px;
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: var(--home-rail-width);
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
}

.home-center-rail .plant-stage {
  position: absolute;
  top: var(--plant-start);
  left: 50%;
  width: min(100%, 420px);
  height: clamp(400px, 37vw, 560px);
  transform: translate3d(-50%, var(--plant-scroll-y, 0px), 0);
  backface-visibility: hidden;
  contain: layout paint;
  will-change: transform;
}

.home-center-rail #plant-canvas {
  height: min(100%, 560px);
}

.home-center-rail .plant-stage::before {
  content: none;
}

.home-center-rail .plant-stage::after {
  content: none;
}

.hero-zone {
  overflow: visible;
  border-bottom: 0;
  background: transparent;
}

.hero-zone::after {
  content: none;
}

.home-scroll-stage > section,
.home-scroll-stage > .hero-zone {
  position: relative;
  z-index: 3;
}

.home-hero {
  min-height: calc(100svh - 72px);
}

.hero-inner,
.home-hero > .hero-stats,
.home-sensor-section .section-container,
.featured-projects .section-container,
.profiles-section .section-container {
  width: min(var(--container), var(--site-gutter));
  padding-inline: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-rail-width) minmax(0, 1fr);
  column-gap: var(--home-side-gap);
}

.hero-inner {
  min-height: calc(100svh - 72px);
  padding-block: clamp(58px, 7vw, 112px) clamp(40px, 5vw, 72px);
  align-items: center;
}

.portrait-card {
  display: flex;
  grid-column: 1;
  grid-row: 1;
}

.hero-plant-col {
  display: block;
  grid-column: 2;
  grid-row: 1;
  min-height: 1px;
}

.hero-text {
  grid-column: 3;
  grid-row: 1;
}

.hero h1 {
  max-width: 10.5ch;
  font-size: clamp(3.1rem, 3.75vw, 4.65rem);
  line-height: 0.98;
}

.home-hero > .hero-stats {
  gap: 14px var(--home-side-gap);
  margin-bottom: clamp(48px, 6vw, 86px);
}

.home-hero > .hero-stats .hero-stat:nth-child(odd) {
  grid-column: 1;
}

.home-hero > .hero-stats .hero-stat:nth-child(even) {
  grid-column: 3;
}

.home-sensor-section,
.featured-projects,
.profiles-section {
  padding-block: clamp(86px, 11vw, 150px);
}

.dashboard-overview-card {
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-sensor-copy {
  grid-column: 1;
  grid-row: 1;
}

.home-sensor-metrics {
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.home-sensor-visual {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.dashboard-overview-card .home-sensor-copy {
  display: contents;
}

.home-sensor-copy .section-glass-heading {
  grid-column: 1 / -1;
  grid-row: 1;
}

.home-sensor-actions {
  grid-column: 1;
  grid-row: 2;
  margin-top: 18px;
}

.home-sensor-metrics {
  grid-row: 3;
}

.home-sensor-visual {
  grid-row: 2 / span 2;
  align-self: stretch;
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.home-sensor-visual .mini-chart-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 300px;
}

.featured-projects {
  border-top: 0;
}

.featured-projects .section-heading-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-rail-width) minmax(0, 1fr);
  column-gap: var(--home-side-gap);
  margin-bottom: 0;
}

.featured-projects .section-heading-row > div:not(.section-glass-heading) {
  display: contents;
}

.featured-projects .section-heading-row .section-glass-heading {
  grid-column: 1 / -1;
  grid-row: 1;
}

.featured-projects .section-heading-row .eyebrow {
  grid-column: 1;
  grid-row: 2;
}

.featured-projects .section-heading-row .section-title {
  grid-column: 1 / -1;
  grid-row: 1;
}

.featured-projects .section-link {
  display: inline-flex;
  grid-column: 3;
  grid-row: 2;
  align-self: start;
  justify-self: start;
  margin-top: 18px;
}

.projects-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-rail-width) minmax(0, 1fr);
  gap: 22px var(--home-side-gap);
  margin-top: 34px;
}

.projects-grid .project-card-link:nth-child(odd) {
  grid-column: 1;
}

.projects-grid .project-card-link:nth-child(even) {
  grid-column: 3;
}

.project-card img,
.project-card-full img {
  height: 180px;
}

.profiles-section .section-title,
.profiles-section .section-subtitle {
  grid-column: 1;
}

.profiles-section .section-container {
  position: relative;
  padding: clamp(18px, 2.6vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(39, 105, 75, 0.055));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 24px 60px rgba(34, 58, 43, 0.12);
  backdrop-filter: blur(6px) saturate(1.14);
  -webkit-backdrop-filter: blur(6px) saturate(1.14);
}

.profiles-section .section-glass-heading {
  grid-column: 1 / -1;
  grid-row: 1;
}

.profiles-section .section-subtitle {
  grid-column: 1;
  grid-row: 2;
}

.section-glass-heading {
  position: relative;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  align-items: center;
  justify-self: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px clamp(18px, 3vw, 42px) 22px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.36)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(39, 105, 75, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 44px rgba(34, 58, 43, 0.1);
  backdrop-filter: blur(14px) saturate(1.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.18);
  color: rgba(21, 32, 26, 0.94);
  text-align: center;
}

.section-glass-heading .section-title {
  max-width: none;
  margin: 0;
  color: rgba(21, 32, 26, 0.96);
  font-size: clamp(1.7rem, 2.35vw, 2.55rem);
  line-height: 1.02;
}

.section-glass-heading .eyebrow {
  margin: 2px 0 0;
  color: var(--primary-dark);
}

.section-glass-heading .section-subtitle {
  max-width: min(780px, 100%);
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.96rem, 0.92vw, 1.08rem);
  line-height: 1.58;
  text-align: center;
}

.profiles-section .social-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-rail-width) minmax(0, 1fr);
  gap: 22px var(--home-side-gap);
}

.profiles-section .social-card:nth-child(odd) {
  grid-column: 1;
}

.profiles-section .social-card:nth-child(even) {
  grid-column: 3;
}

.profiles-section .social-grid {
  grid-row: 2;
}

@media (max-width: 1180px) {
  :root {
    --home-rail-width: clamp(230px, 28vw, 320px);
    --home-side-gap: clamp(20px, 3vw, 36px);
  }

  .portrait-card {
    display: none;
  }
}

@media (max-width: 980px) {
  :root {
    --home-rail-width: min(100%, 330px);
    --home-side-gap: 0px;
  }

  .home-scroll-stage {
    background-size: 48px 48px, 48px 48px, auto;
  }

  .home-scroll-stage::before {
    content: none;
  }

  .home-center-rail {
    --plant-start: clamp(260px, 38vh, 330px);
    --plant-end-padding: 86px;
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: min(78vw, 340px);
    height: 100%;
    margin: 0;
    transform: translateX(-50%);
  }

  .home-center-rail .plant-stage {
    position: absolute;
    top: var(--plant-start);
    left: 50%;
    width: min(100%, 340px);
    height: clamp(310px, 72vw, 430px);
    transform: translate3d(-50%, var(--plant-scroll-y, 0px), 0);
    opacity: 0.66;
  }

  .home-center-rail #plant-canvas {
    height: min(100%, 430px);
  }

  .hero-inner,
  .home-hero > .hero-stats,
  .home-sensor-section .section-container,
  .featured-projects .section-container,
  .profiles-section .section-container,
  .projects-grid,
  .profiles-section .social-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: min(var(--container), var(--site-gutter));
    gap: 20px;
  }

  .home-hero {
    min-height: 0;
  }

  .hero-inner {
    min-height: 0;
    padding-block: 28px 44px;
  }

  .hero-plant-col {
    display: none;
  }

  .hero-text,
  .home-hero > .hero-stats .hero-stat,
  .home-sensor-copy,
  .home-sensor-copy .section-glass-heading,
  .home-sensor-copy .sensor-eyebrow,
  .home-sensor-copy .section-title,
  .home-sensor-copy .section-subtitle,
  .home-sensor-actions,
  .home-sensor-metrics,
  .home-sensor-visual,
  .featured-projects .section-heading-row,
  .featured-projects .section-heading-row .section-glass-heading,
  .featured-projects .section-heading-row .eyebrow,
  .featured-projects .section-heading-row .section-title,
  .featured-projects .section-link,
  .projects-grid .project-card-link,
  .profiles-section .section-glass-heading,
  .profiles-section .section-title,
  .profiles-section .section-subtitle,
  .profiles-section .social-card {
    grid-column: 1;
  }

  .home-hero > .hero-stats .hero-stat:nth-child(odd),
  .home-hero > .hero-stats .hero-stat:nth-child(even),
  .projects-grid .project-card-link:nth-child(odd),
  .projects-grid .project-card-link:nth-child(even),
  .profiles-section .social-card:nth-child(odd),
  .profiles-section .social-card:nth-child(even) {
    grid-column: 1;
  }

  .home-sensor-copy .sensor-eyebrow,
  .home-sensor-copy .section-glass-heading,
  .home-sensor-copy .section-title,
  .home-sensor-copy .section-subtitle,
  .home-sensor-actions,
  .home-sensor-metrics,
  .home-sensor-visual,
  .featured-projects .section-heading-row .section-glass-heading,
  .profiles-section .section-glass-heading,
  .profiles-section .section-subtitle {
    grid-row: auto;
  }

  .featured-projects .section-heading-row {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .hero h1 {
    max-width: 10ch;
    font-size: clamp(2.65rem, 12vw, 3.4rem);
  }

  .home-sensor-section,
  .featured-projects,
  .profiles-section {
    padding-block: 56px;
  }

  .home-sensor-metrics {
    grid-template-columns: 1fr;
  }
}
