/* Tablemakers. The book at the door: green cloth cover, ledger-green ruled pages, one red margin rule. */

:root {
  --green: #14382A;
  --green-deep: #0E2A1F;
  --green-tint: #BFD0C4;
  --bone: #F4F0E6;             /* light text on green */
  --page: #E6EDE2;             /* eye-ease ledger paper */
  --page-deep: #D6E0D1;
  --ink: #16150F;
  --ink-soft: #454A42;
  --feint: #B5C6B3;
  --red: #B5291D;
  --display: 'Libre Caslon Display', 'Libre Caslon Text', Georgia, 'Times New Roman', Times, serif;
  --text: 'Libre Caslon Text', Georgia, 'Times New Roman', Times, serif;
  --row: 2.25rem;              /* one ruled line */
  --spine: 17rem;
  --page-pad: clamp(1.25rem, 5vw, 5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --cloth: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.94 0 0 0 0 0.90 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");  /* self-made SVG grain: the cloth cover */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--green) var(--page-deep);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green); color: var(--page); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--bone); padding: 0.5rem 0.9rem;
  font-size: 0.9rem; z-index: 20;
}
.skip:focus { top: 1rem; }

.num, .n { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum"; }

/* Spine: the cover ------------------------------------------------------ */

.spine {
  position: fixed; inset: 0 auto 0 0;
  width: var(--spine);
  background: var(--green) var(--cloth);
  color: var(--bone);
  display: flex; flex-direction: column;
  padding: 2rem 1.75rem;
  z-index: 10;
}

.mark {
  display: flex; align-items: center; gap: 0.85rem;
  text-decoration: none;
}
.monogram { color: var(--bone); flex: none; }
.wordmark {
  font-family: var(--text);
  font-variant-caps: small-caps;
  letter-spacing: 0.12em;
  font-size: 1.05rem;
  line-height: 1;
  white-space: nowrap;
}

.nav { margin-top: 3.5rem; }
.nav ol { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block;
  padding: 0.45rem 0;
  color: var(--green-tint);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(244, 240, 230, 0.12);
  transition: color 0.2s var(--ease);
}
.nav a:hover, .nav a[aria-current="true"] { color: var(--bone); }

/* For a host with a dinner coming: the way back to their own table. */
.spine-see {
  margin-top: auto;
  align-self: flex-start;
  font-variant-caps: small-caps; letter-spacing: 0.12em; font-size: 0.95rem;
  text-decoration: none;
  color: var(--green-tint);
  border-bottom: 1px solid var(--green-tint);
  padding-bottom: 0.15rem;
  margin-bottom: 1rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.spine-see:hover { color: var(--bone); border-color: var(--bone); }

.spine-cta {
  margin-top: 0;
  align-self: flex-start;
  font-variant-caps: small-caps; letter-spacing: 0.12em; font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--bone);
  padding-bottom: 0.15rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.spine-cta:hover { color: var(--green-tint); border-color: var(--green-tint); }

/* Page ------------------------------------------------------------------ */

.page {
  position: relative;
  margin-left: var(--spine);
  min-height: 100vh;
}

.margin-rule {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--page-pad) - 1.5rem);
  width: 1px; background: var(--red); opacity: 0.85;
  pointer-events: none;
}

section { padding: 0 var(--page-pad); }
.hero, .ledger-section, .prose-section, .faq-section { padding-top: 3.5rem; padding-bottom: 3rem; }
.hero { padding-top: 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 11fr) minmax(0, 12fr); gap: clamp(2.5rem, 5vw, 6rem); align-items: start; }
  .hero-left { position: sticky; top: 3rem; }
}
.table-title { font-size: 1.5rem; margin-bottom: 0.75rem; }
.hero-right .note { font-size: 0.95rem; margin-bottom: 1.25rem; }

.running-head {
  display: flex; gap: 2rem; align-items: baseline;
  font-variant-caps: small-caps; letter-spacing: 0.12em;
  font-size: 0.8rem; color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.5rem;
  margin-bottom: 2.25rem;
}
.running-head .rh-right { margin-left: auto; }
.running-head .num { letter-spacing: 0; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 {
  font-size: clamp(2.75rem, 4.8vw, 4.75rem);
  line-height: 1.02;
  max-width: 14ch;
  margin-bottom: 2rem;
}
h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.12;
  max-width: 22ch;
  margin-bottom: 1.25rem;
}

.prose { max-width: 38em; }
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }
.lede { font-size: 1.2rem; line-height: 1.55; }
.lede p:first-child { max-width: 32em; }

.note { max-width: 38em; color: var(--ink-soft); font-style: italic; margin: 0 0 1.5rem; }
.note.after { margin: 1.5rem 0 0; }

.button {
  display: inline-block;
  font-variant-caps: small-caps; letter-spacing: 0.12em; font-size: 0.95rem;
  line-height: 1;
  padding: 0.95rem 1.5rem 0.85rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.button:hover { background: var(--ink); color: var(--page); }
.button.light { border-color: var(--bone); color: var(--bone); }
.button.light:hover { background: var(--bone); color: var(--green); }

/* Ledger ---------------------------------------------------------------- */

.ledger {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--feint);
}
.entry {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  min-height: var(--row);
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--feint);
  line-height: 1.5;
}
.seats .entry, .steps .entry { grid-template-columns: 3rem 1fr; }
.entry .n {
  font-variant-caps: small-caps; letter-spacing: 0.1em;
  color: var(--ink-soft); font-size: 0.95rem;
}
.seats .n, .steps .n { text-align: right; letter-spacing: 0; font-size: 1.05rem; }
.entry .t { max-width: 44em; }
.entry strong { font-weight: 700; }

.entry.last { border-bottom: 1px solid var(--red); }
.entry.last .n { color: var(--red); }

/* Write-in: entries reveal once, left to right, from an already-visible default. */
.js .entry { clip-path: inset(0 0 0 0); }
.js .entry.pending {
  clip-path: inset(0 100% 0 0);
}
.js .entry.written {
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .entry, .js .entry.pending, .js .entry.written { clip-path: none; transition: none; }
}

/* FAQ ------------------------------------------------------------------- */

.faq { border-top: 1px solid var(--feint); }
.faq details { border-bottom: 1px solid var(--feint); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.9rem 0;
  font-family: var(--text);
  font-size: 1.15rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.8rem; height: 0.8rem;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 100% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1px 100% no-repeat;
  transition: transform 0.35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details .prose { padding: 0 0 1.25rem; max-width: 44em; }

/* Close: back cover ----------------------------------------------------- */

.close {
  background: var(--green) var(--cloth);
  color: var(--bone);
  padding-top: 4.5rem; padding-bottom: 3rem;
}
.close h2 { max-width: 16ch; }
.close-lede { max-width: 32em; font-size: 1.2rem; line-height: 1.55; color: var(--green-tint); margin: 0 0 2rem; }
.close .button { overflow-wrap: anywhere; }

.foot .wordmark { color: var(--bone); }
.foot {
  margin-top: 6rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(244, 240, 230, 0.25);
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; align-items: baseline;
  font-size: 0.9rem; color: var(--green-tint);
}

/* Narrow ---------------------------------------------------------------- */

@media (max-width: 900px) {
  :root { --spine: 0px; --page-pad: clamp(1.25rem, 6vw, 3rem); }
  .spine {
    position: sticky; inset: auto; top: 0;
    width: auto;
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    padding: 0.75rem var(--page-pad) 0;
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  }
  .monogram { width: 34px; height: 34px; }
  .spine .wordmark { font-size: 0.95rem; }
  .mark { grid-row: 1; grid-column: 1; }
  .spine-see { grid-row: 1; grid-column: 2; justify-self: end; margin: 0 0 0.35rem; font-size: 0.85rem; }
  .spine-cta { grid-row: 2; grid-column: 2; justify-self: end; }
  .nav { grid-row: 3; grid-column: 1 / -1; margin: 0.5rem calc(-1 * var(--page-pad)) 0; }
  .nav ol { display: flex; gap: 1.25rem; overflow-x: auto; padding: 0 var(--page-pad); scrollbar-width: none; }
  .nav ol::-webkit-scrollbar { display: none; }
  .nav a { border: 0; padding: 0.6rem 0; font-size: 0.85rem; white-space: nowrap; border-bottom: 2px solid transparent; }
  .nav a[aria-current="true"] { border-bottom-color: var(--bone); }
  .spine-cta { margin-top: 0; font-size: 0.85rem; }
  .page { margin-left: 0; }
  .margin-rule { left: calc(var(--page-pad) - 0.75rem); }
  .hero { padding-top: 3rem; }
  h1 { font-size: clamp(2.5rem, 11vw, 3.5rem); max-width: none; }
  .running-head { gap: 1rem; flex-wrap: wrap; }
  .entry { grid-template-columns: 5.25rem 1fr; gap: 0.75rem; }
  .entry .n { letter-spacing: 0.06em; }
  .seats .entry, .steps .entry { grid-template-columns: 2rem 1fr; }
  .foot { margin-top: 4rem; }
}
