/* The Sky Clocks - warm minimal, full-bleed 3D playground */

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

:root {
  --ink: #181109;
  --cream: #f3e7d3;
  --cream-dim: #c9b795;
  --amber: #f0a63c;
  --amber-deep: #b4762a;
  --terracotta: #c96f4a;
  --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;
  background:
    radial-gradient(120% 90% at 50% 12%, #2a1d11 0%, #1c130b 46%, #120c06 100%);
  color: var(--cream);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  touch-action: manipulation;
}

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }

/* ---------- header ---------- */

#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-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-size: 14px; letter-spacing: .01em; white-space: nowrap;
  color: var(--cream-dim);
  pointer-events: none;
  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-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-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 600; }

@media (max-width: 360px) {
  #hud { padding-left: 12px; padding-right: 12px; }
  #wordmark { font-size: 12px; }
  #corner { gap: 6px; }
}

/* soft scrim so the callout never fights the scene */
#scrim {
  position: fixed; left: 0; right: 0; bottom: 0; height: 200px;
  background: linear-gradient(to top, rgba(16,11,5,.92) 0%, rgba(16,11,5,.55) 45%, transparent 100%);
  pointer-events: none; z-index: 4;
}

/* ---------- dock ---------- */

#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;
}
#dock > * { pointer-events: auto; }
#dock #callout, #dock #hint {
  pointer-events: none;
  user-select: none; -webkit-user-select: none;
}

#callout {
  min-height: 44px;
  display: flex; align-items: flex-end; justify-content: center;
  text-align: center;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic; font-size: 18px; line-height: 1.3;
  color: var(--cream);
  text-shadow: 0 1px 10px rgba(0,0,0,.55);
  padding: 0 8px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .45s ease, transform .45s ease;
}
#callout.show { opacity: 1; transform: none; }

#statusRow {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 36px; padding: 0 4px;
}
#dots { display: flex; gap: 7px; align-items: center; }
#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); }
#hint {
  font-style: italic; font-size: 12.5px; color: var(--cream-dim);
  max-width: 62%; text-align: right;
}

#btnNext {
  width: 100%; 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;
  transform: translateY(0);
  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;
}
#btnNext.ready {
  animation: nudge 1s ease .15s 1;
}
@keyframes nudge {
  0% { transform: translateY(0); }
  35% { transform: translateY(-4px); }
  70% { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

/* ---------- info sheet ---------- */

#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;
  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-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: 20px; margin: 0 0 10px;
}
#sheetCard h3 {
  font-family: 'Fraunces', Georgia, serif; 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 0 10px; color: #e8dcc6; }
#sheetCard .refs a { color: var(--amber); text-decoration: none; font-size: 14px; line-height: 1.8; }
#btnCloseSheet {
  margin-top: 10px; width: 100%; min-height: 48px;
  border-radius: 14px; border: 1px solid var(--pill-border);
  background: rgba(243,231,211,.1); color: var(--cream);
  font-size: 15px; font-weight: 600; cursor: pointer;
}

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