/* Tangerine Phuket — Menu v3 — shared mobile-first design system */

/* Hobo is shipped locally (the brand wordmark/headline face).
   Space Mono + Noto Sans Thai are loaded from Google Fonts via <link> in each HTML page.
   Tan Nimbus is a commercial face we don't ship; fall back to a system serif. */
@font-face { font-family: 'Hobo';   src: url('../fonts/hobo-bt.ttf') format('truetype'); font-display: swap; }

:root {
  --paper:  #F6F0E4;
  --card:   #FFFCF5;
  --navy:   #061E2D;
  --moon:   #EFE6CF;
  --tang:   #EE7F3F;
  --terra:  #C0653A;
  --teal:   #2F6F6A;
  --must:   #E0B84F;
  --brick:  #B2492E;
  --purple: #8F79B7;
  --royal:  #2C45B5;
  --monk:   #7a5a36;
}

/* Theme palettes — applied via body.theme-* */
body.theme-day {
  --bg: var(--paper);
  --fg: var(--navy);
  --line: var(--navy);
  --accent: var(--tang);
  --sub: var(--teal);
  --kick: var(--terra);
  --de: #6b5f4e;
  --dot: rgba(6,30,45,.3);
  --photo-card: #efe6d2;
  --ftbg: var(--navy);
  --ftfg: var(--moon);
  --ftsub: #9FB6C4;
  --wm-fill: var(--navy);
}

body.theme-night,
body.theme-beer {
  --bg: var(--navy);
  --fg: var(--moon);
  --line: var(--moon);
  --accent: var(--tang);
  --sub: #9FB6C4;
  --kick: var(--must);
  --de: #b9c7d0;
  --dot: rgba(239,230,207,.22);
  --photo-card: #0a2638;
  --ftbg: #03141F;
  --ftfg: var(--moon);
  --ftsub: #9FB6C4;
  --wm-fill: var(--moon);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Mono', 'Thai', 'Courier Prime', monospace;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

img { max-width: 100%; display: block; }

/* ---------- Sticky top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--dot);
  /* respect iPhone notch */
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar a {
  font-family: 'Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--fg);
  text-decoration: none;
  padding: 14px 14px;
  border: 1.5px solid var(--dot);
  border-radius: 999px;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.topbar a:hover { border-color: var(--accent); color: var(--accent); }
.topbar a.home {
  font-family: 'Hobo', 'Bubblegum Sans', cursive;
  font-size: 20px;
  letter-spacing: 0;
  padding: 6px 14px 8px;
  border: none;
  color: var(--accent);
  min-width: 44px;
  justify-content: center;
}
.topbar .swatch { /* small menu wordmark chip */
  flex: 1;
  text-align: center;
  font-family: 'Nimbus', serif;
  font-size: 14px;
  letter-spacing: .14em;
  color: var(--fg);
  text-transform: uppercase;
}
.topbar .chips {
  display: flex;
  gap: 6px;
  margin-left: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topbar .chips::-webkit-scrollbar { display: none; }
.topbar .chips a.is-active {
  background: var(--accent);
  color: var(--navy);
  border-color: var(--accent);
}

/* ---------- Masthead (compact) ---------- */
.mast {
  text-align: center;
  padding: 22px 22px 14px;
  padding-top: max(22px, calc(env(safe-area-inset-top) + 14px));
}
.mast .mw { width: min(180px, 38%); height: auto; display: block; margin: 0 auto 8px; }
.mast .mw g path { fill: var(--wm-fill); }
.mast .mk {
  font-family: 'Mono', monospace;
  font-weight: 700;
  letter-spacing: .22em;
  font-size: 12px;
  color: var(--kick);
  text-transform: uppercase;
}
.mast .mk .sep { opacity: .5; margin: 0 6px; }
.mast .mh {
  font-family: 'Mono', monospace;
  letter-spacing: .1em;
  font-size: 10.5px;
  color: var(--sub);
  margin-top: 6px;
}
.mast .mrule {
  width: 90px;
  height: 3px;
  background: var(--accent);
  margin: 14px auto 0;
}

/* ---------- Interactive book ---------- */
.book {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 0 4px;
  outline: none;
}
.book-stage {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
}
.book-track {
  display: flex;
  transition: transform .42s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.page {
  flex: 0 0 100%;        /* mobile: one page fills the stage */
  min-width: 0;
  padding: 6px 2px;
}
/* Desktop: an open book — two pages visible, step by half a width */
.book.spread .page { flex: 0 0 50%; }
.book.spread .page:nth-child(even) {
  border-left: 1px solid var(--dot);
  box-shadow: inset 14px 0 18px -18px rgba(0,0,0,.35);
}
.book.spread .page:nth-child(odd) {
  box-shadow: inset -14px 0 18px -18px rgba(0,0,0,.35);
}

/* edge nav buttons */
.book-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1.5px solid var(--dot);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease, transform .12s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.book-nav svg { width: 20px; height: 20px; }
.book-nav:hover:not(:disabled) { background: var(--accent); color: var(--navy); border-color: var(--accent); }
.book-nav:active:not(:disabled) { transform: translateY(-50%) scale(.94); }
.book-nav:disabled { opacity: .25; cursor: default; }
.book-nav.prev { left: 6px; }
.book-nav.next { right: 6px; }

/* page counter + hint */
.book-counter {
  text-align: center;
  margin-top: 12px;
  font-family: 'Mono', monospace;
  font-weight: 700;
  letter-spacing: .14em;
  font-size: 12px;
  color: var(--sub);
}
.book-counter .cur { color: var(--accent); }
.book-hint {
  text-align: center;
  font-family: 'Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--de);
  opacity: .8;
  margin-top: 4px;
}

/* section (sits inside a page) */
.sec {
  padding: 18px 22px;
}
.sec + .sec { margin-top: 4px; }
.sec .sk {
  font-family: 'Mono', monospace;
  font-weight: 700;
  letter-spacing: .26em;
  font-size: 10px;
  color: var(--kick);
  text-transform: uppercase;
}
.sec h2 {
  font-family: 'Hobo', 'Bubblegum Sans', cursive;
  font-weight: 400;
  font-size: clamp(26px, 4vw, 32px);
  line-height: .95;
  margin: 2px 0 2px;
  color: var(--fg);
}
.sec .sth {
  font-family: 'Thai', 'Noto Sans Thai', sans-serif;
  color: var(--sub);
  font-size: 12px;
  margin-bottom: 10px;
}

/* ---------- Items: dotted leader between name and price ---------- */
.items { list-style: none; }
.items li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  break-inside: avoid;
}
.items .thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--dot);
  flex: none;
}
.items .label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.items .nm {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  color: var(--fg);
}
.items .th {
  font-family: 'Thai', 'Noto Sans Thai', sans-serif;
  color: var(--sub);
  font-size: 10.5px;
  margin-top: 1px;
  line-height: 1.2;
}
.items .de {
  display: block;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--de);
  margin-top: 2px;
  line-height: 1.35;
}
.items .lead {
  flex: 1;
  border-bottom: 1px dotted var(--dot);
  position: relative;
  top: -3px;
  min-width: 12px;
}
.items .pr {
  font-family: 'Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
  flex: none;
}

/* ---------- Beer tap list ---------- */
.taps {
  max-width: 720px;
  margin: 0 auto;
  padding: 6px 22px 8px;
}

/* size column header (500ML / 330ML) */
.beer-sizehead {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 6px 0 10px;
  border-bottom: 1px solid rgba(239,230,207,.18);
}
.beer-sizehead span {
  width: 64px;
  text-align: right;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--must);
}

.beer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(239,230,207,.18);
}
.beer:last-child { border-bottom: none; }
.beer .binfo { flex: 1; min-width: 0; }
.beer .bbrew {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--sub);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.beer .bname {
  font-family: 'Hobo', 'Bubblegum Sans', cursive;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1;
  color: var(--fg);
}
.beer .bstyle {
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--sub);
  margin-top: 6px;
}
.beer .bprices {
  display: flex;
  gap: 18px;
  flex: none;
}
.beer .bprices .bp {
  width: 64px;
  text-align: right;
  font-weight: 700;
  color: var(--tang);
  font-size: clamp(17px, 5vw, 22px);
}

/* cocktails block */
.beer-sub {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 4px solid var(--line);
  text-align: center;
}
.beer-sub .t {
  font-weight: 700;
  letter-spacing: .22em;
  font-size: 11.5px;
  color: var(--kick);
}
.cocktails { margin-top: 8px; }
.ck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(239,230,207,.18);
}
.ck:last-child { border-bottom: none; }
.ck .ckname {
  font-family: 'Hobo', 'Bubblegum Sans', cursive;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1;
  color: var(--fg);
}
.ck b {
  font-weight: 700;
  color: var(--tang);
  font-size: clamp(17px, 5vw, 22px);
  flex: none;
}
.note {
  max-width: 720px;
  margin: 22px auto 36px;
  padding: 16px 24px;
  text-align: center;
  color: var(--must);
  font-size: 12.5px;
  letter-spacing: .03em;
  border: 1.5px solid var(--must);
  margin-left: 22px;
  margin-right: 22px;
}

/* ---------- Footer ---------- */
footer {
  background: var(--ftbg);
  color: var(--ftfg);
  text-align: center;
  padding: 50px 24px;
  padding-bottom: max(50px, env(safe-area-inset-bottom));
}
footer .b {
  font-family: 'Nimbus', serif;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.15;
}
footer .m {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--ftsub);
  margin-top: 12px;
  line-height: 1.9;
}
footer .stripe {
  display: flex;
  max-width: 340px;
  margin: 22px auto 0;
  height: 9px;
}
footer .stripe span { flex: 1; }

/* ---------- Landing page ---------- */
.landing {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 22px;
  padding-top: max(40px, env(safe-area-inset-top));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  text-align: center;
}
.landing .wm {
  width: min(360px, 80%);
  height: auto;
  margin-bottom: 28px;
}
.landing .wm g path { fill: var(--navy); }
.landing .tagline {
  font-family: 'Mono', monospace;
  font-weight: 700;
  letter-spacing: .28em;
  font-size: 12px;
  color: var(--terra);
  margin-bottom: 42px;
}
.landing .picks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: min(420px, 100%);
}
.landing .pick {
  display: block;
  text-decoration: none;
  border-radius: 22px;
  padding: 32px 24px;
  text-align: left;
  position: relative;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .15s ease;
}
.landing .pick:active { transform: scale(.98); }
.landing .pick .pn {
  font-family: 'Hobo', 'Bubblegum Sans', cursive;
  font-size: clamp(36px, 12vw, 56px);
  line-height: .9;
}
.landing .pick .pd {
  font-family: 'Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .8;
  margin-top: 8px;
}
.landing .pick .pk {
  font-family: 'Mono', monospace;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .75;
}
.landing .pick.day {
  background: var(--paper);
  color: var(--navy);
  border: 2px solid var(--navy);
}
.landing .pick.day .pk { color: var(--terra); }
.landing .pick.night {
  background: var(--navy);
  color: var(--moon);
  border: 2px solid var(--moon);
}
.landing .pick.night .pk { color: var(--must); }
.landing .pick.beer {
  background: var(--must);
  color: var(--navy);
  border: 2px solid var(--navy);
}
.landing .pick.beer .pk { color: var(--brick); }
.landing .footer-stripe {
  display: flex;
  width: min(360px, 80%);
  height: 10px;
  margin-top: 40px;
  border-radius: 4px;
  overflow: hidden;
}
.landing .footer-stripe span { flex: 1; }
.landing .footer-addr {
  font-family: 'Mono', monospace;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--monk);
  margin-top: 16px;
}

/* ---------- Loading + error states ---------- */
.state {
  text-align: center;
  padding: 80px 24px;
  font-family: 'Mono', monospace;
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--sub);
}
.state.err { color: var(--brick); }

/* ---------- Responsive: tablet / desktop ---------- */
@media (min-width: 768px) {
  .sec { padding: 22px 28px; }
  .sec h2 { font-size: clamp(30px, 3.4vw, 38px); }
  .items .nm { font-size: 14px; }
  .items .pr { font-size: 14px; }
  .topbar { padding: 12px 22px; }
  .topbar a { font-size: 12px; }
  .landing .picks { grid-template-columns: repeat(3, 1fr); gap: 18px; width: min(900px, 100%); }
  .landing .pick { min-height: 220px; }
  .taps { padding: 14px 30px; }
  .note { margin-left: auto; margin-right: auto; }
}

/* Phones: give the book some breathing room and bigger tap targets */
@media (max-width: 640px) {
  .sec { padding: 16px 18px; }
  .book-nav { width: 40px; height: 40px; }
  .book-nav svg { width: 17px; height: 17px; }
  .book-hint { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .book-track { transition: none; }
}
