/* 
  Wabi-Sabi Portfolio Design System
  Celebrating transience, simplicity, and natural beauty.
*/

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* --- Custom Variables & Tokens --- */
:root {
  --bg-color: #0F0F10;      /* Stark obsidian black void */
  --bg-secondary: #161719;  /* Deep cold iron slate */
  --text-color: #E5E6E4;    /* Cool silver linen */
  --text-muted: #7E8480;    /* Cold ash gray (WCAG AA contrast compliant >4.5:1) */
  --accent-moss: #4A5849;   /* Deep lichen green (dark triad undertone) */
  --accent-rust: #D96B43;   /* Burnt copper ember (the touch of warmth) */
  --accent-gold: #D96B43;   /* Burnt copper ember */
  --border-color: #27292C;  /* Cold iron seam border */
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Outfit', sans-serif;
  --cursor-size: 20px;
  --cursor-color: rgba(217, 107, 67, 0.18); /* Copper ember custom cursor shadow */
}

html.light-theme {
  --bg-color: #F2EDE4;      /* Warm cream background */
  --bg-secondary: #EBE5D8;  /* Slightly darker warm sand */
  --text-color: #1B1917;    /* Dark warm-charcoal text */
  --text-muted: #66635C;    /* Muted charcoal for contrast compliance >4.5:1 */
  --accent-moss: #556652;   /* Moss green for details in light theme */
  --border-color: rgba(27, 25, 23, 0.15); /* Muted dark border line */
  --cursor-color: rgba(217, 107, 67, 0.15); /* Keep copper-themed cursor */
}

/* --- Base Setup --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: none; /* Hide default cursor to use custom wabi-sabi cursor */
}

@media (max-width: 768px) {
  * {
    cursor: auto !important; /* Enable normal cursor on touch devices */
  }
  .custom-cursor {
    display: none !important;
  }
}

html {
  font-size: 16px;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
}

html.lenis {
  scroll-behavior: auto !important;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  position: relative;
  overflow-x: hidden;
  touch-action: pan-y;
  background-color: var(--bg-color);
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* The Calm Animated Gradient Mesh Layer */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(42, 35, 32, 0.3) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(42, 35, 32, 0.35) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(42, 35, 32, 0.2) 0%, transparent 40%);
  animation: gradientMesh 22s ease-in-out infinite alternate;
  pointer-events: none;
  transition: background-color 0.4s ease;
}

html.light-theme body::before {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(223, 214, 196, 0.4) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(223, 214, 196, 0.5) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(223, 214, 196, 0.3) 0%, transparent 40%);
  animation: lightGradientMesh 22s ease-in-out infinite alternate;
}

@keyframes gradientMesh {
  0% {
    background-image: 
      radial-gradient(circle at 10% 20%, rgba(42, 35, 32, 0.3) 0%, transparent 45%),
      radial-gradient(circle at 90% 80%, rgba(42, 35, 32, 0.35) 0%, transparent 55%),
      radial-gradient(circle at 50% 50%, rgba(42, 35, 32, 0.2) 0%, transparent 40%);
  }
  50% {
    background-image: 
      radial-gradient(circle at 30% 70%, rgba(42, 35, 32, 0.4) 0%, transparent 50%),
      radial-gradient(circle at 70% 30%, rgba(42, 35, 32, 0.3) 0%, transparent 45%),
      radial-gradient(circle at 40% 40%, rgba(42, 35, 32, 0.25) 0%, transparent 48%);
  }
  100% {
    background-image: 
      radial-gradient(circle at 80% 15%, rgba(42, 35, 32, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 20% 85%, rgba(42, 35, 32, 0.35) 0%, transparent 55%),
      radial-gradient(circle at 60% 60%, rgba(42, 35, 32, 0.2) 0%, transparent 42%);
  }
}

@keyframes lightGradientMesh {
  0% {
    background-image: 
      radial-gradient(circle at 10% 20%, rgba(223, 214, 196, 0.4) 0%, transparent 45%),
      radial-gradient(circle at 90% 80%, rgba(223, 214, 196, 0.5) 0%, transparent 55%),
      radial-gradient(circle at 50% 50%, rgba(223, 214, 196, 0.3) 0%, transparent 40%);
  }
  50% {
    background-image: 
      radial-gradient(circle at 30% 70%, rgba(223, 214, 196, 0.45) 0%, transparent 50%),
      radial-gradient(circle at 70% 30%, rgba(223, 214, 196, 0.35) 0%, transparent 45%),
      radial-gradient(circle at 40% 40%, rgba(223, 214, 196, 0.4) 0%, transparent 48%);
  }
  100% {
    background-image: 
      radial-gradient(circle at 80% 15%, rgba(223, 214, 196, 0.4) 0%, transparent 50%),
      radial-gradient(circle at 20% 85%, rgba(223, 214, 196, 0.5) 0%, transparent 55%),
      radial-gradient(circle at 60% 60%, rgba(223, 214, 196, 0.3) 0%, transparent 42%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none !important;
  }
}

/* --- Texture Overlay (Dynamic Washi Paper Grain) --- */
.grain-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  animation: grain-animation 1.5s steps(8) infinite;
}

html.light-theme .grain-overlay {
  opacity: 0.022; /* Soften unbleached grain texture overlay */
}

/* Warm Ambient Shadows for Light Theme */
html.light-theme .face-frame {
  box-shadow: 0 8px 30px rgba(42, 35, 32, 0.03);
}

html.light-theme .face-frame:hover {
  box-shadow: 0 15px 40px rgba(42, 35, 32, 0.05);
}

html.light-theme .project-media {
  box-shadow: 0 10px 30px rgba(42, 35, 32, 0.02);
}

@keyframes grain-animation {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -5%); }
  20% { transform: translate(-8%, 3%); }
  30% { transform: translate(4%, -10%); }
  40% { transform: translate(-3%, 12%); }
  50% { transform: translate(-7%, 5%); }
  60% { transform: translate(7%, -3%); }
  70% { transform: translate(1%, 8%); }
  80% { transform: translate(2%, 15%); }
  90% { transform: translate(-5%, 4%); }
}

/* --- Custom Cursor --- */
.custom-cursor {
  width: var(--cursor-size);
  height: var(--cursor-size);
  background-color: var(--cursor-color);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
  backdrop-filter: blur(1px);
}

.custom-cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-moss);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10001;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

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

h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 1rem;
}

p {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 65ch;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--accent-rust);
}

/* --- Scroll Bar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Layout Utilities --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: clamp(6rem, 12vw, 12rem) 0;
  position: relative;
  border-bottom: none; /* Removed straight border in favor of organic SVG dividers */
}

/* --- Hand-drawn Organic SVG Dividers --- */
.divider-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
  overflow: hidden;
  width: 100%;
}

.wabi-divider {
  width: 100%;
  height: 24px;
  opacity: 0.85;
  display: block;
}

.section:last-of-type {
  border-bottom: none;
}

/* --- Header / Navigation --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem; /* Slightly more compact padding */
  z-index: 1000; /* Ensure header stays above all pinned project panels */
  background-color: rgba(15, 15, 16, 0.82); /* Dark scrim by default */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 230, 228, 0.06);
  color: var(--text-color);
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

html.light-theme header {
  background-color: rgba(242, 237, 228, 0.85); /* Light cream scrim */
  border-bottom: 1px solid rgba(27, 25, 23, 0.08);
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-clock-item {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border-color);
  padding-left: 1rem;
}

.nav-clock {
  font-size: 0.8rem;
  font-family: monospace;
  opacity: 0.65;
  letter-spacing: 0.05em;
}

.nav-theme-item {
  display: flex;
  align-items: center;
}

.theme-toggle-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.3s;
}

.theme-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

nav a {
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: inherit;
  opacity: 0.8;
  transition: opacity 0.3s;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: currentColor;
  transition: width 0.3s;
}

nav a:hover::after {
  width: 100%;
}

nav a:hover {
  opacity: 1;
}

/* --- Hero Section --- */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 4rem;
}

.hero-content {
  z-index: 2;
}

.hero-tagline {
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-moss);
  margin-bottom: 1.5rem;
  display: block;
}

.hero-desc {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  color: var(--text-muted);
}

.cta-group {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.btn-primary {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  border: 1px solid var(--text-color);
  color: var(--text-color);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  background: transparent;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: var(--text-color);
  z-index: -1;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  color: var(--bg-color);
}

.btn-primary:hover::before {
  width: 100%;
}

.btn-text {
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2px;
  transition: border-color 0.3s;
}

.btn-text:hover {
  border-color: var(--text-color);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 400px;
}

/* Portrait Sketch Frame & Effects */
.face-frame {
  position: relative;
  max-width: 320px;
  width: 100%;
  aspect-ratio: 0.77; /* Portrait aspect ratio matching sketch */
  border: 1px solid var(--border-color);
  padding: 10px;
  background-color: var(--bg-color);
  transform: rotate(-1.5deg); /* Asymmetric hand-placed look */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.face-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.08) contrast(1.02); /* Blends with warm paper background */
  transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.face-frame::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 1px dashed var(--accent-gold);
  pointer-events: none;
  opacity: 0.45;
  transform: rotate(2.5deg); /* Counter rotation for raw layered look */
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.face-frame:hover {
  transform: rotate(0.5deg) scale(1.03);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

.face-frame:hover::before {
  transform: rotate(-1deg);
}

.face-frame:hover .face-image {
  filter: sepia(0) contrast(1.05); /* Colors clear up and contrast sharpens on hover */
}

.floating-blobs {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.blob {
  position: absolute;
  background-color: var(--bg-secondary);
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: floatBlob 15s infinite alternate ease-in-out;
}

.blob-1 {
  width: 400px;
  height: 400px;
  top: -10%;
  right: -10%;
  background-color: var(--bg-secondary);
}

.blob-2 {
  width: 300px;
  height: 300px;
  bottom: 10%;
  left: -5%;
  background-color: rgba(92, 111, 89, 0.12); /* Subtle moss tint */
  animation-duration: 20s;
}

@keyframes floatBlob {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, -40px) scale(1.15);
  }
}

/* --- Section: Philosophy --- */
#philosophy {
  background-color: var(--bg-secondary);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.philosophy-quote {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.25;
  color: var(--text-color);
  border-left: 2px solid var(--accent-moss);
  padding-left: 2.5rem;
  font-style: italic;
}

.philosophy-text p {
  margin-bottom: 1.5rem;
}

.philosophy-text p:last-child {
  margin-bottom: 0;
}

/* --- Section: Projects --- */
.projects-header {
  margin-bottom: 5rem;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 8rem;
}

/* Asymmetric grid layout for projects */
.project-item {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.project-item:nth-child(even) {
  grid-template-columns: 1.2fr 1fr;
}

.project-item:nth-child(even) .project-info {
  order: 2;
}

.project-item:nth-child(even) .project-media {
  order: 1;
}

/* Project Card/Media style: rustic parchment paper card */
.project-media {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1.4;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-media::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid rgba(0,0,0,0.03);
  pointer-events: none;
  margin: 10px;
  z-index: 2;
}

/* Project illustration styling */
.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.25) sepia(0.06) contrast(0.95); /* Organic, unified sepia look */
  transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Soft hover effect on the raw media block */
.project-item:hover .project-media {
  transform: translateY(-8px) rotate(-0.5deg);
}

.project-item:nth-child(even):hover .project-media {
  transform: translateY(-8px) rotate(0.5deg);
}

.project-item:hover .project-img {
  filter: grayscale(0) sepia(0) contrast(1.02); /* Brings out the full warm tone detail */
  transform: scale(1.05); /* Soft scale inside frame */
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.project-num {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-style: italic;
  color: var(--accent-gold);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin-top: 0.5rem;
}

.project-tags li {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background-color: var(--bg-secondary);
  padding: 0.3rem 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* --- Section: Skills (Garden of Competencies) --- */
.garden-intro {
  margin-bottom: 4rem;
  max-width: 800px;
}

.skills-garden {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

/* Pebble Styling - Beautiful, organic, hand-worn stone shapes */
.pebble {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 1.2rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 140px;
  aspect-ratio: 1.2;
}

/* Each pebble has a unique asymmetrical shape */
.pebble-1 { border-radius: 53% 47% 43% 57% / 51% 39% 61% 49%; }
.pebble-2 { border-radius: 45% 55% 58% 42% / 48% 50% 50% 52%; }
.pebble-3 { border-radius: 60% 40% 55% 45% / 40% 60% 40% 60%; }
.pebble-4 { border-radius: 48% 52% 41% 59% / 55% 45% 55% 45%; }
.pebble-5 { border-radius: 56% 44% 52% 48% / 45% 55% 48% 52%; }
.pebble-6 { border-radius: 40% 60% 46% 54% / 52% 42% 58% 48%; }
.pebble-7 { border-radius: 52% 48% 58% 42% / 41% 59% 41% 59%; }
.pebble-8 { border-radius: 47% 53% 42% 58% / 58% 47% 53% 42%; }

.pebble:hover {
  transform: scale(1.12) rotate(3deg);
  background-color: var(--bg-secondary);
  border-color: var(--accent-moss);
  box-shadow: 0 10px 25px rgba(92, 111, 89, 0.08);
}

.pebble-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-rust);
  margin-bottom: 0.4rem;
}

.pebble-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
}

/* --- Section: Education --- */
.edu-timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding-left: 2.5rem;
}

.edu-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--border-color);
}

.edu-item {
  position: relative;
  margin-bottom: 3rem;
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-node {
  position: absolute;
  left: -2.85rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background-color: var(--bg-color);
  border: 1px solid var(--text-color);
  border-radius: 50%;
  transition: background-color 0.3s;
}

.edu-item:hover .edu-node {
  background-color: var(--accent-moss);
}

.edu-date {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--accent-rust);
  margin-bottom: 0.5rem;
}

.edu-school {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.edu-degree {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* --- Section: Contact --- */
#contact {
  background-color: var(--text-color);
  color: var(--bg-color);
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

#contact h2, #contact p {
  color: inherit;
}

#contact .section-title em {
  color: var(--accent-gold);
}

#contact p {
  opacity: 0.7;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  list-style: none;
  margin: 3rem 0;
}

.contact-info-list a {
  color: var(--bg-color);
  text-decoration: none;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-family: var(--font-serif);
  transition: color 0.3s;
}

.contact-info-list a:hover {
  color: var(--accent-gold);
}

.contact-info-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  margin-bottom: 0.4rem;
  opacity: 0.9;
}

.social-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.social-links a {
  color: var(--bg-color);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.social-links a:hover {
  opacity: 1;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.form-group {
  position: relative;
}

.form-group input, 
.form-group textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid currentColor;
  padding: 0.8rem 0;
  color: inherit;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  opacity: 0.85;
  transition: border-color 0.3s, opacity 0.3s;
}

.form-group input:focus, 
.form-group textarea:focus {
  outline: none;
  opacity: 1;
}

.form-group label {
  position: absolute;
  top: 0.8rem;
  left: 0;
  font-size: 0.9rem;
  color: currentColor;
  opacity: 0.6;
  pointer-events: none;
  transition: transform 0.3s, font-size 0.3s, opacity 0.3s;
}

/* Handle floating labels */
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-1.5rem);
  font-size: 0.75rem;
  opacity: 1;
}

.contact-form .btn-primary {
  border-color: var(--bg-color);
  color: var(--bg-color);
  align-self: flex-start;
}

.contact-form .btn-primary::before {
  background-color: var(--bg-color);
}

.contact-form .btn-primary:hover {
  color: var(--text-color);
}

/* --- Scroll Animation Reveals --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Disable CSS transitions and default states when GSAP is running to prevent animation conflicts */
body.gsap-enabled .reveal {
  transition: none !important;
  opacity: 1;
  transform: none;
}


/* Stagger delay classes */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* Responsive adjustments */
@media (max-width: 992px) {
  header {
    padding: 1.5rem 2rem;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-visual {
    height: 300px;
    order: -1;
  }
  .enso-svg {
    width: 250px;
    height: 250px;
  }
  .cta-group {
    justify-content: center;
  }
  .philosophy-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .philosophy-quote {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--accent-moss);
    padding-top: 2rem;
  }
  .project-item, .project-item:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .project-item:nth-child(even) .project-info {
    order: 0;
  }
  .project-item:nth-child(even) .project-media {
    order: 0;
  }
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

/* --- Phase 6: Editorial Style Elements --- */

/* 1. Numbered Section Labels */
body {
  counter-reset: section-counter;
}

#about, #projects, #skills, #pathways, #contact {
  counter-increment: section-counter;
}

/* Render numbers automatically above the section title headings */
h2[data-section-name]::before {
  content: "Nº00" counter(section-counter) " — " attr(data-section-name);
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent-rust);
  margin-bottom: 0.8rem;
  opacity: 0.85;
}

/* Adjust centering alignment for pathways section label */
#pathways .garden-intro h2[data-section-name]::before {
  text-align: center;
}

/* 2. Textual Transition Marquee Bands */
.marquee-band-container {
  width: 100vw;
  overflow: hidden;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 1.5rem 0;
  pointer-events: none;
  background-color: transparent;
  border-top: 1.5px solid var(--border-color);
  border-bottom: 1.5px solid var(--border-color);
}

.marquee-band-inner {
  display: flex;
  white-space: nowrap;
  gap: 3rem;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-family: var(--font-serif);
  font-weight: 400; /* Bolder outline footprint */
  font-style: italic;
  text-transform: uppercase;
  color: transparent; /* Transparent core */
  -webkit-text-stroke: 1.5px rgba(217, 107, 67, 0.35); /* Bolder copper outline */
  opacity: 1; /* Turn off low opacity */
  letter-spacing: 0.05em;
  width: max-content;
}

/* 3. Horizontal Auto-Scrolling Skills Marquee */
.skills-marquee-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  padding: 1.5rem 0;
}

.skills-marquee-row {
  display: flex;
  overflow: hidden;
  width: 100%;
}

.marquee-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  will-change: transform;
}

/* Infinite sliding keyframes */
.animate-left {
  animation: scroll-left 32s linear infinite;
}

.animate-right {
  animation: scroll-right 32s linear infinite;
}

/* Pause scroll on hover for desktop pointer users */
.skills-marquee-row:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes scroll-right {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* Support prefers-reduced-motion to halt marquees completely */
@media (prefers-reduced-motion: reduce) {
  .animate-left, .animate-right {
    animation: none !important;
  }
  .skills-marquee-container {
    width: auto;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    overflow: visible;
  }
  .skills-marquee-row {
    overflow: visible;
  }
  .marquee-track {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    transform: none !important;
  }
  /* Remove duplicate pebbles for accessibility/screen readers under reduced motion */
  .marquee-track .pebble:nth-child(n+6) {
    display: none;
  }
}

/* --- Phase 7: Pinned Scroll Storytelling Layout --- */
.story-block {
  opacity: 0.3;
  transition: opacity 0.4s ease;
  margin-bottom: 25vh;
}

.story-block:first-of-type {
  opacity: 1; /* intro block is visible by default */
}

.story-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 500;
  color: var(--accent-rust);
  margin-bottom: 0.5rem;
}

@media (min-width: 993px) {
  .project-pinned-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 5rem;
    align-items: flex-start;
    position: relative;
    margin-bottom: 15rem;
  }

  .project-pinned-left {
    position: sticky;
    top: 15vh;
    height: fit-content;
    will-change: transform;
  }

  .project-pinned-right {
    padding-top: 2vh;
    padding-bottom: 30vh;
  }
  
  .project-pinned-wrapper:nth-child(even) {
    grid-template-columns: 1.2fr 1fr;
  }
  
  .project-pinned-wrapper:nth-child(even) .project-pinned-left {
    order: 2;
  }
  
  .project-pinned-wrapper:nth-child(even) .project-pinned-right {
    order: 1;
  }
}

@media (max-width: 992px) {
  .project-pinned-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 8rem;
  }

  .story-block {
    opacity: 1 !important;
    margin-bottom: 2rem;
  }
  
  .story-block:last-child {
    margin-bottom: 0;
  }
}

/* --- Phase 8: Pathways Layout --- */
.pathways-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4rem;
  align-items: flex-start;
}

.pathways-col {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.pathways-col-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 500;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 0.8rem;
  color: var(--accent-rust);
  margin-bottom: 1rem;
  text-transform: capitalize;
}

.pathway-item {
  position: relative;
  padding-left: 1.8rem;
}

.pathway-node {
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 8px;
  height: 8px;
  background-color: var(--bg-color);
  border: 1px solid var(--text-color);
  border-radius: 50%;
  transition: background-color 0.3s;
}

.pathway-item:hover .pathway-node {
  background-color: var(--accent-moss);
}

.pathway-date {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--accent-rust);
  display: block;
  margin-bottom: 0.3rem;
}

.pathway-name {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  color: var(--text-color);
}

.pathway-sub {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 0.8rem;
}

.pathway-meta {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-moss);
}

.pathway-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.achievements-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.achievement-highlight {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0.2rem;
}

.achievement-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.certifications-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.certifications-list li {
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid var(--border-color);
  padding-left: 1rem;
}

.cert-authority {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-rust);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.cert-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-color);
}

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

/* --- Concept A & B: Pinned Projects Visualizations --- */
.terminal-media {
  cursor: crosshair;
  background-color: var(--bg-secondary) !important;
}

.terminal-header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-color);
}

.terminal-dot.active {
  background-color: var(--accent-rust);
}

.terminal-title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent-moss);
  text-transform: uppercase;
  margin-left: 0.5rem;
  font-weight: 500;
}

.terminal-body {
  padding: 1.2rem;
  font-family: monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-color);
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  width: 100%;
}

.terminal-line {
  opacity: 0.65;
  transition: opacity 0.3s;
}

.terminal-line.highlight {
  color: var(--accent-rust);
  font-weight: 600;
  opacity: 1;
}

.terminal-line.success {
  color: #4CAF50;
  opacity: 1;
}

.terminal-prompt::before {
  content: "$ ";
  color: var(--accent-moss);
  font-weight: bold;
}

.net-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Additional Interactive Panels: Projects 3, 4, 5 & 6 --- */
.visualizer-panel {
  width: 100%;
  height: 320px;
  background-color: #0c0c0d;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html.light-theme .visualizer-panel {
  background-color: var(--bg-secondary);
}

/* 1. Campus Connect Feed */
.feed-container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: 100%;
  overflow-y: auto;
}

.feed-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.8rem 1rem;
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.feed-item:hover {
  border-color: var(--accent-rust);
  transform: translateX(4px);
}

.feed-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
}

.feed-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-moss);
  font-weight: 600;
}

.feed-title {
  font-size: 0.85rem;
  color: var(--text-color);
}

.feed-action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s;
}

.feed-item:hover .feed-action-btn {
  background-color: var(--accent-rust);
  border-color: var(--accent-rust);
  color: #1B1917;
}

.feed-item.resolved {
  opacity: 0.45;
  border-color: var(--border-color);
}

.feed-item.resolved .feed-action-btn {
  background-color: var(--accent-moss);
  border-color: var(--accent-moss);
  color: var(--text-color);
}

/* 2. Customer Churn Canvas */
.churn-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* 3. Threat Hash Table Grid */
.hash-table-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  padding: 1rem;
  height: calc(100% - 60px);
}

.hash-cell {
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  transition: all 0.3s;
  cursor: pointer;
  padding: 0.4rem;
}

.hash-index {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: monospace;
}

.hash-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-color);
  font-family: monospace;
  text-align: center;
  word-break: break-all;
}

.hash-cell.active {
  border-color: var(--accent-rust);
  background-color: rgba(217, 107, 67, 0.05);
}

.hash-cell.collision {
  border-color: #f44336;
  background-color: rgba(244, 67, 54, 0.08);
}

.hash-console {
  height: 60px;
  background-color: #080809;
  border-top: 1px solid var(--border-color);
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  text-align: left;
  display: flex;
  align-items: center;
}

html.light-theme .hash-console {
  background-color: #E6E0D2;
}

/* 4. ChemXplore ADMET Panel */
.chem-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  width: 100%;
  height: 100%;
}

.chem-canvas {
  width: 100%;
  height: 100%;
  background-color: #080809;
  cursor: pointer;
}

html.light-theme .chem-canvas {
  background-color: #E6E0D2;
}

.admet-dashboard {
  border-left: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background-color: #0c0c0d;
  justify-content: center;
  text-align: left;
}

html.light-theme .admet-dashboard {
  background-color: var(--bg-secondary);
}

.admet-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-rust);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.admet-bar-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admet-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
}

.admet-label-val {
  color: var(--text-color);
  font-weight: bold;
}

.admet-track {
  width: 100%;
  height: 5px;
  background-color: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.admet-fill {
  height: 100%;
  background-color: var(--accent-rust);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.admet-fill.moss {
  background-color: var(--accent-moss);
}



