
:root {
  color-scheme: light;
  
  /* Dynamic Theme Tokens */
  --primary: #2d7a46;
  --primary-dark: #0a1f12;
  --primary-bright: #4ade80;
  --cream: #0a1f12;
  --paper: #101e16;
  --gold: #caa86a;
  
  --bg-dark: var(--primary-dark);
  --bg-light: var(--paper);
  --text-main: #e4efe6;
  --text-muted: #9ab7a1;
  
  --header-bg: #0a1f12d9;
  --card: #ffffff;
  --card-border: #2d7a461a;
  --glass: rgba(255, 255, 255, 0.6);
  --shadow: #0a1f121a;
  
  --font-heading: "Cormorant Garamond", serif;
  --font-body: "Outfit", sans-serif;
  --radius: 8px;
  --profile-lower-columns: 3;
  --max-width: 1200px;
}

/* Base & Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text-main);
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "clig", "calt";
  transition: background-color 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Outfit:wght@300;400;500;600&family=Fira+Code:wght@400;500&family=Playfair+Display:wght@400;700&display=swap');

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -0.02em; margin-bottom: 1rem; }
h2 { font-size: clamp(2rem, 4vw, 3rem); padding-bottom: 0.5rem; border-bottom: 1px solid var(--gold); display: inline-block; }
h3 { font-size: 1.75rem; }
p { margin-bottom: 1.5rem; max-width: 70ch; }

a { color: var(--primary); text-decoration: none; font-weight: 500; transition: all 0.2s ease; position: relative; }
a:not(.button):hover { color: var(--primary-bright); }
a:not(.button)::after {
    content: ''; position: absolute; width: 100%; transform: scaleX(0); height: 1px; bottom: -2px; left: 0;
    background-color: var(--primary-bright); transform-origin: bottom right; transition: transform 0.25s ease-out;
}
a:not(.button):hover::after { transform: scaleX(1); transform-origin: bottom left; }

/* Layout */
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-top: 80px; width: 100%; max-width: var(--max-width); margin: 0 auto; padding-left: 5vw; padding-right: 5vw; }

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  padding: 1rem 5vw;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}
.site-header.scrolled { padding: 0.75rem 5vw; background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

.logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--primary); letter-spacing: 0.05em; text-transform: uppercase; }
.nav { display: flex; gap: 2rem; }
.nav a { color: var(--text-muted); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.1em; font-weight: 600; }
.nav a:hover, .nav a.active { color: var(--primary); }
.nav a::after { display: none; } /* Disable underline for nav items */

/* Burger Menu */
.header-right { display: flex; align-items: center; gap: 1rem; }
.burger-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}
.burger-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  transition: transform 0.3s ease;
}
.burger-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(10, 10, 10, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6rem 2rem 3rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.burger-menu-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.burger-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 3rem;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}
.burger-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}
.burger-nav a {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.3s ease;
}
.burger-nav a:hover {
  color: var(--gold);
}
.burger-nav hr {
  width: 50%;
  margin: 1rem auto;
  border: 0;
  border-top: 1px solid var(--card-border);
}

/* Profile Tiles */
.profile-tiles {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}
.profile-row {
  gap: 1.5rem;
}
.profile-row--upper {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  perspective: 1200px;
}
.profile-row--lower {
  display: grid;
  grid-template-columns: repeat(var(--profile-lower-columns), minmax(220px, 1fr));
}
.profile-tile {
  --tile-tilt-x: 0deg;
  --tile-tilt-y: 0deg;
  --glow-x: 50%;
  --glow-y: 25%;
  --float-x: 0px;
  --float-y: 0px;
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 240px;
  border-radius: 18px;
  overflow: visible;
  color: #f8f7f4;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, flex 0.45s ease;
  transform: translate3d(var(--float-x), var(--float-y), 0) rotateX(var(--tile-tilt-x)) rotateY(var(--tile-tilt-y));
}
.profile-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--glow-x) var(--glow-y), rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}
.profile-tile::after {
  content: "";
  position: absolute;
  inset: 12% 6% auto 6%;
  height: 55%;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(28px);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}
.profile-tile:hover {
  transform: translate3d(var(--float-x), calc(var(--float-y) - 10px), 0) rotateX(var(--tile-tilt-x)) rotateY(var(--tile-tilt-y));
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.35);
}
.profile-tile:hover::before,
.profile-tile:hover::after {
  opacity: 1;
}
.profile-row--upper .profile-tile {
  flex: 1 1 240px;
  min-height: 320px;
  --tile-tilt-x: 4deg;
  --tile-tilt-y: 0deg;
}
.profile-row--upper .profile-tile:hover {
  flex: 1.55 1 240px;
}
.profile-row--lower .profile-tile {
  min-height: 210px;
}
.tile-stack {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(15, 15, 15, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px -35px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.tile-stack--one {
  transform: translate3d(0, 14px, -40px) scale(0.98);
  opacity: 0.8;
}
.tile-stack--two {
  transform: translate3d(0, 26px, -80px) scale(0.95);
  opacity: 0.6;
}
.profile-tile:hover .tile-stack--one {
  transform: translate3d(0, 18px, -40px) scale(0.98);
}
.profile-tile:hover .tile-stack--two {
  transform: translate3d(0, 30px, -80px) scale(0.95);
}
.tile-surface {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.45);
}
.tile-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.6) saturate(0.95);
  transition: transform 0.6s ease, filter 0.4s ease;
  z-index: 0;
}
.tile-media--alt {
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 0;
}
.profile-tile.has-deck .tile-media {
  animation: deck-base 12s ease-in-out infinite;
  animation-delay: var(--deck-delay, 0s);
}
.profile-tile.has-deck .tile-media--alt {
  animation: deck-alt 12s ease-in-out infinite;
  animation-delay: calc(var(--deck-delay, 0s) + 6s);
}
.profile-row--upper .tile-media {
  animation-name: deck-base, media-drift;
  animation-duration: 12s, 16s;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-iteration-count: infinite, infinite;
  animation-delay: var(--deck-delay, 0s), 0s;
}
.profile-row--upper .tile-media--alt {
  animation-name: deck-alt, media-drift;
  animation-duration: 12s, 16s;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-iteration-count: infinite, infinite;
  animation-delay: calc(var(--deck-delay, 0s) + 6s), 0s;
}
.profile-tile:hover .tile-media {
  transform: scale(1.06);
  filter: brightness(0.5) saturate(1.1);
}
.profile-tile:hover .tile-media--alt {
  opacity: 1;
}
.tile-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 70%);
  transform: translateZ(10px);
  z-index: 1;
}
.tile-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform: translateZ(26px);
}
.tile-content h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #f8f7f4;
}
.tile-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tile-keywords span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.45);
}
.tile-action {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

@keyframes deck-base {
  0%, 45% { opacity: 1; }
  55%, 100% { opacity: 0; }
}

@keyframes deck-alt {
  0%, 45% { opacity: 0; }
  55%, 100% { opacity: 1; }
}

@keyframes media-drift {
  0%, 100% { background-position: 50% 50%; }
  50% { background-position: 55% 45%; }
}

/* Project Overlays */
.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  perspective: 1200px;
}
.project-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.overlay-content {
  position: relative;
  width: min(900px, 92vw);
  max-height: 85vh;
  background: var(--paper);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(24px) scale(0.92) rotateX(-8deg);
  transform-origin: var(--origin-x, 50%) var(--origin-y, 20%);
  transition: transform 0.45s ease, opacity 0.35s ease;
}
.project-overlay.active .overlay-backdrop {
  opacity: 1;
}
.project-overlay.active .overlay-content {
  opacity: 1;
  transform: translateY(0) scaleY(1) rotateX(0deg);
}
.overlay-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  z-index: 10;
}
.overlay-scroll {
  overflow-y: auto;
  padding: 2rem;
}
.overlay-hero {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
}
.overlay-body {
  font-family: var(--font-body);
  line-height: 1.6;
}
.overlay-body h3 {
  font-family: var(--font-heading);
  margin-top: 1.5rem;
}

/* Scroll Reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .profile-row--upper .profile-tile {
    flex: 1 1 100%;
  }
  .profile-row--upper .profile-tile:hover {
    flex: 1 1 100%;
  }
  .profile-row--lower {
    grid-template-columns: repeat(2, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .profile-row--lower {
    grid-template-columns: 1fr;
  }
  .burger-nav a {
    font-size: 1.5rem;
  }
  .burger-close {
    top: 1.5rem;
    right: 1.25rem;
    font-size: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-tile,
  .overlay-content,
  .scroll-reveal {
    transition: none;
    transform: none;
  }
  .profile-tile:hover {
    transform: none;
  }
  .tile-media,
  .tile-media--alt {
    transition: none;
    animation: none;
  }
}

/* Components */
.construction-banner {
  background: var(--gold);
  color: #000;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 2000;
}

.card, .profile-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02); border-color: var(--gold); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--primary); color: #fff;
  border-radius: 4px; border: 1px solid var(--primary);
  text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.1em; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.button:hover { background: var(--primary-bright); border-color: var(--primary-bright); transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.button.ghost { background: transparent; color: var(--primary); }
.button.ghost:hover { background: var(--primary); color: #fff; }

/* Grid Layouts */
.content-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; margin: 4rem 0; }
@media (min-width: 768px) {
  .content-grid { grid-template-columns: 1fr 1fr; align-items: center; }
  .content-grid > div:first-child { order: 1; }
  .content-grid > div:last-child { order: 2; }
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; margin: 3rem 0; }

/* Footer */
.site-footer {
  background: var(--primary-dark); color: var(--cream);
  padding: 4rem 5vw; margin-top: 6rem;
}
.site-footer a { color: var(--gold); opacity: 0.8; }
.site-footer a:hover { opacity: 1; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; }
.footer-title { font-family: var(--font-heading); font-size: 1.25rem; margin-bottom: 1.5rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem; }

/* Utilities */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.image-frame { border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.image-frame img { width: 100%; height: auto; display: block; transition: transform 0.5s ease; }
.image-frame:hover img { transform: scale(1.03); }

/* Form Elements */
input, textarea {
  width: 100%; padding: 1rem;
  border: 1px solid var(--card-border); border-radius: 4px;
  background: rgba(255,255,255,0.8);
  font-family: var(--font-body); font-size: 1rem;
  margin-bottom: 1.5rem; transition: all 0.2s;
}
input:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(101, 20, 28, 0.1); }


        /* Holobiontic / Bio Theme */
        :root {
            color-scheme: dark;
            --card: rgba(10, 31, 18, 0.75);
            --card-border: rgba(74, 222, 128, 0.22);
            --glass: rgba(12, 30, 20, 0.6);
        }
        body {
            background-color: var(--primary-dark);
            background-image:
              radial-gradient(circle at 15% 20%, rgba(74, 222, 128, 0.18), transparent 45%),
              radial-gradient(circle at 80% 10%, rgba(202, 168, 106, 0.15), transparent 35%),
              radial-gradient(circle at 40% 80%, rgba(45, 122, 70, 0.2), transparent 50%),
              linear-gradient(180deg, rgba(10, 31, 18, 0.95) 0%, rgba(5, 16, 11, 0.98) 100%);
        }
        body::before {
            content: "";
            position: fixed;
            inset: 0;
            background-image:
              radial-gradient(circle at 20% 30%, rgba(74, 222, 128, 0.08), transparent 45%),
              radial-gradient(circle at 70% 40%, rgba(202, 168, 106, 0.08), transparent 50%);
            opacity: 0.6;
            z-index: -1;
            pointer-events: none;
        }
        .site-header {
            background: rgba(7, 20, 12, 0.85);
            backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--card-border);
        }
        .site-header.scrolled {
            background: rgba(7, 20, 12, 0.95);
        }
        h1, h2, h3 { color: var(--primary-bright); font-family: "Playfair Display", serif; }
        h2 { border-bottom: 1px solid rgba(202, 168, 106, 0.45); }
        .card, .profile-card, .content-block {
            background: var(--card);
            border: 1px solid var(--card-border);
            box-shadow: 0 24px 45px -35px rgba(0, 0, 0, 0.7);
            border-radius: 16px;
            backdrop-filter: blur(10px);
        }
        .project-grid-section .profile-tile {
            background: rgba(6, 18, 12, 0.6);
        }
        .page-hero {
            position: relative;
            overflow: hidden;
        }
        .page-hero::before {
            content: "";
            position: absolute;
            inset: -10% -5% auto -5%;
            height: 140%;
            background: radial-gradient(circle at 35% 35%, rgba(74, 222, 128, 0.18), transparent 60%);
            opacity: 0.8;
            pointer-events: none;
        }
        .page-hero::after {
            content: "";
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 70% 20%, rgba(202, 168, 106, 0.18), transparent 50%);
            opacity: 0.7;
            animation: tide 12s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes tide {
            0%, 100% { opacity: 0.5; transform: translateY(0); }
            50% { opacity: 0.85; transform: translateY(-8px); }
        }
        .button {
            background: linear-gradient(135deg, var(--primary-bright), var(--primary-dark));
            border-radius: 20px;
            border-color: transparent;
            font-family: var(--font-body);
            letter-spacing: 0.05em;
        }
        .image-frame img { border-radius: 12px; }
        
