*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Poppins', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* THEME SYSTEM VARIABLES */
body.dark {
  --bg-color: #0b1220;
  --text-color: #ffffff;
  --text-muted: #ccc;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(11, 18, 32, 0.7);
  --nav-border: rgba(255, 255, 255, 0.1);
  --accent-gold: #D4AF37;
  --primary-green: #355E3B;
  --primary-green-hover: #2d5032;
  --modal-bg: rgba(0, 0, 0, 0.95);
  --shadow: rgba(0, 0, 0, 0.4);
}

body.light {
  --bg-color: #f5f7fa;
  --text-color: #1a202c;
  --text-muted: #5a6578;
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(245, 247, 250, 0.8);
  --nav-border: rgba(0, 0, 0, 0.08);
  --accent-gold: #b38f19;
  --primary-green: #2e5234;
  --primary-green-hover: #223d27;
  --modal-bg: rgba(0, 0, 0, 0.85);
  --shadow: rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
}

body{
  background: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* BACKGROUND CANVAS */
#bgCanvas{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  z-index:-1;
  pointer-events: none;
}

/* NAV */
header{
  position:fixed;
  width:100%;
  top:0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter:blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom:1px solid var(--nav-border);
}

.nav{
  display:flex;
  justify-content:space-between;
  padding:15px 40px;
  align-items:center;
  max-width: 1200px;
  margin: 0 auto;
}

.brand{
  font-weight:700;
  color: var(--accent-gold);
  font-size: 18px;
}

.brand span{
  display:block;
  font-size:11px;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-links{
  display:flex;
  gap:24px;
  list-style:none;
}

.nav-links a{
  color: var(--text-color);
  text-decoration:none;
  opacity:.8;
  font-weight: 500;
  font-size: 15px;
}

.nav-links a:hover{
  opacity:1;
  color: var(--accent-gold);
}

#themeToggle{
  background:none;
  border:1px solid var(--text-color);
  padding:8px;
  border-radius:50%;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#themeToggle:hover {
  background: var(--card-border);
}

/* FLOATING CTA */
.floating-cta{
  position:fixed;
  bottom:20px;
  right:20px;
  background: var(--primary-green);
  padding:12px 20px;
  border-radius:30px;
  color:white;
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:8px;
  box-shadow:0 10px 30px var(--shadow);
  z-index: 90;
  font-weight: 500;
}
.floating-cta:hover {
  background: var(--primary-green-hover);
  transform: translateY(-2px);
}

/* HERO */
.hero{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  padding:120px 24px 60px;
}

.hero h1{
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero p{
  max-width:650px;
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.hero-buttons a{
  padding:12px 28px;
  background: var(--primary-green);
  color:white;
  border-radius:30px;
  text-decoration:none;
  font-weight: 500;
  box-shadow: 0 4px 15px var(--shadow);
}
.hero-buttons a:hover {
  background: var(--primary-green-hover);
}

.hero-buttons .btn-alt {
  background: transparent;
  border: 1px solid var(--text-color);
  color: var(--text-color);
}
.hero-buttons .btn-alt:hover {
  background: var(--card-border);
}

/* SECTION CORES */
.section{
  padding:80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

h2{
  text-align:center;
  margin-bottom:48px;
  font-size: clamp(24px, 4vw, 36px);
  position: relative;
}

h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent-gold);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* GRID WITH SMART RESPONSIVENESS */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:24px;
}

/* CARDS */
.card{
  background: var(--card-bg);
  border:1px solid var(--card-border);
  padding:24px;
  border-radius:16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.card:hover{
  transform:translateY(-8px);
  box-shadow:0 12px 30px var(--shadow);
  border-color: var(--accent-gold);
}

.card img{
  width:100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius:10px;
  margin-bottom: 16px;
  cursor: pointer;
}

.card h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* PAST PROJECTS CARDS */
.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.project-icon {
  color: var(--accent-gold);
  font-size: 36px;
  margin-bottom: 12px;
}

.tag {
  display: inline-block;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold) !important;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-top: 20px;
  width: fit-content;
}

.project-link span {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.project-link:hover {
  color: var(--accent-gold);
}

.project-link:hover span {
  transform: translateX(4px);
}

/* PHILOSOPHY/INFO CARDS */
.info{
  text-align:center;
  padding:32px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius:16px;
}
.info span {
  font-size: 40px;
  color: var(--accent-gold);
  margin-bottom: 12px;
}
.info h3 {
  margin-bottom: 8px;
}

/* ABOUT */
.about{
  text-align:center;
  max-width:600px;
  margin:auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 40px 24px;
  border-radius: 16px;
}

.about h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.about p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.portfolio-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 500;
}
.portfolio-link:hover {
  text-decoration: underline;
}

/* FOOTER */
footer{
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 14px;
}

/* MODAL */
#modal{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background: var(--modal-bg);
  justify-content:center;
  align-items:center;
  z-index: 1000;
  padding: 20px;
}

#modal img{
  max-width:100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* REVEAL TRANSITIONS */
.reveal{
  opacity:0;
  transform:translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active{
  opacity:1;
  transform:translateY(0);
}

/* MEDIA QUERIES (RESPONSIVENESS DEEP-DIVE) */
@media (max-width: 768px) {
  .nav {
    padding: 15px 20px;
  }
  
  .nav-links {
    display: none; /* Simplifies layout for smaller screens */
  }
  
  .section {
    padding: 60px 20px;
  }
  
  .floating-cta {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 14px;
  }
}