/* Booking: the candlelit end of the wall. Four paper sheets are dealt one onto the next, each leaving the tab on its
   left edge in view; the estimate stands beside them on the dark wall and moves as the answers change. */
html, body { height: 100%; overflow: hidden; }
.bk {
  position: fixed; inset: 0; z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(220px, 300px);
  align-items: center; justify-content: center;
  gap: clamp(28px, 5vw, 96px);
  padding: calc(84px + env(safe-area-inset-top, 0px)) var(--g) calc(34px + env(safe-area-inset-bottom, 0px));
  color: var(--pale);
}

/* ---------- the pile ---------- */
.pile {
  --sp: 46px;
  position: relative;
  width: min(calc(620px + 4 * var(--sp)), calc(100vw - 2 * var(--g) - 330px));
  min-width: 480px;
  height: min(790px, calc(100svh - 130px));
}
/* the candle's flicker, shared by every sheet */
.sheet::before { content: ""; position: absolute; inset: 0; z-index: 3; background: #120b05; opacity: var(--dim, 0); pointer-events: none; }
.sheet {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--i) * var(--sp));
  width: calc(100% - 4 * var(--sp));
  z-index: calc(var(--i) + 1);
  display: flex;
  color: var(--paper-ink);
  background: radial-gradient(130% 95% at 78% 108%, #f1e5cc 0%, #e3d7c0 46%, #cfc3ad 100%);
  box-shadow: -14px 0 34px rgba(0, 0, 0, 0.32);
  transform: translate3d(calc(100vw + 60px), 0, 0);
  visibility: hidden;
  transition: transform 1.05s var(--ease), visibility 0s linear 1.05s;
}
.sheet.in { transform: none; visibility: visible; transition: transform 1.05s var(--ease), visibility 0s; }
/* a sheet lying under another falls a little into shadow */
.sheet::after { content: ""; position: absolute; inset: 0; background: #120b05; opacity: 0; pointer-events: none; transition: opacity 0.9s var(--ease); }
.sheet.under::after { opacity: 0.2; }

.tab {
  flex: none; width: var(--sp);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 24px 0; margin: 0; border: 0; border-right: 1px solid rgba(29, 23, 18, 0.16);
  background: none; color: inherit; cursor: default;
}
.tab span:last-child { writing-mode: vertical-rl; }
.sheet.under .tab { cursor: pointer; position: relative; z-index: 2; }
.sheet.under .tab:hover { background: rgba(29, 23, 18, 0.07); }
.tab:focus-visible { outline-offset: -4px; }

.body { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(26px, 4.4vh, 44px) clamp(24px, 3vw, 44px) 30px; scrollbar-width: thin; scrollbar-color: rgba(29, 23, 18, 0.3) transparent; }
.step-n { opacity: 0.62; }
.body h2 { margin: 12px 0 clamp(18px, 3.2vh, 30px); font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 2.9vw, 42px); line-height: 1.04; letter-spacing: -0.01em; text-wrap: balance; outline: none; }
.sheet > * { opacity: 0; transition: opacity 0.7s var(--ease) 0.35s; }
.sheet.in > * { opacity: 1; }

/* ---------- fields ---------- */
.field { margin: 0 0 clamp(14px, 2.5vh, 22px); padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend, .field > .lbl { display: block; padding: 0; margin-bottom: 8px; opacity: 0.78; }
.field input[type="text"], .field input[type="url"], .field input[type="email"], .field input[type="tel"], .field input[type="date"], .field textarea {
  display: block; width: 100%;
  padding: 7px 0 9px;
  border: 0; border-bottom: 1px solid currentColor; border-radius: 0;
  background: transparent; color: inherit;
  font: inherit; font-size: 18px; line-height: 1.3;
  color-scheme: light;
}
.field textarea { resize: vertical; min-height: 62px; border: 1px solid rgba(29, 23, 18, 0.55); padding: 9px 11px; }
.field input::placeholder { color: rgba(29, 23, 18, 0.38); }
.field input:focus, .field textarea:focus { outline: none; box-shadow: 0 2px 0 0 currentColor; }
.field textarea:focus { box-shadow: 0 0 0 1px currentColor; }
.field [aria-invalid="true"] { border-bottom-color: #8c2f1b; box-shadow: 0 2px 0 0 #8c2f1b; }
.hint { margin-top: 7px; font-size: 13px; line-height: 1.45; opacity: 0.7; }
.hint.small { margin-top: 14px; }
.err { margin-top: 7px; font-size: 13px; line-height: 1.45; color: #8c2f1b; font-weight: 500; }
.warn { margin-top: 9px; font-size: 13px; line-height: 1.45; }
.inline { padding: 0; border: 0; border-bottom: 1px solid currentColor; background: none; cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* choices drawn as square tabs: the chosen one is inked in */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label, .choices label { position: relative; cursor: pointer; }
.chips input, .choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span { display: block; padding: 9px 14px; border: 1px solid rgba(29, 23, 18, 0.55); font-size: 14px; line-height: 1.2; transition: background 0.35s var(--ease), color 0.35s var(--ease); }
.chips input:checked + span { background: var(--paper-ink); color: #eadfca; border-color: var(--paper-ink); }
.chips input:disabled + span { cursor: default; }
.chips input:focus-visible + span, .choices input:focus-visible + span { outline: 1px solid currentColor; outline-offset: 3px; }
.chips label:hover input:not(:checked):not(:disabled) + span, .choices label:hover input:not(:checked) + span { background: rgba(29, 23, 18, 0.08); }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choices span { display: block; height: 100%; padding: 12px 13px 13px; border: 1px solid rgba(29, 23, 18, 0.55); transition: background 0.35s var(--ease), color 0.35s var(--ease); }
.choices b { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.1; }
.choices i { display: block; margin-top: 6px; font-style: normal; font-size: 12.5px; line-height: 1.4; opacity: 0.78; }
.choices input:checked + span { background: var(--paper-ink); color: #eadfca; border-color: var(--paper-ink); }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid rgba(29, 23, 18, 0.55); }
.stepper button { width: 42px; height: 40px; border: 0; background: none; cursor: pointer; font-size: 20px; line-height: 1; }
.stepper button:hover { background: rgba(29, 23, 18, 0.08); }
.stepper button:disabled { opacity: 0.3; cursor: default; background: none; }
.stepper output { display: grid; place-items: center; min-width: 54px; border-inline: 1px solid rgba(29, 23, 18, 0.55); font-family: var(--serif); font-size: 22px; }

.plan { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 4px 0 clamp(16px, 2.8vh, 24px); padding: 16px 0; border-block: 1px solid rgba(29, 23, 18, 0.2); }
.plan dt { opacity: 0.7; margin-bottom: 6px; }
.plan dd { font-family: var(--serif); font-size: clamp(20px, 1.9vw, 26px); line-height: 1.1; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: clamp(20px, 3.4vh, 32px); }
.btn { display: inline-block; padding: 15px 24px; border: 1px solid currentColor; border-radius: 0; background: none; cursor: pointer; transition: background 0.45s var(--ease), color 0.45s var(--ease); }
.sheet .btn:hover, .sheet .btn:focus-visible, .sheet .btn.solid { background: var(--paper-ink); color: #eadfca; border-color: var(--paper-ink); }
.sheet .btn.solid:hover { background: #3a2e24; }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.back { padding: 6px 0; border: 0; border-bottom: 1px solid transparent; background: none; cursor: pointer; opacity: 0.72; }
.back:hover, .back:focus-visible { opacity: 1; border-bottom-color: currentColor; }

/* the last sheet */
.done .lede { font-size: 16px; line-height: 1.5; max-width: 44ch; }
.recap { margin-top: 22px; border-top: 1px solid rgba(29, 23, 18, 0.2); }
.recap div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 9px 0; border-bottom: 1px solid rgba(29, 23, 18, 0.2); font-size: 14px; }
.recap dt { opacity: 0.68; }
.recap dd { overflow-wrap: anywhere; }

/* ---------- the estimate, on the dark wall ---------- */
.tally { min-width: 0; opacity: 0; transform: translateY(12px); transition: opacity 1.8s var(--ease) 1s, transform 1.8s var(--ease) 1s; }
html.lit .tally, html.no-gl .tally { opacity: 1; transform: none; }
.tally .k { opacity: 0.62; }
.tally .total { margin: 8px 0 18px; font-family: var(--serif); font-size: clamp(48px, 5.6vw, 84px); line-height: 0.95; letter-spacing: -0.02em; }
.lines { margin-bottom: 30px; }
.lines div { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 6px 0; font-size: 14px; }
.lines dt { opacity: 0.8; }
.lines dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tally .when { margin: 8px 0 22px; font-family: var(--serif); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.1; }
.tally .note { font-size: 13px; line-height: 1.5; opacity: 0.62; max-width: 32ch; }

/* ---------- narrow screens: one sheet at a time, the estimate as a bar underneath ---------- */
@media (max-width: 900px) {
  .bk { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 14px; padding-top: calc(76px + env(safe-area-inset-top, 0px)); padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .pile { --sp: 0px; width: 100%; min-width: 0; flex: 1; height: auto; min-height: 0; }
  .tab { display: none; }
  .tally { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 22px; row-gap: 2px; flex: none; }
  .tally .k { grid-row: 1; }
  .tally .total { grid-row: 2; grid-column: 1; margin: 0; font-size: 34px; line-height: 1; }
  .tally .when { grid-row: 2; grid-column: 2; margin: 0; font-size: 20px; }
  .lines, .tally .note { display: none; }
  .two { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; }
  .choices i { margin-top: 3px; }
}
@media (max-height: 560px) and (min-width: 901px) {
  .pile { height: calc(100svh - 104px); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet.in, .sheet > *, .tally { transition: none; }
}
html.no-gl .bk { background: #1b1814; }
