/* This Ends In Drinks website.
   Every colour, font, size and shadow here comes from the Figma file "Card Game"
   (App page: Foundations, App Components) and the app's design tokens. */

@font-face { font-family: "Lilita One"; src: url("/assets/fonts/LilitaOne-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Shrikhand"; src: url("/assets/fonts/Shrikhand-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/Outfit-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/assets/fonts/Lexend-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/assets/fonts/Lexend-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/assets/fonts/Lexend-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* Colour · Primitives */
  --orange-100: #FDE3CC;
  --orange-300: #F7852E;
  --orange-400: #EE6D1D;
  --orange-500: #E5540C;
  --orange-700: #B33F06;
  --cream-100: #FFF4D6;
  --cream-200: #F4E6BF;
  --ink-900: #1B1A1F;
  --ink-700: #3D3B43;
  --ink-500: #6E6B75;
  --ink-300: #C9C4BA;
  --ink-100: #ECE7DD;

  /* Brand background (bg/brand top → bottom) */
  --pour: linear-gradient(180deg, var(--orange-300) 0%, var(--orange-400) 50%, var(--orange-500) 100%);

  /* Effect styles */
  --hard-s: 0 3px 0 var(--ink-900);
  --hard-m: 0 6px 0 var(--ink-900);
  --highlight: 0 4px 0 var(--cream-100);
  --card-shadow: 0 2px 6px rgba(27, 26, 31, 0.12), 0 12px 28px rgba(27, 26, 31, 0.22);

  /* Radius */
  --radius-lg: 16px; /* buttons */
  --radius-xl: 24px; /* cards, panels */

  /* Type families */
  --display: "Lilita One", sans-serif;
  --accent: "Shrikhand", serif;
  --title: "Outfit", sans-serif;
  --body: "Lexend", sans-serif;

  --measure: 64ch;
  /* Foam: the solid head is 122/177 of the art; the rest is drips. */
  --foam-h: 112px;
  --foam-head: calc(var(--foam-h) * 122 / 177);
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(27, 26, 31, 0.12);
  font-synthesis: none; /* never fake a bold or italic: only the real Figma font files render */
}
@media (pointer: fine) { html { overscroll-behavior: none; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  font-family: var(--body);
  font-weight: 400;
  font-size: 17px;     /* Body */
  line-height: 24px;
  color: var(--ink-900);
  background: var(--cream-100);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: inherit; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--orange-700); }

:focus-visible { outline: 3px solid var(--ink-900); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 12px 18px;
  background: var(--ink-900); color: var(--cream-100);
  font: 700 18px/24px var(--title);
  border-radius: 12px; text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--cream-100); }

/* ---------- Header: sits centred in the solid head of the foam ---------- */

.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1120px;
  height: var(--foam-head);
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font: 400 24px/28px var(--display);
  color: var(--ink-900);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink-900); }
.wordmark img { width: 36px; height: 36px; border-radius: 9px; }

.header-actions { display: flex; align-items: center; gap: 8px 16px; }

/* ---------- The glass: brand pour with the foam on top ---------- */

.glass {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--pour);
}

.foam {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--foam-h);
  background: url("/assets/foam.svg") repeat-x top center / auto 100%;
  z-index: 1;
  pointer-events: none;
}

.bubbles { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* Each span is a full-height lane; the bubble sits at its top edge, so moving the lane
   by -100% of its own height carries the bubble from the bottom of the glass to the foam. */
.bubbles span {
  position: absolute;
  top: 0;
  height: 100%;
  width: var(--s, 8px);
  transform: translateY(var(--rest, 50%));
}
.bubbles span::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: var(--s, 8px); height: var(--s, 8px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.4);
  opacity: 0.7;
}

/* Beer bubbles rise all the way to the foam and pop there, on a loop, like the app. */
@media (prefers-reduced-motion: no-preference) {
  .bubbles span { animation: rise var(--d, 10s) linear var(--delay, 0s) infinite; will-change: transform; }
  .bubbles span::before { animation: wobble var(--w, 3s) ease-in-out var(--delay, 0s) infinite alternate, pop var(--d, 10s) linear var(--delay, 0s) infinite; }
  @keyframes rise {
    from { transform: translateY(100%); }
    to   { transform: translateY(calc(var(--foam-h) * 0.55)); }
  }
  @keyframes wobble {
    from { translate: calc(-1 * var(--drift, 8px)) 0; }
    to   { translate: var(--drift, 8px) 0; }
  }
  @keyframes pop {
    0%   { opacity: 0; scale: 0.6; }
    6%   { opacity: 0.7; scale: 1; }
    94%  { opacity: 0.7; scale: 1; }
    100% { opacity: 0; scale: 1.4; }
  }
}

/* ---------- Home: hero ---------- */

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--foam-h) + 40px) 20px 0;
}
.hero h1 { margin: 0; }
.lockup { width: min(640px, 90vw); height: auto; }

/* Box-top tagline: Outfit Bold, cream, two lines. */
.tagline {
  margin: 0;
  font: 700 clamp(28px, 2.2vw + 18px, 44px) / 1.18 var(--title);
  color: var(--cream-100);
}
.tagline span { display: block; }

/* ---------- Home: three cards from the deck (Prompt Card component) ---------- */

.hand {
  --cw: clamp(208px, 21vw, 300px);
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  height: calc(var(--cw) * 494 / 353 + 72px);
  margin: 64px auto 0;
  padding: 0;
  list-style: none;
  max-width: 1120px;
}

.card {
  position: absolute;
  top: 0;
  width: var(--cw);
  aspect-ratio: 353 / 494;
  display: flex;
  flex-direction: column;
  gap: calc(var(--cw) * 20 / 353);
  padding: calc(var(--cw) * 24 / 353);
  background: var(--cream-100);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  text-align: left;
}
.card:nth-child(1) { transform: translateX(-82%) translateY(36px) rotate(-8deg); }
.card:nth-child(2) { z-index: 1; }
.card:nth-child(3) { transform: translateX(82%) translateY(36px) rotate(8deg); }

/* Category Chip: ink capsule, Label style (Outfit Bold 13/16, +0.8, uppercase). */
.chip {
  align-self: flex-start;
  margin: 0;
  padding: calc(var(--cw) * 4 / 353) calc(var(--cw) * 12 / 353);
  background: var(--ink-900);
  color: var(--cream-100);
  border-radius: 999px;
  font: 700 calc(var(--cw) * 13 / 353) / calc(var(--cw) * 16 / 353) var(--title);
  letter-spacing: calc(var(--cw) * 0.8 / 353);
  text-transform: uppercase;
  white-space: nowrap;
}
/* Prompt/L (Lexend Medium 28/36); long prompts use Prompt/M (22/30), as in the app. */
.prompt {
  flex: 1;
  margin: 0;
  font: 500 calc(var(--cw) * 28 / 353) / calc(var(--cw) * 36 / 353) var(--body);
  color: var(--ink-900);
}
.prompt--m { font-size: calc(var(--cw) * 22 / 353); line-height: calc(var(--cw) * 30 / 353); }
/* Caption (Lexend Regular 13/18), text/tertiary, centred. */
.card-footer {
  margin: 0;
  font: 400 calc(var(--cw) * 13 / 353) / calc(var(--cw) * 18 / 353) var(--body);
  color: var(--ink-500);
  text-align: center;
}

@media (max-width: 640px) {
  .hand { --cw: 176px; margin-top: 48px; }
  .card:nth-child(1) { transform: translateX(-52%) translateY(28px) rotate(-8deg); }
  .card:nth-child(3) { transform: translateX(52%) translateY(28px) rotate(8deg); }
}

/* ---------- Home: support ---------- */

.support {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 20px 96px;
  text-align: center;
  scroll-margin-top: 24px;
}
/* Display/L → Display/XL on wide screens, cream with Hard M (display text on brand). */
.support h2 {
  margin: 0;
  font: 400 40px/44px var(--display);
  color: var(--cream-100);
  text-shadow: var(--hard-m);
  text-wrap: balance;
}
@media (min-width: 720px) { .support h2 { font-size: 56px; line-height: 56px; } }
.support h2 + p { margin-top: 8px; }
.support p {
  max-width: 34em;
  margin: 8px 0 0;
  font: 400 17px/24px var(--body);
  color: var(--ink-900);
  text-wrap: pretty;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 24px;
  margin-top: 20px;
}

/* Button component: 56 high, ink, cream Button label, cream highlight; pressed drops 3. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  height: 56px;
  padding: 0 24px;
  background: var(--ink-900);
  color: var(--cream-100);
  font: 700 18px/24px var(--title);
  text-decoration: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--highlight);
  touch-action: manipulation;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out;
}
.button:hover { color: var(--cream-100); background: var(--ink-700); }
.button:active { transform: translateY(3px); box-shadow: 0 0 0 var(--cream-100); }
.button svg { width: 22px; height: 22px; flex: none; }

/* Text Button component: ink Button label, 44 touch target. */
.text-button {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 8px;
  font: 700 18px/24px var(--title);
  color: var(--ink-900);
  text-decoration: none;
  border-radius: 12px;
}
.text-button:hover { color: var(--ink-900); text-decoration: underline; }

/* Header-sized buttons: same components, sized to sit inside the foam head. */
.button--small { min-width: 0; height: 44px; padding: 0 20px; box-shadow: none; }
.button--small:active { transform: translateY(2px); }
.text-button--small { padding: 0 4px; }

@media (max-width: 480px) {
  .header-actions { gap: 8px; }
  .button--small, .text-button--small { font-size: 15px; line-height: 20px; }
  .button--small { padding: 0 14px; }
}

/* ---------- Inner pages ---------- */

.page-head {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--foam-h) + 32px) 20px 56px;
}
.page-title {
  margin: 0;
  font: 400 clamp(56px, 4vw + 36px, 80px) / 1 var(--display);
  color: var(--cream-100);
  text-shadow: var(--hard-m);
  text-wrap: balance;
}
.page-intro {
  max-width: 40ch;
  margin: 20px 0 0;
  font: 700 22px/28px var(--title); /* Title */
  color: var(--ink-900);
}

main { flex: 1; }

.content {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 20px 96px;
}

.meta { margin: 0 0 12px; font: 400 13px/18px var(--body); color: var(--ink-700); }

.prose { max-width: var(--measure); }
.prose h2 {
  margin: 48px 0 12px;
  font: 700 22px/28px var(--title); /* Title */
  scroll-margin-top: 24px;
}
.prose h3 {
  margin: 28px 0 8px;
  font: 600 17px/24px var(--body); /* Body/Strong */
}
.prose p, .prose ul { margin: 0 0 16px; }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--orange-500); }
.prose strong { font-weight: 600; }

/* Panel component: cream, ink outline, Hard M. */
.panel {
  max-width: var(--measure);
  margin: 0 0 8px;
  padding: 24px 28px;
  background: var(--cream-100);
  border: 2px solid var(--ink-900);
  border-radius: var(--radius-xl);
  box-shadow: var(--hard-m);
}
.panel h2 { margin: 0 0 12px; font: 700 22px/28px var(--title); }
.panel ul { margin: 0; padding-left: 1.25em; }
.panel li { margin-bottom: 8px; }
.panel li:last-child { margin-bottom: 0; }
.panel li::marker { color: var(--orange-500); }
.panel strong { font-weight: 600; }

/* ---------- 404 ---------- */

.glass--fill { flex: 1; }
.spill {
  margin: 0;
  font: 400 clamp(48px, 5vw + 28px, 96px) / 1.1 var(--accent); /* Accent */
  color: var(--cream-100);
  text-shadow: var(--hard-m);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink-900);
  color: var(--cream-100);
  padding: 48px max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 24px 32px;
  max-width: 1120px;
  margin: 0 auto;
}
.footer-logo { width: 56px; height: 56px; }
.footer-note { max-width: 52ch; font: 400 13px/18px var(--body); color: var(--cream-200); }
.footer-note p { margin: 0 0 8px; }
.footer-links { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.footer-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  overflow-wrap: anywhere;
  font: 400 17px/24px var(--body); /* Body */
  color: var(--cream-100);
}
.footer-links a:hover { color: var(--orange-300); }
.site-footer :focus-visible { outline-color: var(--cream-100); }

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
  .wordmark span { display: none; }
}
