:root {
  --paper: #ece3cf;
  --paper-deep: #e2d6bb;
  --ink: #1f1813;
  --ink-soft: rgba(31, 24, 19, 0.72);
  --font: 'IM Fell English', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-sc: 'IM Fell English SC', 'IM Fell English', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

body.walking #view { cursor: none; }
body.hovering #view { cursor: pointer; }

/* A fine double rule around the print on the title page (positioned from script). */
#plate {
  position: fixed;
  box-sizing: border-box;
  border: 1px solid rgba(31, 24, 19, 0.28);
  outline: 1px solid rgba(31, 24, 19, 0.12);
  outline-offset: 6px;
  pointer-events: none;
}

.panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

/* The caption under the print, like the label beside a framed etching. */
#intro {
  width: min(92vw, 640px);
  padding: 2px 12px 6px;
}
#intro h1 {
  font-family: var(--font-sc);
  font-weight: normal;
  letter-spacing: 0.32em;
  font-size: clamp(24px, 3.4vw, 34px);
  margin: 0 0 2px;
  padding-left: 0.32em;
}
#intro .sub { margin: 0 0 8px; font-style: italic; color: var(--ink-soft); font-size: 15px; }
#intro .hint { margin: 0; font-size: 17px; }

#label {
  position: fixed;
  pointer-events: none;
  padding: 3px 9px 4px;
  font-size: 15px;
  font-style: italic;
  background: rgba(236, 227, 207, 0.92);
  box-shadow: 0 0 0 1px rgba(31, 24, 19, 0.4);
  opacity: 0;
  transform: translate(-50%, -130%);
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
#label.show { opacity: 1; }

#hud {
  position: fixed;
  inset: auto 0 18px 0;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
#gravity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sc);
  font-size: 15px;
  letter-spacing: 0.12em;
  padding: 3px 12px 4px;
  background: rgba(236, 227, 207, 0.86);
  box-shadow: 0 0 0 1px rgba(31, 24, 19, 0.35);
  transition: transform 0.35s ease;
}
#gravity.flash { transform: scale(1.12); }
#keys {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 12px 3px;
  font-size: 14px;
  font-style: italic;
  color: var(--ink);
  background: rgba(236, 227, 207, 0.82);
  transition: opacity 1.5s ease;
}
#keys.faded { opacity: 0; }

#pause {
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 420px);
  padding: 22px 24px 14px;
  background: rgba(236, 227, 207, 0.95);
  box-shadow: 0 0 0 1px rgba(31, 24, 19, 0.5), 0 0 0 7px rgba(236, 227, 207, 0.95), 0 0 0 8px rgba(31, 24, 19, 0.3);
  pointer-events: auto;
}
#pause h2 {
  font-family: var(--font-sc);
  font-weight: normal;
  letter-spacing: 0.3em;
  margin: 0 0 14px;
}
#pause button {
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(31, 24, 19, 0.55);
  padding: 7px 18px 8px;
  min-width: 230px;
  cursor: pointer;
}
#pause button:hover, #pause button:focus-visible { background: rgba(31, 24, 19, 0.08); outline: none; }
#pause .small { font-size: 13px; font-style: italic; color: var(--ink-soft); }

#loading {
  position: fixed;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.hidden { opacity: 0 !important; pointer-events: none !important; }
body.shot .panel, body.shot #hud, body.shot #loading, body.shot #label { display: none; }
body.frame .panel, body.frame #plate, body.frame #loading, body.frame #label { display: none; }

@media (max-width: 640px) {
  #intro { padding: 0 8px; }
  #intro .hint { font-size: 15px; }
  #keys { font-size: 12px; padding: 0 16px; }
}
