/* NIGHTJAR main stylesheet. Layout, components, motion. Tokens live in tokens.css.
   Vocabulary comes from the room: hours (sections), the parlour (conversation menu),
   exchanges and replies, pourcards, the backbar, coasters, swizzles, chits. */

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--amaro); color: var(--dark); }
[data-theme="paper"] ::selection { background: var(--amaro-deep); color: var(--ivory); }

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

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: var(--z-skip);
  padding: var(--s-3) var(--s-5);
  background: var(--ivory);
  color: var(--dark);
  border-radius: var(--r-pill);
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(calc(-100% - 1.5rem));
}
.skip-link:focus-visible { transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- text roles ---------- */
.placard,
.p1, .p2, .p3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 560;
  line-height: var(--lh-heading);
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.placard { font-size: var(--t-display); line-height: var(--lh-tight); font-weight: 620; }
.p1 { font-size: var(--t-h1); line-height: 1.02; }
.p2 { font-size: var(--t-h2); }
.p3 { font-size: var(--t-h3); }

.lead {
  font-size: var(--t-lead);
  line-height: 1.45;
  max-width: var(--measure);
  text-wrap: pretty;
}
.murmur { max-width: var(--measure); color: var(--muted); text-wrap: pretty; }

/* barnote: the small caps notation chalked over the till */
.barnote {
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
}
.barnote--muted { color: var(--muted); }
.barnote--amaro { color: var(--accent); }

.amaro-word { color: var(--accent); }
.hush { color: var(--muted); }

/* swizzle: the little marker stuck in a sample drink */
.swizzle {
  display: inline-block;
  padding: 0.15em 0.7em;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  color: var(--accent);
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- layout primitives ---------- */
.room {
  width: min(100% - 2 * var(--edge), var(--max-w));
  margin-inline: auto;
}

.hour {
  position: relative;
  padding-block: var(--section-pad);
  background: var(--bg);
  color: var(--fg);
}
.hour--hairline { border-top: 1px solid var(--line); }
.hour--flush { padding-block: 0; }

.hour-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3) var(--s-6);
  margin-bottom: var(--s-8);
}
.hour-head .p2 { margin-right: auto; }

/* ---------- header ---------- */
.door {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--dark);
  border-bottom: 1px solid var(--line);
}
.door .room {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-height: 4rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 650;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--ivory);
}
.wordmark svg { width: 1.6rem; height: 1.6rem; color: var(--amaro); }

.door-right { display: flex; align-items: center; gap: var(--s-6); margin-left: auto; }
.door-nav { display: flex; gap: var(--s-6); }
.door-nav a {
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--dur-1) var(--ease-out);
}
.door-nav a:hover,
.door-nav a[aria-current] { color: var(--ivory); }

.door-cta {
  display: inline-flex;
  padding: 0.5em 1.2em;
  border: 1px solid var(--amaro);
  border-radius: var(--r-pill);
  color: var(--amaro);
  font-size: var(--t-small);
  font-weight: 700;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.door-cta:hover { background: var(--amaro); color: var(--dark); }

.latch {
  display: none;
  font-size: var(--t-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--s-2) var(--s-3);
}

/* ---------- menu overlay (the coat check) ---------- */
.coatcheck {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--s-6) var(--edge) var(--s-8);
  background: var(--dark-2);
  color: var(--ivory);
}
.coatcheck.is-open { display: flex; }
.coatcheck-close { align-self: flex-end; }
.coatcheck nav { display: grid; gap: var(--s-5); }
.coatcheck nav a {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
}
.coatcheck nav a .barnote { color: var(--muted); }
.coatcheck-foot { display: grid; gap: var(--s-4); justify-items: start; }

/* ---------- hero (last call at the green door) ---------- */
.hour--hero {
  min-height: min(92svh, 56rem);
  display: grid;
  align-items: end;
  padding-block: var(--s-9) var(--s-8);
  overflow: clip;
}
.candleglow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 72% 24%, var(--amaro-glow-1), transparent 70%),
    radial-gradient(42% 34% at 22% 84%, var(--amaro-glow-2), transparent 70%);
}
.hero-bird {
  position: absolute;
  right: clamp(-4rem, 4vw, 8rem);
  top: clamp(3rem, 9vh, 6rem);
  width: clamp(13rem, 32vw, 24rem);
  color: var(--dark-3);
  pointer-events: none;
}
.hero-bird .bird-eye { fill: var(--amaro); }
.hour--hero .room { position: relative; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  margin-bottom: var(--s-6);
}
.hour--hero h1 { max-width: 11em; }
.hero-base {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s-6) var(--s-8);
  margin-top: var(--s-7);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-4); }

/* ---------- coaster buttons ---------- */
.coaster {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.8em 1.7em;
  border-radius: var(--r-pill);
  background: var(--amaro);
  color: var(--dark);
  font-weight: 700;
  font-size: var(--t-small);
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid var(--amaro);
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.coaster:hover { transform: translateY(-2px); }
.coaster--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.coaster--ghost:hover { border-color: var(--fg); }
[data-theme="paper"] .coaster { background: var(--amaro-deep); border-color: var(--amaro-deep); color: var(--ivory); }
[data-theme="paper"] .coaster--ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }

/* ---------- the parlour: the conversation menu ---------- */
.parlour {
  position: relative;
  max-width: 46rem;
}
.parlour::before {
  content: "";
  position: absolute;
  inset: -1px -1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  pointer-events: none;
}
.exchange {
  padding: var(--s-6) var(--s-5);
  outline: none;
}
.exchange-mark { display: flex; gap: var(--s-4); margin-bottom: var(--s-6); }

.lines { display: grid; gap: var(--s-4); margin-bottom: var(--s-6); }
.line--guest {
  justify-self: end;
  max-width: 26rem;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-3) var(--r-3) var(--r-1) var(--r-3);
  color: var(--muted);
  font-size: var(--t-small);
}
.line--keeper {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 540;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.3;
  max-width: 21em;
  text-wrap: pretty;
}

.replies { display: grid; border-top: 1px solid var(--line); }
.reply {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-2);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding-left var(--dur-2) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.reply-say {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 570;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}
.reply-hint { color: var(--muted); font-size: var(--t-small); text-align: right; }
.reply::after { content: "\2192"; color: var(--accent); }
.reply:hover { padding-left: var(--s-4); color: var(--accent); }

.parlour-asides {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  margin-top: var(--s-6);
}
.parlour-asides a { color: var(--muted); font-size: var(--t-small); }
.parlour-asides a:hover { color: var(--fg); }

/* the recommended pour */
.pourcard {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--dark-2);
  box-shadow: var(--shadow-candle);
  padding: var(--s-6);
}
.pourcard-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-4);
}
.pourcard-top .p3 { margin-right: auto; }
.pour-price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.spec {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
  padding: 0;
}
.spec li { color: var(--muted); font-size: var(--t-small); }
.spec li + li::before { content: "\00B7\2002"; color: var(--line-strong); }
.pour-story { margin-bottom: var(--s-6); }
.pour-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }

/* arrival choreography: JS swaps exchanges; reduced motion gets an instant cut */
html.js .exchange.is-arriving { animation: exchange-in var(--dur-3) var(--ease-out) both; }
@keyframes exchange-in {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

/* ---------- the backbar: tables of what we keep ---------- */
.backbar { overflow-x: auto; }
.pourbook {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-body);
}
.pourbook caption {
  text-align: left;
  padding-bottom: var(--s-4);
}
.pourbook th {
  text-align: left;
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: 1px solid var(--line-strong);
}
.pourbook td {
  padding: var(--s-4) var(--s-4) var(--s-4) 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}
.pourbook td:last-child, .pourbook th:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.pour-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.2em;
  white-space: nowrap;
}
.pourbook .build { color: var(--muted); font-size: var(--t-small); }

.shelf + .shelf { margin-top: var(--s-8); }
.shelf-note { margin-top: var(--s-4); color: var(--muted); font-size: var(--t-small); max-width: var(--measure); }

/* ---------- the room + house rules ---------- */
.snug {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
}
.houserules { display: grid; gap: 0; border-top: 1px solid var(--line); }
.houserule {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--s-4);
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--line);
}
.houserule .barnote { color: var(--accent); padding-top: 0.35em; }
.houserule h3 { font-size: var(--t-body); font-weight: 700; margin-bottom: var(--s-1); }
.houserule p { color: var(--muted); font-size: var(--t-small); max-width: 32em; }

/* ---------- find us ---------- */
.findus {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.hourslist { display: grid; }
.hourslist > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-5);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.hourslist dt { font-weight: 600; }
.hourslist dd { color: var(--muted); }
.findus-lines { display: grid; gap: var(--s-4); justify-items: start; }
.findus-lines a { color: var(--fg); }

/* ---------- hold a seat (the chit) ---------- */
.seatgrid {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: start;
}
.seatform { display: grid; gap: var(--s-5); }
.chit { display: grid; gap: var(--s-2); }
.chitrow { display: grid; gap: var(--s-5); grid-template-columns: 1fr 1fr; }
.chit label { font-size: var(--t-small); font-weight: 700; }
.chit input,
.chit select,
.chit textarea {
  font: inherit;
  color: var(--fg);
  background: var(--dark-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 0.7em 0.9em;
  width: 100%;
}
.chit select { appearance: none; background-image: linear-gradient(45deg, transparent 49%, var(--muted) 50%), linear-gradient(-45deg, transparent 49%, var(--muted) 50%); background-position: calc(100% - 1.2em) 55%, calc(100% - 0.85em) 55%; background-size: 0.35em 0.35em; background-repeat: no-repeat; }
.chit input:focus-visible,
.chit select:focus-visible,
.chit textarea:focus-visible { outline-offset: 1px; }
.chit-err { color: var(--accent); font-size: var(--t-small); font-weight: 600; }
.chit.is-invalid input,
.chit.is-invalid select,
.chit.is-invalid textarea { border-color: var(--accent); }
.chit-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* the sure path when the script never arrives */
.nojs-note {
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
  font-size: var(--t-small);
  color: var(--fg);
}
.nojs-note a { color: var(--accent); font-weight: 600; }
html.js .nojs-note { display: none; }

.chit-summary {
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  padding: var(--s-5);
}
.chit-summary h3 { font-size: var(--t-body); margin-bottom: var(--s-2); }
.chit-summary ul { display: grid; gap: var(--s-1); padding-left: 1.1em; list-style: disc; }
.chit-summary a { color: var(--accent); }
.chit-status { min-height: 1.5em; font-weight: 600; }

.chit-fallback {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: var(--s-5);
  display: grid;
  gap: var(--s-4);
}
.chit-fallback textarea { min-height: 9rem; font-size: var(--t-small); }
.chit-fallback-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.chit-fallback-acts .coaster { padding: 0.55em 1.2em; }

.seat-aside { display: grid; gap: var(--s-5); align-content: start; }
.seat-aside .murmur { max-width: 30em; }

/* ---------- banner (interior pages) ---------- */
.hour--banner { padding-block: var(--s-8) var(--s-7); }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }
.crumbs a { color: var(--muted); font-size: var(--t-small); }
.crumbs a:hover { color: var(--fg); }
.crumbs span[aria-hidden] { color: var(--line-strong); }
.crumbs em { font-style: normal; font-size: var(--t-small); color: var(--fg); }

/* ---------- 404 ---------- */
.hour--lost { min-height: 88svh; display: grid; align-items: center; }
.lost-acts { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-7); }

/* ---------- footer (the till) ---------- */
.till {
  border-top: 1px solid var(--line);
  padding-block: var(--s-8) var(--s-6);
  background: var(--dark);
  color: var(--ivory);
}
.till-grid {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: var(--s-7);
}
.till h2 { font-size: var(--t-note); font-weight: 700; letter-spacing: var(--track-note); text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-4); }
.till ul { display: grid; gap: var(--s-2); }
.till a { color: var(--ivory); text-decoration: none; }
.till a:hover { text-decoration: underline; }
.till-murmur { color: var(--muted); max-width: 26em; margin-top: var(--s-3); }
.till-base {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--t-small);
}

/* ---------- styleguide fixtures ---------- */
.sg-swatches { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.sg-swatch > div { height: 4.5rem; }
.sg-swatch p { padding: var(--s-3); font-size: var(--t-small); color: var(--muted); }
.sg-block { display: grid; gap: var(--s-5); margin-bottom: var(--s-8); }

/* ---------- reveals ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
html.js .reveal[data-delay="1"] { transition-delay: 120ms; }
html.js .reveal[data-delay="2"] { transition-delay: 240ms; }
html.js .reveal[data-delay="3"] { transition-delay: 360ms; }
html.js .reveal.is-inview { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 60rem) {
  .snug, .findus, .seatgrid, .till-grid { grid-template-columns: 1fr; }
  .hero-bird { opacity: 0.75; }
}
@media (max-width: 47rem) {
  .door-nav, .door-cta { display: none; }
  .latch { display: inline-flex; }
  .chitrow { grid-template-columns: 1fr; }
  .line--guest { max-width: 100%; }
  .parlour::before { inset: -1px -0.5rem; }
  .exchange { padding-inline: var(--s-3); }
}

/* ---------- reduced motion: replacement, not shortening ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .exchange.is-arriving { animation: none; }
  .coaster:hover { transform: none; }
  .reply { transition: none; }
  .reply:hover { padding-left: var(--s-2); }
}
