/* Tonight's Drink — a warm little home bar booklet.
   Type: Fraunces (self-hosted, warm serif) over EB Garamond / Iowan / Palatino / Georgia.
   Palette: warm cream paper, warm ink, hairlines in warm taupe.
   Accents (small areas only): amber, caramel, terracotta. All other color = the drinks. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-500-italic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}

:root {
  --paper: #f6efe1;
  --paper-card: #fffdf6;
  --ink: #33291e;
  --ink-soft: #77664f;
  --ink-faint: #a08a6d;
  --line: #e0d2b8;
  --line-warm: #cdbb98;
  --amber: #b5772c;
  --caramel: #a05e2c;
  --terra: #b15f3c;
  --shadow-soft: 0 22px 44px rgba(122, 84, 40, 0.16), 0 4px 12px rgba(122, 84, 40, 0.10);
  --shadow-card: 0 10px 26px rgba(122, 84, 40, 0.14), 0 2px 6px rgba(122, 84, 40, 0.08);
  --serif: "Fraunces", "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 92px;
  overflow-x: hidden;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

main, .site-head { position: relative; z-index: 1; }

.wrap, main { max-width: 560px; margin: 0 auto; padding: 0 22px; }

/* ---------- header ---------- */
.site-head { text-align: center; padding: 44px 22px 6px; max-width: 560px; margin: 0 auto; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--caramel);
  font-weight: 600;
}
.eyebrow.center { text-align: center; }

.site-head h1 {
  font-size: clamp(40px, 11vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  margin: 14px 0 12px;
  letter-spacing: 0.01em;
}
.site-head h1 em { font-style: italic; font-weight: 500; color: var(--caramel); }

.head-sub { font-size: 17px; line-height: 1.55; color: var(--ink-soft); font-style: italic; }

/* ---------- views ---------- */
.view { display: none; padding-top: 26px; animation: viewIn 0.45s ease both; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-title { font-size: 32px; font-weight: 600; text-align: center; margin: 10px 0 8px; }
.view-sub { text-align: center; color: var(--ink-soft); font-size: 16px; line-height: 1.55; max-width: 420px; margin: 0 auto; }

/* ---------- deck ---------- */
.deck-lede {
  text-align: center;
  font-style: italic;
  font-size: 20px;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.deck {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 3 / 4.1;
  margin: 0 auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.stack-card {
  position: absolute; inset: 0;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}
.stack-card.sc-3 { transform: rotate(-4.5deg) translate(-7px, 7px); }
.stack-card.sc-2 { transform: rotate(2.8deg) translate(6px, 3px); }
.stack-card.sc-1 {
  transform: rotate(-0.6deg);
  box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.35s ease;
}
.deck:hover .stack-card.sc-1 { transform: rotate(-0.6deg) translateY(-4px); }

/* flipping like a page of the booklet */
.stack-card.sc-1.is-flipping {
  animation: pageFlip 0.55s ease forwards;
  transform-origin: left center;
}
@keyframes pageFlip {
  0% { transform: rotate(-0.6deg) rotateY(0deg); }
  55% { transform: rotate(-1.5deg) rotateY(-72deg) translateX(-8px); opacity: 0.95; }
  100% { transform: rotate(-2deg) rotateY(-96deg) translateX(-16px); opacity: 0; }
}

.cover { text-align: center; padding: 28px 22px; }
.cover-eyebrow {
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 600;
}
.cover-title { font-size: 46px; font-weight: 600; line-height: 1.12; margin: 20px 0 18px; }
.cover-title em { font-style: italic; font-weight: 500; color: var(--caramel); }
.cover-rule { width: 54px; height: 1px; background: var(--line-warm); margin: 0 auto 18px; position: relative; }
.cover-rule::after {
  content: ""; position: absolute; left: 50%; top: -2.5px; width: 5px; height: 5px;
  background: var(--terra); border-radius: 50%; transform: translateX(-50%);
}
.cover-foot { font-style: italic; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }

.deck-progress { text-align: center; margin-top: 26px; color: var(--ink-soft); font-size: 15.5px; font-style: italic; }

.btn-primary {
  display: block; margin: 16px auto 0;
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  color: #fff8ec; background: var(--ink);
  border: none; border-radius: 999px;
  padding: 15px 34px; cursor: pointer;
  box-shadow: 0 12px 26px rgba(51, 41, 30, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.btn-primary:hover { background: #453625; }
.btn-primary:active { transform: scale(0.96); box-shadow: 0 6px 14px rgba(51,41,30,.25); }

.deck-hint { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--ink-faint); font-style: italic; }

/* ---------- browse ---------- */
.search-wrap { display: block; margin: 24px 0 6px; }
.search-label { display: block; font-style: italic; color: var(--ink-soft); font-size: 15px; margin-bottom: 8px; }
.search-wrap input {
  width: 100%; font-family: var(--serif); font-size: 17px; color: var(--ink);
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 16px; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-wrap input:focus { border-color: var(--line-warm); box-shadow: 0 0 0 3px rgba(176, 119, 44, 0.12); }
.search-wrap input::placeholder { color: var(--ink-faint); font-style: italic; }

.chips { display: flex; gap: 20px; flex-wrap: wrap; margin: 16px 2px 8px; }
.chip {
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
  padding: 4px 1px; border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chip.is-on { color: var(--caramel); border-bottom-color: var(--terra); font-weight: 600; }

.browse-list { margin-top: 8px; }
.browse-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 15px 4px; cursor: pointer; text-align: left; font-family: var(--serif);
  transition: background 0.2s ease;
  border-radius: 6px;
}
.browse-row:active { background: rgba(176, 119, 44, 0.07); }
.row-no { font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em; color: var(--amber); font-weight: 700; width: 34px; flex: none; }
.row-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(51,41,30,0.15); }
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 19px; font-weight: 600; color: var(--ink); }
.row-meta { font-size: 13.5px; color: var(--ink-soft); font-style: italic; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-status { font-size: 13px; flex: none; font-style: italic; }
.row-status.ok { color: var(--caramel); font-weight: 600; }
.row-status.miss { color: var(--ink-faint); }
.row-fav { color: var(--terra); font-size: 15px; flex: none; }

.empty-note { text-align: center; color: var(--ink-soft); font-style: italic; padding: 30px 10px; font-size: 16px; }

/* ---------- my bar ---------- */
.bar-score {
  margin: 26px 0 8px; text-align: center;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px 18px 18px; box-shadow: var(--shadow-card);
}
.bar-score-num { font-size: 34px; font-weight: 600; }
.bar-score-num .of { color: var(--amber); }
.bar-score-text { color: var(--ink-soft); font-style: italic; margin-top: 2px; }
.bar-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.btn-quiet {
  font-family: var(--serif); font-size: 15px; font-weight: 500;
  background: none; color: var(--caramel); cursor: pointer;
  border: 1px solid var(--line-warm); border-radius: 999px; padding: 8px 18px;
  transition: background 0.2s ease, transform 0.12s ease;
}
.btn-quiet:active { transform: scale(0.95); background: rgba(176,119,44,0.08); }
.staples-note { margin-top: 14px; font-size: 13px; color: var(--ink-faint); font-style: italic; }

.bar-group { margin-top: 26px; }
.bar-group-title {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--caramel); font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--line-warm);
}
.bar-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 12.5px 2px; cursor: pointer; font-family: var(--serif); text-align: left;
}
.bar-item .box {
  width: 23px; height: 23px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-warm);
  display: grid; place-items: center;
  color: #fff8ec; font-size: 13px; line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.bar-item.is-on .box { background: var(--amber); border-color: var(--amber); }
.bar-item:active .box { transform: scale(0.85); }
.bar-item .bar-name { font-size: 16.5px; color: var(--ink-soft); transition: color 0.18s ease; }
.bar-item.is-on .bar-name { color: var(--ink); font-weight: 600; }

/* ---------- footer ---------- */
.site-foot { text-align: center; padding: 44px 0 10px; color: var(--ink-soft); }
.foot-rule { width: 54px; height: 1px; background: var(--line-warm); margin: 0 auto 16px; }
.site-foot p { font-size: 15px; }
.foot-small { font-size: 13px !important; color: var(--ink-faint); margin-top: 6px; line-height: 1.6; font-style: italic; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 8px;
  background: rgba(250, 245, 233, 0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.tab {
  font-family: var(--serif); font-size: 16.5px; font-weight: 500;
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
  padding: 7px 16px; position: relative;
}
.tab .tab-name { border-bottom: 2px solid transparent; padding-bottom: 3px; transition: all 0.2s ease; }
.tab.is-on { color: var(--ink); font-weight: 600; }
.tab.is-on .tab-name { border-bottom-color: var(--terra); }

/* ---------- recipe overlay ---------- */
.recipe-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.recipe-inner { max-width: 560px; margin: 0 auto; padding: 20px 22px 60px; position: relative; }
.recipe-overlay::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.recipe-top { display: flex; justify-content: space-between; align-items: center; }
.btn-back {
  font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--caramel);
  background: none; border: none; cursor: pointer; padding: 8px 4px;
}
.btn-fav {
  font-family: var(--serif); font-size: 15.5px; font-weight: 500; color: var(--ink-soft);
  background: none; border: 1px solid var(--line-warm); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; transition: all 0.18s ease;
}
.btn-fav:active { transform: scale(0.94); }
.btn-fav.is-on { color: var(--terra); border-color: var(--terra); background: rgba(177, 95, 60, 0.07); }

.recipe-no { text-align: center; margin-top: 18px; }
.recipe-name { text-align: center; font-size: clamp(36px, 10vw, 48px); font-weight: 600; line-height: 1.12; margin-top: 8px; }
.recipe-name em { font-style: italic; font-weight: 500; }
.recipe-note { text-align: center; font-style: italic; color: var(--ink-soft); font-size: 16.5px; line-height: 1.55; margin: 12px auto 0; max-width: 400px; }

.glass-wrap { display: flex; justify-content: center; margin: 14px 0 2px; }
.glass-wrap svg { width: 168px; height: auto; filter: drop-shadow(0 14px 16px rgba(122, 84, 40, 0.16)); }

.tag-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag {
  font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-weight: 600;
}
.tag.abv-zero { color: var(--caramel); border-color: var(--line-warm); }

.status-stamp {
  display: table; margin: 20px auto 0;
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--terra); border: 1.5px solid var(--terra); border-radius: 8px;
  padding: 8px 16px; transform: rotate(-2deg);
  background: rgba(177, 95, 60, 0.05);
}
.status-stamp.ok { color: var(--caramel); border-color: var(--caramel); background: rgba(176,119,44,0.06); }
.status-sub { text-align: center; color: var(--ink-soft); font-style: italic; font-size: 14.5px; margin-top: 10px; }
.status-sub button { font-family: var(--serif); font-style: italic; font-size: 14.5px; color: var(--caramel); background: none; border: none; border-bottom: 1px solid var(--line-warm); cursor: pointer; padding: 0; }

.section-eyebrow { margin: 34px 0 4px; }

.servings-row { display: flex; align-items: baseline; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.servings-label { font-style: italic; color: var(--ink-soft); font-size: 15.5px; }
.serving-opt {
  font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--ink-soft);
  background: none; border: none; cursor: pointer; padding: 2px 3px 4px;
  border-bottom: 2px solid transparent; position: relative;
  transition: color 0.18s ease;
}
.serving-opt.is-on { color: var(--ink); font-weight: 700; border-bottom-color: var(--terra); }
.serving-opt.is-on::after {
  content: ""; position: absolute; right: -9px; top: 1px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--terra);
}

.ing-table { margin-top: 10px; }
.ing-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 11px 1px; border-bottom: 1px solid var(--line);
}
.ing-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; position: relative; top: -1px; }
.ing-dot.have { background: var(--amber); }
.ing-dot.miss { border: 1.5px solid var(--line-warm); background: transparent; }
.ing-name { flex: 1; font-size: 17px; }
.ing-name .opt { font-size: 12.5px; color: var(--ink-faint); font-style: italic; margin-left: 6px; }
.ing-row.is-miss .ing-name { color: var(--ink-faint); }
.ing-qty { font-size: 17px; font-weight: 600; text-align: right; white-space: nowrap; }
.ing-note { font-size: 13.5px; color: var(--ink-soft); font-style: italic; margin-top: 10px; }

.steps-list { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.step {
  display: flex; gap: 13px; align-items: flex-start; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 13px 2px; cursor: pointer; font-family: var(--serif); text-align: left;
}
.step .box {
  width: 24px; height: 24px; flex: none; border-radius: 50%; margin-top: 1px;
  border: 1.5px solid var(--line-warm); display: grid; place-items: center;
  color: #fff8ec; font-size: 13px; transition: all 0.18s ease;
}
.step.is-done .box { background: var(--amber); border-color: var(--amber); }
.step:active .box { transform: scale(0.85); }
.step .step-text { font-size: 16.5px; line-height: 1.55; color: var(--ink); transition: color 0.2s ease; }
.step.is-done .step-text { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: rgba(176,119,44,0.5); text-decoration-thickness: 1px; }
.step-progress { font-style: italic; color: var(--ink-soft); font-size: 14.5px; margin-top: 12px; text-align: center; }

.btn-cheers {
  display: block; margin: 20px auto 0;
  font-family: var(--serif); font-size: 17.5px; font-weight: 600;
  border-radius: 999px; padding: 14px 30px; cursor: pointer;
  border: 1.5px solid var(--line-warm); background: none; color: var(--ink-faint);
  transition: all 0.25s ease;
}
.btn-cheers.is-ready {
  background: var(--ink); color: #fff8ec; border-color: var(--ink);
  box-shadow: 0 12px 26px rgba(51,41,30,0.26);
  animation: cheersIn 0.4s ease both;
}
.btn-cheers.is-done {
  background: var(--terra); border-color: var(--terra); color: #fff4e8;
  animation: stampIn 0.35s ease both;
}
@keyframes cheersIn { from { transform: scale(0.92); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
@keyframes stampIn { 0% { transform: scale(1.25) rotate(-3deg); } 100% { transform: scale(1) rotate(-1deg); } }

.btn-cheers:active { transform: scale(0.96); }

.recipe-foot { text-align: center; margin-top: 36px; }
.btn-again {
  font-family: var(--serif); font-size: 16.5px; font-style: italic; font-weight: 500;
  color: var(--caramel); background: none; border: none; cursor: pointer;
  border-bottom: 1px solid var(--line-warm); padding-bottom: 2px;
}

/* circle reveal when a recipe opens */
.recipe-overlay.reveal { animation: circleReveal 0.55s ease both; }
@keyframes circleReveal {
  from { clip-path: circle(0% at var(--rx, 50%) var(--ry, 40%)); }
  to { clip-path: circle(142% at var(--rx, 50%) var(--ry, 40%)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- mood music ---------- */
.site-foot a { color: var(--caramel); text-decoration: none; border-bottom: 1px solid var(--line-warm); }

.music-toggle {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 16px; z-index: 80;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--paper-card); border: 1.5px solid var(--line-warm);
  color: var(--ink-faint); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow-card);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.music-toggle:active { transform: scale(0.92); }
.music-toggle .mt-note { font-family: var(--serif); font-size: 21px; line-height: 1; }
.music-toggle.is-on { color: var(--terra); border-color: var(--terra); }
.music-toggle.is-on .mt-note { animation: noteSway 2.4s ease-in-out infinite; }
@keyframes noteSway {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-1.5px) rotate(4deg); }
}
.music-toggle .mt-slash { display: none; }
.music-toggle.is-off .mt-slash {
  display: block; position: absolute; width: 26px; height: 1.5px;
  background: var(--terra); border-radius: 2px; opacity: 0.85;
  transform: rotate(-38deg);
}

.music-line {
  font-style: italic; color: var(--ink-faint); font-size: 13.5px;
  text-align: center; margin-bottom: 14px; min-height: 1.2em;
}
