/* Draught — the pub at closing time: dark wood, one amber lamp.
   Descended from Matinée's projector-lamp palette, which was already the
   colour of beer. No external fonts, no trackers, no dependencies. */

:root {
  --bg: #0e0c09;
  --surface: #171310;
  --surface-2: #1e1914;
  --line: #2c251d;
  --text: #ece4d6;
  --muted: #9b8f7c;
  --faint: #6b6252;
  --amber: #e6a648;
  --amber-dim: #b28031;
  --foam: #f3ead6;
  --red: #c8442e;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1060px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

/* condensation — the haze on a cold glass */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 3;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 15px 0 12px;
}
.masthead .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand {
  font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 1.05rem; color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--amber); }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; align-items: baseline; }
.site-nav a, .site-nav button {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
  border: 0; background: none; cursor: pointer; padding: 0 0 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav button:hover { color: var(--text); text-decoration: none; }
.site-nav a.on { color: var(--amber); border-bottom-color: var(--amber); }
.site-nav .cta {
  color: #14100a; background: var(--amber); border-radius: 5px;
  padding: 6px 13px; font-weight: 700; border-bottom: 0;
}
.site-nav .cta:hover { background: #f0b45c; color: #14100a; }
.avatar { width: 24px; height: 24px; border-radius: 50%; vertical-align: -7px; margin-right: 7px; background: var(--surface-2); }

/* ---------- headings & sections ---------- */
.hero { padding: 44px 0 8px; }
.hero h1, .hero h2 {
  font-size: clamp(2.1rem, 6.5vw, 3.8rem); font-weight: 900; line-height: 1.02;
  letter-spacing: 0.01em; text-transform: uppercase; margin: 0 0 10px;
}
.hero em { font-style: normal; color: var(--amber); }
.hero p { color: var(--muted); max-width: 62ch; margin: 0; }
.hero .kicker {
  font-family: var(--mono); font-size: 0.72rem; color: var(--amber);
  text-transform: uppercase; letter-spacing: 0.22em; margin: 0 0 12px;
}

section.block { margin: 40px 0; }
.block-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.block-head h3 {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--text); margin: 0;
  white-space: nowrap;
}
.block-head .rule { flex: 1; height: 1px; background: var(--line); }
.block-head .note { font-family: var(--mono); font-size: 0.68rem; color: var(--faint); letter-spacing: 0.08em; white-space: nowrap; }

.grid2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.panel h4 { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 30px 0 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 16px 13px; }
.tile .k { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.tile .v { font-size: 1.9rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; margin: 0; }
.tile .s { font-size: 0.76rem; color: var(--faint); margin: 5px 0 0; }

/* ---------- the ledger: a list of pours ---------- */
.pours { list-style: none; margin: 0; padding: 0; }
.pours li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px;
  align-items: baseline; padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.pours li:last-child { border-bottom: 0; }
.pours .d { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); white-space: nowrap; }
.pours .t { min-width: 0; }
.pours .t .beer { font-weight: 600; }
.pours .t .by { color: var(--muted); }
.pours .t .meta { font-family: var(--mono); font-size: 0.66rem; color: var(--faint); letter-spacing: 0.05em; margin-top: 2px; }
.pours .note { grid-column: 2 / -1; font-size: 0.88rem; color: var(--muted); font-style: italic; margin: 4px 0 0; }
.pours .r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pours .stars { color: var(--amber); font-size: 0.9rem; white-space: nowrap; letter-spacing: 0.04em; }
.pours .kill {
  font-family: var(--mono); font-size: 0.62rem; color: var(--faint); background: none;
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer; padding: 2px 6px;
}
.pours .kill:hover { color: var(--red); border-color: var(--red); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.84rem; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; color: var(--text); background: var(--surface); text-decoration: none;
}
a.chip:hover, button.chip:hover { border-color: var(--amber); color: var(--amber); text-decoration: none; }
.chip .n { font-family: var(--mono); font-size: 0.72rem; color: var(--amber); margin-left: 6px; }
button.chip { font: inherit; font-size: 0.84rem; cursor: pointer; }
.chip-on { background: var(--amber); color: #14100a; border-color: var(--amber); font-weight: 700; }

/* ---------- buttons & forms ---------- */
.btn {
  font: inherit; font-family: var(--mono); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 9px 16px;
  text-decoration: none; display: inline-block;
}
.btn:hover { border-color: var(--amber); color: var(--amber); text-decoration: none; }
.btn-amber { background: var(--amber); color: #14100a; border-color: var(--amber); }
.btn-amber:hover { background: #f0b45c; color: #14100a; border-color: #f0b45c; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { font-size: 0.82rem; padding: 13px 24px; }

.field { margin-bottom: 15px; position: relative; }
.field label {
  display: block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 700;
}
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 11px 13px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--amber); border-color: var(--amber); }
.field .hint { font-size: 0.76rem; color: var(--faint); margin: 5px 0 0; }
.row { display: grid; gap: 15px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .row.two { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: 1fr 1fr 1fr; } }

.msg { font-family: var(--mono); font-size: 0.78rem; margin: 10px 0 0; min-height: 1.2em; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--amber); }

/* autocomplete */
.ac {
  position: absolute; z-index: 9; left: 0; right: 0; top: 100%; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  max-height: 268px; overflow-y: auto;
}
.ac:empty { display: none; }
.ac button {
  display: block; width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 9px 13px; color: var(--text);
}
.ac button:last-child { border-bottom: 0; }
.ac button:hover, .ac button[aria-selected="true"] { background: var(--surface-2); }
.ac .n { font-weight: 600; font-size: 0.93rem; }
.ac .m { font-family: var(--mono); font-size: 0.66rem; color: var(--faint); letter-spacing: 0.05em; }

/* ---------- the rating rail: 0.5 to 5, half-stars ---------- */
.rate { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 2rem; }
.stars-input { display: inline-flex; direction: ltr; font-size: 1.75rem; line-height: 1; color: var(--faint); }
.stars-input .half { position: relative; width: 0.5em; height: 1em; overflow: hidden; cursor: pointer; }
.stars-input .half span { position: absolute; left: 0; top: 0; width: 1em; pointer-events: none; }
.stars-input .half.rh span { left: -0.5em; }
.stars-input .half.lit span { color: var(--amber); }
.rate .out { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.1em; min-width: 5.5em; }
.rate .clear { font-family: var(--mono); font-size: 0.66rem; color: var(--faint); background: none; border: 0; cursor: pointer; }
.rate .clear:hover { color: var(--red); }

/* ---------- profile head ---------- */
.phead { display: flex; align-items: center; gap: 18px; padding: 38px 0 4px; flex-wrap: wrap; }
.phead img { width: 68px; height: 68px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.phead h2 { font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; margin: 0; line-height: 1.05; }
.phead .at { font-family: var(--mono); font-size: 0.78rem; color: var(--amber); letter-spacing: 0.1em; }
.phead .bio { color: var(--muted); font-size: 0.92rem; margin: 5px 0 0; max-width: 52ch; }

/* ---------- histogram (a beer's ratings) ---------- */
.hist { display: flex; align-items: flex-end; gap: 3px; height: 62px; }
.hist .col { flex: 1; background: var(--amber-dim); border-radius: 2px 2px 0 0; min-height: 2px; }
.hist .col:hover { background: var(--amber); }
.hist .col.nil { background: var(--line); }
.hist-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.62rem; color: var(--faint); margin-top: 5px; letter-spacing: 0.08em; }

/* ---------- landing ---------- */
.gate { min-height: calc(100svh - 120px); display: grid; place-items: center; padding: 40px 0; }
.gate-inner { text-align: center; max-width: 620px; }
.gate .glass { font-size: 3.2rem; line-height: 1; margin-bottom: 6px; }
.gate h1 {
  font-size: clamp(2.6rem, 11vw, 5rem); font-weight: 900; letter-spacing: 0.06em;
  text-transform: uppercase; margin: 0 0 6px; line-height: 0.98;
}
.gate .tag { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.2em; margin: 0 0 8px; }
.gate .pitch { color: var(--muted); font-size: 1.04rem; margin: 20px auto 30px; max-width: 46ch; }
.signin { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gate .fine { font-size: 0.76rem; color: var(--faint); margin-top: 26px; line-height: 1.6; }
.threeup { display: grid; gap: 20px; grid-template-columns: 1fr; margin: 56px 0 0; text-align: left; }
@media (min-width: 760px) { .threeup { grid-template-columns: repeat(3, 1fr); } }
.threeup h4 { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); margin: 0 0 7px; }
.threeup p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--faint); }
.empty p { margin: 0 0 16px; }
.loading { font-family: var(--mono); font-size: 0.74rem; color: var(--faint); letter-spacing: 0.16em; text-transform: uppercase; padding: 48px 0; text-align: center; }
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 22px 0 40px; font-family: var(--mono); font-size: 0.68rem; color: var(--faint); letter-spacing: 0.08em; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.head-note { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.abv { font-family: var(--mono); font-size: 0.72rem; color: var(--amber); }

@media (prefers-reduced-motion: no-preference) {
  .hero, .phead, .tiles, .gate-inner { animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .tiles { animation-delay: 0.1s; }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
}
