@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");
@import url("https://cdn.jsdelivr.net/gh/MonadABXY/mona-font/web/mona.css");

:root {
  color-scheme: only light;
  --bg-light: #f5f5f7;
  --bg-dark: #0b0d12;
  --ink: #1d1d1f;
  --ink-soft: rgba(29, 29, 31, 0.72);
  --white: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.78);
  --blue: #0071e3;
  --blue-light: #7dc0ff;
  --gold: #ffd37a;
  --gold-soft: rgba(255, 211, 122, 0.14);
  --surface-dark: #161a22;
  --surface-dark-2: #202633;
  --surface-light: #ffffff;
  --line-light: rgba(0, 0, 0, 0.08);
  --line-dark: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.16);
  --shadow-deep: 0 28px 70px rgba(0, 0, 0, 0.32);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --pill: 999px;
  --font-display: "SF Pro Display", "Apple SD Gothic Neo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text: "SF Pro Text", "Apple SD Gothic Neo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-pixel: "Press Start 2P", var(--font-text);
  --font-mona: "Mona12", var(--font-text);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: #87940f;
}

body {
  background: var(--bg-light);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

a,
button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 56px;
  padding: 10px 14px 12px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
}

.topbar-brand {
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.ghost-button,
.action,
.action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--pill);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--white);
  font-size: 13px;
  cursor: pointer;
}

.page,
.stage-shell {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 16px 14px 36px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.panel-light {
  background: var(--surface-light);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.panel-dark {
  background: linear-gradient(180deg, #12161f 0%, #0c0f16 100%);
  color: var(--white);
  box-shadow: var(--shadow-deep);
}

.progress-panel,
.stage-panel,
.completion-panel {
  padding: 20px 18px;
}

.stage-topline,
.stage-header,
.progress-meta,
.actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.progress-title,
.stage-title,
.completion-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.progress-title {
  font-size: 28px;
}

.stage-title,
.completion-panel h2 {
  font-size: 32px;
}

.status-chip,
.stage-chip,
.reveal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-chip,
.stage-chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white-soft);
}

.panel-light .status-chip,
.panel-light .stage-chip {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-soft);
}

.reveal-chip {
  background: rgba(125, 192, 255, 0.14);
  color: var(--blue-light);
}

.code-board {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.code-display {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.code-slot {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-dark-2);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.code-slot[data-state="hidden"] {
  color: rgba(255, 255, 255, 0.28);
}

.progress-meter {
  height: 6px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.panel-light .progress-meter {
  background: rgba(0, 0, 0, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 220ms ease;
}

.progress-meta {
  color: var(--white-soft);
  font-size: 13px;
}

.panel-light .progress-meta {
  color: var(--ink-soft);
}

.stage-directory-panel {
  order: 3;
}

.reveal-panel {
  order: 2;
}

.stage-panel {
  order: 1;
  display: grid;
  gap: 18px;
}

.completion-panel {
  order: 4;
}

.stage-message,
.stage-prompt,
.stage-hint,
.completion-panel p,
.progress-panel p {
  margin: 0;
  color: inherit;
}

.panel-dark .stage-message,
.panel-dark .stage-prompt,
.panel-dark .stage-hint,
.panel-dark .completion-panel p,
.panel-dark .progress-panel p {
  color: var(--white-soft);
}

.panel-light .stage-message,
.panel-light .stage-prompt,
.panel-light .stage-hint {
  color: var(--ink-soft);
}

.stage-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.stage-form input,
.stage-form button {
  min-height: 48px;
  border-radius: 14px;
}

.stage-form input {
  padding: 0 14px;
  border: 1px solid var(--line-light);
  background: #fbfbfd;
  color: var(--ink);
}

.stage-form button,
.action {
  border: 1px solid transparent;
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
}

.action-secondary {
  border: 1px solid rgba(0, 113, 227, 0.24);
  background: transparent;
  color: var(--blue);
}

.panel-dark .action-secondary {
  border-color: rgba(125, 192, 255, 0.24);
  color: var(--blue-light);
}

.completion-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.stage-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.stage-nav-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 14px;
  border-radius: 14px;
  background: #f7f8fb;
  color: var(--ink);
}

.panel-dark .stage-nav-link {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.stage-nav-link[data-current="true"] {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.stage-nav-link[data-state="solved"] .stage-nav-char {
  color: var(--blue);
}

.stage-nav-order {
  font-size: 11px;
  color: var(--ink-soft);
}

.panel-dark .stage-nav-order {
  color: rgba(255, 255, 255, 0.52);
}

.stage-nav-title,
.stage-nav-char {
  font-family: var(--font-display);
}

.stage-nav-title {
  font-size: 18px;
  font-weight: 600;
}

.stage-nav-char {
  font-size: 18px;
  font-weight: 700;
}

body[data-stage-state="solved"] .stage-chip {
  background: rgba(0, 113, 227, 0.14);
  color: var(--blue);
}

body[data-page-kind="stage"],
body[data-page-kind="answer-status"],
body[data-page-kind="stage-select"] {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background: #f2dfad;
  font-family: var(--font-pixel);
  isolation: isolate;
}

body[data-page-kind="stage"]::before,
body[data-page-kind="answer-status"]::before,
body[data-page-kind="stage-select"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("./stage-bg.png") center center / cover no-repeat;
}

body[data-page-kind="answer-status"],
body[data-page-kind="stage-select"] {
  color: #050505;
}

.game-topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  z-index: 100;
  display: flex;
  gap: 8px;
  width: min(calc(100% - 28px), 430px);
  transform: translateX(-50%);
}

.game-topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(42, 22, 7, 0.45);
  border-radius: 0;
  background: transparent;
  color: #2a1607;
  font-family: var(--font-mona);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  box-shadow: none;
}

.game-topbar-link[aria-current="page"] {
  background: transparent;
}

body[data-page-kind="stage"] .stage-shell {
  padding-top: clamp(56px, 11vh, 116px);
}

body[data-page-kind="answer-status"] .utility-shell,
body[data-page-kind="stage-select"] .utility-shell {
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding-top: calc(env(safe-area-inset-top, 0px) + 70px);
  padding-bottom: 70px;
}

body[data-page-kind="stage-select"] .utility-shell {
  align-items: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 84px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
}

body[data-page-kind="stage"] .stage-panel {
  background: transparent;
  box-shadow: none;
  color: #050505;
}

.utility-panel {
  display: grid;
  gap: 18px;
  border: 2px solid rgba(82, 48, 22, 0.58);
  background: rgba(255, 244, 203, 0.72);
  box-shadow:
    inset 0 2px 0 rgba(255, 249, 218, 0.64),
    0 8px 26px rgba(56, 33, 14, 0.26);
}

body[data-page-kind="answer-status"] .utility-panel,
body[data-page-kind="stage-select"] .utility-panel {
  overflow: visible;
}

body[data-page-kind="stage-select"] .stage-select-list {
  padding-bottom: 24px;
}

body[data-page-kind="answer-status"] .utility-panel,
body[data-page-kind="stage-select"] .utility-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.utility-title {
  margin: 0;
  color: #050505;
  font-family: var(--font-mona);
  font-size: clamp(1.3rem, 6vw, 2rem);
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
}

.utility-copy {
  margin: 0;
  color: #050505;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 700;
}

.utility-empty {
  margin: 0;
  color: #2a1607;
  font-weight: 700;
}

.answer-list,
.stage-select-list {
  display: grid;
  gap: 10px;
}

body[data-page-kind="answer-status"] .answer-list {
  gap: 22px;
  padding: 0 18px;
}

body[data-page-kind="answer-status"] .utility-copy {
  padding: 0 18px;
  white-space: nowrap;
}

.answer-status-card,
.stage-select-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 14px;
  border: 2px solid rgba(82, 48, 22, 0.56);
  border-radius: 8px;
  background: rgba(255, 245, 214, 0.54);
  color: #2a1607;
}

body[data-page-kind="answer-status"] .answer-status-card {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.answer-status-stage,
.stage-select-title,
.stage-select-state {
  font-family: var(--font-pixel);
  font-size: 11px;
}

.answer-status-value {
  font-family: var(--font-pixel);
  font-size: 22px;
  text-transform: uppercase;
}

.stage-select-state {
  color: rgba(42, 22, 7, 0.68);
}

body[data-page-kind="stage"] .stage-title,
body[data-page-kind="stage"] .stage-prompt,
body[data-page-kind="stage"] .stage-hint,
body[data-page-kind="stage"] .stage-message {
  color: #050505;
  font-weight: 700;
  text-shadow:
    0 2px 8px rgba(255, 255, 255, 0.55);
}

body[data-page-kind="stage"] .stage-title,
body[data-page-kind="stage"] .completion-panel h2,
body[data-page-kind="stage"] .status-chip,
body[data-page-kind="stage"] .stage-chip,
body[data-page-kind="stage"] .reveal-chip,
body[data-page-kind="stage"] .stage-form button,
body[data-page-kind="stage"] .action,
body[data-page-kind="stage"] .completion-code {
  font-family: var(--font-pixel);
}

body[data-page-kind="stage"] .stage-title {
  margin-bottom: 26px;
}

body[data-page-kind="stage"] .stage-form {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 52px);
  z-index: 20;
  width: min(calc(100% - 28px), 402px);
  transform: translateX(-50%);
}

@media (max-width: 480px) {
  body[data-page-kind="stage"] .stage-shell {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  }

  body[data-page-kind="stage"] .stage-form {
    position: static;
    width: 100%;
    margin-top: clamp(180px, 32vh, 300px);
    transform: none;
  }
}

body[data-page-kind="stage"] .stage-form input {
  min-height: 52px;
  padding: 0 4px;
  border: 0;
  border-bottom: 3px solid rgba(42, 22, 7, 0.82);
  border-radius: 0;
  background: rgba(255, 245, 214, 0.18);
  color: #2a1607;
  font-family: var(--font-pixel);
  font-weight: 700;
  box-shadow: inset 0 -10px 16px rgba(255, 236, 174, 0.22);
}

body[data-page-kind="stage"] .stage-form input::placeholder {
  color: rgba(42, 22, 7, 0.58);
  font-family: var(--font-pixel);
  font-weight: 700;
}

body[data-page-kind="stage"] .stage-form input:focus {
  border-bottom-color: rgba(0, 0, 0, 0.95);
  outline: 0;
  background: rgba(255, 245, 214, 0.28);
}

body[data-page-kind="stage"] .stage-form button {
  min-height: 52px;
  border: 2px solid rgba(82, 48, 22, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 235, 177, 0.96) 0%, rgba(204, 151, 75, 0.94) 100%);
  color: #2a1607;
  box-shadow:
    inset 0 2px 0 rgba(255, 249, 218, 0.72),
    inset 0 -3px 0 rgba(111, 63, 24, 0.34),
    0 4px 0 rgba(75, 44, 18, 0.7);
  text-shadow: 0 1px 0 rgba(255, 245, 205, 0.7);
}

body[data-page-kind="stage"] .stage-form button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 249, 218, 0.54),
    inset 0 -1px 0 rgba(111, 63, 24, 0.28),
    0 1px 0 rgba(75, 44, 18, 0.7);
}

@media (hover: hover) {
  body[data-page-kind="stage"] .stage-form button:hover {
    background:
      linear-gradient(180deg, rgba(255, 242, 194, 0.98) 0%, rgba(221, 166, 83, 0.96) 100%);
  }
}

body[data-page-kind="home"] {
  background: #87940f;
  color: #f4ecdf;
  overflow: hidden;
}

body[data-page-kind="home"] .topbar {
  background: rgba(6, 8, 14, 0.42);
  backdrop-filter: blur(18px);
}

body[data-page-kind="home"] .page,
.home-page {
  width: 100%;
}

.home-page {
  position: relative;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  padding: 0;
  isolation: isolate;
  overflow: hidden;
}

.home-background-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: url('./background.png') center bottom / cover no-repeat;
}

.home-page::before,
.home-page::after {
  display: none;
}

.home-cosmos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 16px 14px 0;
  position: relative;
  z-index: 1;
}

.home-scrollband,
.home-lore,
.home-ending {
  position: relative;
  z-index: 1;
}

.home-copy-flow {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}

.home-copy-topline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.home-kicker,
.home-state-inline {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-kicker {
  background: var(--gold-soft);
  color: var(--gold);
}

.home-state-inline {
  background: rgba(125, 192, 255, 0.12);
  color: var(--blue-light);
}

.home-overline {
  margin: 16px 0 0;
  color: rgba(244, 236, 223, 0.7);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-title {
  margin: 14px 0 0;
  color: #fff6e5;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2.9rem, 13vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.home-copy {
  margin: 18px 0 0;
  color: rgba(246, 241, 232, 0.9);
  font-size: 16px;
  line-height: 1.75;
}

.home-portal-scene {
  position: relative;
  display: block;
  min-height: 360px;
  cursor: pointer;
  margin-top: 6px;
  image-rendering: pixelated;
  z-index: 2;
}

.home-portal-scene:focus-visible {
  outline: 2px solid rgba(173, 212, 255, 0.92);
  outline-offset: 8px;
}

/* ================================================================
   PIXEL-ART SCENE — high-detail 2-D dot style
   ================================================================ */

.pixel-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  image-rendering: pixelated;
}

.pixel-mountain,
.pixel-platform,
.pixel-path,
.pixel-arch,
.pixel-mist,
.pixel-ground {
  position: absolute;
}

/* ---- back mountain (distant, misty, visible) ---- */

.pixel-mountain-back {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110%;
  height: 78%;
  z-index: 0;
  background:
    /* rock-band texture */
    repeating-linear-gradient(176deg,
      transparent 0px, transparent 6px,
      rgba(255, 255, 255, 0.03) 6px, rgba(255, 255, 255, 0.03) 7px
    ),
    linear-gradient(180deg,
      #6a7a8e 0%,
      #5e7084 18%,
      #52667a 38%,
      #485c70 58%,
      #3e5468 78%,
      #364c60 100%
    );
  clip-path: polygon(
    0% 100%,
    0% 54%, 2% 50%, 5% 46%, 8% 42%, 12% 38%,
    16% 34%, 20% 30%, 24% 27%, 28% 24%, 32% 20%,
    36% 17%, 40% 15%, 44% 12%, 47% 10%, 50% 8%,
    53% 10%, 56% 12%, 60% 15%, 64% 18%, 68% 20%,
    70% 18%, 73% 16%, 76% 18%, 80% 22%, 84% 28%,
    88% 34%, 92% 40%, 96% 48%, 100% 54%,
    100% 100%
  );
}

/* back mountain highlight face */
.pixel-mountain-back::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg,
    rgba(140, 160, 180, 0.2) 0%,
    transparent 30%,
    rgba(90, 110, 130, 0.12) 50%,
    transparent 80%
  );
  clip-path: inherit;
}

/* ---- left mountain (tall, richly textured) ---- */

.pixel-mountain-left {
  bottom: 0;
  left: -6%;
  width: 54%;
  height: 96%;
  z-index: 2;
  background:
    /* vertical crack lines */
    repeating-linear-gradient(95deg,
      transparent 0px, transparent 14px,
      rgba(0, 0, 0, 0.06) 14px, rgba(0, 0, 0, 0.06) 15px
    ),
    /* horizontal strata */
    repeating-linear-gradient(178deg,
      transparent 0px, transparent 8px,
      rgba(0, 0, 0, 0.04) 8px, rgba(0, 0, 0, 0.04) 9px
    ),
    linear-gradient(160deg,
      #3a4a58 0%,
      #344456 12%,
      #2e3e50 28%,
      #28384a 44%,
      #223244 60%,
      #1e2c3e 76%,
      #1a2838 100%
    );
  clip-path: polygon(
    0% 100%,
    0% 20%, 2% 18%, 5% 15%, 8% 12%, 12% 9%,
    16% 6%, 20% 4%, 24% 2%, 28% 0%, 30% 1%,
    33% 3%, 36% 6%, 38% 5%, 41% 7%, 44% 10%,
    48% 14%, 52% 18%, 56% 24%, 60% 30%,
    64% 36%, 68% 42%, 72% 48%, 76% 54%,
    80% 60%, 84% 66%, 88% 72%, 92% 78%,
    96% 86%, 100% 94%,
    100% 100%
  );
}

/* cliff face highlight (light hitting left side) */
.pixel-mountain-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* bright edge highlight */
    linear-gradient(130deg,
      rgba(120, 150, 170, 0.2) 0%,
      rgba(100, 130, 150, 0.12) 15%,
      transparent 30%
    ),
    /* shadow side */
    linear-gradient(240deg,
      transparent 0%,
      rgba(10, 18, 28, 0.2) 60%,
      rgba(10, 18, 28, 0.35) 100%
    );
  clip-path: inherit;
}

/* waterfall streak */
.pixel-mountain-left::after {
  content: "";
  position: absolute;
  left: 58%;
  top: 22%;
  width: 4px;
  height: 42%;
  background: linear-gradient(180deg,
    rgba(210, 230, 250, 0.4) 0%,
    rgba(190, 215, 240, 0.3) 20%,
    rgba(170, 200, 235, 0.2) 45%,
    rgba(160, 195, 230, 0.1) 70%,
    transparent 100%
  );
  filter: blur(1px);
}

/* ---- right mountain (tall, richly textured) ---- */

.pixel-mountain-right {
  bottom: 0;
  right: -6%;
  width: 50%;
  height: 92%;
  z-index: 2;
  background:
    /* vertical crack lines */
    repeating-linear-gradient(85deg,
      transparent 0px, transparent 12px,
      rgba(0, 0, 0, 0.05) 12px, rgba(0, 0, 0, 0.05) 13px
    ),
    /* horizontal strata */
    repeating-linear-gradient(182deg,
      transparent 0px, transparent 10px,
      rgba(0, 0, 0, 0.04) 10px, rgba(0, 0, 0, 0.04) 11px
    ),
    linear-gradient(200deg,
      #404e5e 0%,
      #3a4858 14%,
      #344254 30%,
      #2e3c4e 48%,
      #283648 64%,
      #223042 80%,
      #1e2c3c 100%
    );
  clip-path: polygon(
    0% 100%,
    0% 90%, 3% 84%, 6% 78%, 10% 70%,
    14% 62%, 18% 54%, 22% 46%, 26% 40%,
    30% 34%, 34% 28%, 38% 22%, 42% 17%,
    46% 13%, 50% 9%, 54% 6%, 58% 4%,
    62% 2%, 66% 0%, 68% 1%, 71% 3%,
    74% 2%, 77% 4%, 80% 7%, 84% 11%,
    88% 16%, 92% 20%, 96% 24%, 100% 28%,
    100% 100%
  );
}

/* cliff face highlight on right */
.pixel-mountain-right::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* bright edge */
    linear-gradient(210deg,
      rgba(110, 140, 160, 0.18) 0%,
      rgba(90, 120, 145, 0.1) 15%,
      transparent 28%
    ),
    /* shadow side */
    linear-gradient(120deg,
      transparent 0%,
      rgba(10, 18, 28, 0.15) 55%,
      rgba(10, 18, 28, 0.28) 100%
    );
  clip-path: inherit;
}

/* rock ledge detail */
.pixel-mountain-right::after {
  content: "";
  position: absolute;
  right: 30%;
  top: 35%;
  width: 20%;
  height: 2px;
  background: rgba(80, 100, 120, 0.25);
  box-shadow:
    0 12px 0 rgba(80, 100, 120, 0.18),
    0 28px 0 rgba(80, 100, 120, 0.12),
    0 48px 0 rgba(80, 100, 120, 0.08);
}

/* ---- mist / fog layers (visible, atmospheric) ---- */

.pixel-mist {
  left: 0;
  right: 0;
  pointer-events: none;
}

.pixel-mist-high {
  bottom: 58%;
  height: 18%;
  z-index: 1;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(180, 200, 215, 0.08) 20%,
    rgba(170, 192, 210, 0.16) 45%,
    rgba(160, 185, 205, 0.12) 65%,
    transparent 100%
  );
}

.pixel-mist-mid {
  bottom: 36%;
  height: 22%;
  z-index: 5;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(190, 205, 210, 0.12) 18%,
    rgba(180, 198, 208, 0.26) 44%,
    rgba(170, 192, 204, 0.18) 68%,
    transparent 100%
  );
}

.pixel-mist-low {
  bottom: 14%;
  height: 20%;
  z-index: 8;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(190, 205, 200, 0.1) 22%,
    rgba(180, 198, 194, 0.2) 48%,
    rgba(170, 190, 186, 0.1) 74%,
    transparent 100%
  );
}

/* ---- central green platform (mossy hill) ---- */

.pixel-platform {
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  width: 56%;
  height: 32%;
  z-index: 6;
  background:
    /* grass/moss texture */
    repeating-linear-gradient(175deg,
      transparent 0px, transparent 4px,
      rgba(60, 100, 30, 0.08) 4px, rgba(60, 100, 30, 0.08) 5px
    ),
    linear-gradient(180deg,
      #96c85e 0%,
      #84b852 6%,
      #72a648 14%,
      #62963e 26%,
      #528636 40%,
      #44762e 56%,
      #386628 72%,
      #2c5620 86%,
      #224418 100%
    );
  clip-path: polygon(
    0% 100%,
    1% 76%, 4% 64%, 8% 52%, 14% 42%,
    20% 32%, 26% 24%, 32% 18%, 38% 12%,
    44% 7%, 48% 4%, 52% 1%, 55% 0%,
    58% 2%, 62% 6%, 66% 10%, 72% 18%,
    78% 28%, 82% 36%, 86% 46%,
    90% 56%, 94% 68%, 97% 78%, 100% 90%,
    100% 100%
  );
  box-shadow:
    inset 0 -24px 36px rgba(16, 32, 10, 0.5),
    0 24px 50px rgba(0, 0, 0, 0.25);
}

/* bright moss highlight on top edge */
.pixel-platform::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(200, 240, 140, 0.3) 0%,
      rgba(180, 225, 120, 0.18) 10%,
      rgba(160, 210, 100, 0.08) 22%,
      transparent 38%
    );
  clip-path: inherit;
}

/* dark underside shadow */
.pixel-platform::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 60%,
    rgba(10, 24, 8, 0.3) 80%,
    rgba(8, 18, 6, 0.45) 100%
  );
  clip-path: inherit;
}

/* ---- stone stairway ---- */

.pixel-path {
  left: 50%;
  bottom: 24%;
  width: 28%;
  height: 36%;
  transform: translateX(-50%);
  z-index: 7;
}

.pixel-step {
  position: absolute;
  left: 50%;
  height: 3.4%;
  background: linear-gradient(180deg,
    #e2d8b6 0%,
    #d4c8a2 40%,
    #c4b892 70%,
    #b4a882 100%
  );
  box-shadow:
    0 2px 0 rgba(100, 90, 64, 0.35),
    inset 0 1px 0 rgba(255, 250, 230, 0.35);
  image-rendering: pixelated;
}

.pixel-step-1 { bottom: 0%;  width: 84%; transform: translateX(-50%); }
.pixel-step-2 { bottom: 8%;  width: 78%; transform: translateX(-48%); }
.pixel-step-3 { bottom: 17%; width: 70%; transform: translateX(-52%); }
.pixel-step-4 { bottom: 27%; width: 62%; transform: translateX(-47%); }
.pixel-step-5 { bottom: 38%; width: 54%; transform: translateX(-53%); }
.pixel-step-6 { bottom: 50%; width: 46%; transform: translateX(-47%); }
.pixel-step-7 { bottom: 64%; width: 38%; transform: translateX(-53%); }
.pixel-step-8 { bottom: 80%; width: 30%; transform: translateX(-48%); }

/* ---- stone arch / portal gate ---- */

.pixel-arch {
  left: 50%;
  bottom: 48%;
  transform: translateX(-50%);
  width: 26%;
  height: 26%;
  z-index: 7;
  background:
    /* stone grain */
    repeating-linear-gradient(92deg,
      transparent 0px, transparent 5px,
      rgba(0, 0, 0, 0.04) 5px, rgba(0, 0, 0, 0.04) 6px
    ),
    linear-gradient(180deg,
      #9a9278 0%,
      #8a8468 14%,
      #7a7660 30%,
      #6a6854 48%,
      #5e5c4a 66%,
      #525042 84%,
      #48463c 100%
    );
  clip-path: polygon(
    0% 100%, 0% 28%, 4% 22%, 10% 14%, 18% 8%, 28% 3%,
    40% 0%, 60% 0%, 72% 3%, 82% 8%, 90% 14%, 96% 22%, 100% 28%, 100% 100%,
    78% 100%, 78% 40%, 72% 30%, 64% 22%, 56% 18%, 50% 16%,
    44% 18%, 36% 22%, 28% 30%, 22% 40%, 22% 100%
  );
  box-shadow:
    inset 0 -10px 20px rgba(30, 28, 22, 0.35),
    0 16px 32px rgba(0, 0, 0, 0.25);
}

/* stone light/shadow faces */
.pixel-arch::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg,
      rgba(220, 210, 180, 0.18) 0%,
      transparent 22%
    ),
    linear-gradient(180deg,
      transparent 50%,
      rgba(40, 36, 28, 0.15) 100%
    );
  clip-path: inherit;
}

/* glowing portal inside the arch */
.pixel-arch-inner {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 50%;
  height: 74%;
  background: linear-gradient(180deg,
    rgba(140, 215, 255, 0.9) 0%,
    rgba(100, 180, 255, 0.92) 24%,
    rgba(60, 130, 240, 0.88) 52%,
    rgba(30, 80, 180, 0.82) 100%
  );
  clip-path: polygon(
    0% 100%, 0% 36%, 8% 22%, 20% 12%, 34% 4%, 50% 0%,
    66% 4%, 80% 12%, 92% 22%, 100% 36%, 100% 100%
  );
  box-shadow:
    0 0 40px rgba(100, 180, 255, 0.5),
    0 0 80px rgba(80, 150, 255, 0.25),
    0 0 120px rgba(60, 120, 240, 0.12),
    inset 0 0 24px rgba(255, 255, 255, 0.18);
}

/* ---- stone ground (bottom of the valley) ---- */

.pixel-ground {
  left: 0;
  right: 0;
  bottom: 0;
  height: 16%;
  z-index: 9;
  background:
    /* stone block texture */
    repeating-linear-gradient(88deg,
      transparent 0px, transparent 18px,
      rgba(0, 0, 0, 0.06) 18px, rgba(0, 0, 0, 0.06) 19px
    ),
    repeating-linear-gradient(178deg,
      transparent 0px, transparent 10px,
      rgba(0, 0, 0, 0.05) 10px, rgba(0, 0, 0, 0.05) 11px
    ),
    linear-gradient(180deg,
      #484058 0%,
      #403852 14%,
      #3a324c 30%,
      #342e46 48%,
      #2e2840 66%,
      #28223a 82%,
      #221e34 100%
    );
  clip-path: polygon(
    0% 0%, 2% 8%, 5% 3%, 9% 12%, 14% 5%, 19% 14%,
    24% 7%, 29% 15%, 34% 8%, 39% 14%, 44% 6%, 49% 16%,
    54% 8%, 59% 14%, 64% 5%, 69% 12%, 74% 4%, 79% 13%,
    84% 6%, 89% 14%, 94% 4%, 97% 10%, 100% 3%,
    100% 100%, 0% 100%
  );
  box-shadow: inset 0 14px 28px rgba(80, 70, 100, 0.2);
}

/* stone surface highlights */
.pixel-ground::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* top-edge light */
    linear-gradient(180deg,
      rgba(120, 110, 140, 0.2) 0%,
      transparent 18%
    ),
    /* color variation */
    linear-gradient(90deg,
      rgba(70, 60, 90, 0.25) 0%,
      rgba(55, 48, 75, 0.1) 16%,
      rgba(70, 60, 90, 0.18) 32%,
      rgba(55, 48, 75, 0.1) 48%,
      rgba(70, 60, 90, 0.2) 64%,
      rgba(55, 48, 75, 0.1) 80%,
      rgba(70, 60, 90, 0.22) 100%
    );
}

.portal-halo,
.portal-ring,
.portal-rift {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.portal-halo-back {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(74, 141, 255, 0.58) 0%, rgba(74, 141, 255, 0.16) 34%, transparent 66%);
  filter: blur(8px);
  opacity: 0.54;
}

.portal-rift {
  width: 92px;
  height: 92px;
  background:
    radial-gradient(circle, rgba(138, 197, 255, 0.95) 0%, rgba(84, 150, 255, 0.9) 32%, rgba(38, 82, 186, 0.5) 68%, transparent 76%);
  box-shadow:
    0 0 46px rgba(92, 158, 255, 0.28),
    inset 0 0 30px rgba(255, 255, 255, 0.12);
  opacity: 0.72;
}

.portal-halo-front {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 233, 188, 0.28) 0%, rgba(255, 233, 188, 0.06) 34%, transparent 68%);
  filter: blur(4px);
  opacity: 0.58;
}

.portal-ring {
  border: 1px solid rgba(196, 225, 255, 0.28);
}

.portal-ring-a {
  width: 124px;
  height: 124px;
  animation: portal-spin 24s linear infinite;
}

.portal-ring-b {
  width: 102px;
  height: 102px;
  border-style: dashed;
  animation: portal-spin-reverse 18s linear infinite;
}

.portal-ring-c {
  width: 82px;
  height: 82px;
  border-color: rgba(255, 222, 172, 0.24);
  animation: portal-pulse 4.2s ease-in-out infinite;
}

.portal-entry-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  color: rgba(255, 249, 239, 0.96);
  font-family: "Apple Chancery", "Snell Roundhand", "URW Chancery L", cursive;
  font-size: clamp(2.4rem, 11vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.28),
    0 0 34px rgba(118, 185, 255, 0.34);
  animation: portal-entry-breathe 3.6s ease-in-out infinite;
}

.portal-fragments {
  position: absolute;
  inset: 0;
}

.portal-fragments span {
  position: absolute;
  padding: 8px 12px;
  border-radius: var(--pill);
  background: rgba(28, 34, 40, 0.36);
  color: rgba(239, 244, 255, 0.78);
  font-size: 11px;
  letter-spacing: 0.08em;
  animation: fragment-drift 7s ease-in-out infinite;
}

.portal-fragments span:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.portal-fragments span:nth-child(2) { top: 16%; right: 8%; animation-delay: 1s; }
.portal-fragments span:nth-child(3) { top: 70%; left: 6%; animation-delay: 2s; }
.portal-fragments span:nth-child(4) { top: 76%; right: 12%; animation-delay: 1.4s; }
.portal-fragments span:nth-child(5) { top: 34%; left: 0; animation-delay: 2.8s; }
.portal-fragments span:nth-child(6) { top: 52%; right: 0; animation-delay: 3.4s; }

.home-scrollband,
.home-lore,
.home-ending {
  padding-left: 14px;
  padding-right: 14px;
}

.home-scrollband {
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

.home-scrollband p {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 235, 198, 0.18);
  color: rgba(248, 242, 232, 0.82);
  font-size: 14px;
  line-height: 1.7;
}

.home-lore {
  display: grid;
  gap: 24px;
  padding-top: 28px;
}

.home-card-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-lore-block h2,
.home-ending h2 {
  margin: 14px 0 0;
  color: #fff5df;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2rem, 9vw, 2.9rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.home-lore-block p,
.home-ending p {
  margin: 16px 0 0;
  color: rgba(248, 242, 232, 0.86);
  font-size: 15px;
  line-height: 1.8;
}

/* completion overlay — positioned over the full viewport */
.home-ending {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
}

.home-ending[hidden] {
  display: none;
}

.home-ending .completion-code {
  margin-top: 22px;
}

@keyframes portal-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes portal-spin-reverse {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes portal-pulse {
  0%, 100% { opacity: 0.64; transform: translate(-50%, -50%) scale(0.98); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes fragment-drift {
  0%, 100% { transform: translateY(0); opacity: 0.72; }
  50% { transform: translateY(-12px); opacity: 1; }
}

@keyframes portal-entry-breathe {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 18px rgba(83, 170, 255, 0.22),
      0 12px 28px rgba(0, 0, 0, 0.28);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow:
      0 0 26px rgba(83, 170, 255, 0.36),
      0 14px 32px rgba(0, 0, 0, 0.34);
  }
}

@keyframes portal-enter-float {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-6px);
  }
}

@keyframes portal-enter-fade-breathe {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.68;
  }
}

/* ================================================================
   CINEMATIC HOME — game title screen
   ================================================================ */

/* ---- Animated fog overlay ---- */

.fog-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.fog-layer {
  position: absolute;
  width: 200%;
  height: 100%;
  background:
    radial-gradient(ellipse at 12% 48%, rgba(200, 215, 225, 0.09) 0%, transparent 48%),
    radial-gradient(ellipse at 52% 32%, rgba(200, 215, 225, 0.12) 0%, transparent 42%),
    radial-gradient(ellipse at 82% 58%, rgba(200, 215, 225, 0.07) 0%, transparent 52%),
    radial-gradient(ellipse at 38% 72%, rgba(200, 215, 225, 0.1) 0%, transparent 46%);
}

.fog-1 {
  animation: fogDrift1 55s linear infinite;
}

.fog-2 {
  animation: fogDrift2 38s linear infinite;
  opacity: 0.55;
}

@keyframes fogDrift1 {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes fogDrift2 {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* ---- Hero section (mobile-first, bottom-aligned) ---- */

.home-hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 48px) 14px 0;
}

.hero-content {
  width: 100%;
  max-width: 440px;
  margin-top: clamp(12px, 3vh, 42px);
  text-align: center;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-eyebrow {
  display: inline-block;
  min-height: 26px;
  padding: 3px 14px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  color: #d4af37;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 26px;
}

.hero-eyebrow:empty {
  display: none;
}

.hero-title {
  margin: 0 0 6px;
  font-family: "Noto Serif KR", "Iowan Old Style", serif;
  font-size: clamp(1.48rem, 6.35vw, 2.65rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1.2px;
  color: #fff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 2px 12px rgba(0, 0, 0, 0.8),
    0 4px 24px rgba(0, 0, 0, 0.6);
}

.hero-title-line {
  display: inline;
}

.hero-title-line-nowrap {
  display: inline-block;
  font-size: 1em;
  letter-spacing: -1.6px;
  white-space: nowrap;
}

.hero-title-logo {
  display: block;
  width: clamp(320px, 104vw, 560px);
  max-width: none;
  height: auto;
  margin: -64px 0 -84px 50%;
  transform: translateX(-50%);
  filter: none;
}

.hero-subtitle {
  margin: 0 0 14px;
  font-size: 0.8rem;
  letter-spacing: 5px;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-copy {
  display: grid;
  gap: 1px;
  margin: 0 auto 20px;
  font-size: 14px;
  line-height: 1.05;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 2px 8px rgba(0, 0, 0, 0.8),
    0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-copy span {
  display: block;
}

/* ---- Menu items (touch-optimized glass buttons) ---- */

.hero-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.95rem;
  font-family: "Noto Serif KR", serif;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.menu-item:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.97);
}

@media (hover: hover) {
  .menu-item:hover {
    background: rgba(255, 255, 255, 0.88);
    color: #1a1a1a;
    transform: scale(1.03);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
    border-color: transparent;
  }
}

.menu-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

/* ---- Portal entry (centered on the portal) ---- */

.portal-enter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: auto;
  max-width: none;
  padding: 0 24px calc(env(safe-area-inset-bottom, 0px) + 34px);
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
  z-index: 4;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-pixel);
  font-size: clamp(1.14rem, 4.55vw, 1.85rem);
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  text-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.48);
  box-shadow: none;
  animation: portal-enter-fade-breathe 3.6s ease-in-out infinite;
  transition: color 180ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.portal-enter:active {
  transform: none;
}

@media (hover: hover) {
  .portal-enter:hover {
    color: rgba(255, 255, 255, 1);
  }
}

.portal-enter:focus-visible {
  outline: 2px solid rgba(166, 220, 255, 0.9);
  outline-offset: 3px;
}

@keyframes portalEnterPulse {
  0%, 100% {
    opacity: 0.85;
    text-shadow:
      0 0 16px rgba(80, 160, 255, 0.5),
      0 0 32px rgba(60, 130, 255, 0.3),
      0 2px 12px rgba(0, 0, 0, 0.8);
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 28px rgba(100, 180, 255, 0.8),
      0 0 56px rgba(80, 150, 255, 0.5),
      0 0 80px rgba(60, 120, 255, 0.25),
      0 2px 12px rgba(0, 0, 0, 0.8);
  }
}

/* ---- Reduce motion for accessibility ---- */

@media (prefers-reduced-motion: reduce) {
  .hero-content { animation: none; }
  .fog-layer { animation: none; }
  .portal-enter { animation: none; }
}

/* ---- Larger screens (tablet / desktop) ---- */

@media (min-width: 600px) {
  .home-hero {
    justify-content: flex-start;
    padding: 60px 24px 0;
  }

  .hero-content {
    max-width: 760px;
    margin-top: clamp(16px, 4vh, 56px);
  }

  .hero-title {
    font-size: clamp(2.1rem, 4.8vw, 3.4rem);
    letter-spacing: -2.2px;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 1rem;
    letter-spacing: 6px;
    margin-bottom: 20px;
  }

  .hero-copy {
    font-size: 15px;
    margin-bottom: 28px;
  }

  .hero-menu {
    align-items: center;
    max-width: 280px;
    margin: 0 auto;
  }

  .menu-item {
    min-height: 52px;
    font-size: 1rem;
  }
}

/* ---- Very small screens (iPhone SE, etc.) ---- */

@media (max-height: 640px) {
  .hero-subtitle {
    display: none;
  }

  .hero-copy {
    display: none;
  }

  .hero-title {
    font-size: clamp(1.4rem, 6vw, 2rem);
    margin-bottom: 12px;
  }

  .hero-menu {
    gap: 6px;
  }

  .menu-item {
    min-height: 44px;
    font-size: 0.85rem;
  }
}
