:root {
  --ink: #fffaf1;
  --muted: rgba(255, 250, 241, 0.78);
  --accent: #b85743;
  --shadow: 0 18px 45px rgba(0,0,0,.34);
  --safe-x: clamp(28px, 4.7vw, 76px);
  --safe-y: clamp(22px, 3vw, 38px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #121718; }
body {
  min-height: 100svh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}
button, a { font: inherit; }
button { color: inherit; }

.cover {
  position: relative;
  min-height: 100svh;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #1b1d1a;
}

.cover__image {
  position: absolute;
  inset: 0;
  z-index: -7;
  overflow: hidden;
}
.cover__image-inner {
  position: absolute;
  inset: -2.5%;
  background-image: url('assets/jeonju-cover.png');
  background-size: cover;
  background-position: center 50%;
  transform: scale(1.012);
  animation: city-breathe 24s ease-in-out infinite alternate;
  will-change: transform, background-position;
}
@keyframes city-breathe {
  0% { transform: scale(1.012) translate3d(0,0,0); background-position: 50% 50%; }
  100% { transform: scale(1.038) translate3d(-0.28%, -0.18%, 0); background-position: 50.6% 49.7%; }
}

/* Subtle atmospheric movement: enough to keep the street alive, never a game effect. */
.cover__air {
  position: absolute;
  inset: -15%;
  z-index: -6;
  pointer-events: none;
  opacity: .18;
  background:
    radial-gradient(circle at 70% 58%, rgba(255,205,142,.18), transparent 22%),
    radial-gradient(circle at 47% 25%, rgba(214,232,240,.12), transparent 28%);
  filter: blur(24px);
  animation: air-drift 17s ease-in-out infinite alternate;
}
@keyframes air-drift {
  from { transform: translate3d(-1.2%, .4%, 0) scale(1); opacity: .12; }
  to   { transform: translate3d(1.6%, -1%, 0) scale(1.035); opacity: .23; }
}
.cover__glow {
  position: absolute;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  background: radial-gradient(ellipse at 69% 69%, rgba(255,177,97,.16), transparent 18%);
  mix-blend-mode: screen;
  animation: street-glow 8s ease-in-out infinite;
}
@keyframes street-glow {
  0%,100% { opacity: .25; transform: translateX(-.4%); }
  50% { opacity: .56; transform: translateX(.6%); }
}

.cover__veil {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(10,14,14,.70) 0%, rgba(10,14,14,.38) 34%, rgba(10,14,14,.06) 64%, rgba(10,14,14,.12) 100%),
    linear-gradient(180deg, rgba(0,0,0,.13) 0%, rgba(0,0,0,.02) 42%, rgba(0,0,0,.29) 100%);
}
.cover__vignette {
  position: absolute;
  inset: 0;
  z-index: -3;
  box-shadow: inset 0 0 165px rgba(0,0,0,.28);
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: max(var(--safe-y), env(safe-area-inset-top)) var(--safe-x) 0;
  z-index: 10;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand__seal {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #29211d;
  background: #f7f1e7;
  border: 1px solid rgba(70,52,42,.16);
  box-shadow: 0 9px 28px rgba(0,0,0,.20);
  flex: 0 0 auto;
  line-height: 1;
}
.brand__seal-main {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .10em;
}
.brand__seal-rule {
  margin-top: 6px;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: .18em;
}
.brand__wordmark {
  display: grid;
  gap: 5px;
  transform: translateY(-1px);
  text-shadow: 0 2px 15px rgba(0,0,0,.48);
}
.brand__wordmark strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 1.38vw, 23px);
  letter-spacing: .13em;
  white-space: nowrap;
}
.brand__wordmark small {
  color: rgba(255,250,241,.72);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .20em;
  white-space: nowrap;
}

.controls { display: flex; align-items: center; gap: 13px; }
.lang-switch { display: flex; align-items: center; gap: 7px; font-size: 17px; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.lang {
  appearance: none; border: 0; background: transparent; padding: 8px 2px; cursor: pointer;
  opacity: .62; transition: opacity .2s ease, transform .2s ease;
}
.lang:hover, .lang:focus-visible, .lang.is-active { opacity: 1; }
.lang.is-active { transform: translateY(-1px); }
.sound-button {
  width: 62px; height: 62px; border-radius: 50%; border: 1px solid rgba(255,255,255,.60);
  background: rgba(8,14,16,.20); backdrop-filter: blur(8px); cursor: pointer;
  display: grid; place-content: center; gap: 2px; box-shadow: 0 7px 25px rgba(0,0,0,.14);
  transition: background .2s ease, transform .2s ease;
}
.sound-button:hover { transform: translateY(-1px); background: rgba(8,14,16,.34); }
.sound-button__icon { font-size: 20px; line-height: 1; }
.sound-button__label { font-size: 8px; letter-spacing: .11em; }
.sound-button[aria-pressed="true"] { background: rgba(30,84,73,.42); }
.menu-button {
  width: 40px; height: 40px; padding: 9px; border: 0; background: transparent; opacity: .95;
  display: grid; align-content: center; gap: 5px;
}
.menu-button span { height: 1.5px; width: 100%; background: currentColor; border-radius: 99px; }
.menu-button:disabled { opacity: .9; }

.hero {
  position: absolute;
  left: var(--safe-x);
  top: 51%;
  transform: translateY(-43%);
  width: min(650px, 50vw);
  z-index: 5;
  text-shadow: 0 4px 26px rgba(0,0,0,.38);
}
.hero__eyebrow {
  margin: 0 0 16px;
  color: #f2a17e;
  font-size: clamp(12px, 1.02vw, 16px);
  font-weight: 700;
  letter-spacing: .23em;
}
.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 5.55vw, 88px);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.038em;
  text-wrap: balance;
}
.hero__intro {
  margin: 23px 0 0;
  max-width: 600px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 1.95vw, 31px);
  line-height: 1.22;
}
.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  margin-top: 27px;
}
.start-button {
  min-width: 270px;
  border: 1px solid rgba(255,247,236,.76);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(190,83,63,.97), rgba(154,61,49,.97));
  padding: 15px 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .2s ease, filter .2s ease;
}
.start-button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.start-button:active { transform: translateY(0); }
.passport-link {
  border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left;
  display: grid; gap: 3px; color: rgba(255,255,255,.82); font-size: 13px;
  text-shadow: 0 2px 12px rgba(0,0,0,.66);
}
.passport-link strong { color: #fff; font-size: 14px; }


/* Leaf overlay uses selected transparent PNG assets. */
.leaves { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 4; }
.leaf {
  position: absolute;
  top: var(--start-y, -14vh);
  width: var(--size);
  height: var(--size);
  opacity: var(--opacity);
  filter: blur(var(--blur)) drop-shadow(0 5px 8px rgba(35,16,8,.26));
  will-change: transform, opacity;
  animation: leaf-fall var(--duration) linear forwards;
  transform-origin: 50% 50%;
}
.leaf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@keyframes leaf-fall {
  0% {
    transform: translate3d(0,0,0) rotate(var(--rot0)) scale(var(--scale));
    opacity: 0;
  }
  10% {
    opacity: var(--opacity);
  }
  35% {
    transform: translate3d(var(--drift-a), 31vh, 0) rotate(var(--rot1)) scale(calc(var(--scale) * 1.02));
  }
  68% {
    transform: translate3d(var(--drift-b), 68vh, 0) rotate(var(--rot2)) scale(calc(var(--scale) * .97));
  }
  100% {
    transform: translate3d(var(--drift-c), 112vh, 0) rotate(var(--rot3)) scale(calc(var(--scale) * .92));
    opacity: 0;
  }
}

.demo-toast {
  position: fixed;
  left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  max-width: calc(100vw - 36px); padding: 10px 15px; border-radius: 999px;
  background: rgba(12,18,18,.78); color: #fff; backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14); font-size: 12px; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 30;
}
.demo-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 820px) {
  :root { --safe-x: 22px; --safe-y: 17px; }
  .cover__image-inner { background-position: 58% center; animation-name: city-breathe-mobile; }
  @keyframes city-breathe-mobile {
    0% { transform: scale(1.025) translate3d(0,0,0); background-position: 58% 50%; }
    100% { transform: scale(1.052) translate3d(-.18%, -.12%, 0); background-position: 59% 49.7%; }
  }
  .cover__veil {
    background:
      linear-gradient(180deg, rgba(4,9,10,.40) 0%, rgba(4,9,10,.10) 24%, rgba(4,9,10,.19) 48%, rgba(4,9,10,.64) 100%),
      linear-gradient(90deg, rgba(4,9,10,.12), rgba(4,9,10,.03));
  }
  .brand { gap: 9px; }
  .brand__seal { width: 50px; height: 50px; }
  .brand__seal-main { font-size: 9.5px; }
  .brand__seal-rule { font-size: 5.3px; margin-top: 5px; }
  .brand__wordmark strong { font-size: 15px; letter-spacing: .10em; }
  .brand__wordmark small { display: none; }
  .controls { gap: 7px; }
  .lang-switch { font-size: 14px; gap: 5px; }
  .sound-button { width: 50px; height: 50px; }
  .menu-button { width: 36px; height: 36px; padding: 8px; }
  .hero {
    left: var(--safe-x);
    right: var(--safe-x);
    top: auto;
    bottom: clamp(52px, 8vh, 82px);
    transform: none;
    width: auto;
  }
  .hero__eyebrow { font-size: 10.5px; letter-spacing: .17em; margin-bottom: 11px; }
  .hero h1 { font-size: clamp(44px, 14vw, 66px); line-height: .95; }
  .hero__intro { margin-top: 15px; font-size: clamp(18px, 5vw, 25px); max-width: 94%; }
  .hero__actions { margin-top: 20px; gap: 11px; }
  .start-button { min-width: min(290px, 88vw); padding: 14px 24px; font-size: 19px; }
  .passport-link { font-size: 12px; }
  .passport-link strong { font-size: 13px; }
}

@media (max-width: 430px) {
  :root { --safe-x: 16px; }
  .topbar { align-items: flex-start; }
  .brand { gap: 7px; }
  .brand__seal { width: 47px; height: 47px; }
  .brand__wordmark strong { font-size: 12px; letter-spacing: .075em; }
  .controls { margin-left: auto; gap: 5px; }
  .lang-switch { font-size: 12px; }
  .sound-button { width: 46px; height: 46px; }
  .menu-button { width: 32px; height: 32px; }
  .hero { bottom: 42px; }
  .hero h1 { font-size: clamp(42px, 13.5vw, 58px); }
  .hero__intro { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .leaves { display: none; }
}
#coverTheme { display: none; }
