/* A Leaf Makes Food - warm minimal, full-bleed 3D playground */
@font-face { font-family: 'Fraunces'; src: url('assets/fraunces-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('assets/fraunces-var-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --ink: #181109; --cream: #f3e7d3; --cream-dim: #c9b795;
  --amber: #f0a63c; --amber-deep: #b4762a;
  --pill-border: rgba(243,231,211,.26); --pill-bg: rgba(24,17,9,.42);
  --dock-pad-b: max(14px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; color: var(--cream);
  background: radial-gradient(120% 90% at 50% 12%, #2a1d11 0%, #1c130b 46%, #120c06 100%);
  font-family: 'Fraunces', Georgia, serif; touch-action: manipulation;
}
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
#veil { position: fixed; inset: 0; z-index: 3; background: #170f08; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
#veil.on { opacity: 1; }

#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px 0; pointer-events: none; z-index: 5; }
#wordmark { font-weight: 600; font-size: 14px; letter-spacing: .01em; white-space: nowrap; color: var(--cream-dim);
  text-shadow: 0 1px 8px rgba(0,0,0,.45); }
#corner { display: flex; gap: 8px; pointer-events: auto; }
.pill { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--pill-border);
  background: var(--pill-bg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--cream-dim); font-family: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), opacity .2s; }
.pill:active { transform: scale(.92); }
.pill:disabled { opacity: .32; transform: none; cursor: default; }
#btnInfo { font-style: italic; font-weight: 600; }
@media (max-width: 360px) { #hud { padding-left: 12px; padding-right: 12px; } #wordmark { font-size: 12px; } #corner { gap: 6px; } .pill { min-width: 40px; height: 40px; padding: 0 10px; } }

#scrim { position: fixed; left: 0; right: 0; bottom: 0; height: 270px; z-index: 4; pointer-events: none;
  background: linear-gradient(to top, rgba(16,11,5,.94) 0%, rgba(16,11,5,.72) 52%, transparent 100%); }

#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 0 16px var(--dock-pad-b);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; align-items: center; }
#dock > * { pointer-events: auto; }
#callout { pointer-events: none; user-select: none; -webkit-user-select: none; width: 100%; max-width: 460px;
  min-height: 92px; display: flex; align-items: flex-end; justify-content: center; text-align: center;
  font-style: italic; font-size: 18px; line-height: 1.32; color: var(--cream);
  text-shadow: 0 1px 10px rgba(0,0,0,.6); padding: 0 6px; transition: opacity .35s ease; }
#callout b { font-style: normal; font-weight: 600; color: #ffd48a; }
#callout.fade { opacity: 0; }
@media (max-width: 360px) { #callout { font-size: 16.5px; min-height: 100px; } }
@media (max-height: 560px) { #callout { min-height: 70px; font-size: 16px; } }
#dots { display: flex; gap: 7px; align-items: center; min-height: 14px; pointer-events: none; }
#dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(243,231,211,.28); transition: background .3s, transform .3s; }
#dots i.done { background: var(--cream-dim); }
#dots i.now { background: var(--amber); transform: scale(1.35); }

#btnNext { width: 100%; max-width: 460px; min-height: 56px; border: none; border-radius: 16px; background: var(--amber);
  color: #241708; font-size: 17px; font-weight: 700; letter-spacing: .01em; font-family: inherit;
  box-shadow: 0 3px 0 var(--amber-deep), 0 10px 24px rgba(0,0,0,.38); cursor: pointer;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s, opacity .25s, background .25s; }
#btnNext:active { transform: scale(.965) translateY(2px); box-shadow: 0 1px 0 var(--amber-deep), 0 4px 10px rgba(0,0,0,.3); }
#btnNext:disabled { background: rgba(243,231,211,.14); color: rgba(243,231,211,.45); box-shadow: none; cursor: default; transform: none; }

#sheet[hidden] { display: none !important; }
#sheet { position: fixed; inset: 0; z-index: 20; background: rgba(10,7,3,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center; }
#sheetCard { width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: #221709;
  border: 1px solid rgba(243,231,211,.14); border-bottom: none; border-radius: 22px 22px 0 0;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); color: var(--cream); }
#sheetCard h2 { font-weight: 600; font-size: 20px; margin: 0 0 10px; }
#sheetCard h3 { font-weight: 600; font-size: 14px; margin: 18px 0 6px; color: var(--cream-dim); }
#sheetCard p { font-size: 14.5px; line-height: 1.55; margin: 0; color: #e8dcc6; }
#sheetCard .refs a { color: var(--amber); text-decoration: none; font-size: 14px; line-height: 1.8; }
#btnCloseSheet { margin-top: 18px; width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--pill-border);
  background: rgba(243,231,211,.1); color: var(--cream); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  #btnNext, .pill, #callout, #veil, #dots i { transition: none; animation: none !important; }
}
