/* ============================================================
   Elhouse.es — mobile landing page
   Reveal animation adapted from a GSAP template, resolving into
   a single, non-scrollable landing screen with a video backdrop.
   ============================================================ */

/* ---- Licensed brand fonts (drop the files into /fonts to enable) ----
   Until the licensed files exist, the browser falls back to the next
   family in each stack (Anton / Rye), so the page looks right today. */
@font-face {
  font-family: "Berthold Block";
  src:
    url("fonts/BertholdBlock.woff2") format("woff2"),
    url("fonts/BertholdBlock.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zing Rust Base";
  /* Drop any one of these into /fonts (see fonts/README.txt). The browser
     uses whichever exists; until then it falls back to Anton/Oswald. */
  src:
    url("fonts/ZingRustBase.woff2") format("woff2"),
    url("fonts/ZingRustBase.woff") format("woff"),
    url("fonts/ZingRustBase.otf") format("opentype"),
    url("fonts/ZingRustBase.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --accent: #98ff51; /* requested font colour */
  --ink: #0a0f0a;

  /* Intro reveal palette — Elhouse tropical sunset into night */
  --base-100: #eafff2; /* soft highlight */
  --base-200: #ff7a59; /* sunset coral   */
  --base-300: #ffc23d; /* golden hour    */
  --base-400: #86e35a; /* tropical green */
  --base-500: #0a0f0a; /* night ink (= --ink), blends into the landing */

  --font-title: "Berthold Block", "Anton", "Archivo Black", sans-serif;
  /* Zing Rust Base is a commercial Canva font — supply the file to get it
     exactly; Anton/Oswald approximate its heavy condensed silhouette. */
  --font-sub: "Zing Rust Base", "Anton", "Oswald", "Arial Narrow", sans-serif;
}

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

/* Lock the page to a single, non-scrollable screen */
html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
}
body {
  position: fixed;
  inset: 0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
}

img {
  display: block;
}

/* ============================================================
   INTRO / REVEAL
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  color: var(--base-100);
  overflow: hidden;
  z-index: 2;
}

.preloader-bg,
.preloader-revealer {
  position: absolute;
  width: 100%;
  height: 100svh;
  transform-origin: center;
}

.preloader-bg {
  background-color: var(--base-500);
}

.preloader-revealer {
  clip-path: circle(0% at 50% 50%);
  will-change: clip-path;
}
.preloader-revealer-1 {
  background-color: var(--base-200);
}
.preloader-revealer-2 {
  background-color: var(--base-300);
}
.preloader-revealer-3 {
  background-color: var(--base-400);
}
.preloader-revealer-4 {
  background-color: var(--base-500);
}

.items {
  position: absolute;
  width: 100%;
  height: 100svh;
}

.item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30vw;
  max-width: 168px;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%) scale(0);
  will-change: transform;
  backface-visibility: hidden;
}
.item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* lighter shadow = cheaper to recompute while the item moves */
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
}

.preloader-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26vw;
  max-width: 150px;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.preloader-logo img {
  width: 100%;
  height: auto;
}

/* ============================================================
   LANDING
   ============================================================ */
.landing {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  z-index: 0;
  background: var(--ink);
}

/* Full-bleed looping video backdrop */
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Overlay for legibility + mood */
.bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      120% 80% at 50% 18%,
      rgba(10, 15, 10, 0) 40%,
      rgba(10, 15, 10, 0.35) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(10, 15, 10, 0.6) 0%,
      rgba(10, 15, 10, 0.12) 32%,
      rgba(10, 15, 10, 0.2) 60%,
      rgba(10, 15, 10, 0.82) 100%
    );
}

/* Top bar: logo + language switch */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: calc(1.4rem + env(safe-area-inset-top)) 1.4rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
}

.nav-logo img {
  width: 3.4rem;
  height: auto;
  transform-origin: top left;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.top-right {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.ig {
  display: inline-flex;
  color: var(--accent);
  opacity: 0.9;
  transition:
    opacity 0.25s ease,
    transform 0.2s ease;
}
.ig svg {
  width: 1.45rem;
  height: 1.45rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}
.ig:active {
  transform: scale(0.9);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.lang-switch button {
  position: relative;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.15rem 0.4rem;
  font-family: var(--font-sub);
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0.45;
  transition:
    opacity 0.25s ease,
    text-shadow 0.25s ease;
}
/* Sliding, glowing underline marks the active language */
.lang-switch button::after {
  content: "";
  position: absolute;
  left: 0.15rem;
  right: 0.15rem;
  bottom: 0.05rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(152, 255, 81, 0.8);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.6, 0, 0.2, 1);
}
.lang-switch button.is-active {
  opacity: 1;
  text-shadow: 0 0 14px rgba(152, 255, 81, 0.55);
}
.lang-switch button.is-active::after {
  transform: scaleX(1);
}
.lang-switch .lang-sep {
  color: var(--accent);
  opacity: 0.35;
  font-family: var(--font-sub);
  font-size: 0.9rem;
}

/* Centre content */
.center {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 2.4rem);
  text-align: center;
  z-index: 2;
}

.eyebrow {
  margin-bottom: 0.7rem;
  font-family: var(--font-sub);
  color: var(--accent);
  text-transform: uppercase;
  font-size: clamp(0.85rem, 4vw, 1.15rem);
  letter-spacing: 0.22em;
  padding-left: 0.22em; /* balance the trailing letter-spacing */
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

/* Title is now the El House wordmark image */
.title {
  margin: 0 auto;
  line-height: 0;
}
.title img {
  width: min(86vw, 500px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.45));
}

.subtitle {
  margin: 1rem auto 0;
  max-width: 20ch;
  font-family: var(--font-sub);
  color: var(--accent);
  text-transform: uppercase;
  font-size: clamp(1rem, 4.8vw, 1.5rem);
  letter-spacing: 0.015em;
  line-height: 1.18;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.65);
}

/* Bottom: location line */
.bottombar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem 1.4rem calc(1.7rem + env(safe-area-inset-bottom));
  text-align: center;
  z-index: 2;
}
.location {
  font-family: var(--font-sub);
  color: var(--accent);
  text-transform: uppercase;
  font-size: clamp(0.8rem, 3.6vw, 1rem);
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  opacity: 0.92;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
}
.cta {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--font-sub);
  text-transform: uppercase;
  text-decoration: none;
  font-size: clamp(1rem, 4.6vw, 1.2rem);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--accent);
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  box-shadow: 0 10px 34px rgba(152, 255, 81, 0.4);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  will-change: transform;
}
.cta:active {
  transform: scale(0.96);
  box-shadow: 0 6px 22px rgba(152, 255, 81, 0.35);
}

/* SplitText helpers */
.nav-word,
.eyebrow-line,
.loc-line,
.title .char,
.title .word,
.sub-line {
  display: inline-block;
  will-change: transform;
}

/* Larger screens: keep it phone-shaped and centred */
@media (min-width: 700px) {
  .center {
    width: min(560px, 90%);
  }
  .title {
    font-size: clamp(6rem, 12vw, 10rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
