/* =========================================================================
   BrunnenBar — house theme
   =========================================================================
   The shared look for every BrunnenBar recommender. Nothing in this file
   knows about cocktails, whiskey or tequila. Copy it verbatim into a new app,
   link it first, then put whatever that app needs on its own in a second
   stylesheet after it.

   Mobile-first throughout. Most guests open these on a phone, at a table, in
   low light. Large tap targets, high contrast, no hover-only affordances.

   Full explanation and copy-paste recipes: docs/design-system.md
   ========================================================================= */

:root {
  /* Grounds. BrunnenBar's forest green driven right down to a near-black, so
     the page stays dark while still reading as the brand. Every neutral
     carries the same green bias, which is what keeps it from looking like a
     generic dark theme with a gold accent bolted on. Do not swap these for
     grey, that is the single change that would break the whole look. */
  --ink:        #0d1712;   /* page ground */
  --ink-2:      #131f18;   /* cards, options, anything raised off the page */
  --ink-3:      #1a2a20;   /* hover state of a raised surface */
  --line:       #274235;   /* visible border */
  --line-soft:  #1e3327;   /* resting border, dividers */

  /* Champagne gold, straight off the logo and the printed card. The only
     accent. Selection, progress, focus and the primary action are all gold,
     nothing else is. */
  --gold:       #e3c87c;
  --gold-lit:   #f1dda6;   /* hover on a gold fill */
  --gold-deep:  #c9a95c;   /* reserved for gold on light, print, small type */

  /* The card's own green, kept at full strength for secondary marks. Second
     accent only, never competes with gold. */
  --green:      #35664a;
  --green-lit:  #5f9d76;

  --cream:      #f2ece0;   /* body text */
  --muted:      #9aa89b;   /* secondary text */
  --muted-dim:  #6d7c70;   /* labels, disabled, the quietest thing readable */

  --on-gold:    #10201a;   /* text sitting on a gold fill */

  --radius:     14px;      /* options, notices, small cards */
  --radius-lg:  20px;      /* result cards */
  --maxw:       46rem;     /* one column, never wider, on any screen */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  /* Two soft washes, gold from above and green from the lower left. They are
     what stop a flat near-black from looking cheap. Fixed, so scrolling does
     not drag them. */
  background-image:
    radial-gradient(90rem 40rem at 50% -18rem, rgba(227, 200, 124, 0.11), transparent 65%),
    radial-gradient(60rem 40rem at 12% 108%, rgba(53, 102, 74, 0.22), transparent 60%);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Serif for every heading, sans for everything else. That one split does most
   of the work of making it feel like a bar and not a form. */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }

.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.15rem 4rem;
}

/* ---------------------------------------------------------------- header */

.top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-bottom: 1.75rem;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--ink-2);
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.42rem 0.8rem;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.lang button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.lang button:not([aria-pressed="true"]):hover { color: var(--cream); }

/* ------------------------------------------------------------ transitions */

.stage > * { animation: rise 0.42s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stage > *, * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ----------------------------------------------------------------- intro */

.intro { text-align: center; padding: 1.5rem 0 0; }

.intro h1 { font-size: clamp(2.3rem, 9vw, 3.4rem); }

.rule {
  width: 3.5rem;
  height: 1px;
  background: var(--gold);
  border: 0;
  margin: 1.5rem auto;
  opacity: 0.6;
}

.lede {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto 2.25rem;
  font-size: 1.02rem;
}

/* --------------------------------------------------------------- buttons */

.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.85rem 2rem;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), background 0.18s var(--ease),
              border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn:active { transform: translateY(1px); }

/* A link styled as a button still needs the link chrome stripped. */
a.btn { text-decoration: none; display: inline-block; }

.btn-primary { background: var(--gold); color: var(--on-gold); }
.btn-primary:hover { background: var(--gold-lit); }
.btn-primary[disabled] {
  background: var(--ink-3);
  color: var(--muted-dim);
  cursor: not-allowed;
  border-color: var(--line);
}

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--cream); border-color: var(--gold); }

.btn-quiet {
  background: none;
  border: 0;
  color: var(--muted-dim);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 0.5rem;
}
.btn-quiet:hover { color: var(--cream); }

.link-card {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.link-card:hover { color: var(--gold); border-color: var(--gold); }

/* --------------------------------------------------------------- progress */

.progress { margin-bottom: 2rem; }

.progress-track {
  height: 2px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0;
  transition: width 0.45s var(--ease);
}

.progress-label {
  margin-top: 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

/* -------------------------------------------------------------- questions */

.q-title { font-size: clamp(1.6rem, 5.5vw, 2.15rem); margin-bottom: 0.6rem; }
.q-sub { color: var(--muted); margin: 0 0 1.75rem; font-size: 0.96rem; }

.options { display: grid; gap: 0.7rem; grid-template-columns: 1fr; }

/* One column on a phone, two from roughly a large phone in landscape up.
   34rem is the only layout breakpoint in the whole theme. */
@media (min-width: 34rem) {
  .options.cols-2 { grid-template-columns: 1fr 1fr; }
  .options.cols-2 .option-wide { grid-column: 1 / -1; }
}

/* An answer of a different kind to the ones above it, such as handing the
   choice back to the bar. Dashed until chosen, so it reads as an aside. */
.option-wide { margin-top: 0.5rem; border-style: dashed; }
.option-wide[aria-pressed="true"] { border-style: solid; }

.option {
  appearance: none;
  text-align: left;
  font: inherit;
  color: var(--cream);
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 3.6rem;   /* thumb-sized, do not shrink */
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease),
              transform 0.12s var(--ease);
}

.option:hover { border-color: var(--gold); background: var(--ink-3); }
.option:active { transform: translateY(1px); }

.option[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(227, 200, 124, 0.15), rgba(227, 200, 124, 0.06));
}

.option-mark {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1.5px solid var(--muted-dim);
  display: grid;
  place-items: center;
  transition: border-color 0.18s var(--ease);
}

.option[aria-pressed="true"] .option-mark { border-color: var(--gold); }

.option-mark::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}

.option[aria-pressed="true"] .option-mark::after { transform: scale(1); }

.option-body { min-width: 0; }
.option-label { font-weight: 600; display: block; }
.option-hint { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.12rem; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.9rem;
  flex-wrap: wrap;
}

.nav-right { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

/* ----------------------------------------------------------------- scale */
/* A six stop intensity picker. Cocktails use it for strength, whiskey could
   use it for peat, tequila for how much agave shows. Three across on a phone,
   six across once there is room. */

.scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }

@media (min-width: 34rem) { .scale { grid-template-columns: repeat(6, 1fr); } }

.scale-stop {
  appearance: none;
  font: inherit;
  color: var(--muted);
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0.85rem 0.4rem 0.7rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  min-height: 4.4rem;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease),
              color 0.18s var(--ease);
}

.scale-stop:hover { border-color: var(--gold); background: var(--ink-3); }

.scale-stop[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--cream);
  background: linear-gradient(180deg, rgba(227, 200, 124, 0.15), rgba(227, 200, 124, 0.06));
}

/* Five pips per stop, filled to show intensity. A rising bar was tried first
   and became unreadable the moment the labels wrapped. */
.pips { display: flex; gap: 3px; height: 0.9rem; align-items: center; }

.pip {
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}

.pip.on { background: var(--muted-dim); }

.scale-stop[aria-pressed="true"] .pip.on { background: var(--gold); transform: scale(1.25); }

.scale-label { font-size: 0.82rem; font-weight: 600; text-align: center; line-height: 1.2; }

/* --------------------------------------------------------------- results */

.results-head { text-align: center; margin-bottom: 2.25rem; }
.results-head h2 { font-size: clamp(1.9rem, 6.5vw, 2.6rem); }
.results-head p { color: var(--muted); margin: 0.7rem 0 0; font-size: 0.95rem; }

/* Said out loud when the app had to bend a rule to answer at all. Green rule
   on the left, never red, because it is information and not a failure. */
.notice {
  border: 1px solid var(--line);
  border-left: 2px solid var(--green-lit);
  background: var(--ink-2);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem;
  margin-bottom: 1rem;
}

/* The top recommendation. Gold edge and a gold wash off the top, so the eye
   lands on it before it reads a word. Exactly one card per screen gets this. */
.card.hero {
  border-color: rgba(227, 200, 124, 0.45);
  background:
    linear-gradient(180deg, rgba(227, 200, 124, 0.07), transparent 45%),
    var(--ink-2);
}

/* A product shot on a result card.
   ---------------------------------------------------------------------------
   The Menu API's images are square, 900 by 900, and often sit on a light or
   transparent ground. So they are CONTAINED and never cropped, because a
   square crop of a bottle takes the neck off, and they are given a ground of
   their own rather than punching a hole in the card. The gold radial behind
   them is the same wash as the page, which makes a product photo read as lit
   on a shelf rather than pasted on.

   Two sizes. `.shot` alone is the full width frame for the favourite.
   `.shot-sm` inside a `.card-lead` row is the thumbnail for a runner up, big
   enough to recognise a bottle by and small enough not to turn a short list
   of suggestions into a catalogue.

   `image` is a URL or null, so the markup is omitted entirely when there is
   no photo. Never a placeholder, and a card with no photo simply has none.

   A photo on a white ground fills the frame and hides the wash, which is
   fine and is what a catalogue cutout will do. The padding keeps a thin mat
   around it so it reads as a framed photo rather than a hole in the card. A
   transparent PNG looks better here, and costs nothing at export time. */
.shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    radial-gradient(62% 62% at 50% 40%, rgba(227, 200, 124, 0.1), transparent 70%),
    var(--ink-3);
}

.shot img {
  display: block;
  width: 100%;
  height: 10rem;
  object-fit: contain;
  padding: 0.75rem;
  box-sizing: border-box;
}

.card > .shot { margin-bottom: 1.15rem; }

.card-lead { display: flex; gap: 0.9rem; align-items: flex-start; }
.card-lead-body { flex: 1; min-width: 0; }

.shot-sm { flex: 0 0 4.6rem; }
.shot-sm img { height: 4.6rem; padding: 0.4rem; }

.card-rank {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.card h3 { font-size: clamp(1.5rem, 5vw, 1.95rem); }
.card.alt h3 { font-size: 1.3rem; }

.match {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--muted-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

.badge {
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Three variants and no more. Gold says the house stands behind it, green
   says it is a property worth knowing, quiet says it is a caveat. */
.badge.accent { color: var(--gold);      border-color: rgba(227, 200, 124, 0.5); }
.badge.good   { color: var(--green-lit); border-color: rgba(95, 157, 118, 0.5); }
.badge.quiet  { color: var(--muted-dim); }

/* The one line of persuasion on a card. Serif italic, because it is a person
   talking, not a data field. */
.note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.06rem;
  line-height: 1.5;
  color: var(--cream);
  margin: 1.1rem 0 0;
}

.card.alt .note { font-size: 0.98rem; color: var(--muted); }

/* An aside from behind the bar. Quieter than .note and set off by a rule. */
.house-note {
  margin: 0.9rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.meta { margin-top: 1.25rem; padding-top: 1.15rem; border-top: 1px solid var(--line-soft); }

.meta-row { display: flex; gap: 0.6rem; font-size: 0.88rem; margin-top: 0.5rem; }
.meta-row:first-child { margin-top: 0; }

.meta-key {
  flex: 0 0 auto;
  color: var(--muted-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  padding-top: 0.28rem;
  width: 5.5rem;
}

.meta-val { color: var(--muted); }
.meta-val.price { font-variant-numeric: tabular-nums; color: var(--cream); }

/* Why this was picked. A list, but never rendered with list bullets, the
   gold dot is the mark. */
.why { margin: 1.15rem 0 0; padding: 0; list-style: none; }

.why li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.why li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.75;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin: 2.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.results-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}

/* ---------------------------------------------------------------- footer */

.foot {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-dim);
  font-size: 0.8rem;
  text-align: center;
}

/* ----------------------------------------------------------------- a11y */

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- print */
/* Guests do print these, and a phone screenshot goes to the printer as often
   as the page does. Ink on white, chrome gone. */

@media print {
  body { background: #fff; color: #000; }
  .top, .results-actions, .nav, .foot { display: none; }
  /* A product photo on a sheet of paper is a smear of toner. */
  .shot { display: none; }
  .card { border: 1px solid #ccc; background: #fff; page-break-inside: avoid; }
  .card h3, .note, .meta-val, .why li { color: #000; }
}
