/* Landing: a four-scene introduction shown on the first visit (and via "How to visit"). */

.intro {
  position: fixed; inset: 0; z-index: 40;
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto;
  padding: calc(env(safe-area-inset-top) + 56px) 22px calc(env(safe-area-inset-bottom) + 18px);
  background:
    linear-gradient(180deg, oklch(89% 0.045 232) 0, oklch(93.5% 0.028 215) 30%, oklch(97.2% 0.013 85) 70%);
  color: var(--ink);
  overflow: hidden;
}
:root[data-theme="dark"] .intro {
  background:
    radial-gradient(ellipse 70% 40% at 70% 0%, oklch(40% 0.08 250 / .45), transparent 70%),
    linear-gradient(180deg, oklch(15% 0.05 265) 0, oklch(21% 0.055 252) 60%, oklch(19.5% 0.045 258));
}
.intro[hidden] { display: none; }
.intro:focus { outline: none; }
:root[data-first-visit] .intro[hidden] { display: grid; }  /* visible from the first paint */
.intro.is-leaving { animation: intro-out .7s var(--ease-out) forwards; }
@keyframes intro-out { to { opacity: 0; transform: scale(1.04); } }

.intro__skip {
  position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: 12px; z-index: 3;
  min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in oklch, var(--wall) 70%, transparent); color: var(--ink-soft);
  font: inherit; font-size: var(--fs-sm); cursor: pointer;
}

/* ---------- Visual stage ---------- */
.intro__visual { position: relative; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; container-type: size; }   /* one cell, exactly the space the step leaves */
.intro__hero, .intro__model, .intro__card { grid-area: 1 / 1; transition: opacity .7s var(--ease-out), transform .9s var(--ease-out); }
.intro__hero { opacity: 0; transform: scale(.9); }
.intro__model { opacity: 0; transform: translateY(24px) scale(.96); width: min(320px, 80vw); }
.intro__card { opacity: 0; transform: translateY(24px); }
.intro[data-scene="0"] .intro__hero { opacity: 1; transform: none; }
.intro[data-scene="1"] .intro__model, .intro[data-scene="2"] .intro__model, .intro[data-scene="3"] .intro__model,
.intro[data-scene="4"] .intro__model, .intro[data-scene="5"] .intro__model { opacity: 1; transform: none; }
.intro[data-scene="6"] .intro__card { opacity: 1; transform: none; }


/* Mini maquette: a clone of the real one, lit wing by wing. */
.intro__model .maq { pointer-events: none; }
.intro__model .m-you { display: none; }
.intro__model .m-floor { cursor: default; }
.intro__model .m-plinth, .intro__model .m-wingname, .intro__model .m-no { transition: background-color .6s var(--ease-out), box-shadow .6s var(--ease-out), color .6s; }
/* The wing being explained keeps its colour; the other fades back to sand. */
.intro__model.is-wing-1 .m-plinth--2, .intro__model.is-wing-2 .m-plinth--1 { background-color: var(--m-ground); box-shadow: none; }
.intro__model.is-wing-1 .m-wingname--2, .intro__model.is-wing-2 .m-wingname--1,
.intro__model.is-wing-1 .m-no--right, .intro__model.is-wing-2 .m-no--left { color: color-mix(in oklch, var(--ink) 30%, transparent); }
.intro__model.is-wing-1 .m-plinth--1, .intro__model.is-wing-2 .m-plinth--2 { box-shadow: 0 0 0 3px var(--gold-bright), 0 0 calc(var(--u) * 1.6) oklch(85% 0.12 80 / .8); }
.intro__model.is-wing-1 .m-room[data-wing="1"] .m-floor,
.intro__model.is-wing-2 .m-room[data-wing="2"] .m-floor { background-color: color-mix(in oklch, var(--gold-bright) 45%, var(--floor)); box-shadow: inset 0 0 0 2px var(--gold-bright), inset 0 0 calc(var(--u) * 1.3) oklch(85% 0.12 80 / .7); }
.intro__model .m-floor { transition: background-color .6s var(--ease-out), box-shadow .6s var(--ease-out); }
.intro__model.is-wing-1 .m-room[data-wing="1"] .m-num,
.intro__model.is-wing-2 .m-room[data-wing="2"] .m-num { color: var(--gold); }
.intro__model .m-room.is-selected .m-floor { background-color: var(--floor); box-shadow: inset 0 0 0 1px var(--m-line); }
.intro__model .m-room.is-selected .m-num { color: color-mix(in oklch, var(--ink) 55%, transparent); }
.intro__model .m-room.is-demo .m-floor { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 calc(var(--u) * 1.4) color-mix(in oklch, var(--accent) 40%, transparent); }
.intro__model .m-room.is-demo .m-num { color: var(--accent); }

/* A finger that taps, with a ripple. */
.intro__finger {
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 2;
  border-radius: 50%; background: oklch(99% 0.005 80 / .75); box-shadow: 0 0 0 2px var(--accent), 0 6px 16px oklch(20% 0.05 20 / .35);
  opacity: 0; pointer-events: none;
}
.intro__finger.is-tap { animation: tap .5s var(--ease-out); }
.intro__finger.is-tap::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent);
  animation: ripple .8s var(--ease-out) forwards;
}
@keyframes tap { 40% { transform: scale(.78); } }
@keyframes ripple { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.intro__bubble {
  position: absolute; left: 0; top: 0; z-index: 2; transform: translate(-50%, calc(-100% - 30px));
  padding: 7px 14px 6px; border-radius: 999px; white-space: nowrap;
  background: var(--accent); color: var(--wall); font-size: var(--fs-sm);
  box-shadow: 0 10px 24px -12px oklch(20% 0.05 20 / .6);
  opacity: 0; transition: opacity .35s var(--ease-out);
  pointer-events: none;
}
.intro__bubble.is-on { opacity: 1; }
.intro__bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: inherit; transform: rotate(45deg); }

/* Mini room card with a shimmering full-collection button. */
.intro__card {
  width: min(300px, 78vw); padding: 18px 16px 16px; text-align: center;
  background: oklch(33% 0.07 150); color: oklch(96% 0.02 110);
  box-shadow: 0 30px 60px -30px oklch(15% 0.05 150 / .7);
}
.intro__card-no { margin: 0; font-size: var(--fs-xs); letter-spacing: .28em; text-transform: uppercase; opacity: .8; }
.intro__card-name { margin: 2px 0 12px; font-size: var(--fs-xl); line-height: 1; }
.intro__card-prints { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.intro__card-prints img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.intro[data-scene="6"] .intro__card-prints img { animation: print-in .7s var(--ease-out) both; }
.intro[data-scene="6"] .intro__card-prints img:nth-child(2) { animation-delay: .12s; }
.intro[data-scene="6"] .intro__card-prints img:nth-child(3) { animation-delay: .24s; }
.intro__card-text { margin: 10px 0 0; font-size: var(--fs-sm); line-height: 1.35; opacity: .88; }
.intro__card-line.is-short { width: 58%; margin-top: 6px; }
.intro__card-cta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; min-height: 44px; background: oklch(82% 0.08 120); color: oklch(24% 0.05 150); font-size: var(--fs-md);
}
.intro__card-cta svg { width: 12px; height: 12px; }
.intro__card-cta::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, oklch(100% 0 0 / .6) 50%, transparent 70%);
}
.intro[data-scene="6"] .intro__card-cta::after { animation: shimmer 2.4s 1s ease-in-out infinite; }
@keyframes shimmer { 60%, 100% { transform: translateX(120%); } }

/* ---------- Text ---------- */
.intro__text { position: relative; display: grid; max-width: 34rem; margin: 0 auto; width: 100%; text-align: center; }
.intro__step { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .6s var(--ease-out), visibility 0s .6s; }
.intro__step.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: .15s, .15s, 0s; }
.intro__step .kicker { margin-bottom: 8px; }
.intro__step h2 { font-size: clamp(1.9rem, 8vw, 3rem); line-height: 1.02; text-wrap: balance; margin: 0 0 10px; }
.intro__step[data-intro-step="0"] h2 { font-size: clamp(2.6rem, 12vw, 4.4rem); }
.intro__step h2 .of { display: block; font-style: italic; font-size: .5em; color: var(--ink-soft); margin-bottom: .1em; }
.intro__step p { margin: 0; color: var(--ink-soft); font-size: var(--fs-md); text-wrap: pretty; }
.intro__step p b { font-weight: 500; color: var(--ink); }

/* ---------- Navigation ---------- */
.intro__nav { display: grid; justify-items: center; gap: 10px; margin-top: 18px; }
.intro__dots { display: flex; gap: 8px; }
.intro__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); opacity: .2; transition: opacity .3s, width .4s var(--ease-out), border-radius .4s; }
.intro__dots i.is-on { opacity: .8; width: 22px; border-radius: 4px; }
.intro__next {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: min(100%, 360px); min-height: 54px; border: 0; border-radius: var(--r-btn);
  background: var(--accent); color: var(--wall);
  font: inherit; font-size: var(--fs-md); letter-spacing: .02em; cursor: pointer;
  box-shadow: 0 16px 28px -16px color-mix(in oklch, var(--accent) 85%, transparent);
}
.intro__alt { visibility: hidden; min-height: 44px; border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.intro[data-scene="6"] .intro__alt { visibility: visible; }

/* ---------- Map additions: "How to visit" and the tap hint ---------- */
.mapview__how {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 44px; padding: 0 14px 0 8px;
  border: 1px solid var(--line); border-radius: 999px; background: color-mix(in oklch, var(--wall) 70%, transparent);
  color: var(--ink-soft); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.mapview__how span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--wall); font-size: var(--fs-xs); }
.mapview__progress + .mapview__how { margin-left: 10px; }

.m-hint {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  transform: translate(-50%, calc(-100% - 22px));
  padding: 7px 14px 6px; border-radius: 999px; white-space: nowrap;
  background: var(--accent); color: var(--wall); font-size: var(--fs-sm);
  box-shadow: 0 10px 24px -12px oklch(20% 0.05 20 / .6);
  opacity: 0; transition: opacity .35s var(--ease-out);
}
.m-hint.is-on { opacity: 1; animation: hint-bob 2.4s var(--ease-out) infinite; }
.m-hint::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: inherit; transform: rotate(45deg); }
.m-hint-dot {
  position: absolute; left: 0; top: 0; z-index: 3; width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none;
  border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity .35s;
}
.m-hint-dot.is-on { opacity: 1; }
.m-hint-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); animation: ping 1.8s var(--ease-out) infinite; }
@keyframes hint-bob { 50% { transform: translate(-50%, calc(-100% - 27px)); } }
.maq.is-flying .m-hint, .maq.is-flying .m-hint-dot { opacity: 0; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .intro {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 64px;
    padding: 72px max(48px, 6vw) 48px;
  }
  .intro__visual { grid-column: 1; grid-row: 1 / 3; }
  .intro__text { grid-column: 2; align-self: end; text-align: left; margin: 0; }
  .intro__nav { grid-column: 2; justify-items: start; align-self: start; }
  .intro__model { width: min(420px, 38vw); }
  .intro__card { width: 340px; }
}


/* ---------- Language switch in the top bar ---------- */
.lang {
  flex: none; min-width: 44px; min-height: 44px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink);
  font: inherit; font-size: var(--fs-xs); letter-spacing: .14em; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .lang:hover { border-color: var(--accent); color: var(--accent); } }
.bar .lang { margin-left: auto; }
.bar .lang + .switch { margin-left: 4px; }
:root[lang="id"] .roomlist button.is-visited::after { content: "Dikunjungi"; }



/* Short phones: keep the mini card clear of the text below it. */
@media (max-height: 760px) {
  .intro__card { width: min(250px, 68vw); padding: 12px 12px 12px; }
  .intro__card-name { font-size: var(--fs-xl); margin-bottom: 8px; }
  .intro__card-line { display: none; }
  .intro__card-cta { margin-top: 10px; min-height: 40px; }
}

/* ---------- Landing: Back and Next side by side ---------- */
.intro__buttons { display: flex; gap: 10px; width: min(100%, 420px); }
.intro__buttons .intro__next { flex: 1; width: auto; }
.intro__back[hidden] { display: none; }
.intro__back {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 54px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--r-btn);
  background: color-mix(in oklch, var(--wall) 70%, transparent); color: var(--ink);
  font: inherit; font-size: var(--fs-md); cursor: pointer;
}
.intro__back svg { width: 14px; height: 14px; }

/* Short phones (iPhone SE and smaller): give the picture room by tightening the copy, and only
   reserve space for the "prefer scrolling?" link on the step that shows it. */
@media (max-height: 640px) and (max-width: 899px) {
  .intro { padding-top: calc(env(safe-area-inset-top) + 50px); }
  .intro__step .kicker { margin-bottom: 4px; }
  .intro__step h2 { font-size: 1.6rem; margin-bottom: 6px; }
  .intro__step[data-intro-step="0"] h2 { font-size: 2.3rem; }
  .intro__step p { line-height: 1.45; }
  .intro__nav { margin-top: 12px; gap: 8px; }
  .intro__alt { display: none; min-height: 32px; font-size: var(--fs-xs); position: relative; }
  .intro__alt::after { content: ""; position: absolute; inset: -7px 0; }   /* 46px hit area */
  .intro[data-scene="6"] .intro__alt { display: block; }
}
/* The sample room card shrinks to the height the step leaves it. */
@container (max-height: 260px) {
  .intro__card { width: max(200px, min(250px, 68vw, calc((100cqh - 132px) * 2.4 + 36px))); padding: 10px 12px; }
  .intro__card-name { font-size: var(--fs-lg); margin-bottom: 6px; }
  .intro__card-line { display: none; }
  .intro__card-cta { margin-top: 8px; min-height: 36px; }
}
@container (max-height: 200px) { .intro__card-prints { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .intro *, .intro { animation: none !important; transition: none !important; }
  .m-hint.is-on { animation: none; }
}
