/* ==========================================================================
   1. TOKENS & VARIABLES
   ========================================================================== */
:root {
  --bg-dark: #0a0f0b;
  --bg-cream: #fcfaf7;
  --accent: #6fbf9b;
  --accent-deep: #2d4a3e;

  --text-main: #1a2421;
  --text-muted: #5f6d68;
  --white: #ffffff;

  --radius-lg: 40px;
  --radius-md: 24px;
  --radius-sm: 12px;

  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.06);
  --shadow-heavy: 0 30px 60px rgba(0, 0, 0, 0.3);

  --container: 1000px;
  --pad-x: clamp(1.5rem, 5vw, 3rem);
  --section-y: clamp(6rem, 12vw, 10rem);
}

/* ==========================================================================
     2. BASE RESET & ACCESSIBILITY
     ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  width: 100%;
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background: var(--bg-dark);
  line-height: 1.8;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  background: var(--bg-cream);
  color: var(--text-main);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  z-index: 9999;
}

/* ==========================================================================
     3. LAYOUT & CONTAINERS
     ========================================================================== */
section {
  position: relative;
  padding: var(--section-y) var(--pad-x);
  width: 100%;
}

.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.two-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-top: 5rem;
}

/* ==========================================================================
     4. TYPOGRAPHY & BUTTONS
     ========================================================================== */
h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 400;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--white);
}

.lead-centered {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 2.4rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0b1a16;
  border: 1px solid var(--accent);
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
}

/* ==========================================================================
     5. NAVIGATION
     ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: all 0.4s ease;
  background: rgba(10, 15, 11, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar.scrolled {
  background: rgba(10, 15, 11, 0.9);
  padding: 1rem 0;
}

.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--pad-x);
}

.nav-logo {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

/* Language Switcher */
.lang-select {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0 24px 0 8px;
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  margin-left: 10px;
  height: 24px;
  line-height: 1;
  vertical-align: middle;
  margin-top: -2px;
}

.lang-select:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lang-select option {
  background-color: var(--bg-dark);
  color: var(--white);
  padding: 10px;
}

/* ==========================================================================
     6. HERO SECTION
     ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1), var(--bg-dark)),
    url("/images/home/hero-background.webp") center / cover no-repeat;
}

.hero-content {
  padding-top: 7rem;
  max-width: 1200px;
}

.brand-title {
  display: inline-block;
  font-weight: 600;
  font-size: clamp(1.2rem, 4vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: 0.8em;
  color: var(--white);
  margin-bottom: 4rem;
  padding: 0.8rem 2.8rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hero-lead {
  max-width: 800px;
  margin: 0 auto 3.5rem;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-btn-spaced {
  margin-right: 1rem;
}

/* ==========================================================================
     7. SHARED COMPONENTS (Cards, Projects, etc.)
     ========================================================================== */
.section-with-bg {
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.section-with-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--bg-dark) 0%,
    rgba(10, 15, 11, 0.7) 50%,
    var(--bg-dark) 100%
  );
  z-index: 1;
}

#two-paths {
  background-image: url("/images/home/section-background.webp");
}
#projects {
  background-image: url("/images/home/projects-background.webp");
}

/* Column Cards */
.column {
  background: rgba(252, 250, 247, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  padding: 4rem 3rem;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.column h3 {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-main);
}

.column ul {
  list-style: none;
}
.column li {
  position: relative;
  margin-bottom: 1.2rem;
  padding-left: 1.8rem;
  color: #3a4541;
  font-size: 1.1rem;
}

.column li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Projects */
.project {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
  margin-top: 5rem;
  background: rgba(252, 250, 247, 0.9);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-heavy);
}

.project-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.project-content {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.project-content h3 {
  display: none;
} /* Redundant title */

.project-desc {
  font-size: 1.2rem;
  color: #3a4541;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.project-content .btn-primary {
  background: var(--accent-deep);
  color: white;
  border: none;
  align-self: flex-start;
  padding: 1rem 2.5rem;
}

/* Note Section */
.note {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border-radius: var(--radius-md);
  padding: 4rem 2rem;
  margin-top: 6rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
}

/* ==========================================================================
     8. PAGE SPECIFIC: CONTACT
     ========================================================================== */
.contact-hero {
  min-height: 100vh;
  /* Reduced from 12rem to handle mobile better */
  padding-top: clamp(8rem, 15vh, 12rem);
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4), var(--bg-dark)),
    url("/images/home/hero-background.webp") center/cover no-repeat;
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  background: var(--bg-cream);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 3rem;
  /* Ensuring the shadow doesn't cause horizontal scroll */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  width: 100%;
}

.contact-info {
  background: #1a2421;
  color: var(--white);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-info h3 {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.info-item {
  margin-top: 2.5rem;
}
.info-item strong {
  display: block;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.info-item a {
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s;
}
.info-item a:hover {
  color: var(--accent);
}

/* Contact Form */
.contact-form-container {
  padding: 4rem;
  background: rgba(252, 250, 247, 0.95);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
}
.form-group input,
.form-group textarea {
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: white;
  transition: border-color 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form .btn-primary {
  align-self: flex-start;
  margin-top: 1rem;
  background: var(--accent-deep);
  color: white;
  border: none;
}

/* ==========================================================================
     9. UTILITIES (Animations, Lightbox, Footer)
     ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.stagger-1 {
  transition-delay: 0.1s;
}
.stagger-2 {
  transition-delay: 0.3s;
}
.zoomable {
  cursor: zoom-in;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
}
.lightbox.open {
  display: flex;
}
.lightbox-img {
  max-width: min(1100px, 95vw);
  max-height: 90vh;
  border-radius: 16px;
}
.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

/* Footer */
footer {
  background: var(--bg-dark);
  padding: 8rem var(--pad-x) 4rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}
.footer-tagline {
  color: var(--accent);
  font-style: italic;
  margin-bottom: 1rem;
}

/* ==========================================================================
     10. RESPONSIVE DESIGN
     ========================================================================== */
@media (max-width: 900px) {
  .hero-btn-spaced {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  .two-columns,
  .project,
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .section-with-bg {
    background-attachment: scroll;
  }
  .column,
  .project-content,
  .contact-info,
  .contact-form-container {
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .lang-select {
    margin-left: 0;
    margin-top: 10px;
    width: fit-content;
  }
}

@media (max-width: 600px) {
  /* Navbar Mobile Overhaul */
  .navbar {
    padding: 0.5rem 0;
  }
  .nav-logo {
    display: none;
  }
  .nav-container {
    justify-content: center;
  }
  .nav-links {
    gap: 0.8rem;
    padding: 0 5px;
  }
  .nav-links li {
    font-size: 0.85rem;
  }

  .brand-title {
    letter-spacing: 0.2em;
    padding: 0.4rem 1rem;
  }
  h2 {
    font-size: 2rem;
  }
  .note {
    font-size: 1.1rem;
    padding: 2rem 1rem;
  }

  .lang-select {
    margin-left: 5px;
    padding: 2px 4px 2px 4px;
    font-size: 0.75rem;
    background-position: right 4px center;
    padding-right: 18px;
    margin-top: 0;
    vertical-align: baseline;
  }

  .contact-form-container {
    /* Reduce horizontal padding so the widget has room to breathe */
    padding: 2.5rem 1.2rem;
  }

  .contact-wrapper {
    /* Ensure the wrapper doesn't have side-margins eating up space */
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-content {
    padding: 0 20px;
  }
  h1 {
    font-size: 2rem;
  }
}

@media (max-width: 900px) {
  .contact-hero {
    /* Push content up on mobile so form is visible */
    padding-top: 7rem;
    padding-bottom: 4rem;
    height: auto;
    min-height: auto;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    margin-top: 2rem;
  }

  .contact-info {
    padding: 2.5rem 1.5rem;
    text-align: center;
  }

  .contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  /* Remove the big gap below "Let's Connect" on mobile */
  .info-item {
    margin-top: 1.5rem;
  }

  .contact-form-container {
    padding: 2.5rem 1.5rem;
  }

  /* Make inputs easier to tap on phones */
  .form-group input,
  .form-group textarea {
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
    padding: 0.8rem;
  }

  /* Make the button full width on small screens for better UX */
  .contact-form .btn-primary {
    align-self: stretch;
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* Smaller headings for narrow phones */
  h2 {
    font-size: 1.8rem !important;
  }
  .lead-centered {
    font-size: 1rem;
  }
}

/* ==========================================================================
   TURNSTILE STABILITY FIX
   ========================================================================== */
/* 1. The Container: Force exact dimensions */
.cf-turnstile {
  width: 100% !important;
  height: 140px !important;
  display: flex !important;
  justify-content: center;
  align-items: center;
  position: relative;
  background: rgba(255, 255, 255, 0.05); /* Very light background */
  border-radius: var(--radius-sm);
  overflow: hidden;
}
