:root {
  --night-1: #0c1020;
  --ink: #f4f1ea;
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

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

/* the page itself never scrolls, zooms or pans — gestures only switch the text */
html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-body);
  background: var(--night-1);
  color: var(--ink);
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.nav-logo img {
  height: 62px;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
  transition: transform 0.25s ease;
}
.nav-logo:hover img { transform: scale(1.04); }

.nav-x {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
  transition: color 0.2s ease, transform 0.25s ease;
}

.nav-x svg {
  width: 26px;
  height: 26px;
  display: block;
}

.nav-x:hover {
  color: #ffc964;
  transform: translateY(-50%) scale(1.1);
}

/* ---------- Hero ---------- */

.stage {
  height: 100%;
}

.hero {
  position: relative;
  height: 100svh;
  min-height: 480px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
  animation: bg-breathe 28s ease-in-out infinite alternate;
  will-change: transform;
}

/* slow "living painting" drift — display transform only, the file is untouched */
@keyframes bg-breathe {
  from { transform: scale(1); }
  to   { transform: scale(1.045) translateY(-0.4%); }
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% 42%, rgba(6, 8, 18, 0.18) 0%, rgba(6, 8, 18, 0) 55%),
    linear-gradient(180deg, rgba(6, 8, 18, 0.42) 0%, rgba(6, 8, 18, 0.05) 26%, rgba(6, 8, 18, 0) 55%, rgba(9, 12, 24, 0.5) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  transform: translateY(-9vh);
  display: grid;
}

/* stacked slides: the old text leaves first, the new one enters after a pause */
.slide {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: 0s;               /* fade-out starts immediately */
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: 0.5s;             /* fade-in waits for the old text to clear */
  pointer-events: auto;
}

.slide.is-past {
  transform: translateY(-34px);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7.2vw, 6.2rem);
  line-height: 1.02;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow:
    0 4px 18px rgba(8, 10, 22, 0.55),
    0 14px 60px rgba(8, 10, 22, 0.45);
  animation: rise-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title-sm {
  font-size: clamp(2.1rem, 4.8vw, 4.2rem);
  animation: none;
}

.hero-sub {
  margin: 22px auto 0;
  max-width: 620px;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.65;
  font-weight: 600;
  color: rgba(244, 241, 234, 0.88);
  text-shadow: 0 2px 14px rgba(8, 10, 22, 0.65);
}

/* ---------- Scroll hint ---------- */

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(244, 241, 234, 0.55);
  text-shadow: 0 1px 8px rgba(8, 10, 22, 0.6);
  animation: hint-float 2.2s ease-in-out infinite;
  transition: opacity 0.5s ease;
}

/* terminal-style blinking cursor */
.scroll-hint::after {
  content: "_";
  margin-left: 2px;
  animation: hint-blink 1.1s steps(2, start) infinite;
}

.scroll-hint.is-hidden { opacity: 0; }

@keyframes hint-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

@keyframes hint-blink {
  50% { opacity: 0; }
}

/* ---------- Copyright ---------- */

.copyright {
  position: absolute;
  left: 28px;
  bottom: 24px;
  z-index: 2;
  font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: rgba(244, 241, 234, 0.6);
  text-shadow: 0 1px 8px rgba(8, 10, 22, 0.6);
  animation: rise-in 0.9s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.copyright-comment {
  display: block;
  color: rgba(244, 241, 234, 0.38);
  margin-bottom: 2px;
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .nav { padding: 18px 16px; }
  .nav-logo img { height: 48px; }
  .nav-x { right: 16px; }
  .nav-x svg { width: 22px; height: 22px; }
  .hero-content { transform: translateY(-4vh); }
  .copyright { left: 16px; bottom: 14px; font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title, .copyright, .scroll-hint, .scroll-hint::after, .hero-bg { animation: none; }
  .slide { transition: opacity 0.3s ease; transform: none; }
  .slide.is-past { transform: none; }
}
