/* LÜBECK — A Walk Through Time. The menu is the only 2D surface (§16): it should
   read as a printed plate, not a web app. Fonts are vendored (OFL); failure falls
   back to a serif stack without layout breakage. */

@font-face {
  font-family: 'UnifrakturMaguntia';
  src: url('../vendor/fonts/unifrakturmaguntia-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../vendor/fonts/eb-garamond-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../vendor/fonts/eb-garamond-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../vendor/fonts/eb-garamond-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #efe6d2;
  --ink: #2a2620;
  --display: 'UnifrakturMaguntia', 'Times New Roman', serif;
  --body: 'EB Garamond', Georgia, 'Times New Roman', serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

canvas#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#ui-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-family: var(--body);
  color: var(--paper);
}

/* Small centered hint (pointer-lock, paused) — quiet, period-toned. */
.overlay-hint {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  padding: 0.5em 1.4em;
  background: rgba(20, 17, 12, 0.72);
  border: 1px solid rgba(239, 230, 210, 0.35);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* --- Fade veil for era switches (§7.7) --- */
#fade-veil {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* --- Menu: a printed plate, not a web app (§16) --- */
.menu-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #171410 0%, #0a0908 100%);
  pointer-events: auto;
}

.menu-plate {
  width: min(860px, 92vw);
  max-height: 94vh;
  padding: 2.2rem 3rem 2.4rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.85);
  border: 1px solid #c9bda2;
  outline: 3px double #8d8064;
  outline-offset: -10px;
  text-align: center;
  overflow-y: auto;
}

#engraving {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.8rem;
}

/* Illustrated home banner — framed inside the plate like a printed plate figure. */
.menu-hero {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  border: 1px solid #8d8064;
  box-shadow: 0 1px 8px rgba(20, 17, 12, 0.35);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Bird's-eye map row (§16 addition) — quiet inline links under the era cards. */
.map-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  font-family: var(--body);
}

.map-label {
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.map-year {
  font-family: var(--display);
  font-size: 1.05rem;
  background: transparent;
  color: var(--ink);
  border: none;
  border-bottom: 1px solid #8d8064;
  padding: 0 0.15em 0.05em;
  cursor: pointer;
}

.map-year:hover,
.map-year:focus-visible {
  background: rgba(141, 128, 100, 0.14);
}

.menu-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4.2vw, 3rem);
  letter-spacing: 0.02em;
  margin-bottom: 0.15em;
}

.menu-subtitle {
  font-family: var(--body);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  margin-bottom: 1.6rem;
}

.era-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.era-card {
  font-family: var(--body);
  background: transparent;
  color: var(--ink);
  border: 1px solid #8d8064;
  padding: 0.9rem 0.7rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.era-card:hover,
.era-card:focus-visible {
  background: rgba(141, 128, 100, 0.14);
  transform: translateY(-2px);
}

.era-year {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  margin-bottom: 0.35em;
}

.era-caption {
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
}

.era-info {
  font-family: var(--body);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.45;
  min-height: 4.2em;
  max-width: 640px;
  margin: 0 auto;
}

/* --- Loading --- */
.loading-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #0a0908;
}

.loading-text {
  font-family: var(--body);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--paper);
}

.loading-bar {
  width: min(360px, 60vw);
  height: 2px;
  background: rgba(239, 230, 210, 0.2);
}

.loading-fill {
  height: 100%;
  width: 0;
  background: var(--paper);
  transition: width 0.2s ease;
}

.loading-slow {
  font-family: var(--body);
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(239, 230, 210, 0.65);
  max-width: 420px;
  text-align: center;
}

/* --- Paused / help --- */
.paused-screen {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 3, 0.45);
  pointer-events: auto;
}

.help-screen {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.help-hint {
  bottom: auto;
  top: 8%;
}
