/* Para Teba. White ground, ink, neutral greys, one warm accent (--accent = "today / just done").
   Allo (variable, ROND 100) everywhere: the warmth comes from roundness and motion, not colour. */
@font-face {
  font-family: 'Allo';
  src: url('../fonts/AlloVariable.woff2') format('woff2-variations'), url('../fonts/AlloVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #17171a;
  --ink-2: #6c6c72;
  --ink-3: #b3b3b8;
  --line: #ebebee;
  --soft: #f4f4f6;
  --accent: #e8452c;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --r-card: 32px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; font-variation-settings: 'ROND' 100; }
html, body { margin: 0; height: 100%; background: #fff; color: var(--ink); overflow: hidden; }
body { font-family: 'Allo', ui-rounded, system-ui, sans-serif; font-optical-sizing: auto; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, canvas { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
[data-nogesture] { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#app { position: fixed; left: 0; right: 0; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; z-index: 0; }

/* ---------- calendar ("Hoy") ---------- */
.cal { padding: max(16px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom)); max-width: 470px; margin: 0 auto; width: 100%; }
.kick { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.kick .who { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.kick .cnt { height: 30px; padding: 0 12px; border-radius: 99px; background: var(--soft); display: inline-flex; align-items: center; font-size: 14px; font-weight: 560; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kick .cnt b { color: var(--ink); font-weight: 650; margin-right: 3px; }
.hero { position: relative; display: block; width: 100%; margin-top: 12px; height: min(50dvh, 430px); border-radius: var(--r-card); overflow: hidden;
  background: var(--soft); transition: transform 180ms var(--ease); text-align: left; isolation: isolate; }
.hero:active { transform: scale(.985); }
.hero .bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(30px) saturate(1.15); transform: scale(1.1); }
.hero.done .bg { inset: 0; filter: none; transform: none; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.32)); }
.hero .big { position: absolute; left: 24px; bottom: 20px; color: #fff; }
.hero .big .n { font-size: 120px; line-height: .86; font-weight: 640; letter-spacing: -0.045em; }
.hero .big .m { font-size: 22px; font-weight: 520; margin-top: 6px; opacity: .92; }
.hero .go { position: absolute; right: 18px; bottom: 22px; height: 44px; padding: 0 18px 0 16px; border-radius: 99px; background: #fff; color: var(--ink);
  display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.hero .go .ic { color: var(--accent); }
.hero.wait { background: var(--soft); display: grid; place-items: center; text-align: center; }
.hero.wait .w1 { font-size: 96px; font-weight: 640; letter-spacing: -0.04em; line-height: 1; }
.hero.wait .w2 { font-size: 19px; color: var(--ink-2); margin-top: 8px; font-weight: 500; }
.rounds { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 10px; margin-top: 24px; }
.rd { aspect-ratio: 1; border-radius: 999px; position: relative; display: grid; place-items: center; font-size: 16px; font-weight: 600;
  color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); background-size: cover; background-position: center;
  transition: transform 180ms var(--ease); font-variant-numeric: tabular-nums; }
.rd:active { transform: scale(.92); }
.rd.locked { color: var(--ink-3); box-shadow: none; background-color: var(--soft); }
.rd.done { box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); color: transparent; }
.rd.today { box-shadow: inset 0 0 0 2.5px var(--accent); color: var(--accent); }
.rd.cur::after { content: ''; position: absolute; bottom: -9px; width: 5px; height: 5px; border-radius: 5px; background: var(--ink); }
.rd.just { animation: rd-pop 760ms cubic-bezier(0.34, 1.4, 0.5, 1) both; }
@keyframes rd-pop { 0% { transform: scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); } }
.note { margin-top: 22px; text-align: center; font-size: 15px; color: var(--ink-2); min-height: 22px; transition: opacity 220ms ease; font-weight: 500; }
.note .more { height: 48px; padding: 0 24px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 600; transition: transform 160ms var(--ease); }
.note .more:active { transform: scale(.97); }

/* ---------- puzzle ---------- */
.top { position: relative; z-index: 3; height: 60px; margin-top: env(safe-area-inset-top); display: flex; align-items: center; justify-content: space-between; padding: 0 12px; flex: none; }
.back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 99px; background: var(--soft); transition: transform 160ms var(--ease); }
.back:active { transform: scale(.92); }
.top .d { font-size: 19px; font-weight: 620; letter-spacing: -0.01em; }
.top .c { min-width: 44px; height: 32px; padding: 0 11px; border-radius: 99px; background: var(--soft); display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stage { position: relative; flex: 1; min-height: 0; margin-bottom: env(safe-area-inset-bottom); }
/* the canvas: a quiet, near-white rounded surface with a hairline edge and a whisper of inset,
   plus the faint cut lines as slot hints. Never a copy of the photo. */
.canvas { position: absolute; background: #fafafb; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(23,23,26,.07), inset 0 1px 3px rgba(23,23,26,.045); transition: opacity 400ms ease; }
.canvas canvas { position: absolute; left: 0; top: 0; }
.pc { position: absolute; left: 0; top: 0; will-change: transform; transform-origin: 50% 50%; }
.pc canvas { position: absolute; display: block; pointer-events: none; }
.pc .sr { transition: opacity 180ms ease; opacity: 1; }
.pc .sl { transition: opacity 180ms ease; opacity: 0; }
.pc.lift .sr { opacity: 0; }
.pc.lift .sl { opacity: 1; }
.pc.placed .sr, .pc.placed .sl { opacity: 0; }
.pc.hidden { visibility: hidden; }
.melt { position: absolute; z-index: 9999; background-size: cover; background-position: center; opacity: 0; transition: opacity 460ms ease; }

/* ---------- reveal ---------- */
.rv { position: fixed; inset: 0; z-index: 50; background: #fff; opacity: 0; transition: opacity 300ms ease; }
.rv .ph { position: absolute; background-size: cover; background-position: center; transform-origin: 0 0; box-shadow: 0 24px 60px -20px rgba(16,16,24,.34); }
.rv .ring { position: absolute; box-shadow: 0 0 0 2px var(--accent); opacity: 0; pointer-events: none; }
.rv .cap { position: absolute; left: 0; right: 0; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 420ms ease, transform 600ms var(--ease); }
.rv .w { font-size: 34px; font-weight: 680; letter-spacing: -0.02em; color: var(--ink); }
.rv .dt { font-size: 16px; color: var(--ink-2); margin-top: 4px; font-weight: 500; }
.btn { margin-top: 22px; height: 52px; padding: 0 28px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 600; transition: transform 160ms var(--ease); }
.btn:active { transform: scale(.97); }

/* ---------- welcome (first visit) ---------- */
.welcome { justify-content: space-between; padding: max(24px, env(safe-area-inset-top)) 28px max(24px, env(safe-area-inset-bottom)); overflow-y: auto;
  transition: opacity 260ms ease, transform 260ms var(--ease); }
.welcome.out { opacity: 0; transform: translateY(-8px); }
.wl-in { max-width: 420px; width: 100%; margin: auto; }
.wl-tile { position: relative; width: 120px; height: 120px; margin: 8px 0 34px 4px; }
.wl-melt { position: absolute; inset: 0; z-index: 10; background-size: 100% 100%; opacity: 0; transition: opacity 360ms ease;
  box-shadow: 0 1px 1.5px rgba(16,16,24,.18), 0 6px 18px -6px rgba(16,16,24,.22); }
.wl-t { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 14px; line-height: 1.05; }
.wl-p { font-size: 19px; line-height: 1.42; font-weight: 450; margin: 0 0 12px; text-wrap: pretty; }
.wl-foot { max-width: 420px; width: 100%; margin: 26px auto 0; }
.wl-go { width: 100%; margin-top: 0; }
.wl-t, .wl-p, .wl-foot { animation: wl-up 620ms var(--ease) both; }
.wl-t { animation-delay: 380ms; } .wl-p:nth-child(1) { animation-delay: 460ms; } .wl-p:nth-child(2) { animation-delay: 540ms; }
.wl-p:nth-child(3) { animation-delay: 610ms; } .wl-p:nth-child(4) { animation-delay: 660ms; } .wl-foot { animation-delay: 780ms; }
@keyframes wl-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wl-t, .wl-p, .wl-foot { animation: none; } .welcome { transition: none; } }

/* ---------- final note ---------- */
.final { align-items: center; justify-content: center; padding: 32px 28px; overflow-y: auto; }
.final .inner { max-width: 440px; width: 100%; }
.final .ring { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; margin-bottom: 34px; }
.final .ring i { aspect-ratio: 1; border-radius: 99px; background-size: cover; background-position: center; animation: rd-pop 700ms var(--ease) both; }
.fin-to { font-size: 30px; font-weight: 680; margin: 0 0 16px; letter-spacing: -0.02em; }
.fin-p { font-size: 21px; line-height: 1.4; font-weight: 450; margin: 0 0 14px; }
.fin-from { font-size: 21px; font-weight: 620; margin: 20px 0 0; }
.fin-ph { font-size: 12px; color: var(--ink-3); margin-top: 28px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

@keyframes nudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
.nudge { animation: nudge 320ms var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .nudge, .rd.just, .final .ring i { animation: none; }
}

/* UI icons (Jelly duo, 20-unit grid). Next to text: 20px, gap 7px; back chevron 22px. */
.ic { width: 20px; height: 20px; flex: none; display: block; }
.back .ic { width: 22px; height: 22px; }
.kick .cnt { gap: 6px; padding-left: 9px; }
.kick .cnt .ic { width: 18px; height: 18px; color: var(--ink-2); }
.top .c { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; }
.top .c .ic { width: 18px; height: 18px; }
.btn, .note .more { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* ---------- moments of wonder ---------- */
/* glint: a band of light crossing a piece as it seats (clip-path = the piece's outline) */
.glint { position: absolute; left: 0; top: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.glint i { position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(105deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.5) 50%, rgba(255,255,255,0) 70%); }
/* the photo flying home into its circle */
.fly { position: fixed; z-index: 61; background-size: cover; background-position: center; transform-origin: 0 0; will-change: transform, clip-path; pointer-events: none; }
.fly-veil { position: fixed; inset: 0; z-index: 60; background: #fff; pointer-events: none; }
.rd.awaiting { opacity: 0; }
/* today's card: the blurred photo drifts very slowly, like light moving behind frosted glass */
.hero:not(.done):not(.wait) .bg { animation: hero-drift 18s ease-in-out infinite alternate; will-change: transform; }
@keyframes hero-drift { from { transform: scale(1.1) translate3d(-10px, -6px, 0); } to { transform: scale(1.18) translate3d(12px, 8px, 0); } }
@media (prefers-reduced-motion: reduce) { .hero .bg { animation: none !important; } }
