:root {
  --ink: #254d3a;
  --paper: #f3efdc;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
header, footer { display: flex; justify-content: space-between; align-items: center; }
.brand {
  display: flex; align-items: center; gap: .55rem;
  font: bold 26px Georgia, serif; letter-spacing: -1.5px; text-decoration: none;
}
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
button {
  cursor: pointer; border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: var(--paper); padding: 10px 14px;
  font: 15px/1.2 system-ui, sans-serif;
}
button:hover { background: #183827; }
input { min-width: 0; color: var(--ink); background: transparent; }
footer { position: relative; }
summary { cursor: pointer; list-style: none; text-decoration: underline; font-size: 14px; }
summary::-webkit-details-marker { display: none; }
footer details p {
  position: absolute; right: 0; z-index: 2; width: 320px; padding: 16px;
  border: 1px solid var(--ink); background: var(--paper); font: 14px/1.5 Georgia, serif;
}
:focus-visible { outline: 3px solid #89582e; outline-offset: 3px; }
#notice { font: 14px/1.3 system-ui, sans-serif; }
/* The photograph covers the viewport. Controls sit directly on the print. */
.landing {
  --inset: clamp(16px, 3vw, 42px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--inset);
}
.landscape {
  position: fixed;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.landing header, .landing footer {
  height: auto;
  min-height: 0;
  border: 0;
}
.landing header { align-self: start; }
.landing .brand, .landing summary {
  background: var(--paper);
  padding: 5px 9px;
}
.landing main { display: grid; place-items: center; min-width: 0; }
.landing header { align-items: flex-start; gap: 8px; }
.gate { width: min(100%, 260px); min-width: 0; }
.gate-controls { display: flex; background: var(--paper); border: 1px solid var(--ink); }
.gate input { flex: 1; border: 0; padding: 9px 11px; font: 16px Georgia, serif; }
.gate input::placeholder { color: #42604d; opacity: 1; }
.gate button { padding: 10px 12px; gap: 7px; border: 0; }
.gate input:focus-visible { outline-offset: -3px; }
.gate #notice { margin: 4px 0 0; padding: 7px 10px; background: var(--paper); }

.landing footer { justify-content: flex-end; }

.landing footer details p { bottom: 26px; max-width: calc(100vw - 2 * var(--inset)); }
@media (max-width: 640px) {
  .landscape { object-position: 56% center; }
  .gate { width: 210px; }
  .gate button { padding: 10px; }
}
@media (max-width: 420px) {
  .landing .brand { font-size: 20px; }
  .landing .brand img { display: none; }
  .gate input { padding-inline: 7px; }
  .gate button span { display: none; }
}

.tile-grid {
  width: min(100%, 620px);
  margin: 30px auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
}
.tile {
  position: relative;
  aspect-ratio: 1.65;
  padding: clamp(13px, 2.2vw, 27px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: transform 180ms ease-out;
}
.family-tree { background: var(--ink); color: var(--paper); }
.recipes { background: var(--paper); }
.tile-mark { width: 38px; height: auto; image-rendering: pixelated; }
.tile-arrow { position: absolute; top: 12px; right: 15px; font: 18px/1 system-ui, sans-serif; }
.tile-title, .section-view h1 { font-size: clamp(22px, 3vw, 40px); letter-spacing: -.045em; }
.placeholder { background: rgb(243 239 220 / 46%); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { transform: scale(1.045); z-index: 1; }
}
.tile:focus-visible { transform: scale(1.045); z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  .tile:hover, .tile:focus-visible { transform: none; }
}
.section-view {
  margin: 24px 0; width: min(100%, 460px); padding: clamp(22px, 4vw, 42px);
  background: var(--paper); border: 1px solid var(--ink);
}
.section-view h1 { margin: 26px 0 12px; }
.section-view p { margin: 0; }
@media (max-width: 640px) {
  .tile { aspect-ratio: 1.25; }
  .tile-mark { width: 28px; }
}
.tree-view {
  width: min(100%, 1080px);
  min-width: 0;
}
.tree-view pre {
  margin: 24px 0 0;
  padding-top: 24px;
  border-top: 1px solid #b0bba4;
  font: 500 clamp(14px, 1.18vw, 17px)/1.65 ui-monospace, Menlo, Consolas, monospace;
  font-variant-ligatures: none;
}
.tree-narrow { display: none; }
.reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 959px) {
  .tree-view { width: min(100%, 520px); }
  .tree-wide { display: none; }
  .tree-narrow { display: block; }
  .tree-view pre { font-size: clamp(13px, 3.4vw, 16px); line-height: 1.4; }
}
