:root {
  --brand: #44b3eb;
  --max-width: 1100px;
  --page-gap: 20px;
  --base-font-size: 16px;

  /* Header */
  --header-height: 110px;
  --header-logo-height: 160px;
  --nav-gap: 28px;
  --nav-font-size: 18px;
  --flag-w: 50px;
  --flag-h: 40px;

  --muted: #6b7280;
  --card-shadow: rgba(12, 24, 32, 0.08);

  --hero-glow: rgba(68, 179, 235, 0.16);
  --hero-glow-strong: rgba(68, 179, 235, 0.3);

  /* move hero text down */
  --gallery-hero-text-shift: 25vh;
}

/* Reset / base */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font-family:
    "Sora",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: var(--base-font-size);
  color: #111827;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

main {
  padding-top: var(--header-height);
}

/* HEADER */
.header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 60;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(13, 24, 35, 0.08);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px var(--page-gap);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  min-height: var(--header-height);
  height: auto;
}
.header-inner .nav.nav-left {
  justify-self: end;
  margin-right: 12px;
}
.header-inner .nav.nav-right {
  justify-self: start;
  margin-left: 12px;
}
.nav {
  display: flex;
  gap: var(--nav-gap);
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
}
.logo {
  height: var(--header-logo-height);
  display: inline-block;
  max-height: calc(var(--header-height) + 30px);
  width: auto;
}

/* Links */
.nav-link {
  position: relative;
  text-decoration: none;
  color: #0f1720;
  font-size: var(--nav-font-size);
  font-weight: 700;
  padding: 8px 0;
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 3px;
  width: 100%;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 220ms ease;
}
.nav-link:hover::after,
.nav-link:focus::after {
  transform: scaleX(1);
}

/* Language flag */
.lang-flag {
  display: inline-block;
  position: relative;
}
.lang-flag img {
  width: var(--flag-w);
  height: var(--flag-h);
  object-fit: cover;
  transform: translateY(2px);
  border-radius: 20%;
}
.lang-flag::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 3px;
  width: 100%;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 220ms ease;
}
.lang-flag:hover::after,
.lang-flag:focus::after {
  transform: scaleX(1);
}

/* ===== Header responsiveness (NO overlap, same as style.css) ===== */
@media (max-width: 1100px) {
  :root {
    --header-height: 104px;
    --header-logo-height: 110px;
    --nav-gap: 18px;
    --nav-font-size: 16px;
    --flag-w: 40px;
    --flag-h: 32px;
  }

  .header-inner {
    gap: 18px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 100px;
    --header-logo-height: 96px;
    --nav-gap: 14px;
    --nav-font-size: 14px;
    --flag-w: 38px;
    --flag-h: 30px;
  }

  .header-inner .nav.nav-left,
  .header-inner .nav.nav-right {
    margin: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 140px;
    --header-logo-height: 92px;
    --nav-gap: 14px;
    --nav-font-size: 14px;
    --flag-w: 42px;
    --flag-h: 34px;

    --gallery-hero-text-shift: 16vh;
  }

  main {
    padding-top: var(--header-height);
  }

  .header-inner {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 10px 14px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .header-inner::-webkit-scrollbar {
    display: none;
  }

  .logo-link {
    order: 0;
  }

  .nav.nav-left,
  .nav.nav-right {
    margin: 0 !important;
    display: inline-flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    row-gap: 0;
    gap: var(--nav-gap);
    align-items: center;
    flex: 0 0 auto;
  }
  .nav.nav-left {
    order: 1;
  }
  .nav.nav-right {
    order: 1;
  }

  .lang-flag img {
    width: var(--flag-w);
    height: var(--flag-h);
    transform: none;
  }

  .nav-link {
    padding: 6px 0;
  }
}

@media (max-width: 600px) {
  :root {
    --header-height: 124px;
    --header-logo-height: 84px;
    --nav-gap: 12px;
    --nav-font-size: 13px;
    --flag-w: 40px;
    --flag-h: 32px;
  }

  main {
    padding-top: var(--header-height);
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 124px;
    --header-logo-height: 76px;
    --nav-gap: 10px;
    --nav-font-size: 12px;
    --flag-w: 38px;
    --flag-h: 30px;

    --gallery-hero-text-shift: 14vh;
  }

  main {
    padding-top: var(--header-height);
  }
}

/* HERO GALLERY (unchanged) */
.hero-gallery {
  position: relative;
  width: 100%;
  height: calc(154vh - 40px);
  min-height: 1080px;
  overflow: hidden;
}
.hero-gallery-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

/* slider */
.hero-gallery-image-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.hero-gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms ease;
}
.hero-gallery-image.visible {
  opacity: 1;
}

/* overlay */
.hero-gallery-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at top left,
      rgba(56, 189, 248, 0.18),
      transparent 60%
    ),
    linear-gradient(180deg, rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.65));
  mix-blend-mode: multiply;
  z-index: 1;
}

/* text moved down */
.hero-gallery-content {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-gap);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateY(var(--gallery-hero-text-shift));
}
.hero-gallery-content h1 {
  margin: 0 0 10px 0;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 800;
  color: #f9fafb;
  max-width: 520px;
}
.hero-gallery-content p {
  margin: 0;
  font-size: 18px;
  color: #e5e7eb;
  max-width: 520px;
}

/* fade-in hero */
.hero-gallery-inner {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 600ms ease,
    transform 600ms cubic-bezier(0.2, 0.9, 0.2, 1);
}
.hero-gallery-inner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* GALLERY GRID SECTION */
.gallery-grid-section {
  background: #ffffff;
  padding: 64px 0 96px;
}
.gallery-grid-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--page-gap);
}
.gallery-grid-inner h2 {
  margin: 0 0 8px 0;
  font-size: 32px;
  color: #0f1720;
  font-weight: 800;
}
.gallery-grid-subtitle {
  margin: 0 0 32px 0;
  color: var(--muted);
  font-size: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.gallery-grid-item {
  margin: 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);

  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 480ms cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 480ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 260ms ease;
}
.gallery-grid-item img {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: cover;
}
.reveal-section.is-visible .gallery-grid-item {
  opacity: 1;
  transform: translateY(0);
}
.gallery-grid-item:hover,
.gallery-grid-item:focus-within {
  transform: translateY(-6px);
  box-shadow:
    0 22px 44px rgba(15, 23, 42, 0.22),
    0 0 0 3px rgba(56, 189, 248, 0.24);
}

/* reveal section base */
.reveal-section {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 520ms cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: opacity, transform;
}
.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* LIGHTBOX */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.lightbox.open {
  display: flex;
  pointer-events: auto;
}
.lightbox .lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, 0.85);
  opacity: 0;
  transition: opacity 220ms ease;
}
.lightbox.open .lb-overlay {
  opacity: 1;
}
.lightbox .lb-stage {
  position: relative;
  z-index: 230;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}
.lightbox .lb-img {
  object-fit: contain;
  max-width: 92vw;
  max-height: 92vh;
  transform-origin: center center;
  transform: scale(0.96);
  opacity: 0;
  transition:
    transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 220ms ease;
  box-shadow: 0 40px 80px rgba(4, 8, 12, 0.75);
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}
.lightbox.open .lb-img {
  transform: scale(1);
  opacity: 1;
}

.lb-prev,
.lb-next,
.lb-close {
  position: fixed;
  z-index: 240;
  background: rgba(15, 23, 42, 0.8);
  color: #f9fafb;
  border: none;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 28px;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease;
  backdrop-filter: blur(6px);
}
.lb-close {
  right: 22px;
  top: 22px;
  width: 44px;
  height: 44px;
  font-size: 24px;
}
.lb-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-prev:hover,
.lb-next:hover,
.lb-close:hover {
  background: rgba(56, 189, 248, 0.9);
  color: #0b1120;
}
.lb-prev:active,
.lb-next:active,
.lb-close:active {
  transform: translateY(-50%);
}
.lb-prev:focus,
.lb-next:focus,
.lb-close:focus {
  outline: none;
}

/* FOOTER */
.site-footer {
  background: #ffffff;
  padding: 28px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-gap);
  text-align: center;
}
.footer-inner .muted {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

/* ===== RESPONSIVE (gallery content) ===== */

@media (min-width: 1400px) {
  :root {
    --max-width: 1300px;
  }

  body {
    font-size: 17px;
  }

  .hero-gallery {
    height: calc(160vh - 40px);
    min-height: 1200px;
  }

  .hero-gallery-content h1 {
    font-size: 50px;
  }
  .hero-gallery-content p {
    font-size: 20px;
  }
}

@media (max-width: 1100px) {
  .hero-gallery {
    height: calc(143vh - 20px);
    min-height: 968px;
  }
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .hero-gallery {
    height: calc(125vh - 20px);
    min-height: 780px;
  }
  .hero-gallery-content h1 {
    font-size: 32px;
  }
  .hero-gallery-content p {
    font-size: 16px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Smaller grid items on tablets */
  .gallery-grid-item img {
    height: 260px;
  }
}

/* iPhone 13 Safari fix:
   On small screens, IntersectionObserver may not reveal until user interaction.
   We keep the hero untouched, but force the gallery grid to be visible. */
@media (max-width: 600px) {
  .gallery-grid-inner {
    max-width: 520px;
    margin: 0 auto;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gallery-grid-item img {
    height: 210px;
  }

  .gallery-grid-item {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  }

  /* Critical: don't allow reveal-section to keep content hidden */
  .gallery-grid-section.reveal-section {
    opacity: 1 !important;
    transform: none !important;
  }
  .gallery-grid-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 500px) {
  .hero-gallery {
    height: calc(110vh - 20px);
    min-height: 620px;
  }
  .hero-gallery-content h1 {
    font-size: 26px;
  }

  .gallery-grid-section {
    padding: 40px 0 64px;
  }

  .lb-prev,
  .lb-next {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .lb-close {
    right: 12px;
    top: 12px;
  }
}

@media (max-width: 380px) {
  .hero-gallery-content h1 {
    font-size: 22px;
  }

  .gallery-grid-item img {
    height: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-gallery-inner,
  .hero-gallery-image,
  .lightbox .lb-img,
  .gallery-grid-item {
    transition: none !important;
    animation: none !important;
  }
  .reveal-section {
    opacity: 1 !important;
    transform: none !important;
  }
}
