/* ---------- Themes ---------- */
:root,
[data-theme="pine"] {
  --bg: #EDEFEA;
  --surface: #FFFFFF;
  --ink: #1E2B26;
  --muted: #5E6E64;
  --line: #D3D9D1;
  --accent: #8A5E2C;
  --on-accent: #FFFFFF;
  --tag-bg: #2F4A3E;
  --tag-ink: #F1EEE4;
  --tag-muted: #B7C4B8;
  --tag-accent: #E3BC76;
  color-scheme: light;
}

[data-theme="coast"] {
  --bg: #E9F0F3;
  --surface: #FFFFFF;
  --ink: #13293B;
  --muted: #536E82;
  --line: #CCDAE3;
  --accent: #226C92;
  --on-accent: #FFFFFF;
  --tag-bg: #143F5B;
  --tag-ink: #EEF4F7;
  --tag-muted: #A8C1D1;
  --tag-accent: #F2C879;
  color-scheme: light;
}

[data-theme="night"] {
  --bg: #151917;
  --surface: #1F2522;
  --ink: #ECE9E1;
  --muted: #A4ADA6;
  --line: #343C38;
  --accent: #D7B26E;
  --on-accent: #151917;
  --tag-bg: #2B3530;
  --tag-ink: #F4F0E6;
  --tag-muted: #A9B3AC;
  --tag-accent: #E5BE75;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3, p { margin: 0; }
h2 {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 5.5vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h3 { font-size: 1.08rem; font-weight: 700; }
a { color: var(--accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
button { font: inherit; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 22px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
}
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---------- Hero ---------- */
.cover {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 64vh;
  overflow: hidden;
  background: var(--line);
}
.cover[hidden] { display: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }

.hero-text { padding-top: 30px; padding-bottom: 26px; }
.hero:not(:has(.cover:not([hidden]))) .hero-text { padding-top: calc(56px + env(safe-area-inset-top, 0px)); }

.greeting { font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.greeting:empty { display: none; }
.name {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.place { margin-top: 10px; color: var(--muted); font-weight: 500; }
.intro { margin-top: 16px; font-size: 1.1rem; max-width: 40ch; }

/* ---------- The key tag (WiFi, code, times) ---------- */
.tag {
  position: relative;
  background: var(--tag-bg);
  color: var(--tag-ink);
  border-radius: 26px;
  padding: 26px 22px 22px;
  isolation: isolate;
}
/* stitched edge, like a leather key tag */
.tag::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px dashed color-mix(in srgb, var(--tag-ink) 28%, transparent);
  border-radius: 19px;
  pointer-events: none;
  z-index: -1;
}
.tag-hole {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--tag-accent) 70%, transparent);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 14px;
  padding: 4px 0 18px;
}
.tag-row + .tag-row { border-top: 1px solid color-mix(in srgb, var(--tag-ink) 16%, transparent); padding-top: 18px; }
.tag-row[hidden] { display: none; }
.tag-item { min-width: 0; flex: 1 1 200px; }
.tag-label { padding-right: 34px; font-size: 0.9rem; color: var(--tag-muted); font-weight: 500; }
.tag-value {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 600;
  overflow-wrap: break-word;
}
.tag-value.mono { font-family: "Figtree", system-ui, sans-serif; font-size: 1.7rem; font-weight: 700; }
.tag-sub { margin-top: 2px; color: var(--tag-muted); overflow-wrap: break-word; }
.tag-sub .mono { color: var(--tag-ink); font-weight: 600; }

.tag-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--tag-ink) 16%, transparent);
}
.tag-times .tag-value { font-size: 1.45rem; }

.chip {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--tag-accent);
  background: transparent;
  color: var(--tag-accent);
  font-weight: 700;
  cursor: pointer;
}
.chip:hover { background: var(--tag-accent); color: var(--tag-bg); }
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
.tag-value.tag-note { font-family: "Figtree", system-ui, sans-serif; font-size: 1.05rem; font-weight: 500; line-height: 1.4; }

/* ---------- Contact buttons ---------- */
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.contact-row:empty { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.reply-note { width: 100%; color: var(--muted); font-size: 0.92rem; }

/* ---------- Jump links ---------- */
.jump {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-top: 36px;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.jump-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
}
.jump-inner::-webkit-scrollbar { display: none; }
.jump a {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.jump a:hover, .jump a[aria-current="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Sections ---------- */
.section { padding-top: 48px; padding-bottom: 8px; }
.lede { margin-top: 8px; color: var(--muted); max-width: 52ch; }

/* Arrival steps: a real sequence, so they're numbered */
.steps { list-style: none; margin: 22px 0 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 52px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 700;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px; top: 40px; bottom: 6px;
  width: 2px;
  background: var(--line);
}
.steps p { color: var(--muted); margin-top: 2px; }

/* Rooms */
.rooms { margin-top: 22px; display: grid; gap: 16px; }
.room { background: var(--surface); border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }
.room figure { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.room figure img { width: 100%; height: 100%; object-fit: cover; }
.room-body { padding: 18px 20px 20px; }
.room ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.room li + li { margin-top: 6px; }

/* Rules */
.rules { list-style: none; margin: 20px 0 0; padding: 0; }
.rules li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rules li:first-child { border-top: 1px solid var(--line); }

/* Places */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.filters button {
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.places { list-style: none; margin: 18px 0 0; padding: 0; }
.place-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.place-item.no-photo { grid-template-columns: 1fr; }
.place-item[hidden] { display: none; }
.place-item img { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; }
.place-meta { color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.place-note { margin-top: 6px; }
.place-link { display: inline-block; margin-top: 8px; font-weight: 600; }
.places-empty { color: var(--muted); padding: 16px 0; }

/* Check-out list */
.checklist { list-style: none; margin: 20px 0 0; padding: 0; }
.checklist label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.checklist input {
  width: 24px; height: 24px; margin: 0; flex-shrink: 0;
  accent-color: var(--accent);
}
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.progress { margin: 16px 0; font-weight: 600; }
.btn[hidden] { display: none; }

/* Help */
.emergency {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.emergency:hover { border-color: var(--ink); color: var(--ink); }
.emergency strong { font-family: "Newsreader", Georgia, serif; font-size: 2rem; line-height: 1; }
.emergency span { color: var(--muted); }
.emergency[hidden] { display: none; }

.contacts { margin: 18px 0 0; }
.contacts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contacts dt { font-weight: 600; }
.contacts dd { margin: 0; color: var(--muted); text-align: right; }

.faq { margin-top: 26px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { padding-top: 48px; padding-bottom: 56px; color: var(--muted); font-size: 0.92rem; }
.link-btn {
  background: none; border: 0; padding: 0; margin-bottom: 14px;
  color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.demo-switcher { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.demo-switcher button {
  min-height: 40px; padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
}
.demo-switcher button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 160%);
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-align: center;
}
.toast:not(.show) { visibility: hidden; }
.toast.show { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: transform 0.25s ease; } }

/* ---------- Larger screens ---------- */
@media (min-width: 760px) {
  .cover { aspect-ratio: 21 / 9; max-height: 70vh; }
  .hero-text { padding-top: 44px; }
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Print (a paper house manual) ---------- */
@media print {
  body { background: #fff; color: #000; }
  .jump, .chip, .contact-row, .filters, .demo-switcher, .link-btn, .toast, #left-msg, .skip { display: none !important; }
  .cover { max-height: 7cm; aspect-ratio: auto; }
  .tag { background: #fff; color: #000; border: 1.5px solid #000; }
  .tag-label, .tag-sub { color: #444; }
  .tag-hole { display: none; }
  .place-item[hidden] { display: grid; }
  .section { break-inside: avoid-page; }
  .room { break-inside: avoid; }
  a { color: #000; }
}
