/* ─── Navigation ─────────────────────────────────────────────────────────── */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 2rem;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Logo fills the header height naturally */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo:hover {
  transform: scale(1.2);
}

.nav-logo-img {
  /* Height matches the nav's inner content area */
  height: clamp(36px, 4.5vh, 54px);
  width: auto;
}

.site-nav.scrolled {
  background: rgba(3, 31, 34, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-white);
  transition: color 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

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

/* Hamburger (hidden on desktop) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Hero Section ───────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Character: vertically centered, left-edge anchored */
.character-anchor {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  width: clamp(380px, 50vw, 820px);
}

.character-img {
  display: block;
  width: 75%;
  height: auto;
}

/* Right-side content column: fills from ~40% to the right edge */
.hero-right {
  position: relative;
  z-index: 2;
  margin-left: 50%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 5.5rem 1.25rem 4rem 1.5rem;
  min-height: 100vh;
}

/* ─── Window: light paper texture ────────────────────────────────────────── */

.main-window {
  width: 95%;
  /* max-width: 560px; */
  /* Warm paper base + SVG fractal noise grain */
  /* background-color: #f4edda; */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E"),
    linear-gradient(100deg, rgba(255, 255, 255, 0.896) 10%, rgba(255, 255, 255, 0.62) 65%, rgba(235, 218, 185, 0.541) 100%);
  border-radius: 20px;
  border: 1px solid rgba(185, 158, 108, 0.35);
  padding: 2.5rem 3rem;
  box-shadow:
    0 8px 40px rgba(3, 31, 34, 0.22),
    0 2px 8px rgba(3, 31, 34, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: var(--color-black);
  text-align: left;
}

.window-section {
  padding: 1.25rem 0;
}

.window-section:first-child {
  padding-top: 0;
}

.window-section:last-child {
  padding-bottom: 0;
}

.window-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(3, 31, 34, 0.14) 25%,
    rgba(3, 31, 34, 0.10) 75%,
    transparent
  );
}

/* ─── Projects Section ───────────────────────────────────────────────────── */

.projects-section {
  padding: 5rem 2rem;
  background: linear-gradient(0deg, #063D43, #0a5560);
}

.projects-section-inner {
  max-width: var(--section-max-width);
  margin: 0 auto;
}

.projects-section .section-label {
  text-align: center;
  margin-bottom: 2rem;
}

.projects-section .projects-grid {
  max-width: 680px;
  margin: 0 auto;
}

/* ─── Blog Preview Section ───────────────────────────────────────────────── */

.blog-preview-section {
  padding: 6rem 2rem;
  background: linear-gradient(0deg, #031F22, #063D43);
}

.blog-preview-inner {
  max-width: var(--section-max-width);
  margin: 0 auto;
  text-align: center;
}

.blog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  text-align: left;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  padding: 2rem;
  text-align: center;
  background: var(--color-black);
  font-size: 0.8rem;
  color: rgba(250, 254, 249, 0.4);
  letter-spacing: 0.05em;
}

/* ─── Responsive: Tablet ─────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .hero-right {
    margin-left: 34%;
    padding: 5.5rem 1rem 4rem 1.25rem;
  }

  .character-anchor {
    width: clamp(280px, 38vw, 560px);
  }

  .main-window {
    padding: 2rem 2.25rem;
  }
}

/* ─── Responsive: Mobile ─────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .site-nav {
    padding: 1rem 1.25rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--color-black);
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    z-index: 99;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links.nav-open a {
    font-size: 1.2rem;
    letter-spacing: 0.12em;
  }

  .nav-hamburger {
    display: flex;
    z-index: 101;
  }

  /* Stack vertically on mobile */
  .hero {
    flex-direction: column;
  }

  .hero-right {
    margin-left: 0;
    padding: 5rem 1.25rem 3rem;
    min-height: unset;
    justify-content: flex-start;
  }

  .main-window {
    padding: 1.75rem 1.5rem;
  }

  /* Hide SVG character on mobile — replaced by darmoque_mobile.png in the window */
  .character-anchor {
    display: none;
  }

  .blog-cards {
    grid-template-columns: 1fr;
  }
}
