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

/* Visual Direction: Grounded Luxury
   Dark forest greens, warm brass accents that feel aged not shiny,
   deliberate asymmetry, editorial typography. Nothing generic SaaS.
   Reference: heritage editorial meets industrial craft.
*/

/* Variables — Dark Forest + Brass */
:root {
  /* Core */
  --color-bg: #131A0F;
  --color-surface: #1C2416;
  --color-surface-raised: #242E1C;
  --color-text: #E8E0CC;
  --color-text-muted: #8A9A78;
  --color-border: #2E3A25;

  /* Primary — Forest Green */
  --color-green: #6B8F52;
  --color-green-bright: #8FB872;
  --color-green-dim: #3D5429;

  /* Secondary — Brass */
  --color-brass: #C49A3A;
  --color-brass-dim: #8A6E28;
  --color-brass-glow: rgba(196, 154, 58, 0.15);
  --color-brass-light: #E8C86B;

  /* Accent — Expanded Palette */
  --color-sky: #7BA3C9;
  --color-sage: #8FAE7C;
  --color-wine: #6B1C23;
  --color-wheat: #D4B847;
  --color-wood: #5C4033;
  --color-coral: #C9856B;
  --color-clay: #9C7B5C;
  --color-mist: #A8B5A8;

  /* Legacy (light mode) */
  --color-cream: #F4F1EA;
  --color-cream-dark: #E8E0CC;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --max-width: 1100px;
  --max-width-content: 800px;
}

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600&family=DM+Sans:wght@300;400;500&display=swap');

/* Base */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-weight: 300;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
}

a {
  color: var(--color-brass);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-green-bright);
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(28, 36, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(46, 58, 37, 0.6);
  padding: 0.75rem 1rem;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  color: var(--color-brass);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
  font-family: var(--font-heading);
}

.nav-logo span {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.6rem;
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  font-weight: 400;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-brass);
  transition: width 0.25s ease;
}

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

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

nav a.active {
  color: var(--color-brass);
  text-shadow: 0 0 12px rgba(196, 154, 58, 0.3);
}

nav a.active::after {
  width: 100%;
}

/* Main */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  width: 100%;
}

/* Hero */
.hero {
  text-align: left;
  padding: 5rem 0 3.5rem;
  position: relative;
}

/* Subtle brass horizontal rule accent above hero */
.hero::before {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--color-brass);
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 3.25rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.hero h1.brass-name {
  color: var(--color-brass);
  text-shadow: 0 0 30px rgba(196, 154, 58, 0.3);
}

.hero .tagline {
  color: var(--color-text-muted);
  font-size: 1rem;
  font-family: var(--font-heading);
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.hero .location {
  color: var(--color-brass);
  font-size: 0.78rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  opacity: 0.85;
}

.hero .summary {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 600px;
  margin: 0 0 2.5rem;
  font-weight: 300;
  text-align: left;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-brass);
  color: #131A0F;
  font-weight: 500;
}

.btn-primary:hover {
  background: #D4AA45;
  color: #131A0F;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196, 154, 58, 0.25);
}

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

.btn-secondary:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-text-muted);
  color: var(--color-text);
  transform: translateY(-1px);
}

/* Stats bar — clean 3-column layout */
.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin: 3rem 0;
  overflow: hidden;
}

.stats-bar .stat-item:nth-child(1),
.stats-bar .stat-item:nth-child(2),
.stats-bar .stat-item:nth-child(3) {
  grid-column: span 1;
}

.stat-item {
  background: var(--color-surface);
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--color-brass);
  display: block;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Sections */

/* Featured / Project Grid */
.featured {
  margin-top: 3rem;
}

.featured h2 {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
  color: var(--color-text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-green), var(--color-brass), var(--color-wine));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: 10;
}

.project-card:hover {
  border-color: var(--color-brass);
  background: var(--color-surface-raised);
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-thumb {
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: var(--color-bg);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.3s ease;
}

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

/* Placeholder thumbnail for projects without screenshots */
.project-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-raised);
}

.placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

/* Project card links */
.project-card h3 a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-brass);
  text-underline-offset: 3px;
}

.project-card h3 a:hover {
  color: var(--color-brass);
  text-decoration-color: var(--color-brass-light);
}

/* Personal project badge */
.project-badge-personal {
  display: inline-block;
  font-size: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brass);
  background: var(--color-brass-glow);
  border: 1px solid var(--color-brass-dim);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* Site by in footer */
.site-by {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  opacity: 0.6;
  margin-top: 0.5rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

/* ============================================
   PROJECTS PAGE — Atmospheric CSS background
   (replaced Three.js particle field with
   grounded, purposeful atmosphere)
   ============================================ */

/* Grain texture via SVG filter */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

#projects-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
  background:
    radial-gradient(ellipse at 15% 25%, rgba(107, 143, 82, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(196, 154, 58, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(107, 28, 35, 0.08) 0%, transparent 65%),
    var(--color-bg);
}

/* Project Cards Grid */
   .project-cards {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
     gap: 1.5rem;
     padding: 2rem 0;
     position: relative;
     z-index: 1;
   }
   
   /* Interactive Project Card */
   .project-card-interactive {
     position: relative;
     background: rgba(28, 36, 22, 0.85);
     border: 1px solid var(--color-border);
     border-radius: 12px;
     padding: 1.5rem;
     cursor: pointer;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     overflow: hidden;
   }
   
   .project-card-interactive::before {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background: linear-gradient(135deg, var(--accent) 0%, transparent 60%);
     opacity: 0;
     transition: opacity 0.3s ease;
   }
   
   .project-card-interactive:hover {
     transform: translateY(-6px);
     border-color: var(--accent);
     box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
   }
   
   .project-card-interactive:hover::before {
     opacity: 0.15;
   }
   
   .project-card-interactive h3 {
     font-family: var(--font-heading);
     font-size: 1.1rem;
     font-weight: 500;
     color: var(--color-text);
     margin-bottom: 0.5rem;
     position: relative;
     z-index: 1;
   }
   
   .project-card-interactive p {
     font-size: 0.9rem;
   }
   
   /* Three.js demo containers */
   .three-demo {
     position: relative;
     width: 100%;
     height: 300px; /* fixed height for demo canvas */
     margin: 2rem 0;
     background: var(--color-surface);
     border: 1px solid var(--color-border);
     border-radius: 8px;
     overflow: hidden;
   }
   
   .three-demo canvas {
     display: block;
     width: 100%;
     height: 100%;
   }
   
   .demo-label {
     position: absolute;
     bottom: 0.5rem;
     left: 50%;
     transform: translateX(-50%);
     color: var(--color-text-muted);
     font-size: 0.8rem;
     pointer-events: none;
   }
   
/* Ensure later demos stack nicely */
   .demo-section { margin-bottom: 3rem; }

/* Three.js Demo Containers */
.card-year {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--accent);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

/* Modal Overlay */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(19, 26, 15, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.project-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.project-modal.open .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--color-brass);
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-nav:hover {
  border-color: var(--color-brass);
  color: var(--color-brass);
}

.modal-prev {
  left: 1rem;
}

.modal-next {
  right: 1rem;
}

/* Modal Dots */
.modal-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.modal-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-dots .dot.active {
  background: var(--color-brass);
  transform: scale(1.2);
}

.modal-dots .dot:hover {
  background: var(--color-text-muted);
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Responsive for projects modal */
@media (max-width: 600px) {
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }
  
  .modal-nav {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .modal-prev {
    left: 0.5rem;
  }
  
  .modal-next {
    right: 0.5rem;
  }
}

.project-card h3 {
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.project-card p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 300;
}

.tag {
  display: inline-block;
  background: var(--color-green-dim);
  color: var(--color-green-bright);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.4rem;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

.tag.personal {
  background: #C49A3A;
  color: #1a1a2e;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* Resume/About specific */
.resume-page {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

/* About page — 2-column asymmetric layout */
.about-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-left .summary-text {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.about-left .summary-text:last-child {
  margin-bottom: 0;
}

.about-lead {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 2rem;
  max-width: 500px;
}

/* Section rule — editorial brass accent */
.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-rule::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--color-brass);
  flex-shrink: 0;
}

.section-rule-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brass);
}

/* About fact list */
.about-fact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about-fact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.about-fact-list li:first-child {
  border-top: 1px solid var(--color-border);
}

.fact-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.fact-value {
  font-size: 0.9rem;
  color: var(--color-text);
}

/* About contact list */
.about-contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.about-contact-list a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.about-contact-list a:hover {
  color: var(--color-brass);
}

.page-header {
  text-align: center;
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.3rem;
}

.page-header .subtitle {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
}

.page-header .contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.page-header .contact-row a {
  color: var(--color-brass);
  text-decoration: none;
}

.page-header .contact-row a:hover {
  color: var(--color-green-bright);
  text-decoration: underline;
}

/* Job / experience items */
.job-card {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
}

.job-card:last-child {
  border-bottom: none;
}

.job-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.1rem;
}

.job-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

.job-org {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 300;
}

.job-date {
  font-size: 0.78rem;
  color: var(--color-brass-dim);
  white-space: nowrap;
  font-family: var(--font-heading);
}

.expand-btn {
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-brass);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
  margin-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-heading);
  transition: all 0.15s ease;
}

.expand-btn:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-brass-dim);
  color: var(--color-brass);
}

.job-details {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 0;
}

.job-details.open { max-height: 600px; }

.job-bullets {
  margin-top: 0.6rem;
  padding-left: 1rem;
}

.job-bullets li {
  font-size: 0.825rem;
  margin-bottom: 0.3rem;
  line-height: 1.55;
  font-weight: 300;
  color: var(--color-text-muted);
}

.section-block {
  margin-bottom: 2.5rem;
}

.section-block h2 {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brass);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-heading);
  font-weight: 400;
}

/* Competencies grid */
.competencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.25rem;
}

.comp-group h3 {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-brass);
  margin-bottom: 0.5rem;
}

.comp-group ul {
  list-style: none;
}

.comp-group li {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  padding-left: 0.75rem;
  position: relative;
  font-weight: 300;
}

.comp-group li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-border);
}

/* Education row */
.edu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.edu-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text);
}

.edu-date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  font-family: var(--font-heading);
}

/* Summary text */
.summary-text {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--color-text-muted);
  font-weight: 300;
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
}

.summary-text-wide {
  max-width: none;
  margin-bottom: 2.5rem;
}

/* Philosophy card */
.philosophy-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-brass);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
}

.philosophy-card h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.philosophy-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  font-weight: 300;
}

/* Action row */
.action-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Projects list */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0 1rem;
}

.project-item {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.project-item:last-child {
  border-bottom: none;
}

.project-item h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-family: var(--font-heading);
  color: var(--color-text);
}

.project-item p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.65;
}

.project-item .tag {
  margin-top: 0.5rem;
}

/* Footer */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
}

/* ============================================
   DESIGN PAGE STYLES
   ============================================ */

/* Color Palette */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.swatch {
  border-radius: 8px;
  padding: 1rem;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  cursor: default;
}

.swatch:hover {
  transform: scale(1.05);
}

.swatch-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.swatch-hex {
  opacity: 0.7;
  font-family: monospace;
  font-size: 0.7rem;
}

/* Demo Sections */
.demo-section {
  margin: 4rem 0;
  padding: 2rem;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.demo-title {
  font-size: 1.25rem;
  color: var(--color-brass);
  margin-bottom: 0.5rem;
}

.demo-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Film Grain Demo */
.grain-demo {
  position: relative;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-surface) 100%);
}

.grain-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
  animation: grain 0.5s steps(10) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -2%); }
  20% { transform: translate(2%, 2%); }
  30% { transform: translate(-1%, 2%); }
  40% { transform: translate(2%, -1%); }
  50% { transform: translate(-2%, 1%); }
  60% { transform: translate(1%, -2%); }
  70% { transform: translate(-1%, -1%); }
  80% { transform: translate(1%, 1%); }
  90% { transform: translate(2%, -2%); }
}

.grain-demo .demo-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  text-align: center;
}

/* Gradient Flow Demo */
.gradient-flow {
  height: 200px;
  border-radius: 8px;
  background: linear-gradient(270deg, var(--color-green-dim), var(--color-brass-dim), var(--color-wine), var(--color-green-dim));
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-flow .demo-content {
  background: rgba(19, 26, 15, 0.85);
  padding: 1rem 2rem;
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

/* Firefly Particles Demo */
.firefly-demo {
  position: relative;
  height: 200px;
  border-radius: 8px;
  background: radial-gradient(ellipse at bottom, #1a2416 0%, var(--color-bg) 100%);
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-brass-light);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px var(--color-brass-glow);
  animation: float 6s ease-in-out infinite;
}

.firefly:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.firefly:nth-child(2) { left: 25%; top: 60%; animation-delay: 1s; }
.firefly:nth-child(3) { left: 40%; top: 30%; animation-delay: 2s; }
.firefly:nth-child(4) { left: 55%; top: 70%; animation-delay: 0.5s; }
.firefly:nth-child(5) { left: 70%; top: 40%; animation-delay: 1.5s; }
.firefly:nth-child(6) { left: 85%; top: 80%; animation-delay: 2.5s; }
.firefly:nth-child(7) { left: 15%; top: 80%; animation-delay: 3s; }
.firefly:nth-child(8) { left: 60%; top: 15%; animation-delay: 3.5s; }

@keyframes float {
  0%, 100% { 
    transform: translate(0, 0) scale(1); 
    opacity: 0.3;
  }
  25% { 
    transform: translate(20px, -30px) scale(1.2); 
    opacity: 1;
  }
  50% { 
    transform: translate(-10px, -50px) scale(0.8); 
    opacity: 0.6;
  }
  75% { 
    transform: translate(15px, -20px) scale(1.1); 
    opacity: 1;
  }
}

.firefly-demo .demo-content {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* Glassmorphism Cards */
.glass-demo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.glass-card {
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(28, 36, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(196, 154, 58, 0.2);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(28, 36, 22, 0.8);
  border-color: rgba(196, 154, 58, 0.4);
  transform: translateY(-4px);
}

.glass-card h4 {
  color: var(--color-brass);
  margin-bottom: 0.5rem;
}

.glass-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Mouse Trail Demo */
.trail-demo {
  position: relative;
  height: 200px;
  border-radius: 8px;
  background: var(--color-bg);
  overflow: hidden;
  cursor: crosshair;
}

.trail-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-brass);
  pointer-events: none;
  opacity: 0.8;
  animation: trailFade 1s ease-out forwards;
}

@keyframes trailFade {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(0); opacity: 0; }
}

.trail-demo .demo-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

/* Interactive Hover Cards */
.hover-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.hover-card {
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.hover-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-green), var(--color-brass), var(--color-wine));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.hover-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-brass);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.hover-card:hover::before {
  transform: scaleX(1);
}

.hover-card h4 {
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.hover-card p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Three.js Demo Containers */
/* Background particle field */
.bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: var(--color-bg);
}

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .stats-bar .stat-item:nth-child(3) { grid-column: 1 / -1; max-width: 50%; }
  .stat-number { font-size: 1.4rem; }
  header { padding: 0.5rem 0.75rem; }
  nav { gap: 0.75rem; flex-wrap: wrap; }
  .nav-logo { font-size: 0.8rem; }
  .nav-logo span { display: none; }
  nav a { font-size: 0.75rem; }
  .competencies-grid { grid-template-columns: 1fr 1fr; }
  .glass-demo, .hover-cards { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ============================================
   PROJECTS PAGE — modal gallery, card thumbs, lightbox
   ============================================ */

/* Gallery thumbnails inside modal */
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.modal-gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top left;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.modal-gallery img:hover {
  transform: scale(1.02);
  border-color: var(--color-brass);
}

/* Card thumbnail */
.card-thumb {
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  height: 160px;
  background: var(--color-bg);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.3s ease;
}
.project-card-interactive:hover .card-thumb img {
  transform: scale(1.04);
}

/* Lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

/* Gallery section label */
.gallery-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}