/* Latent Lodge — linen, navy ink, brass. Fonts are self-hosted (SIL OFL). */
@font-face { font-family: 'Bricolage Grotesque'; src: url('fonts/bricolage-grotesque-var.woff2') format('woff2'); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('fonts/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #E4ECF2;          /* linen blue */
  --paper: #F7F9FB;       /* pillowcase */
  --ink: #18263D;         /* navy ink */
  --ink-2: #3D4D66;
  --muted: #5B6B82;
  --brass: #B48A3E;       /* key tags, rails */
  --brass-ink: #7A5B22;   /* brass dark enough for text */
  --rule: #C9D3DE;
  --code-bg: #18263D;
  --code-ink: #E4ECF2;
  --focus: #2F6FD6;

  --font-display: 'Bricolage Grotesque', 'Avenir Next Condensed', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-code: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale: 1.25 ratio from 18px body */
  --step--1: 0.889rem;
  --step-0: 1.125rem;
  --step-1: 1.406rem;
  --step-2: 1.758rem;
  --step-3: 2.197rem;
  --step-4: clamp(2.6rem, 5.4vw, 4.4rem);

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101A29;
    --paper: #17243A;
    --ink: #E6EDF5;
    --ink-2: #C3CEDC;
    --muted: #93A3B8;
    --brass: #CFA45A;
    --brass-ink: #E1BE7E;
    --rule: #2A3A52;
    --code-bg: #0B1320;
    --code-ink: #DCE6F0;
    --focus: #7DB0FF;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-body);
  overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--brass); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { color: var(--brass-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
img, svg { max-width: 100%; }
code { font-family: var(--font-code); font-size: 0.86em; background: color-mix(in srgb, var(--paper) 70%, var(--rule)); padding: 0.08em 0.35em; border-radius: 4px; word-break: break-word; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 800; font-stretch: 85%; letter-spacing: -0.025em; }
h2 { font-size: var(--step-3); font-stretch: 90%; margin-top: 0; }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: 68ch; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 48rem; }
.muted { color: var(--muted); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: 40ch; }
.docs .lede, .narrow .lede { max-width: 60ch; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: 0.35rem; }
main > section, main > div, main > article { margin-bottom: clamp(3.5rem, 8vw, 6.5rem); }

/* Header */
.top { border-bottom: 1px solid var(--rule); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 800 1.35rem/1 var(--font-display); font-stretch: 85%; }
.brand-mark { width: 1.4rem; height: 1.75rem; }
nav[aria-label="Main"] { display: flex; gap: clamp(0.9rem, 2.5vw, 1.8rem); flex-wrap: wrap; }
nav[aria-label="Main"] a { text-decoration: none; color: var(--ink-2); padding: 0.4rem 0; border-bottom: 2px solid transparent; }
nav[aria-label="Main"] a:hover, nav[aria-label="Main"] a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brass); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0.55rem 1.25rem; border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 700 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--paper); color: var(--ink); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--brass-ink); border-color: var(--brass-ink); color: #fff; }
.btn-sm { min-height: 2rem; padding: 0.25rem 0.75rem; font-size: 0.85rem; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.75rem 0 2rem; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; padding-top: clamp(3rem, 8vw, 6rem); }
.hero h1 { max-width: 12ch; }
.vacancy { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; color: var(--ink-2); font-size: var(--step--1); }
.vacancy-sign { font: 700 0.95rem/1 var(--font-display); font-stretch: 80%; letter-spacing: 0.04em; color: #B23A48; border: 2px solid currentColor; border-radius: 6px; padding: 0.35rem 0.6rem; text-shadow: 0 0 10px rgba(255, 90, 110, 0.55); box-shadow: 0 0 12px rgba(255, 90, 110, 0.25), inset 0 0 8px rgba(255, 90, 110, 0.18); }
@media (prefers-color-scheme: dark) { .vacancy-sign { color: #FF7A8A; } }

/* The door hanger: the one bold object on the page */
.hanger {
  position: relative; margin: 0; min-width: 0; padding: 5.2rem 1.6rem 1.6rem;
  background: var(--paper); border: 2px solid var(--brass);
  border-radius: 2.6rem 2.6rem 1rem 1rem;
  box-shadow: 0 18px 40px -24px rgba(24, 38, 61, 0.45);
  transform: rotate(2deg); transform-origin: 50% 0;
  animation: sway 2.6s ease-in-out 0.4s 1 both;
}
@keyframes sway { 0% { transform: rotate(-3deg); } 45% { transform: rotate(3.2deg); } 75% { transform: rotate(1.2deg); } 100% { transform: rotate(2deg); } }
.hanger-hole { position: absolute; top: 1.3rem; left: 50%; width: 4.2rem; height: 2.4rem; transform: translateX(-50%); border-radius: 999px; background: var(--bg); border: 2px solid var(--brass); }
.hanger figcaption { display: grid; gap: 0.15rem; margin-bottom: 1.1rem; }
.hanger-title { font: 800 var(--step-3)/1 var(--font-display); font-stretch: 78%; letter-spacing: -0.02em; }
.hanger-sub { font: italic 400 var(--step-0)/1.3 var(--font-body); color: var(--brass-ink); }
.hanger-foot { margin: 1rem 0 0; font-size: var(--step--1); color: var(--muted); }

.code { margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: 0.6rem; padding: 1rem 1.1rem; overflow-x: auto; font: 400 0.84rem/1.6 var(--font-code); }
.code code { background: none; padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }

/* Key board */
.rooms-section h2 { margin-bottom: 0.3rem; }
.section-lede { color: var(--ink-2); margin-bottom: 2.5rem; }
.keyboard { position: relative; }
.rail { position: absolute; left: 0; right: 0; top: 0.8rem; height: 6px; background: linear-gradient(var(--brass), color-mix(in srgb, var(--brass) 70%, #000)); border-radius: 3px; }
.keys { list-style: none; margin-block: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(1rem, 2.4vw, 2rem); }
.key { position: relative; padding-top: 1.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hook { position: absolute; top: 0.35rem; width: 0.75rem; height: 1.6rem; border: 3px solid var(--brass); border-top: none; border-radius: 0 0 999px 999px; }
.fob {
  --w: 9.5rem;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  width: min(100%, var(--w)); padding: 2.6rem 0.8rem 1.6rem;
  background: var(--tag); color: #18263D; text-decoration: none;
  border-radius: 1.4rem 1.4rem 3.2rem 3.2rem; border: 2px solid color-mix(in srgb, var(--tag) 60%, #18263D);
  box-shadow: inset 0 -6px 0 rgba(24, 38, 61, 0.08);
  transform-origin: 50% 0; transition: transform 220ms cubic-bezier(.3,1.6,.5,1);
}
.key:nth-child(odd) .fob { transform: rotate(-2deg); }
.key:nth-child(even) .fob { transform: rotate(1.6deg); }
.fob:hover, .fob:focus-visible { transform: rotate(0) translateY(-4px); color: #18263D; }
.fob-hole { position: absolute; top: 0.85rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--brass); }
.fob-num { font: 800 clamp(2rem, 3.4vw, 2.7rem)/1 var(--font-display); font-stretch: 75%; letter-spacing: -0.02em; }
.fob-name { font: 700 1rem/1.2 var(--font-display); }
.fob-price { font-size: 0.92rem; margin-top: 0.35rem; padding-top: 0.45rem; border-top: 1.5px solid rgba(24, 38, 61, 0.25); width: 80%; }
.key-desc { margin: 1rem 0 0; font-size: var(--step--1); color: var(--ink-2); max-width: 22ch; }

/* Steps — a real sequence, so numbered */
.steps { list-style: none; counter-reset: s; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.steps li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(s); display: block; font: 800 var(--step-2)/1 var(--font-display); color: var(--brass-ink); margin-bottom: 0.6rem; }
.steps h3 { margin-bottom: 0.35rem; }
.steps p { font-size: var(--step--1); color: var(--ink-2); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.note { border-left: 3px solid var(--brass); padding: 0.2rem 0 0.2rem 1rem; color: var(--ink-2); font-size: var(--step--1); }
.endpoints { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.endpoints div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.endpoints dt { font-weight: 700; }
.endpoints dd { margin: 0; overflow-wrap: anywhere; }

.wallet { background: var(--paper); border: 1px solid var(--rule); border-radius: 1rem; padding: 1.4rem; }
.wallet-label { font-size: var(--step--1); color: var(--muted); margin-bottom: 0.4rem; }
.wallet-addr { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.wallet-addr code { font-size: 0.85rem; overflow-wrap: anywhere; }
.copy { font: 700 0.85rem var(--font-body); border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer; }
.chips { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li { border: 1.5px solid var(--rule); border-radius: 999px; padding: 0.2rem 0.75rem; font-size: 0.9rem; }

/* Guestbook notes: hotel notepad slips */
.notes { list-style: none; margin: 1.5rem 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.note-card { background: var(--paper); border-top: 6px solid var(--tag, var(--brass)); padding: 1.2rem 1.3rem 1rem; border-radius: 0 0 0.6rem 0.6rem; }
.note-card p { font-size: var(--step--1); }
.note-card .note-by { margin: 0; color: var(--muted); font-size: 0.85rem; display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.note-card.pinned { outline: 2px solid var(--brass); }
.stars { color: var(--brass-ink); letter-spacing: 0.1em; }
.wall { margin: 2rem 0 3rem; padding: 1.5rem; border: 2px solid var(--brass); border-radius: 1rem; }
.wall-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font: 700 var(--step-1)/1.3 var(--font-display); }
.empty { padding: 2rem; border: 2px dashed var(--rule); border-radius: 1rem; }

details { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; max-width: 52rem; }
details:first-of-type { border-top: 1px solid var(--rule); }
summary { cursor: pointer; font: 700 var(--step-0)/1.4 var(--font-display); list-style-position: outside; }
details p { margin: 0.75rem 0 0.25rem; color: var(--ink-2); }

/* Room page */
.crumbs { padding-top: 1.5rem; font-size: var(--step--1); color: var(--muted); }
.room-page { padding-top: 2rem; }
.room-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; margin-bottom: 3.5rem; }
.fob-lg { --w: 11rem; width: 11rem; padding: 3rem 1rem 3.2rem; transform: rotate(-3deg); }
.fob-lg .fob-num { font-size: 3.6rem; }
.room-price { font: 700 var(--step-1)/1.3 var(--font-display); color: var(--brass-ink); }
.amenities { padding-left: 1.2rem; }
.amenities li { margin-bottom: 0.35rem; }
.amenities li::marker { color: var(--brass); }
.room-page .split h2 { font-size: var(--step-2); margin-top: 0.5rem; }
.room-page .code { margin-bottom: 1rem; }
.room-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* Docs */
.docs { padding-top: clamp(2.5rem, 6vw, 4rem); }
.docs h1 { max-width: 16ch; }
.docs section { margin-top: 3.25rem; scroll-margin-top: 1rem; }
.docs section h2 { font-size: var(--step-2); }
.docs .code { margin: 1rem 0 1.25rem; max-width: 52rem; }
.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0 0; }
.toc a { text-decoration: none; border: 1.5px solid var(--rule); border-radius: 999px; padding: 0.25rem 0.8rem; font-size: 0.92rem; }
.toc a:hover { border-color: var(--brass); }
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); margin: 1rem 0 1.5rem; }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table th { font-family: var(--font-display); }
.table-scroll { overflow-x: auto; }
.addr { font-size: 0.78rem; }

.faq-item { margin-top: 2.5rem; }
.faq-item h2 { font-size: var(--step-1); }
.prose h2 { font-size: var(--step-1); margin-top: 2.25rem; }
.narrow > h1, .wrap > h1 { padding-top: clamp(2.5rem, 6vw, 4rem); }

.lost { text-align: left; }
.lost-num { font: 800 clamp(6rem, 22vw, 12rem)/0.9 var(--font-display); font-stretch: 75%; color: var(--brass); margin: 2.5rem 0 0; }
.lost h1 { padding-top: 0.5rem !important; }

/* Admin */
.admin .login { display: grid; gap: 0.6rem; max-width: 22rem; }
.admin input[type=password] { font: inherit; padding: 0.6rem 0.8rem; border: 2px solid var(--rule); border-radius: 0.5rem; background: var(--paper); color: var(--ink); }
.admin h2 { font-size: var(--step-1); margin-top: 2.5rem; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.admin-stats > div { background: var(--paper); border-radius: 0.8rem; padding: 1rem 1.2rem; }
.admin-stats .big { font: 800 var(--step-3)/1 var(--font-display); margin: 0 0 0.3rem; }
.admin-stats .muted { margin: 0; font-size: var(--step--1); }
.logout { float: right; margin-top: -3.5rem; }
.flash { background: var(--paper); border-left: 4px solid var(--brass); padding: 0.75rem 1rem; }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: 3rem 0 3.5rem; font-size: var(--step--1); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.foot-name { font: 800 var(--step-1)/1 var(--font-display); font-stretch: 85%; }
.foot-h { font-weight: 700; margin-bottom: 0.6rem; }

/* Responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hanger { max-width: 34rem; }
  .keys { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2.5rem; }
  .rail { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
  .split, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .steps, .notes, .room-head { grid-template-columns: minmax(0, 1fr); }
  .fob-lg { --w: 8.5rem; width: 8.5rem; padding: 2.6rem 0.8rem 2.6rem; }
  .fob-lg .fob-num { font-size: 2.6rem; }
  .endpoints div { grid-template-columns: 1fr; gap: 0.2rem; }
  .hanger { transform: none; animation: none; border-radius: 2rem 2rem 1rem 1rem; padding-inline: 1.1rem; }
  .logout { float: none; margin: 0 0 1rem; }
}
