/* =========================================================
   ATEMPORALIA — copied from moreli.xyz (Framer source)
   ========================================================= */

/* ---------- Framer fonts (direct .woff2 from framerusercontent) ---------- */
@font-face {
  font-family: "Tungsten Bold";
  src: url("https://framerusercontent.com/assets/7cdf44c5ede4a36fde3adb2c4bfb0e60.woff2") format("woff2"),
       url("https://framerusercontent.com/assets/PHKUAUJUPjnOjPcAUFiqYkhCao.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Haas Grotesk Display Pro";
  src: url("https://framerusercontent.com/assets/kShTzUxKj4RvIyQsStoGJ1mwmT8.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Haas Grotesk Display Pro";
  src: url("https://framerusercontent.com/assets/MBiSEwpJAgdoYzfg1GnBfBjJag.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Antonio";
  src: url("https://fonts.gstatic.com/s/antonio/v21/gNMbW2BrTpK8-inLtBJgMMfbm6uNVDvRxiv0UQX3oUpf.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("https://framerusercontent.com/assets/5vvr9Vy74if2I6bQbJvbw7SY1pQ.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   Design tokens (copied from moreli.xyz)
   ========================================================= */
:root {
  --token-4fd1ffb3-13cc-4037-a6be-4b036930d7b1: rgb(10, 10, 10);    /* page bg */
  --token-b13bf0e8-8303-44e6-9ff2-0f72c8ebb480: rgb(161, 161, 161); /* muted */
  --token-28a3b5fa-5e9a-4dc6-aec3-d49e3fdd0d93: rgb(71, 71, 71);    /* dark muted */
  --token-76984086-09a4-4d22-a541-4f3e4321f82e: rgb(255, 255, 255); /* white */

  /* aliases */
  --bg:           var(--token-4fd1ffb3-13cc-4037-a6be-4b036930d7b1);
  --white:        var(--token-76984086-09a4-4d22-a541-4f3e4321f82e);
  --muted:        var(--token-b13bf0e8-8303-44e6-9ff2-0f72c8ebb480);
  --muted-dark:   var(--token-28a3b5fa-5e9a-4dc6-aec3-d49e3fdd0d93);
  --pill-bg:      rgb(29, 29, 29);

  --font-display: "Tungsten Bold", "Antonio", Impact, "Arial Narrow", sans-serif;
  --font-body:    "Neue Haas Grotesk Display Pro", "Inter", -apple-system, sans-serif;

  --ease-out-expo: cubic-bezier(0, 0, 0, 1);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html {
  margin: 0; padding: 0;
  /* iOS Safari: prevent font inflation */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* iOS Safari: smooth momentum scroll */
  -webkit-overflow-scrolling: touch;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
/* iOS: prevent zoom on input focus (requires font-size >= 16px) */
input, textarea, select { font-size: 16px; }
em { font-style: italic; }

/* =========================================================
   Appear animations (Framer appear effect ported)
   ========================================================= */
[data-appear] { opacity: 0; will-change: transform, opacity; }

[data-appear="hero-img"] {
  transform: scale(1.2);
  animation: appear-scale 1.8s var(--ease-out-expo) 0.2s forwards;
}
[data-appear="fade-up"] {
  transform: translateY(40px);
  animation: appear-fade-up 1.2s var(--ease-out-expo) 0.6s forwards;
}
[data-appear="pill"] {
  transform: translateY(20px);
  animation: appear-fade-up 1s var(--ease-out-expo) var(--d, 0s) forwards;
}

@keyframes appear-scale {
  to { opacity: 1; transform: scale(1); }
}
@keyframes appear-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;        /* fallback */
  min-height: 100svh;       /* svh = stable on iOS — no jump when address bar hides */
  background: var(--bg);
  color: var(--white);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Giant WHITE "ATEMPORALIA" wordmark behind portrait — Tungsten Bold */
.hero__bg-text {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 14vw, 240px);
  letter-spacing: -0.02em;
  line-height: 0.85;
  color: var(--white);
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  text-transform: uppercase;
}

/* Portrait: near-full-height, stacked clear + blur layers */
.hero__portrait {
  position: relative;
  z-index: 2;
  width: 100%;        /* required so left:50% on child images works correctly */
  height: 95vh;
  height: 95svh;
  display: flex;
  align-items: flex-end;
  margin: 0 auto;
}
.hero__img {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;       /* reliable centering — works with scrollbar on Windows */
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
}
.hero__img--clear {
  z-index: 2;
  opacity: 1;
  /* NO CSS transition — JS handles opacity directly on scroll.
     A CSS transition on top of JS scroll causes restart-flicker on iOS Safari. */
  will-change: opacity;
  -webkit-transform: translateZ(0); /* force GPU compositing layer on iOS */
  transform: translateZ(0);
}
.hero__img--blur {
  z-index: 1;
  opacity: 1;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.hero__tagline {
  position: absolute;
  left: 40px;
  bottom: 40px;
  max-width: 230px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.35;
  color: var(--white);
  z-index: 3;
}
.hero__tagline p { margin: 0; }

/* =========================================================
   PILL NAV
   ========================================================= */
.pill-nav {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--pill-bg);
  border-radius: 64px;
  padding: 4px;
  z-index: 10;
}
.pill-nav__item {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.3);
  padding: 10px 18px;
  border-radius: 100px;
  transition: background 0.2s var(--ease-out-expo), color 0.2s var(--ease-out-expo);
}
.pill-nav__item.is-active {
  background: var(--white);
  color: var(--bg);
}
.pill-nav__item:hover:not(.is-active) { color: var(--white); }

.pill-nav__plus {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease-out-expo);
}
.pill-nav__plus:hover { background: rgba(255, 255, 255, 0.2); }

/* =========================================================
   MANIFESTO — h2 preset (Neue Haas Grotesk 75 Bold)
   ========================================================= */
.manifesto {
  background: var(--bg);
  color: var(--white);
  padding: 140px 40px 120px;
}
.manifesto__lead {
  max-width: 1199px;
  margin: 0 auto 80px;
}
.manifesto__lead h2 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(36px, 3.8vw, 72px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 1050px;
}
.manifesto__lead .accent { color: var(--white); }

.manifesto__columns {
  max-width: 1199px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  text-align: right;
}
.manifesto__columns p {
  margin: 0 0 0 auto;
  font-size: clamp(13px, 0.9vw, 17px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 300px;
}

/* =========================================================
   STORY
   ========================================================= */
.story {
  position: relative;
  background: var(--bg);
  color: var(--white);
  padding: 80px 40px 160px;
  overflow: hidden;
}
.story__ghost {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(220px, 32vw, 520px);
  line-height: 0.8;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.story__col {
  position: relative;
  z-index: 1;
  max-width: 480px;
}
.story__col p {
  font-size: clamp(16px, 1.3vw, 24px);
  line-height: 1.4;
  margin: 0 0 24px;
  color: var(--white);
  font-weight: 300;
}
.story__col p em { color: var(--white); font-style: italic; }
.story__col--left { margin: 0 0 80px 0; }
.story__col--right { margin-left: auto; }

@media (min-width: 810px) {
  .story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 80px;
    align-items: start;
  }
  .story__ghost { grid-column: 1 / -1; }
  .story__col--left { grid-column: 1; margin: 40px 0 0 0; }
  .story__col--right { grid-column: 2; margin: 160px 0 0 0; }
}

/* =========================================================
   GROUP
   ========================================================= */
.group {
  position: relative;
  background: var(--bg);
}
.group__img {
  width: 100%;
  height: auto;
  display: block;
}
.group__band {
  background: var(--bg);
  color: var(--white);
  padding: 40px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}
@media (min-width: 810px) {
  .group__band {
    grid-template-columns: 1fr 1fr;
    padding: 40px 60px;
  }
}
.group__band-left {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.group__band-right {
  margin: 0 0 0 auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 380px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--white);
  color: var(--bg);
  padding: 60px 40px 0;
  position: relative;
  overflow: visible;
}
.site-footer__row {
  max-width: 1199px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.site-footer__row--bottom {
  padding: 80px 0 40px;
  align-items: end;
}
.site-footer__slogan p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.site-footer__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.site-footer__links a { transition: opacity 0.2s var(--ease-out-expo); }
.site-footer__links a:hover { opacity: 0.5; }
.site-footer__row--bottom p {
  margin: 0;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.site-footer__legal {
  text-align: right;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.site-footer__legal li { margin-bottom: 6px; }
.site-footer__legal a { transition: opacity 0.2s var(--ease-out-expo); }
.site-footer__legal a:hover { opacity: 0.5; }

/* giant ATEMPORALIA wordmark with fade gradient — letter-by-letter reveal on scroll */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 12vw, 140px); /* CSS fallback; JS overrides on desktop */
  line-height: 0.9;
  text-transform: uppercase;
  text-align: center;
  margin: 120px 0 20px;
  padding: 0 10px;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--bg) 0%, var(--bg) 55%, var(--muted-dark) 72%, var(--muted) 88%, rgba(161,161,161,0.4) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =========================================================
   MENU OVERLAY
   ========================================================= */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s var(--ease-out-expo);
}
.menu-overlay[hidden] { display: none; }
.menu-overlay__close {
  position: absolute;
  top: 30px;
  right: 40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease-out-expo);
}
.menu-overlay__close:hover { background: rgba(255, 255, 255, 0.2); }
.menu-overlay nav ul {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.menu-overlay nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 9vw, 112px);
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo);
  display: inline-block;
}
.menu-overlay nav a:hover { color: var(--muted); transform: translateX(6px); }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =========================================================
   RESPONSIVE — Framer breakpoints 1440 / 810 / mobile
   ========================================================= */
@media (max-width: 1439px) {
  .manifesto__lead h2 { font-size: 43px; }
  .group__band-left { font-size: 22px; }
  .site-footer__slogan p { font-size: 20px; }
}

/* ── TABLET (max 809px) ── */
@media (max-width: 809px) {
  /* Hero */
  .hero__tagline {
    bottom: 130px;
    left: 20px;
    font-size: 13px;
    max-width: 160px;
  }
  .hero__portrait { height: 90vh; height: 90svh; width: 100%; }
  .hero__portrait .hero__img { width: 100%; height: auto; max-height: 100%; }
  .hero__bg-text { font-size: clamp(40px, 14vw, 150px); top: 14%; }
  .pill-nav { bottom: 30px; padding: 4px; }
  .pill-nav__item { font-size: 11px; padding: 8px 12px; }
  .pill-nav__plus { width: 30px; height: 30px; }

  /* Manifesto */
  .manifesto { padding: 60px 20px 60px; }
  .manifesto__lead { margin-bottom: 40px; }
  .manifesto__lead h2 { font-size: 26px; }
  .manifesto__columns {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: left;
  }
  .manifesto__columns p { margin-left: 0; max-width: none; }

  /* Story */
  .story { padding: 40px 20px 80px; }
  .story__col p { font-size: 16px; }
  .story__ghost { font-size: clamp(100px, 28vw, 220px); }

  /* Group */
  .group__band { padding: 30px 20px; gap: 20px; }
  .group__band-left { font-size: 18px; }
  .group__band-right { margin-left: 0; max-width: none; }

  /* Footer */
  .site-footer { padding: 40px 20px 0; }
  .site-footer__row { grid-template-columns: 1fr; gap: 30px; }
  .site-footer__links { grid-template-columns: 1fr 1fr; text-align: left; gap: 20px; }
  .site-footer__links ul:last-child { text-align: right; }
  .site-footer__row--bottom { padding: 40px 0 30px; }

  /* Menu overlay */
  .menu-overlay nav a { font-size: clamp(36px, 10vw, 60px); }
}

/* ── MOBILE (max 480px) ── */
@media (max-width: 480px) {
  .hero__portrait {
    height: 100vh;    /* fallback */
    height: 100svh;   /* svh = small viewport height — STABLE on iOS, never resizes when address bar hides */
    width: 100vw;
    position: absolute;
    bottom: 0;
    left: 0;
    display: block;
  }
  .hero__img--blur { display: none; }
  .hero__img--clear {
    position: absolute;
    bottom: 32vh;     /* slightly above ATEMPORALIA text */
    left: 50%;
    transform: translateX(-50%);
    width: 130vw;
    height: auto;
    max-width: none;
    object-fit: unset;
    object-position: unset;
  }
  .hero__bg-text { font-size: clamp(28px, 14vw, 65px); top: 10%; }
  .hero__tagline { bottom: 120px; max-width: 140px; font-size: 12px; }
  .pill-nav__item--muted { display: none; }

  .manifesto__lead h2 { font-size: 22px; line-height: 1.3; }

  .group__img { width: 100%; height: auto; }

  .site-footer__links { grid-template-columns: 1fr 1fr; }

  .wordmark {
    margin-left: -20px;
    margin-right: -20px;
    padding: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    /* iOS: ensure wordmark fits correctly */
    width: calc(100% + 40px);
    font-size: clamp(24px, 14vw, 65px);
  }
}

/* =========================================================
   Scroll reveal for below-fold sections
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Windows-only font spacing fix
   (class added via JS when navigator.userAgent contains Windows)
   ========================================================= */
.os-windows .hero__bg-text {
  letter-spacing: 0;
}
.os-windows .story__ghost {
  letter-spacing: 0;
}
.os-windows .menu-overlay nav a {
  letter-spacing: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-appear] { opacity: 1 !important; transform: none !important; }
}
