/* DUBAI NIGHT® — main.css
   Techniques reverse-engineered from 14islands.com:
   CSS-Modules-like BEM naming, letter-split nav, marquee, fixed global canvas. */

:root {
  --bg: #06060e;
  --bg-2: #0b0a1a;
  --ink: #eae6da;
  --ink-dim: rgba(234, 230, 218, 0.55);
  --gold: #d9a441;
  --amber: #ffb45e;
  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", sans-serif;
  --nav-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--gold); color: var(--bg); }

/* ————— global canvas ————— */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

/* GL slot elements are transparent markers the renderer scissors onto */
.gl-slot { position: absolute; inset: 0; opacity: 0; }

/* ————— nav ————— */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  mix-blend-mode: difference; /* readable over any shader scene */
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}
.wordmark sup { font-size: 0.5em; margin-left: 2px; }
.nav__links { display: flex; gap: 40px; }
.nav__link {
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.22em;
}
.nav__clock {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* letter-split animation (the "W o r k" spread on the source site) */
.split { display: inline-flex; overflow: hidden; }
.split > span {
  display: inline-block;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  white-space: pre;
}
.split > span:nth-child(odd)  { transform: translateY(0); }
a:hover .split > span:nth-child(odd),
a:focus-visible .split > span:nth-child(odd) { transform: translateY(-0.12em); }
a:hover .split > span:nth-child(even),
a:focus-visible .split > span:nth-child(even) { transform: translateY(0.12em); }
.split > span { transition-delay: calc(var(--i) * 24ms); }

/* ————— reveal on scroll ————— */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s cubic-bezier(0.16,1,0.3,1), transform 1s cubic-bezier(0.16,1,0.3,1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ————— hero ————— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 32px 64px;
}
.hero__visual { position: absolute; inset: 0; z-index: 0; }
.hero__visual::before { content: ""; position: absolute; inset: 0; } /* keeps box for scissor */
.hero__content { position: relative; z-index: 1; max-width: 1400px; }
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  margin-bottom: 24px;
}
.eyebrow--gold { color: var(--gold); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(56px, 11vw, 168px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.hero__line { display: block; overflow: hidden; }
.hero__line--mix { color: var(--gold); -webkit-text-stroke: 0; }
.hero__sub {
  margin-top: 32px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 46ch;
}
.cta {
  display: inline-block;
  margin-top: 40px;
  padding: 16px 28px;
  border: 1px solid rgba(234,230,218,0.35);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.22em;
  transition: border-color 0.5s, background 0.5s;
  backdrop-filter: blur(4px);
}
.cta:hover { border-color: var(--gold); background: rgba(217,164,65,0.08); }
.hero__scrollhint {
  position: absolute;
  right: 32px; bottom: 64px;
  width: 1px; height: 72px;
  background: rgba(234,230,218,0.2);
  overflow: hidden;
}
.hero__scrollhint span {
  position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--gold);
  animation: scrolldrip 2.2s cubic-bezier(0.65,0,0.35,1) infinite;
}
@keyframes scrolldrip { 70% { top: 100%; } 100% { top: 100%; } }

/* ————— marquee ————— */
.marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(234,230,218,0.14);
  border-bottom: 1px solid rgba(234,230,218,0.14);
  padding: 18px 0;
  overflow: hidden;
  /* transparent: the global canvas is the page background */
}
.marquee__track { display: flex; white-space: nowrap; will-change: transform; animation: marquee 28s linear infinite; }
.marquee__track span {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 20px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  padding-right: 16px;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ————— sections ————— */
.section-head { padding: 140px 32px 64px; max-width: 1400px; margin: 0 auto; }
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.nights, .journal, .contact, .hero { position: relative; z-index: 1; }

/* ————— night cards ————— */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0 32px 140px;
  max-width: 1400px;
  margin: 0 auto;
}
.card {
  position: relative;
  border: 1px solid rgba(234,230,218,0.14);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(11,10,26,0.22); /* translucent: orb scene shows through */
  transition: border-color 0.6s;
}
.card:hover { border-color: rgba(217,164,65,0.6); }
.card__visual {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.card__visual .gl-slot { position: absolute; inset: 0; }
.card__meta { padding: 24px; }
.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.card__line { font-size: 14px; color: var(--ink); }
.card__line--dim { color: var(--ink-dim); margin-top: 4px; }
.card__index {
  position: absolute;
  top: 18px; right: 20px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--gold);
  z-index: 1;
}

/* ————— manifesto ————— */
.manifesto { position: relative; min-height: 200vh; z-index: 1; }
.manifesto__visual { position: sticky; top: 0; height: 100vh; height: 100svh; }
.manifesto__content {
  position: sticky;
  top: 0;
  height: 100vh;
  margin-top: -100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 0 24px;
  z-index: 1;
}
.manifesto__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.6vw, 72px);
  line-height: 1.12;
  max-width: 20ch;
}
.manifesto__line:nth-child(odd) { color: var(--gold); }

/* ————— journal ————— */
.journal__list { list-style: none; max-width: 1400px; margin: 0 auto; padding: 0 32px 140px; }
.journal__item a {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid rgba(234,230,218,0.14);
  text-decoration: none;
  color: var(--ink);
  transition: padding-left 0.6s cubic-bezier(0.16,1,0.3,1);
}
.journal__item a:hover { padding-left: 16px; }
.journal__no { font-size: 12px; letter-spacing: 0.2em; color: var(--gold); }
.journal__name { font-size: clamp(18px, 2.4vw, 30px); font-weight: 400; }
.journal__date { font-size: 12px; letter-spacing: 0.2em; color: var(--ink-dim); text-align: right; }

/* ————— contact ————— */
.contact {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 140px 24px;
}
.contact__mail {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 5vw, 72px);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  background: linear-gradient(var(--gold), var(--gold)) left bottom / 0% 2px no-repeat;
  transition: background-size 0.8s cubic-bezier(0.16,1,0.3,1);
}
.contact__mail:hover { background-size: 100% 2px; }
.contact__meta { margin-top: 32px; color: var(--ink-dim); line-height: 1.8; font-size: 15px; }
.contact__meta a { color: var(--gold); text-decoration: none; }

/* ————— footer ————— */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 32px;
  border-top: 1px solid rgba(234,230,218,0.14);
}
.footer__line { font-size: 12px; letter-spacing: 0.14em; color: var(--ink-dim); }
.footer .wordmark { font-size: 13px; }

/* ————— perf hud (?perf=1) ————— */
.perf-hud {
  position: fixed;
  left: 12px; bottom: 12px;
  z-index: 99;
  font: 11px/1.5 ui-monospace, monospace;
  color: #0f0;
  background: rgba(0,0,0,0.7);
  padding: 8px 10px;
  border-radius: 6px;
  pointer-events: none;
}

/* ————— responsive ————— */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .nav__clock { display: none; }
  .nav__links { gap: 20px; }
  .hero__scrollhint { display: none; }
}

/* ————— reduced motion ————— */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .hero__scrollhint span { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .split > span { transition: none !important; }
}
