:root{
  --bg: #ffffff;
  --text: #0b0f17;
  --muted: #5b6472;
  --card: #f6f7f9;
  --line: #e7e9ee;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
  --radius: 18px;
  --accent: #111827;
}

/* Dark theme overrides */
html[data-theme="dark"]{
  --bg: #000000;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --card: #101113;
  --line: #1f2937;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --accent: #e5e7eb;
}

*{ box-sizing: border-box; }
html{ 
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  overflow-x: hidden;
}
body{
  margin:0;
  padding-top: 70px; /* Account for fixed header height */
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  line-height: 1.5;
  overflow-x: hidden;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

#contact{
  text-align: center;
}
/* Contact title + subtitle closer */
#contact .section-head-stack{
  gap: 2px;
  align-items: center;
}
#contact .section-head-stack p{
  margin-top: 0;
}

#contact .form{
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.container{
  width: min(1100px, 92%);
  margin: 0 auto;
}

.header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
  transition: all 0.3s ease;
}
html[data-theme="dark"] .header{
  background: rgba(11,15,23,.65);
}

/* Enhanced styles when scrolled */
.header.scrolled {
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
html[data-theme="dark"] .header.scrolled {
  background: rgba(11,15,23,.90);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.header-row{
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left / center / right */
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.brand{ justify-self: start; }     /* logo left */
.logo{
  height: 40px;
  width: auto;
  max-width: 160px;
  display:block;
}
html[data-theme="dark"] .logo{
  filter: invert(1);
}

.nav{ 
  justify-self: center;            /* nav centered */
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}
.nav a:hover{ color: var(--text); text-decoration: none; }
.theme-btn{ justify-self: end; }   /* dark mode button right */
.theme-btn{
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.theme-btn:hover{ box-shadow: var(--shadow); }
.hero-center{
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-center .lead{
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.theme-btn{
  color: var(--text);
}

#themeIcon{
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.hero-center .cta-row{
  justify-content: center;
}

.hero-center .meta-row{
  justify-content: center;
}

.hero{
  padding: 90px 0 6px;
}
#work.section{
  padding-top: 15px;  /* default is larger because .section */
}
/* Bring Services closer to Work */
#work.section{ padding-bottom: 25px; }
#services.section{ padding-top: 25px; }
.work-actions{
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

/* Expand/collapse wrapper */
.more-wrap{
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 500ms ease, opacity 350ms ease;
  margin-top: 12px;
}

.more-wrap.is-open{
  max-height: 2000px; /* big enough to fit extra projects */
  opacity: 1;
}

.hero-grid{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  align-items: start;
}

.kicker{
  margin: 0 0 10px;
  color: var(--muted);
  letter-spacing: .16em;
  font-size: 12px;
  text-transform: uppercase;
}

h1{
  margin: 0 0 12px;
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.lead{
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16px;
  max-width: 62ch;
}

.cta-row{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.btn{
  border: 1px solid var(--line);
  background: var(--card);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.btn:hover{ text-decoration:none; box-shadow: var(--shadow); }

.btn.primary{
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}

.meta-row{
  display:flex;
  gap: 10px;
  align-items:center;
  color: var(--muted);
  font-size: 14px;
}
.dot{ opacity: .6; }

.hero-card{
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.hero-card h2{
  margin: 0 0 10px;
  font-size: 18px;
}
.bullets{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.bullets li{ margin: 8px 0; }

.section{
  padding: 60px 0;
}

.section-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head-stack{
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

h2{
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.subhead{
  margin: 26px 0 10px;
  font-size: 18px;
}

.muted{ color: var(--muted); }
.about{ max-width: 80ch; }
#about{
  text-align: center;
}

#about .about{
  margin-left: auto;
  margin-right: auto;
}

.grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card{
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-link:hover{ text-decoration:none; transform: translateY(-1px); }

.thumb{
  width: 100%;
  height: 200px;           /* smaller thumbnail */
  border-radius: 10px;     /* rounded edges */
  display: block;
  object-fit: cover;
  background: #000;
}


html[data-theme="dark"] .thumb{
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,0));
}
.card .thumb{
  margin-bottom: 12px;
}
.card h3{ margin: 12px 0 8px; font-size: 18px; }
.card-cta{ display:inline-block; margin-top: 10px; font-weight: 700; }

.pill-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.pill{
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
}

.form{
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  max-width: 760px;
}
.form label{
  display:block;
  font-weight: 600;
  margin: 10px 0 6px;
}
.form input, .form textarea{
  width:100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.form input:focus, .form textarea:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(0,0,0,.07);
}
html[data-theme="dark"] .form input:focus,
html[data-theme="dark"] .form textarea:focus{
  box-shadow: 0 0 0 4px rgba(255,255,255,.10);
}

.form-note{ margin-top: 12px; }

.footer{
  border-top: 1px solid var(--line);
  padding: 18px 0;
  margin-top: 18px;
}
.footer-row{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

.project{ padding: 26px 0 40px; }
.back{
  display:inline-block;
  margin: 10px 0 16px;
  color: var(--muted);
}
.project-hero{
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.project-hero h1{ margin-bottom: 8px; font-size: clamp(28px, 3vw, 40px); }

.project-meta{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.project-meta .label{
  display:block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-meta .value{ display:block; font-weight: 700; margin-top: 4px; }

.project-section{ margin-top: 22px; }
.project-section{ margin-top: 22px; }

.video-grid{
  display: grid;
  grid-template-columns: 1fr;  /* stacked */
  gap: 14px;
  margin-top: 12px;
}

.video{
  width: 100%;
  max-width: 400px;   /* smaller, left-aligned */
  /* no margin: 0 auto; (that would center it) */
  /* background: #000; removed */
  border-radius: 18px;
  overflow: hidden;

  box-shadow: 0 10px 60px 18px rgba(0,0,0,0.10);
}

.video.is-landscape {
  max-width: 800px; /* Wider for 16:9 on desktop */
}

.video video.video-player{
  width: 100%;
  height: auto;
  display: block;
}


@media (max-width: 400px){
  .hero-grid{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
  .project-meta{ grid-template-columns: 1fr; }
  .video-grid{ grid-template-columns: 1fr; }
}

/* --- Hamburger Menu --- */

.header-row {
  /* Change grid to flex for better control */
  display: flex !important; /* Force flex over grid */
  justify-content: space-between;
  align-items: center;
}

/* Hide hamburger by default (desktop) */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 10000; /* Above menu wrap */
  padding: 0;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  align-items: center;
}

.hamburger .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 2px;
}

/* Menu Wrapper (Desktop: Flex row) */
.menu-wrap-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Mobile Styling */
@media (max-width: 768px) {
  .hamburger {
    display: flex; /* Show hamburger */
  }

  .menu-wrap-header {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh; /* Fallback */
    height: 100dvh;
    width: 250px;
    background-color: rgba(255, 255, 255, 1);
    border-left: 1px solid var(--line);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    
    flex-direction: column;
    padding: 80px 20px 20px;
    gap: 24px;
    align-items: flex-start;
    
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    visibility: hidden; /* Hide from swipes when closed */
  }
  
  html[data-theme="dark"] .menu-wrap-header {
    background-color: rgba(11, 15, 23, 1); /* Dark mode matching header */
  }

  .menu-wrap-header.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav {
    flex-direction: column;
    width: 100%;
    gap: 18px;
    font-size: 18px;
  }
  
  .nav a {
    display: block;
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }

  .theme-btn {
    width: 100%;
    border-radius: 12px;
    margin-top: auto; /* Push to bottom if desired, or keep near links */
    justify-content: center;
  }
  
  /* Hamburger Animation when open */
  .hamburger.is-active .bar:first-child {
    transform: translateY(4px) rotate(45deg);
  }
  .hamburger.is-active .bar:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  /* Bring hero up on mobile */
  .hero {
    padding-top: 40px;
  }
}

/* Form Status Styles */
#contact-status {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 8px;
  display: none; /* hidden by default */
}

#contact-status.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
html[data-theme="dark"] #contact-status.success {
  background-color: rgba(21, 87, 36, 0.3);
  color: #d4edda;
  border-color: rgba(195, 230, 203, 0.2);
}

#contact-status.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
html[data-theme="dark"] #contact-status.error {
  background-color: rgba(114, 28, 36, 0.3);
  color: #f8d7da;
  border-color: rgba(245, 198, 203, 0.2);
}
