/* Crushoney — design tokens + components */

@font-face { font-family: 'Gambetta'; src: url('./assets/fonts/gambetta-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('./assets/fonts/gambetta-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('./assets/fonts/gambetta-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('./assets/fonts/switzer-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('./assets/fonts/switzer-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('./assets/fonts/switzer-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem;

  /* Night palette taken from the painting: teal-black street, ochre interior light, neon red */
  --color-bg: oklch(0.15 0.02 175);
  --color-surface: oklch(0.17 0.022 175 / 0.78);
  --color-surface-2: oklch(0.22 0.025 170 / 0.9);
  --color-surface-solid: oklch(0.18 0.02 172);
  --color-border: oklch(0.92 0.04 90 / 0.14);
  --color-divider: oklch(0.92 0.04 90 / 0.09);

  --color-text: oklch(0.93 0.035 88);
  --color-text-muted: oklch(0.76 0.035 88);
  --color-text-faint: oklch(0.6 0.03 88);
  --color-ochre: oklch(0.83 0.11 82);

  --color-primary: oklch(0.6 0.2 28);        /* neon red */
  --color-primary-hover: oklch(0.54 0.2 28);
  --color-primary-active: oklch(0.48 0.18 28);
  --color-on-primary: oklch(0.98 0.01 80);

  --color-live: oklch(0.78 0.14 150);

  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-xl: 1rem; --radius-full: 9999px;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-lg: 0 18px 48px oklch(0.05 0.02 175 / 0.55);

  --font-display: 'Gambetta', 'Georgia', serif;
  --font-body: 'Switzer', 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
}

html, body { background: var(--color-bg); }
body { overflow-x: hidden; }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--color-surface-solid); color: var(--color-text);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
}
.skip-link:focus { top: var(--space-4); }

/* ---------- Scene ---------- */
.scene { position: fixed; inset: 0; z-index: 0; }
.scene img {
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 62% 40%;
}
.scene::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, oklch(0.1 0.02 175 / 0.55) 0%, oklch(0.1 0.02 175 / 0.15) 38%, transparent 60%),
    linear-gradient(0deg, oklch(0.1 0.02 175 / 0.5) 0%, transparent 35%);
}

/* ---------- Layout ---------- */
.page {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(var(--space-4), 3vw, var(--space-10));
  gap: var(--space-4);
}
main { display: flex; align-items: flex-end; }

/* ---------- Bar-Talk panel ---------- */
.talk {
  width: min(380px, 100%);
  background: var(--color-surface);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.talk__head { padding: var(--space-5) var(--space-5) var(--space-3); border-bottom: 1px solid var(--color-divider); }
.talk__eyebrow {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-ochre); font-weight: 500;
}
.dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--color-live); box-shadow: 0 0 0 3px oklch(0.78 0.14 150 / 0.18); }
.talk h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--text-xl); line-height: 1.1;
  margin-top: var(--space-2); color: var(--color-text);
}
.talk__sub { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); }

.talk__stream {
  height: clamp(220px, 36vh, 320px);
  overflow: hidden;
  padding: var(--space-4) var(--space-5);
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-3);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 26%);
}
.bubble {
  max-width: 86%;
  align-self: flex-start;
  animation: bubble-in 520ms var(--ease-out) both;
}
.bubble--right { align-self: flex-end; text-align: right; }
.bubble__who { font-size: var(--text-xs); color: var(--color-ochre); font-weight: 500; margin-bottom: 2px; display: flex; gap: var(--space-2); align-items: baseline; }
.bubble--right .bubble__who { justify-content: flex-end; }
.bubble__badge { font-size: var(--text-xs); color: var(--color-text-faint); font-weight: 400; }
.bubble__text {
  display: inline-block; text-align: left;
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
  font-size: var(--text-sm); line-height: 1.45; color: var(--color-text);
  overflow-wrap: anywhere;
}
.bubble--right .bubble__text { border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg); }
.bubble--leaving { animation: bubble-out 400ms var(--ease-out) both; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bubble-out { to { opacity: 0; } }

.talk__empty { margin: auto; text-align: center; font-size: var(--text-sm); color: var(--color-text-muted); font-style: italic; max-width: 28ch; }
.talk__foot { padding: var(--space-3) var(--space-5) var(--space-5); border-top: 1px solid var(--color-divider); display: grid; gap: var(--space-3); }
.talk__status { font-size: var(--text-xs); color: var(--color-text-faint); display: flex; justify-content: space-between; gap: var(--space-2); }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.notice { font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.notice strong { color: var(--color-text); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 44px; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
}
.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--primary:active { background: var(--color-primary-active); }
.btn--ghost { color: var(--color-text); border: 1px solid var(--color-border); }
.btn--ghost:hover { background: oklch(0.92 0.04 90 / 0.08); }
.btn--small { min-height: 36px; padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
:focus-visible { outline-color: var(--color-ochre); }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-6);
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.foot a { color: var(--color-text-muted); text-decoration: none; }
.foot a:hover { color: var(--color-text); }

/* ---------- Dialogs ---------- */
dialog {
  margin: auto;
  width: min(560px, calc(100% - 2 * var(--space-4)));
  max-height: calc(100dvh - 2 * var(--space-4));
  background: var(--color-surface-solid); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 0;
}
dialog::backdrop { background: oklch(0.08 0.02 175 / 0.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog[open] { animation: dlg-in 360ms var(--ease-out) both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.dlg__inner { padding: var(--space-6); display: grid; gap: var(--space-5); }
.dlg__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); }
.dlg__head h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); line-height: 1.1; }
.close { width: 44px; height: 44px; border-radius: var(--radius-md); display: grid; place-items: center; color: var(--color-text-muted); flex: none; }
.close:hover { background: oklch(0.92 0.04 90 / 0.08); color: var(--color-text); }
.dlg h3 { font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-ochre); }
.dlg p, .dlg li { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.55; }
.dlg p strong { color: var(--color-text); font-weight: 500; }

.callout {
  background: oklch(0.6 0.2 28 / 0.1);
  border: 1px solid oklch(0.6 0.2 28 / 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: var(--color-text); line-height: 1.5;
}

.menu { list-style: none; display: grid; }
.menu li { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-divider); max-width: none; }
.menu li:last-child { border-bottom: 0; }
.menu__name { color: var(--color-text); font-weight: 500; }
.menu__price { color: var(--color-ochre); font-variant-numeric: tabular-nums; font-weight: 500; }
.menu__desc { grid-column: 1 / -1; font-size: var(--text-xs); color: var(--color-text-faint); }

.tabs { display: flex; gap: var(--space-1); background: oklch(0.92 0.04 90 / 0.05); border-radius: var(--radius-md); padding: var(--space-1); }
.tab { flex: 1; min-height: 40px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); padding: 0 var(--space-2); }
.tab[aria-selected='true'] { background: var(--color-surface-2); color: var(--color-text); }
.pay { display: grid; grid-template-columns: 148px 1fr; gap: var(--space-4); align-items: start; }
.pay[hidden] { display: none; }
.qr { background: #fff; border-radius: var(--radius-md); padding: var(--space-2); width: 148px; height: 148px; }
.qr img { width: 100%; height: 100%; }
.pay__meta { display: grid; gap: var(--space-2); min-width: 0; }
.pay__label { font-size: var(--text-xs); color: var(--color-text-faint); }
.addr {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text);
  background: oklch(0.92 0.04 90 / 0.06); border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm); padding: var(--space-2);
  overflow-wrap: anywhere; user-select: all;
}
.copy-state { font-size: var(--text-xs); color: var(--color-live); min-height: 1.2em; }

.code {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text);
  background: oklch(0.1 0.015 175); border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  overflow-x: auto; white-space: pre; line-height: 1.6;
}
.links { list-style: none; display: grid; gap: var(--space-2); }
.links a { color: var(--color-ochre); text-underline-offset: 3px; }
.rules { padding-left: var(--space-5); display: grid; gap: var(--space-1); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .page { padding: var(--space-3); }
  .talk { width: 100%; }
  .talk__head { padding: var(--space-4) var(--space-4) var(--space-3); }
  .talk__stream { height: clamp(150px, 26vh, 220px); padding: var(--space-3) var(--space-4); }
  .talk__foot { padding: var(--space-3) var(--space-4) var(--space-4); }
  .scene img { height: 62%; object-position: 74% 30%; }
  .scene::after { background: linear-gradient(0deg, var(--color-bg) 38%, oklch(0.15 0.02 175 / 0.6) 50%, transparent 70%); }
  .pay { grid-template-columns: 1fr; }
  .qr { margin-inline: auto; }
  .foot { justify-content: center; text-align: center; }
  .foot nav { justify-content: center; }
}

.foot-link { font-size: var(--text-xs); color: var(--color-text-muted); padding: 0; min-height: 0; }
.foot-link:hover { color: var(--color-text); }
.foot nav a, .foot-link { padding-block: var(--space-2); }
.dlg a { color: var(--color-ochre); text-underline-offset: 3px; }
