:root {
  /* Dynamic Palette: Emerald & Mint Deep (Strictly No Blue) */
  --bg-canvas: #eef7f2;
  --bg-surface: rgba(255, 255, 255, 0.4);
  --bg-surface-hover: rgba(255, 255, 255, 0.7);
  --text-primary: #1f2937;
  --text-muted: #14532d;
  --accent-primary: #14532d;
  --accent-secondary: #059669;
  --border-subtle: rgba(20, 83, 45, 0.3);
  
  /* Advanced UI Micro-Interactions & Depth */
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(20, 83, 45, 0.15);
  --glow-accent: 0 0 24px -4px var(--accent-primary);
  --glass-backdrop: blur(16px) saturate(180%);
}

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

html {
  lang: "en";
  font-family: 'Charter', 'Cambria', serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  margin: 0.5rem;
  min-height: calc(100vh - 1rem);
  border: 1px solid var(--accent-primary); /* Delicate inset border frame */
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Typography Limits & Overflows */
h1, h2, h3, h4, h5, h6, p, li, blockquote {
  overflow-wrap: anywhere;
  hyphens: auto;
}

h1, h2, h3 {
  color: var(--accent-primary);
  font-weight: normal;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

p {
  margin-bottom: 1.5rem;
}

/* Strict Brand Placement & Header Flow */
header {
  position: relative; /* Moves up out of view on scroll */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 5%;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--accent-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Desktop Navigation */
nav {
  display: none;
}

@media (min-width: 769px) {
  nav {
    display: flex;
    gap: 2rem;
  }
  
  nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    transition: color 0.3s var(--ease-kinetic);
  }

  nav a:hover, nav a:focus-visible {
    color: var(--accent-secondary);
  }
}

/* Mobile 3-dot Navigation */
.mobile-nav-toggle {
  display: block;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--accent-primary);
  cursor: pointer;
  padding: 0.5rem;
}

@media (min-width: 769px) {
  .mobile-nav-toggle {
    display: none;
  }
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 50;
  padding: 2rem 5%;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-variant: small-caps;
}

/* Core Layout Wrappers */
main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 5%;
}

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

/* Architecturally Sharp Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0; /* Strict 0px corners */
  object-fit: cover;
  display: block;
}

/* Hero Section: Trio Overlapping Grid */
.hero-trio {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(10, 5vw);
  gap: 1rem;
  margin-bottom: 5rem;
  position: relative;
}

.hero-img-1 {
  grid-column: 1 / 8;
  grid-row: 1 / 8;
  height: 100%;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevation);
}

.hero-img-2 {
  grid-column: 7 / 13;
  grid-row: 3 / 10;
  height: 100%;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevation);
  z-index: 2;
}

.hero-img-3 {
  grid-column: 4 / 9;
  grid-row: 6 / 11;
  height: 100%;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevation);
  z-index: 3;
}

@media (max-width: 768px) {
  .hero-trio {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 1.5rem;
  }
  .hero-img-1, .hero-img-2, .hero-img-3 {
    grid-column: 1 / -1;
    grid-row: auto;
    aspect-ratio: 16 / 9;
  }
}

/* Bento & Split Screen Layouts */
.grid-bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 4rem 0;
}

.split-screen {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 4rem;
  margin: 4rem 0;
  align-items: start;
}

@media (max-width: 1024px) {
  .split-screen {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Glassmorphic Cards with Sharp Corners */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 2rem;
  transition: transform 0.4s var(--ease-kinetic), box-shadow 0.4s var(--ease-kinetic);
}

.glass-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-elevation), var(--glow-accent);
  background: var(--bg-surface-hover);
}

.glass-card img {
  aspect-ratio: 4 / 3;
  margin-bottom: 1.5rem;
}

/* Taxonomic Labels */
.taxonomic-label {
  font-variant: small-caps;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Hollow Outlined Buttons */
.btn, button {
  display: inline-block;
  border: 1px solid var(--accent-primary);
  background: transparent;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1rem 2rem;
  border-radius: 0;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-kinetic);
  text-align: center;
}

.btn:hover, button:hover {
  background: var(--accent-primary);
  color: var(--bg-canvas);
  box-shadow: var(--shadow-elevation);
}

/* Tables for Chemistry */
.table-wrapper {
  overflow-x: auto;
  margin: 3rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  text-align: left;
}

th {
  background: rgba(20, 83, 45, 0.05);
  font-weight: normal;
  color: var(--accent-primary);
  font-variant: small-caps;
}

/* Scroll Reveal Kinetic Feedback */
.reveal-hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-kinetic), transform 0.7s var(--ease-kinetic);
}

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

/* Tool Forms */
.tool-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 3rem 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-variant: small-caps;
  color: var(--accent-primary);
}

input, select, textarea {
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 5%;
  margin-top: auto;
}

.footer-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col {
  flex: 1;
  min-width: 200px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.legal-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

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