/* Miniature Tokyo — city scroll journey */
:root {
  --ink: #f4efe8;
  --ink-dim: rgba(244, 239, 232, .72);
  --night: #0c0a12;
  --night-2: #14101d;
  --panel: rgba(12, 10, 18, .62);
  --line: rgba(244, 239, 232, .14);
  --band-bg: #100d18;
  --band-bg-2: #171222;
  --band-ink: #f4efe8;
  --band-dim: rgba(244, 239, 232, .66);
  --card-bg: rgba(244, 239, 232, .045);
  --accent: #f2b544;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--night);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

/* ---------------- nav ---------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.1rem, 4vw, 3rem);
  transition: background-color .45s ease, box-shadow .45s ease, padding .45s ease;
  background: transparent;
}
.nav-brand {
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  font-size: 1.06rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .55);
}
.nav-brand span { color: var(--accent, #f2b544); font-weight: 800; }
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a {
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .85;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
}
.nav-links a:hover { opacity: 1; }
.nav.solid {
  background: rgba(12, 10, 18, .88);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
  padding-block: .7rem;
}
.nav.solid .nav-brand, .nav.solid .nav-links a { text-shadow: none; }

/* ---------------- journey ---------------- */
.journey-track {
  position: relative;
  height: 800svh; /* 5 scenes × 1.6 viewport heights */
}
.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--night);
}
.scene-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
}
/* first paint never blank: scene 1 poster shows before the engine boots */
.scene-layer[data-scene="0"] { opacity: 1; }
.scene-layer .poster,
.scene-layer .clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-layer .clip { opacity: 0; transition: opacity .35s ease; }
.scene-layer .clip.ready { opacity: 1; }

.ambient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
/* scrim is baked into the clips/posters themselves (zero composite cost) */

/* low-spec rest-state life: three tiny blurred glows, CSS-only motion */
.glow-dot {
  display: none;
  position: absolute;
  z-index: 3;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: .4;
  pointer-events: none;
}
body.lowspec .ambient { display: none; }
body.lowspec .glow-dot { display: block; }
.glow-dot.d1 { left: 12%; top: 22%; background: radial-gradient(circle, rgba(242, 181, 68, .8) 0%, transparent 68%); animation: drift1 11s ease-in-out infinite alternate; }
.glow-dot.d2 { right: 16%; top: 58%; background: radial-gradient(circle, rgba(55, 200, 232, .7) 0%, transparent 68%); animation: drift2 14s ease-in-out infinite alternate; }
.glow-dot.d3 { left: 46%; top: 70%; background: radial-gradient(circle, rgba(155, 108, 240, .7) 0%, transparent 68%); animation: drift3 17s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0, 0); } to { transform: translate(46px, -30px); } }
@keyframes drift2 { from { transform: translate(0, 0); } to { transform: translate(-38px, 26px); } }
@keyframes drift3 { from { transform: translate(0, 0); } to { transform: translate(30px, -34px); } }
body.scrubbing .glow-dot { animation-play-state: paused; }

/* scene copy */
.copy {
  position: absolute;
  z-index: 4;
  left: clamp(1.2rem, 6vw, 6rem);
  bottom: clamp(4.2rem, 12vh, 8rem);
  max-width: min(34rem, 82vw);
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}
.eyebrow {
  margin: 0 0 .55rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}
.title {
  margin: 0 0 .7rem;
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.title::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 3px;
  margin-top: .8rem;
  background: var(--accent);
  border-radius: 2px;
}
.body {
  margin: 0;
  font-size: clamp(.98rem, 1.35vw, 1.12rem);
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 30rem;
}
.ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0 0; }
.cta {
  display: inline-block;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  letter-spacing: .02em;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.cta.primary {
  background: var(--accent);
  color: #17110a;
  box-shadow: 0 6px 28px rgba(155, 108, 240, .45);
}
.cta.secondary {
  border: 1px solid rgba(155, 108, 240, .65);
  color: var(--accent);
}
.cta:hover { transform: translateY(-2px); }

/* dots */
.dots {
  position: absolute;
  z-index: 5;
  right: clamp(1rem, 3vw, 2.2rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 239, 232, .65);
  background: transparent;
  cursor: pointer;
  transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
}
.dots button:hover { transform: scale(1.25); }
.dots button.on { background: var(--dot-accent, #fff); border-color: var(--dot-accent, #fff); transform: scale(1.3); }

.scroll-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 1.3rem;
  transform: translateX(-50%);
  margin: 0;
  font-size: .78rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(244, 239, 232, .75);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  transition: opacity .4s ease;
}
.scroll-hint .chev {
  width: 9px; height: 9px;
  border-right: 2px solid rgba(244, 239, 232, .8);
  border-bottom: 2px solid rgba(244, 239, 232, .8);
  transform: rotate(45deg);
  animation: hint-bob 1.8s ease-in-out infinite;
}
@keyframes hint-bob { 0%, 100% { transform: rotate(45deg) translate(0, 0); } 50% { transform: rotate(45deg) translate(3px, 3px); } }
.scroll-hint.gone { opacity: 0; }

/* ---------------- reduced-motion journey ---------------- */
.rm-journey { display: none; }
.rm-scene { position: relative; }
.rm-scene img { width: 100%; height: min(78svh, 56rem); object-fit: cover; }
.rm-copy {
  padding: 1.6rem clamp(1.2rem, 6vw, 6rem) 3rem;
  background: var(--night-2);
}
.rm-copy .eyebrow { margin-bottom: .4rem; }
.rm-copy h1, .rm-copy h2 { margin: 0 0 .6rem; font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
.rm-copy p { color: var(--ink-dim); max-width: 34rem; line-height: 1.55; }
.rm-copy .ctas a:first-child { margin-right: .8rem; }

/* ---------------- supporting sections ---------------- */
main { background: var(--band-bg); }
.band {
  padding: clamp(4rem, 9vh, 7rem) clamp(1.2rem, 6vw, 6rem);
}
.band + .band { background: var(--band-bg-2); }
.band-head { max-width: 44rem; margin-bottom: 2.6rem; }
.band-eyebrow {
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #e8a94b;
}
.band-head h2 {
  margin: 0 0 .7rem;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  letter-spacing: -.01em;
}
.band-sub { margin: 0; color: var(--band-dim); line-height: 1.55; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: 1.4rem;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 239, 232, .3);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .4);
}
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card-body h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.card-body p { margin: 0; color: var(--band-dim); font-size: .95rem; line-height: 1.5; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.card-grid .card.reveal:nth-child(2) { transition-delay: .12s; }
.card-grid .card.reveal:nth-child(3) { transition-delay: .24s; }

/* ---------------- footer ---------------- */
.footer {
  background: var(--night);
  border-top: 1px solid var(--line);
  padding: 3.2rem clamp(1.2rem, 6vw, 6rem) 2.4rem;
  text-align: center;
}
.footer-brand { font-weight: 800; font-size: 1.2rem; margin: 0 0 .6rem; }
.footer-brand span { color: #e8a94b; }
.footer-line { color: var(--band-dim); margin: 0 auto 1.4rem; max-width: 32rem; line-height: 1.55; }
.footer-links { display: flex; justify-content: center; gap: 1.6rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.footer-links a {
  font-size: .88rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none; opacity: .8;
}
.footer-links a:hover { opacity: 1; }
.footer-fine { font-size: .8rem; color: rgba(244, 239, 232, .4); margin: 0; }

/* ---------------- color scheme ---------------- */
@media (prefers-color-scheme: light) {
  :root {
    --band-bg: #f5f0e8;
    --band-bg-2: #ece5d9;
    --band-ink: #241d16;
    --band-dim: rgba(36, 29, 22, .68);
    --card-bg: rgba(36, 29, 22, .045);
  }
  main, .band-head h2 { color: var(--band-ink); }
  .card { border-color: rgba(36, 29, 22, .14); }
  .card:hover { border-color: rgba(36, 29, 22, .32); box-shadow: 0 18px 44px rgba(36, 29, 22, .16); }
  .footer { background: #ece5d9; color: #241d16; border-top-color: rgba(36, 29, 22, .14); }
  .footer-fine { color: rgba(36, 29, 22, .45); }
  .nav.solid { background: rgba(245, 240, 232, .9); box-shadow: 0 1px 0 rgba(36, 29, 22, .14); }
  .nav.solid .nav-brand, .nav.solid .nav-links a { color: #241d16; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .journey-track { display: none; }
  .rm-journey { display: block; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint .chev { animation: none; }
  .cta, .card { transition: none; }
}

/* ---------------- small screens ---------------- */
@media (max-width: 640px) {
  .nav { padding: .85rem 1.1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: .8rem; }
  .copy { bottom: 5.2rem; }
  .dots { right: .7rem; gap: .7rem; }
  .dots button { width: 10px; height: 10px; }
  .ctas .cta { padding: .7rem 1.2rem; font-size: .88rem; }
}
