:root {
  --topbar-h: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  touch-action: none;
}

#app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  touch-action: none;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

#top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 100;
  pointer-events: none;
}

#top-bar > * {
  pointer-events: auto;
}

#logo-area {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  padding: 14px 0;
  opacity: 0;
  transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 800ms ease;
}

#logo-area.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

#top-logo {
  display: block;
  width: 64px;
  height: auto;
}

#menu-button {
  position: absolute;
  top: 10px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 350ms ease;
  z-index: 300;
}

#menu-button.visible {
  opacity: 1;
}

#menu-button.menu-open {
  opacity: 0;
  pointer-events: none;
}

.hamburger-line {
  width: 22px;
  height: 2px;
  background: white;
  display: block;
  transition: transform 300ms ease, opacity 300ms ease;
  pointer-events: none;
}

#menu-button:focus {
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

#menu-button:focus:not(:focus-visible) {
  outline: none;
}

#scene-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* ─────────────────────────────────────────
   OVERLAY SYSTEM (desktop + mobile shared)
───────────────────────────────────────── */
#overlay-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 500;
  pointer-events: auto;
}

#overlay-container[hidden] {
  display: none;
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 400ms ease;
}

.overlay-backdrop.visible {
  opacity: 1;
}

.overlay-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 20px;
  padding-top: calc(60px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.overlay-close {
  position: fixed;
  top: 20px;
  top: calc(20px + env(safe-area-inset-top));
  right: 20px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 32px;
  line-height: 1;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 200ms ease;
}

.overlay-close:hover {
  opacity: 0.7;
}

.overlay-close:focus {
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.overlay-close:focus:not(:focus-visible) {
  outline: none;
}

.overlay-content {
  max-width: 700px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 300;
  opacity: 0;
  transition: opacity 600ms ease;
}

.overlay-content.visible {
  opacity: 1;
}

.overlay-content h1 {
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}

.overlay-content h2 {
  font-size: 16px;
  font-weight: 400;
  margin-top: 28px;
  margin-bottom: 12px;
}

.overlay-content p {
  margin-bottom: 16px;
}

.overlay-content p:last-child {
  margin-bottom: 0;
}

.overlay-content a.overlay-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  text-decoration: none;
  transition: opacity 200ms ease;
  display: inline-block;
  margin-top: 20px;
}

.overlay-content a.overlay-link:hover {
  opacity: 0.8;
}

/* ─────────────────────────────────────────
   MEGA MENU
───────────────────────────────────────── */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1;
  pointer-events: auto;
}

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2;
  transform: translateX(100%);
  transition: transform 500ms cubic-bezier(0.65, 0, 0.35, 1);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  color: white;
  font-family: 'Montserrat', sans-serif;
}

.menu-panel.visible {
  transform: translateX(0);
}

.menu-close-button {
  position: absolute;
  top: 10px;
  top: calc(10px + env(safe-area-inset-top));
  right: 16px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 10;
  color: white;
}

.menu-close-button:focus {
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.menu-close-button:focus:not(:focus-visible) {
  outline: none;
}

.menu-close-x {
  width: 22px;
  height: 2px;
  background: white;
  display: block;
  position: absolute;
  pointer-events: none;
}

.menu-close-x:nth-child(1) {
  transform: rotate(45deg);
}

.menu-close-x:nth-child(2) {
  transform: rotate(-45deg);
}

.menu-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 80px 40px 40px;
  padding-top: calc(80px + env(safe-area-inset-top));
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  min-height: 100%;
}

.menu-primary {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 32px;
}

.menu-primary a {
  color: white;
  text-decoration: none;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
}

.menu-primary a:hover {
  opacity: 0.7;
}

.menu-secondary {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 48px;
}

.menu-secondary a {
  color: white;
  text-decoration: none;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
}

.menu-secondary a:hover {
  opacity: 0.7;
}

.menu-newsletter {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 48px;
  width: 100%;
  max-width: 500px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.menu-newsletter input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  padding: 8px 12px 8px 0;
  outline: none;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
  min-width: 0;
}

.menu-newsletter input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.menu-newsletter button {
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  padding: 8px 0 8px 16px;
  cursor: pointer;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.menu-newsletter button:hover {
  opacity: 0.7;
}

.menu-newsletter-success {
  text-align: center;
  font-size: 14px;
  color: white;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 48px;
}

.menu-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.menu-footer a,
.menu-footer button {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 12px;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.02em;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-footer a:hover,
.menu-footer button:hover {
  opacity: 0.7;
}

/* DESKTOP MENU */
@media (min-width: 768px) {
  .menu-panel {
    width: clamp(320px, 35vw, 520px);
    background: rgba(0, 0, 0, 0.65);
  }

  .menu-content {
    justify-content: flex-start;
    align-items: flex-end;
    padding: 100px 60px 60px;
  }

  .menu-primary {
    align-items: flex-end;
    gap: 28px;
    margin-bottom: 28px;
  }

  .menu-primary a {
    text-align: right;
  }

  .menu-secondary {
    align-items: flex-end;
    gap: 28px;
  }

  .menu-secondary a {
    text-align: right;
  }

  .menu-newsletter {
    justify-content: flex-end;
    max-width: 100%;
    width: auto;
  }

  .menu-newsletter input {
    min-width: 220px;
  }

  .menu-newsletter-success {
    text-align: right;
  }

  .menu-footer {
    align-items: flex-end;
    gap: 12px;
    margin-top: auto;
  }
}

/* ─────────────────────────────────────────
   HOME SCENE
───────────────────────────────────────── */
.home-scene {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.home-video-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.home-video-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Invisible clickable overlay on the video — links to services */
.home-video-link {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}

.home-blackout-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 2;
  opacity: 1;
  transition: opacity 600ms ease-out;
  pointer-events: none;
}

.home-blackout-layer.fade-out {
  opacity: 0;
}

.home-leopard-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0;
  transition: opacity 1200ms ease-in-out;
  pointer-events: none;
}

.home-leopard-layer.visible {
  opacity: 1;
}

.home-leopard-layer.fade-out {
  opacity: 0;
  transition: opacity 600ms ease-out;
}

.home-leopard-layer img {
  display: block;
  width: 120px;
  height: auto;
}

/* Small variant — matches header logo size */
.home-leopard-small img {
  width: 64px;
}

.home-curtains-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
}

.home-curtains-layer.visible {
  opacity: 1;
  pointer-events: auto;
}

.home-curtains-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.home-curtain-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background-image: url('/assets/curtains.jpg');
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transform: translateY(-100%);
  transition: transform 1000ms cubic-bezier(0.65, 0, 0.35, 1);
}

.home-curtain-panel::before {
  content: '';
  position: absolute;
  top: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.4), transparent);
  opacity: 0.6;
}

.home-curtain-panel.left {
  left: 0;
  background-position: left center;
}

.home-curtain-panel.left::before {
  right: 0;
}

.home-curtain-panel.right {
  right: 0;
  background-position: right center;
}

.home-curtain-panel.right::before {
  left: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.4), transparent);
}

.home-curtain-panel.drop {
  transform: translateY(0);
}

.home-curtain-panel.open.left {
  transform: translateX(-100%);
}

.home-curtain-panel.open.right {
  transform: translateX(100%);
}

/* ─────────────────────────────────────────
   ROOM SCENE (about / contact / services / projects)
───────────────────────────────────────── */
.about-scene {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.about-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.about-hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.about-hotspot {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.about-hotspot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────
   MOBILE ROOM LINK SYSTEM
   Only active at max-width: 1024px
───────────────────────────────────────── */
.mobile-room-layer {
  display: none;
}

@media (max-width: 1024px) {

  /* Hide desktop hotspots */
  .about-hotspot-layer {
    display: none;
  }

  /* Root layer */
  .mobile-room-layer {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
  }

  /* Dark overlay */
  .mobile-room-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
  }

  .mobile-room-layer.mobile-overlay-visible .mobile-room-overlay {
    opacity: 1;
  }

  /* Link list centred over image */
  .mobile-room-links {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 80px 32px;
    pointer-events: none;
    z-index: 2;
  }

  .mobile-room-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 350ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    width: 100%;
  }

  .mobile-room-layer.mobile-links-visible .mobile-room-item {
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-room-item.mobile-item-hidden {
    opacity: 0 !important;
    transform: translateY(6px) !important;
    pointer-events: none !important;
    transition: opacity 180ms ease, transform 180ms ease !important;
  }

  /* Link — identical to mega menu primary links */
  .mobile-room-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
    display: block;
    width: 100%;
    pointer-events: auto;
  }

  .mobile-room-link:active {
    opacity: 0.6;
  }

  /* Services category expand */
  .mobile-sublist {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 400ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 300ms ease;
    width: 100%;
  }

  .mobile-cat-item.mobile-cat-open > .mobile-sublist {
    max-height: 400px;
    opacity: 1;
  }

  .mobile-cat-item.mobile-cat-open > .mobile-room-link {
    opacity: 0.5;
  }

  .mobile-sublist-item {
    padding-top: 14px;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .mobile-sub-link {
    font-size: 20px !important;
    opacity: 0.85;
  }

  /* Popup panel — full layer, flexed column, top-anchored */
  .mobile-popup-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 32px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 3;
    overflow: hidden;
  }

  .mobile-popup-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 520px;
    height: 100%;
    padding: 80px 0;
  }

  .mobile-room-layer.mobile-popup-active .mobile-popup-panel {
    opacity: 1;
    pointer-events: auto;
  }

  /* Title row — sticky at top, close button absolutely placed so title stays truly centred */
  .mobile-popup-title-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 32px;
    flex-shrink: 0;
  }

  .mobile-popup-title-text {
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    padding: 0 44px;
  }

  /* Close X — absolutely positioned so it doesn't shift the title */
  .mobile-popup-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .mobile-popup-close:focus-visible {
    outline: 1px solid rgba(255,255,255,0.4);
    outline-offset: 3px;
  }

  .mob-close-line {
    position: absolute;
    width: 20px;
    height: 1.5px;
    background: white;
    display: block;
    pointer-events: none;
  }

  .mob-close-line:nth-child(1) { transform: rotate(45deg); }
  .mob-close-line:nth-child(2) { transform: rotate(-45deg); }

  /* Popup body — scrolls independently when content overflows */
  .mobile-popup-body {
    width: 100%;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    line-height: 1.75;
    font-weight: 300;
    text-align: center;
    opacity: 0;
    transition: opacity 250ms ease;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .mobile-popup-body.mob-content-in {
    opacity: 1;
  }

  .mobile-popup-body h1 {
    display: none;
  }

  .mobile-popup-body .project-overlay-header {
    display: none;
  }

  .mobile-popup-body h2 {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    margin-top: 22px;
    margin-bottom: 8px;
    opacity: 0.7;
  }

  .mobile-popup-body p {
    margin-bottom: 14px;
  }

  .mobile-popup-body p:last-child {
    margin-bottom: 0;
  }

  .mobile-popup-body input,
  .mobile-popup-body textarea {
    text-align: left;
  }

  .mobile-popup-body form {
    text-align: left;
  }

  /* Footer */
  .mobile-room-footer {
    position: absolute;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.04em;
    pointer-events: none;
    z-index: 20;
  }
}

/* ─────────────────────────────────────────
   REDUCED MOTION
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #logo-area {
    transition: opacity 400ms ease;
  }

  #logo-area.visible {
    transform: translateX(-50%) translateY(0);
  }

  .menu-panel {
    transition: opacity 400ms ease;
  }

  .menu-panel.visible {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ─────────────────────────────────────────
   PROJECT OVERLAY
───────────────────────────────────────── */
.project-overlay {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.project-overlay-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-overlay-title {
  text-align: center;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.project-overlay-rule {
  width: min(520px, 80%);
  height: 1px;
  margin: 14px auto 0;
  background: rgba(255, 255, 255, 0.45);
}

.project-overlay-body {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.project-overlay-body p {
  margin-bottom: 14px;
}

.project-overlay-body p:last-child {
  margin-bottom: 0;
}

/* ── Project image scroll strip ── */
.project-overlay-scroll-strip {
  display: flex;
  flex-direction: row;
  gap: 0;
  margin-top: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.project-overlay-scroll-strip::-webkit-scrollbar {
  display: none;
}

.project-overlay-tile {
  flex: 0 0 auto;
  width: 55%;
  scroll-snap-align: start;
}

.project-overlay-tile img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

@media (max-width: 768px) {
  .project-overlay-tile {
    width: 72vw;
  }
}

/* ─────────────────────────────────────────
   FADE TRANSITION
───────────────────────────────────────── */
.fade-transition {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 600ms ease;
}

.fade-transition.visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .fade-transition {
    transition-duration: 0.01ms !important;
  }
}

/* hide reCAPTCHA badge */
.grecaptcha-badge {
  visibility: hidden !important;
}