:root {
  /* Palette - Clean Scientific */
  --bg-core: #fdfbf9;
  --bg-surface: #f4f1ee;
  --bg-surface-hover: #ebe8e5;
  --bg-light-gray: #f9fafb;

  --text-primary: #111111;
  --text-secondary: #6e6e80;
  --text-tertiary: #8c8c8c;

  --accent-primary: #d26a45;
  /* Muted Terracotta */
  --accent-secondary: #e6e0d9;
  --accent-blue: #0066cc;
  /* Tech Blue */
  --accent-blue-border: #b3d9ff;

  --border-subtle: #e5e5e5;
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-main: 'Roboto Flex', sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  --container-max: 1200px;
  --header-height: 50px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-core);
  color: var(--text-primary);
  line-height: 1.6;
  font-variation-settings: 'opsz' 14, 'wght' 400;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 32, 'wght' 500;
}

h1 {
  font-size: 3rem;
  font-variation-settings: 'opsz' 48, 'wght' 400;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: var(--space-sm);
}

p {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

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

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-core);
  border-radius: 999px;
}

.btn-primary:hover {
  background-color: #333;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

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

/* Layout */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

section {
  padding: var(--space-xl) 0;
}

/* Header */
header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: rgba(253, 251, 249, 0.60);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

header.scrolled {
  border-bottom-color: var(--border-subtle);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  z-index: 1001;
  font-variation-settings: 'wght' 700;
}

.brand-bold {
  font-weight: 700;
  font-variation-settings: 'wght' 700;
}

/* .nav-links handling moved to Burger Menu section */

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* Hero */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-content {
  max-width: 800px;
}

.hero-tag {
  display: inline-block;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  color: var(--text-tertiary);
  font-weight: 600;
}

#technology {
  padding-top: var(--space-lg);
}

/* Feature Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.card {
  background: var(--bg-surface);
  padding: var(--space-md);
  border-radius: 8px;
  transition: transform 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

/* Footer */
footer {
  background-color: var(--bg-surface);
  padding: var(--space-lg) 0;
  margin-top: var(--space-xl);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer-col h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  color: var(--text-tertiary);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.footer-col a:hover {
  color: var(--text-primary);
}

/* Mobile */
.mobile-toggle {
  display: flex;
  /* Changed from none */
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 2000;
  padding: 0.5rem;
  transition: opacity 0.3s;
}

.mobile-toggle:hover {
  opacity: 0.7;
}

.bar {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  height: 2px;
  background-color: var(--text-primary);
  transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Mobile Toggle - Visible everywhere */
.mobile-toggle {
  display: flex !important;
  /* Override any previous hidden state */
}

/* Nav Links - Default Hidden/Sidebar state (Burger Menu) */
.nav-links {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 260px;
  background-color: rgba(253, 251, 249, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  flex-direction: column;
  padding: calc(var(--space-xl) + 2.5rem) var(--space-md) var(--space-xl);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  gap: 1.5rem;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  z-index: 1002;
}

.nav-links.active {
  transform: translateX(0);
}

.nav-close {
  display: none !important;
}

.nav-close:hover {
  opacity: 0.7;
  transform: translateY(-1px);
}

.nav-close span {
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
}

.nav-close span:first-child {
  transform: rotate(45deg);
}

.nav-close span:last-child {
  transform: rotate(-45deg);
}

/* Nav Items */
.nav-item {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  padding: 0.5rem 0;
}

.nav-sub-item {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-left: 1.5rem;
  display: block;
  padding: 0.25rem 0;
  border-left: 1px solid var(--border-subtle);
  padding-left: 1rem;
}

.nav-sub-item:hover {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
}

/* =========================================
   VERSION C: CLEAN & BALANCED (TECH FIRST)
   ========================================= */

.bold-tech-section {
  padding: 6rem 0;
  background: #fff;
  /* Clean white background */
}

.tech-header {
  margin-bottom: 4rem;
  text-align: left;
  /* Align header to left like image? No, image title is left aligned 'Core Technology' */
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid transparent;
  flex-wrap: wrap;
  /* Allow wrapping */
  gap: 1rem;
}

@media (max-width: 600px) {
  .tech-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.tech-header h2 {
  font-size: 2.5rem;
  font-weight: 500;
  /* Lighter weight */
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.tech-header a {
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--text-primary);
}

.tech-header .subtitle {
  display: none;
  /* Hide subtitle to match clean look */
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  align-items: start;
  /* Align cards to top for consistent header/value alignment */
}

.stat-card {
  background: white;
  padding: 1.5rem 0;
  border: none;
  border-top: 4px solid black;
  border-bottom: 4px solid black;
  border-radius: 0;
  text-align: center;
  transition: transform 0.2s ease;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* Start from top instead of center */
  height: auto;
  /* Let content determine height */
  min-height: 0;
  /* Remove min-height constraint */
}

/* Specific Card Styles - Card 1 & 3: Water Uptake & Regeneration - Blue Lines */
.stat-card:nth-child(1),
.stat-card:nth-child(3) {
  border-color: var(--accent-blue);
  background: white;
  /* Reset background to match others for clean look */
}

/* Card 3: No special styles needed anymore for consistency */

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.stat-value {
  font-size: 4.5rem;
  font-weight: 400;
  /* Thinner font */
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}

.stat-value .unit {
  font-size: 1.5rem;
  color: var(--text-tertiary);
  font-weight: 400;
  vertical-align: super;
  margin-left: 0.25rem;
}

.stat-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 90%;
}

.stat-card:nth-child(3) .stat-desc {
  max-width: 100%;
}

.stat-text-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Deep Dive Layout */
.tech-deep-dive {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: stretch;
}

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

/* Chart Container */
.chart-container-bold {
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: none;
  position: relative;
  z-index: 0;
}

@media (max-width: 600px) {
  .chart-container-bold {
    padding: 1.5rem 0.5rem 2.5rem 0.5rem;
    /* Reduced horizontal padding, increased bottom for legend */
  }
}

.chart-container-bold h3 {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

#water-uptake-chart {
  position: relative;
  z-index: 0;
}

/* Comparison Block */
.comparison-block {
  padding: 1rem 0 0 1rem;
}

.comparison-block h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
  font-variation-settings: 'wght' 700;
}

.comparison-list {
  list-style: none;
  padding: 0;
  margin-bottom: 3rem;
}

.win-item {
  gap: 0;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.check-icon {
  display: none;
}

.win-item strong {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.win-item p {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Minimal VS Table */
.vs-table-mini {
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  font-size: 0.9rem;
  width: 100%;
}

.vs-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 0.5rem;
}

.vs-row:last-child {
  border-bottom: none;
}

.vs-row.header {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding-bottom: 0.25rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.vs-row.winner {
  background: transparent;
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: none;
  margin: 0.25rem 0;
  padding: 0.5rem 0.5rem;
  border-radius: 6px;
  position: relative;
  font-weight: 600;
}

.vs-row.loser {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* =========================================
   Applications Section (Industry Grid)
   ========================================= */

.applications-section {
  padding: 8rem 0;
  background-color: transparent;
}

.applications-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

@media (max-width: 960px) {
  .applications-container {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

.applications-text {
  max-width: 500px;
}

.applications-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

/* Industry Showcase Strip */
.industry-showcase {
  display: flex;
  width: 100%;
  height: 500px;
  overflow: hidden;
  border-radius: 4px;
  /* Slight rounding on proper container edges if desired, or 0 */
}

.industry-card {
  flex: 1;
  position: relative;
  transition: flex 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  cursor: default;
  /* Reset previous styles */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  /* Override previous min-height */
  background-color: #333;
  /* Fallback */
}

.industry-card:hover {
  flex: 3;
  box-shadow: none;
  border-color: transparent;
  transform: none;
}

/* Dark overlay */
.industry-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  transition: background 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.industry-card:hover::before {
  background: rgba(0, 0, 0, 0.2);
}

.industry-name {
  position: relative;
  z-index: 2;
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 1.3rem;
  /* Increased by 30% from 1rem */
  white-space: nowrap;
  /* Vertical Text (Bottom to Top) */
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  /* Let clicks pass through */
}

/* Hide Icons */
.industry-icon {
  display: none;
}

/* Last Card - Get In Touch */
.industry-card.cta-card {
  background-color: var(--accent-blue);
  cursor: pointer;
}

/*
.industry-card.cta-card::before {
  display: none;
}
Removed so the overlay applies, improving readability over the image.
*/

.industry-card.cta-card:hover {
  background-color: #0056b3;
  /* Darker blue */
}

.industry-card.cta-card .industry-name {
  font-size: 1.43rem;
  /* Increased by 30% from 1.1rem */
}

/* =========================================
   Research Page
   ========================================= */

.research-hero {
  padding: 8rem 0 4rem 0;
  background-color: var(--bg-core);
}

.research-header {
  max-width: 800px;
}

.research-header h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.publications-section {
  padding: 4rem 0 8rem 0;
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.pub-card {
  background: white;
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.pub-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg-surface);
}

.pub-journal {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.pub-year {
  font-family: monospace;
  background: var(--bg-surface);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pub-card-body {
  margin-bottom: 2rem;
  flex-grow: 1;
}

.pub-title {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.pub-meta {
  font-size: 0.95rem;
  color: var(--text-tertiary);
  font-style: italic;
}

.pub-card-footer {
  margin-top: auto;
}

.pub-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pub-link:hover {
  text-decoration: underline;
}

/* Make nav link active state visible */
.nav-links a.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* Founders Section */
.founders-section {
  padding: 4rem 0;
  background-color: #fff;
}

.founders-container {
  display: flex;
  align-items: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.founders-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 140px;
}

.founders-links {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.founders-links a {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.2s;
}

.founders-links a:hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .founders-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .founders-links {
    gap: 1.5rem;
    flex-direction: column;
  }
}

/* Typewriter Cursor */
.cursor {
  display: inline-block;
  width: 2px;
  background-color: var(--text-primary);
  animation: blink 1.15s step-end infinite;
  margin-left: 2px;
  height: 1em;
  vertical-align: text-bottom;
}

@keyframes blink {

  from,
  to {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Typing Container to prevent layout shift */
.typing-container {
  display: inline-block;
  min-width: 4ch;
  /* Approximate width for "water" */
  text-align: left;
}