/* ─────────────────────────────────────────────────────────────────────────
   Waters — gallery-quiet styling.
   Phone-first, generous whitespace, one typeface, restrained palette.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --paper: #f7f6f3;        /* warm off-white, like gallery wall */
  --ink: #1c1c1a;          /* near-black */
  --ink-soft: #6b6b66;     /* muted secondary text */
  --hairline: #d9d7d0;     /* divider lines */
  --highlight: #e9eff0;    /* faint water-blue for the jumped-to entry */
  --maxw: 40rem;
  --space: clamp(1.25rem, 4vw, 2rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 8vw, 4.5rem) var(--space) 4rem;
  /* Respect notches on phones */
  padding-left: max(var(--space), env(safe-area-inset-left));
  padding-right: max(var(--space), env(safe-area-inset-right));
}

/* ── Masthead ─────────────────────────────────────────────────────────── */
.masthead { margin-bottom: 2.5rem; }

.title {
  font-weight: 400;
  font-size: clamp(2.25rem, 9vw, 3.25rem);
  letter-spacing: 0.01em;
  margin: 0 0 0.55rem;
  line-height: 1.05;
}

/* Place/locator beneath the title — small, tracked, muted uppercase */
.locator {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Artist credit beneath the locator */
.byline {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-soft);
}

.intro {
  color: var(--ink-soft);
  margin: 0;
  max-width: 34rem;
  font-size: 1rem;
}
.intro-p {
  margin: 0 0 0.9rem;
  line-height: 1.55;
}
.intro-toggle {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.intro-toggle:hover { color: var(--ink-soft); }

/* ── Toolbar: jump-to-number + count ──────────────────────────────────── */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  margin-bottom: 0.5rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.jump {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.jump-label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.jump-input {
  font: inherit;
  font-size: 1rem;
  width: 4.5rem;
  padding: 0.3rem 0.5rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  outline-offset: 3px;
}
.jump-input::placeholder { color: var(--ink-soft); opacity: 0.6; }

.count {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ── Status / messages ────────────────────────────────────────────────── */
.status {
  color: var(--ink-soft);
  font-style: italic;
  margin: 1.5rem 0;
}
.status[hidden] { display: none; }
.status.error { color: #9a3b2f; font-style: normal; }

/* ── The list ─────────────────────────────────────────────────────────── */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(1rem, 5vw, 2rem);
  align-items: baseline;
  padding: 1.5rem 0;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 4.5rem; /* clear the sticky toolbar when jumped to */
  transition: background-color 900ms ease;
}
.entry:last-child { border-bottom: 1px solid var(--hairline); }

.entry-id {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding-top: 0.1rem;
}

.entry-body { min-width: 0; }

.entry-desc {
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.35;
}

.entry-loc {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Brief highlight when an entry is jumped to */
.entry.is-target {
  background: var(--highlight);
  border-radius: 6px;
}

/* ── Footer shelf: a quiet row of the collected bottles ───────────────── */
.shelf {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.5rem, 4vw, 1.75rem);
  width: fit-content;          /* shrink to the bottle row */
  margin: 4rem auto 0;         /* and center it */
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--hairline); /* line spans only the bottles */
}
.shelf-bottle {
  height: clamp(28px, 5.67vw, 41px);
  width: auto;
  display: block;
}

/* Honor reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .entry { transition: none; }
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Optional dark gallery mode */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15150f;
    --ink: #eceae2;
    --ink-soft: #9b988c;
    --hairline: #34332b;
    --highlight: #1d2a2c;
  }
}
