/* Home page: hero, demos and feature sections */

/* Zigzag "pinking shears" edge at the top of a coloured band */
.zig { --band: var(--ink); }
.zig::before {
  content: ""; position: absolute; left: 0; right: 0; top: -15px; height: 16px;
  background: var(--band);
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 30px 100%;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 30px 100%;
}
.band-ink.zig { --band: var(--ink); }
.band-lemon.zig { --band: var(--lemon); border-top: 0; }
.band-sky.zig { --band: var(--sky); border-top: 0; }
.band-lilac.zig { --band: var(--lilac); border-top: 0; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 6vw, 80px) 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; }
.hero h1 .hl { position: relative; display: inline-block; z-index: 0; }
.hero h1 .hl::after {
  content: ""; position: absolute; z-index: -1; left: -4px; right: -6px; bottom: .06em; height: .36em;
  background: var(--lemon); border-radius: 6px; transform: rotate(-1.5deg) scaleX(0); transform-origin: left;
  animation: swipe .7s .5s var(--bounce) forwards;
}
.hero h1 .word { display: inline-block; opacity: 0; transform: translateY(.6em) rotate(6deg); animation: drop .7s var(--bounce) forwards; animation-delay: calc(var(--i) * 90ms); }
@keyframes drop { to { opacity: 1; transform: none; } }
@keyframes swipe { to { transform: rotate(-1.5deg) scaleX(1); } }
.hero .lede { margin-bottom: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-note { margin-top: 18px; font-size: 15px; font-weight: 600; }
.hero .phone-stage { min-height: 600px; }
.hero .phone { transform: rotate(4deg); animation: phoneIn 1s .2s var(--bounce) both; }
@keyframes phoneIn { from { transform: translateY(120px) rotate(14deg); opacity: 0; } to { transform: rotate(4deg); opacity: 1; } }
.hero .sticker.s1 { top: 14%; left: -4%; --r: -6deg; background: var(--paper); animation-delay: -1s; }
.hero .sticker.s2 { top: 46%; right: -6%; --r: 5deg; background: var(--mint); animation-delay: -2.5s; }
.hero .sticker.s3 { bottom: 12%; left: 0; --r: -3deg; background: var(--lemon); animation-delay: -3.6s; }
.flame { width: 34px; height: 34px; animation: flicker 1.1s ease-in-out infinite; transform-origin: 50% 90%; }

.hero-shelf { margin-top: clamp(30px, 6vw, 60px); justify-content: center; overflow: hidden; }
.hero-shelf .spine { animation: fall .9s var(--bounce) both; animation-delay: calc(.6s + var(--i) * 70ms); transition: transform .25s var(--bounce); }
.hero-shelf .spine:hover { transform: rotate(180deg) translateY(18px); }
@keyframes fall { from { transform: rotate(180deg) translateY(380px); opacity: 0; } to { transform: rotate(180deg); opacity: 1; } }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero .phone-stage { min-height: 0; }
  .hero .sticker.s1 { left: 2%; }
  .hero .sticker.s2 { right: 2%; }
}
@media (max-width: 520px) {
  .hero .sticker { font-size: 15px; padding: 8px 12px; }
  .hero .sticker .big { font-size: 22px; }
  .hero-shelf .spine:nth-child(n+8) { display: none; }
}

/* ---------- Spin the shelf demo ---------- */
.spin-demo { padding: 26px; background: var(--ink); color: var(--ground); border-radius: 26px; border: var(--stroke) solid var(--ink); box-shadow: 8px 8px 0 var(--tomato); }
.spin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.spin-head h3 { margin: 0; color: var(--paper); }
.spin-head p { margin: 4px 0 0; font-size: 16px; color: rgba(255,244,222,.7); }
.spin-btn { font-size: 22px; padding: 14px 26px; box-shadow: 4px 4px 0 var(--paper); }
.spin-btn:active { box-shadow: 0 0 0 var(--paper); }
.spin-btn[disabled] { opacity: .6; cursor: progress; }
.moods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.mood { font: inherit; font-weight: 700; font-size: 15px; color: var(--paper); background: transparent; border: 2px solid var(--paper); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: transform .2s var(--bounce); }
.mood:hover { transform: translateY(-2px); }
.mood[aria-pressed="true"] { background: var(--lemon); color: var(--ink); border-color: var(--lemon); }
.spin-shelf { background: var(--ground); border-radius: 14px; padding: 18px 10px 0; border: var(--stroke) solid var(--paper); overflow: hidden; }
.spin-shelf .shelf { justify-content: center; gap: 5px; padding: 0 6px; min-height: 196px; }
.spin-shelf .spine { transition: transform .18s ease, filter .2s, opacity .3s; color: var(--ink); }
.spin-shelf .spine.out { opacity: .22; filter: grayscale(1); }
.spin-shelf .spine.lit { transform: rotate(180deg) translateY(16px); }
.spin-shelf .spine.picked { transform: rotate(180deg) translateY(30px) scale(1.06); animation: none; box-shadow: 0 0 0 4px var(--tomato), 3px 3px 0 var(--ink); }
.spin-result { display: flex; align-items: center; gap: 16px; margin-top: 18px; color: var(--ink); padding: 14px 16px; min-height: 92px; transform-origin: left center; }
.spin-result.bump { animation: resultIn .6s var(--bounce); }
@keyframes resultIn { from { transform: scale(.7) rotate(-4deg); opacity: 0; } }
.mini-cover { width: 50px; height: 68px; flex: none; border: var(--stroke) solid var(--ink); border-radius: 6px; box-shadow: 3px 3px 0 var(--ink); background: var(--c, var(--sky)); }
.spin-result .tag { background: var(--lemon); color: var(--ink); font-size: 11px; }
.spin-result h4 { font-size: 21px; margin: 6px 0 2px; }
.spin-result p { margin: 0; font-size: 15px; }
@media (max-width: 520px) {
  .spin-demo { padding: 18px; }
  .spin-head { flex-direction: column; align-items: flex-start; }
  .spin-shelf .shelf { gap: 3px; padding: 0 2px; }
  .spin-shelf .spine { flex: 1 1 0; min-width: 0; font-size: 10px; }
}

/* ---------- Streak / level / badges ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; margin-top: 50px; }
.stat { padding: 26px; position: relative; overflow: hidden; }
.stat h3 { margin-bottom: 6px; }
.stat-streak { grid-column: span 4; background: var(--paper); }
.stat-heat { grid-column: span 8; }
.stat-level { grid-column: span 5; }
.stat-badges { grid-column: span 7; }
@media (max-width: 900px) { .stat-streak, .stat-heat, .stat-level, .stat-badges { grid-column: 1 / -1; } }
.streak-num { display: flex; align-items: center; gap: 14px; }
.streak-num .flame { width: 72px; height: 72px; }
.streak-num b { font-family: var(--display); font-size: 76px; line-height: 1; }
.freeze { display: inline-flex; gap: 6px; align-items: center; margin-top: 14px; font-size: 15px; font-weight: 700; }
.freeze span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--sky); border: 2px solid var(--ink); }

.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cal-head h3 { margin: 0; }
.cal-month { margin: 2px 0 0; font-weight: 700; color: var(--muted); }
.cal-arrows { display: flex; gap: 8px; }
.cal-arrow { width: 40px; height: 36px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); box-shadow: 2px 2px 0 var(--ink); display: grid; place-items: center; color: var(--ink); cursor: pointer; transition: transform .15s; }
.cal-arrow:hover:not(:disabled) { transform: translateY(-2px); }
.cal-arrow:disabled { opacity: .35; box-shadow: none; cursor: default; }
.cal-pills { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cal-pill { border: 2px solid var(--ink); border-radius: 10px; padding: 3px 10px; font-weight: 600; font-size: 15px; }
.cal-pill.mint { background: var(--mint); } .cal-pill.lemon { background: var(--lemon); }
.cal-week, .heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 500px; }
.cal-week { margin-top: 14px; text-align: center; font-weight: 700; font-size: 13px; color: var(--muted); }
.heat { margin-top: 6px; }
.heat i { aspect-ratio: 1; border-radius: 8px; border: 2px solid var(--ink); background: var(--ground); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 13px; color: rgba(26,26,26,.55); transform: scale(.4); opacity: 0; transition: transform .4s var(--bounce), opacity .25s, background .3s; }
.heat.in i { transform: none; opacity: 1; }
.heat i.l1, .heat-legend i.l1 { background: #C3F3DD; } .heat i.l2, .heat-legend i.l2 { background: #86E8BD; } .heat i.l3, .heat-legend i.l3 { background: var(--mint); }
.heat i.l1, .heat i.l2, .heat i.l3 { color: var(--ink); } .heat i.l3 { font-weight: 800; }
.heat i.frozen { background: #CDE9FF; color: var(--ink); font-size: 12px; }
.heat i.future { background: transparent; border-color: rgba(26,26,26,.15); color: rgba(26,26,26,.3); }
.heat i.today { border-width: 3px; }
.heat i.blank { border: 0; background: none; }
.heat-freeze { margin-left: 8px; padding: 1px 8px; border: 2px solid var(--ink); border-radius: 6px; background: #CDE9FF; color: var(--ink); font-size: 13px; }
.heat-legend { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.heat-legend i { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 4px; display: inline-block; }

.level-top { display: flex; align-items: center; gap: 18px; }
.level-badge { width: 84px; height: 84px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--lilac); border: var(--stroke) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-family: var(--display); font-weight: 800; font-size: 40px; }
.level-badge.bump { animation: jiggle .6s ease; }
.bar { height: 18px; border: var(--stroke) solid var(--ink); border-radius: 999px; background: var(--ground); overflow: hidden; margin: 10px 0 6px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--lilac); border-right: var(--stroke) solid var(--ink); transition: width 1s var(--bounce); }
.ladder { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ladder li { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--ground); opacity: .5; transition: all .3s var(--bounce); }
.ladder li.done { background: var(--lilac); opacity: 1; }
.ladder li.now { background: var(--lemon); opacity: 1; transform: scale(1.08); }

.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 10px; margin-top: 18px; }
.badge { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; display: grid; justify-items: center; gap: 8px; color: var(--ink); }
.badge .disc { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: var(--lemon); border: var(--stroke) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transition: transform .3s var(--bounce); }
.badge .disc svg { width: 30px; height: 30px; }
.badge span { font-size: 14px; font-weight: 700; text-align: center; line-height: 1.2; }
.badge:hover .disc { transform: translateY(-4px) rotate(-8deg); }
.badge.jig .disc { animation: jiggle .6s ease; }
.badge-tip { margin-top: 16px; min-height: 52px; padding: 12px 16px; border-radius: 12px; border: 2px dashed var(--ink); font-weight: 600; font-size: 16px; }
.badge-tip b { font-family: var(--display); }

/* ---------- Wrapped ---------- */
.wrapped-stage { position: relative; height: 460px; display: grid; place-items: center; }
.wcard { position: absolute; width: 250px; height: 360px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 22px; transition: transform .8s var(--bounce); }
.wcard h4 { font-size: 28px; margin: 0; }
.wcard .k { font-family: var(--display); font-weight: 800; font-size: 76px; line-height: .9; }
.wcard small { font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.wcard.w1 { background: var(--tomato); color: var(--paper); transform: rotate(-3deg); z-index: 1; }
.wcard.w2 { background: var(--lemon); transform: rotate(2deg); z-index: 2; }
.wcard.w3 { background: var(--sky); transform: rotate(-1deg); z-index: 3; }
.wrapped-stage.in .w1 { transform: translateX(-280px) rotate(-8deg); }
.wrapped-stage.in .w3 { transform: translateX(280px) rotate(7deg); }
.wrapped-stage:hover .w1 { transform: translateX(-295px) translateY(-10px) rotate(-11deg); }
.wrapped-stage:hover .w3 { transform: translateX(295px) translateY(-10px) rotate(10deg); }
.wrapped-intro { max-width: 760px; margin: 0 auto 30px; text-align: center; }
.wrapped-intro .lede { margin-left: auto; margin-right: auto; }
.wrapped-intro .ticks { display: inline-grid; text-align: left; }
.wrapped-stage:hover .w2 { transform: translateY(-16px) rotate(0); }
.wcard .spines { display: flex; gap: 4px; align-items: flex-end; }
.wcard .spines i { width: 14px; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); }
/* Narrow screens: deal the cards out in a column instead of a fan */
@media (max-width: 900px) {
  .wrapped-stage { height: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; }
  .wcard { position: relative; width: min(300px, 100%); height: auto; min-height: 220px; gap: 14px; }
  .wcard .k { font-size: 64px; }
  .wcard.w1, .wrapped-stage.in .w1, .wrapped-stage:hover .w1 { transform: rotate(-3deg); }
  .wcard.w2, .wrapped-stage:hover .w2 { transform: rotate(2deg); }
  .wcard.w3, .wrapped-stage.in .w3, .wrapped-stage:hover .w3 { transform: rotate(-2deg); }
}

/* ---------- Extras grid (widgets, live activity, scanner, import) ---------- */
.extras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 50px; }
@media (max-width: 820px) { .extras { grid-template-columns: 1fr; } }
.extra { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.extra .demo { flex: 1; min-height: 220px; display: grid; place-items: center; border-radius: 14px; border: var(--stroke) solid var(--ink); position: relative; overflow: hidden; }
.extra p { margin: 0; }

.wallpaper { background: linear-gradient(135deg, var(--lilac), var(--pink) 55%, var(--orange)); }
.widgets { display: flex; gap: 14px; align-items: center; padding: 20px; flex-wrap: wrap; justify-content: center; }
.widget { background: var(--ground); border: var(--stroke) solid var(--ink); border-radius: 22px; box-shadow: 3px 3px 0 var(--ink); padding: 14px; }
.widget.sm { width: 130px; height: 130px; display: flex; flex-direction: column; justify-content: space-between; }
.widget.sm b { font-family: var(--display); font-size: 44px; line-height: 1; }
.widget.sm .flame { width: 30px; height: 30px; }
.widget.md { width: 230px; height: 130px; display: flex; gap: 12px; align-items: center; }
.widget.md .mini-cover { width: 58px; height: 86px; }
.widget.md h5 { font-family: var(--display); font-size: 17px; margin: 0 0 4px; }
.widget.md .bar { height: 14px; margin: 8px 0 4px; }
.widget.md .bar > i { background: var(--mint); animation: grow 4s ease-in-out infinite; }
@keyframes grow { 0% { width: 30%; } 60%, 100% { width: 72%; } }

.lock { background: linear-gradient(160deg, #23202F, #3a2d5c); color: #fff; }
.lock-time { position: absolute; top: 18px; width: 100%; text-align: center; font-family: var(--display); font-size: 54px; font-weight: 600; opacity: .9; }
.activity { position: absolute; bottom: 18px; left: 16px; right: 16px; background: rgba(20,18,30,.85); border-radius: 24px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; border: 1.5px solid rgba(255,255,255,.15); }
.activity .mini-cover { width: 38px; height: 54px; box-shadow: none; border-color: #fff; }
.activity h5 { margin: 0; font-family: var(--display); font-size: 16px; }
.activity p { font-size: 13px; opacity: .7; }
.activity .clock { margin-left: auto; font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--mint); font-variant-numeric: tabular-nums; }

.scanner { background: #2b2b2b; }
.book-back { width: 190px; height: 150px; background: var(--paper); border-radius: 10px; border: var(--stroke) solid var(--ink); display: grid; place-items: center; transform: rotate(-4deg); }
.barcode { width: 140px; height: 70px; background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 5px, var(--ink) 5px 6px, transparent 6px 9px, var(--ink) 9px 13px, transparent 13px 15px); }
.scan-frame { position: absolute; width: 230px; height: 130px; border: 4px solid var(--lemon); border-radius: 16px; }
.scan-line { position: absolute; left: calc(50% - 105px); width: 210px; height: 4px; background: var(--tomato); box-shadow: 0 0 12px var(--tomato); border-radius: 4px; animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 34%; } 50% { top: 64%; } }
.found { position: absolute; bottom: 14px; background: var(--mint); color: var(--ink); animation: foundPop 2.4s var(--bounce) infinite; }
@keyframes foundPop { 0%, 55% { transform: scale(0); } 70%, 100% { transform: scale(1); } }

.import { background: var(--ground); }
.import .shelf { width: 86%; min-height: 150px; justify-content: center; }
.import .spine { --h: 120px; --w: 30px; font-size: 0; animation: slideIn 4.2s var(--bounce) infinite; animation-delay: calc(var(--i) * .18s); }
@keyframes slideIn {
  0% { transform: rotate(180deg) translateX(-400px); opacity: 0; }
  20%, 80% { transform: rotate(180deg); opacity: 1; }
  100% { transform: rotate(180deg) translateY(200px); opacity: 0; }
}
.import .pill { position: absolute; top: 14px; left: 14px; background: var(--paper); }

/* ---------- Finish celebration ---------- */
.finish { text-align: center; }
.finish h2 { max-width: 13em; margin-left: auto; margin-right: auto; }
.finish-btn { font-size: clamp(22px, 3vw, 30px); padding: 20px 34px; margin-top: 10px; }
.finish-count { margin-top: 26px; font-weight: 700; font-size: 18px; }
.finish-count b { font-family: var(--display); font-size: 26px; }

/* ---------- Final CTA ---------- */
.cta-card { padding: clamp(36px, 6vw, 70px); text-align: center; background: var(--pink); border-radius: 32px; box-shadow: 10px 10px 0 var(--ink); position: relative; overflow: hidden; }
.cta-card h2 { max-width: 11em; margin-left: auto; margin-right: auto; }
.cta-card .spark { position: absolute; width: 46px; height: 46px; animation: spin 9s linear infinite; }
