:root {
  --paper: #f6f3ec;
  --mark: #4f5f45;
  --ink: #1f2a22;
  --muted: #7d8478;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --edge: clamp(16px, 2.2vw, 36px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151a16;
    --mark: #b7c4a4;
    --ink: #eef1ea;
    --muted: #8e978a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151a16;
  --mark: #b7c4a4;
  --ink: #eef1ea;
  --muted: #8e978a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.hero {
  position: relative;
  height: 100svh;
  overflow: hidden;
}

/* Like a magazine cover, the house stands in front of the masthead. */
.masthead {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  padding: clamp(6px, 1vw, 16px) var(--edge) 0;
  user-select: none;
}
#wordmark {
  margin: 0;
  color: var(--mark);
  font: 400 21vw/0.78 var(--serif); /* refined by fitWordmark() */
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-align: center;
}
.strap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: clamp(6px, 0.8vw, 14px) 0 0;
  padding-bottom: clamp(6px, 0.8vw, 12px);
  border-bottom: 1px solid color-mix(in srgb, var(--mark) 35%, transparent);
  color: var(--mark);
  font: 500 clamp(12px, 1vw, 15px)/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.strap em {
  font: italic 400 clamp(17px, 1.6vw, 26px)/1 var(--serif);
  letter-spacing: 0;
  text-transform: none;
}

/* The house fills everything under the masthead, close enough to touch. */
.stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}
#house {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.2s ease, transform 2s cubic-bezier(0.2, 0.85, 0.25, 1);
}
#house.ready { opacity: 1; transform: none; }
#house.dragging { cursor: grabbing; }
#house.pointing { cursor: pointer; }

.back {
  position: absolute;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  z-index: 3;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(246, 243, 236, 0.88);
  color: #1f2a22;
  box-shadow: 0 8px 26px rgba(40, 32, 20, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px 10px 14px;
  border: 0;
  font: italic 400 22px/1 var(--serif);
  cursor: pointer;
  animation: rise 0.35s cubic-bezier(0.2, 0.85, 0.25, 1);
}
.back[hidden] { display: none; }
.back svg { width: 16px; height: 16px; }
.back:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; }

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.links {
  position: fixed;
  right: var(--edge);
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  gap: 14px;
  font: 500 12px/1 var(--sans);
}
.links a {
  color: var(--ink);
  text-decoration: none;
  text-shadow: 0 0 8px var(--paper), 0 0 2px var(--paper);
  opacity: 0.75;
}
.links a:hover, .links a:focus-visible { opacity: 1; text-decoration: underline; }

@media (max-width: 640px) {
  .strap { font-size: 10px; }
  .links { left: 0; right: 0; justify-content: center; }
  .back { bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  #house { transition: none; transform: none; }
  .back { animation: none; }
}
