/* The Plank Keeper product page */
.grad { background: linear-gradient(100deg, var(--accent), #8a5cf6 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* hero */
.hero { padding-top: clamp(110px, 14vw, 170px); padding-bottom: clamp(60px, 8vw, 100px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 22px; font-size: clamp(2.5rem, 5.4vw, 4.6rem); }
.hero .lead { margin-bottom: 30px; }
.ticks { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .95rem; }
.ticks li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 9px; }
.hero-visual { position: relative; display: flex; justify-content: center; min-height: 560px; }
.hero-visual .phone { --w: min(300px, 70vw); z-index: 2; align-self: center; }
.bit { transform: translate3d(0, var(--py, 0px), 0) rotate(var(--rot, 0deg)); height: 22px; }
.bit.v { width: 22px; }
.float { animation: bob 7s ease-in-out infinite; animation-delay: var(--fd, 0s); }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; text-align: left; } .hero-visual { min-height: 470px; } }

/* numbers */
.stats { padding: 40px 0; background: var(--bg2); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stats b { display: block; font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.03em; line-height: 1; }
.stats span { color: var(--muted); font-size: .95rem; }
@media (max-width: 640px) { .stats .wrap { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; } }

/* the playable demo */
.demo-head { text-align: center; margin-bottom: 44px; }
.demo-head .lead { margin: 16px auto 0; }
.game { --g-bg: #EFE7D8; --g-node: #4A4760; --g-plank: #D79A5B; --g-player: #FFFFFF; max-width: 760px; margin: 0 auto; background: var(--g-bg); border-radius: 36px; padding: 22px 22px 18px; box-shadow: var(--shadow); transition: background .5s, box-shadow .6s; position: relative; color: #2B2638; }
.game.solved { box-shadow: var(--shadow), 0 0 0 6px color-mix(in srgb, var(--gold) 60%, transparent); }
.game-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; padding: 4px 8px 10px; flex-wrap: wrap; gap: 6px; }
.game-top .nums { font-weight: 600; opacity: .7; font-size: .95rem; }
.game-board { background: color-mix(in srgb, var(--g-bg) 45%, #fff); border-radius: 26px; padding: 6px; position: relative; }
.game-board svg { display: block; width: 100%; max-height: 52vh; touch-action: none; user-select: none; -webkit-user-select: none; }
.g-node { fill: var(--g-node); }
.g-start { fill: var(--accent); }
.g-finish { fill: var(--gold); }
.g-wood { fill: var(--g-plank); stroke: rgba(0, 0, 0, .32); stroke-width: 3; transition: opacity .3s; }
.g-peg { fill: rgba(0, 0, 0, .42); }
.g-can { cursor: grab; }
.g-can:hover .g-wood { filter: brightness(1.08); }
.g-fixed .g-wood { opacity: .55; }
.g-held { cursor: grabbing; filter: drop-shadow(0 14px 10px rgba(0, 0, 0, .3)); }
.g-slot { fill: transparent; stroke: var(--g-plank); stroke-width: 3; stroke-dasharray: 9 8; opacity: .85; cursor: pointer; animation: dash 1.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -34; } }
.g-near { fill: color-mix(in srgb, var(--g-plank) 40%, transparent); opacity: 1; }
.g-player { transition: transform .34s cubic-bezier(.4, 0, .2, 1); }
.game-msg { min-height: 1.6em; text-align: center; font-size: .98rem; opacity: .75; margin: 10px 0 2px; }
.game-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 6px; }
.game-bar button { font: inherit; font-weight: 600; background: rgba(0, 0, 0, .07); color: inherit; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.game-bar button:disabled { opacity: .35; cursor: default; }
.game-bar .sw { padding: 0; width: 26px; height: 26px; border-radius: 50%; flex: none; }
.swatches { display: flex; gap: 8px; align-items: center; }
.swatches span { font-size: .85rem; opacity: .65; margin-right: 4px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18); position: relative; overflow: hidden; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent), inset 0 0 0 2px rgba(0, 0, 0, .18); }
.sw i { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; }
.win { position: absolute; inset: 0; border-radius: 36px; background: color-mix(in srgb, var(--g-bg) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 20px; animation: pop .45s cubic-bezier(.2, 1.3, .3, 1); }
.win[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.win h3 { font-size: 2rem; }
.win .stars { font-size: 3rem; letter-spacing: .1em; color: var(--gold); line-height: 1.1; }
.win .btn { margin-top: 10px; }

/* how it works: sticky phone + steps */
.steps-grid { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 60px; align-items: start; }
.steps-grid .copy { order: 1; }
.step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .28; transition: opacity .5s; }
.step.active { opacity: 1; }
.step h3 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 12px; }
.step .num { font-weight: 800; color: var(--accent); letter-spacing: .12em; font-size: .85rem; margin-bottom: 8px; }
.steps-grid .sticky { order: 2; position: sticky; top: calc(50vh - 290px); display: flex; justify-content: center; }
.steps-grid .sticky .phone { --w: min(300px, 60vw); }
@media (max-width: 800px) {
  .steps-grid { grid-template-columns: 1fr; gap: 0; }
  .steps-grid .sticky { order: 0; top: 70px; z-index: 3; padding: 6px 0 10px; background: linear-gradient(var(--bg2) 70%, color-mix(in srgb, var(--bg2) 0%, transparent)); }
  .steps-grid .sticky .phone { --w: 170px; }
  .step { min-height: 52vh; }
}

/* mechanics rail */
.rail-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.arrows { display: flex; gap: 10px; }
.arrows button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font-size: 1.3rem; cursor: pointer; transition: opacity .2s, transform .2s; }
.arrows button:hover { transform: scale(1.06); }
.arrows button:disabled { opacity: .25; cursor: default; transform: none; }
.rail { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px max(22px, calc((100vw - var(--max)) / 2 + 22px)) 40px; scrollbar-width: none; cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.drag { cursor: grabbing; scroll-snap-type: none; }
.mech { flex: 0 0 min(320px, 80vw); scroll-snap-align: center; background: var(--card); border-radius: var(--radius); padding: 28px 24px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 1px 0 var(--line); transition: transform .35s, box-shadow .35s; }
.mech:hover { transform: translateY(-8px); box-shadow: 0 30px 50px -28px rgba(0, 0, 0, .45); }
.mech .phone { --w: 200px; margin-bottom: 22px; pointer-events: none; }
.mech h3 { margin-bottom: 6px; }
.mech p { color: var(--muted); font-size: .98rem; margin: 0; }
.mech .tag { display: inline-block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

/* daily + leaderboard */
.daily-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.phones { position: relative; height: 560px; }
.phones .phone { position: absolute; --w: 190px; }
.phones .p1 { left: 0; top: 70px; transform: rotate(-6deg); z-index: 1; }
.phones .p2 { left: 50%; margin-left: -118px; top: 0; z-index: 3; --w: 236px; }
.phones .p3 { right: 0; top: 80px; transform: rotate(6deg); z-index: 2; }
.checks { list-style: none; padding: 0; margin: 22px 0 0; }
.checks li { padding-left: 34px; position: relative; margin: 12px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; display: grid; place-items: center; font-weight: 800; line-height: 1; top: 4px; }
@media (max-width: 880px) { .daily-grid { grid-template-columns: 1fr; } .phones { height: 470px; max-width: 460px; margin: 0 auto; width: 100%; } .phones .phone { --w: 150px; } .phones .p2 { --w: 188px; margin-left: -94px; } }

/* colours */
.colours { background: color-mix(in srgb, var(--tint, #EFE7D8) 55%, var(--bg)); transition: background .6s ease; }
.col-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items: center; }
.col-grid .phone { --w: min(300px, 70vw); margin: 0 auto; }
.themes { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 10px; }
.theme { width: 64px; height: 64px; border-radius: 20px; border: 0; padding: 0; cursor: pointer; position: relative; overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); transition: transform .2s; }
.theme:hover { transform: translateY(-3px) scale(1.04); }
.theme[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--accent), inset 0 0 0 2px var(--line); }
.theme i { position: absolute; border-radius: 50%; }
.theme .a { width: 18px; height: 18px; left: 10px; top: 10px; }
.theme .b { width: 26px; height: 10px; left: 18px; top: 34px; border-radius: 6px; }
.theme .c { width: 14px; height: 14px; right: 9px; bottom: 9px; }
.theme-name { font-weight: 700; font-size: 1.15rem; }
@media (max-width: 880px) { .col-grid { grid-template-columns: 1fr; } }

/* closing call */
.cta { text-align: center; padding-bottom: 40px; }
.cta h2 { margin-bottom: 16px; }
.cta .lead { margin: 0 auto 30px; }

/* ?static preview (full-page captures): no viewport-height tricks */
.static .step { min-height: 420px; opacity: 1; }
.static .steps-grid .sticky { position: static; }

.store-badge { display: inline-block; line-height: 0; vertical-align: middle; margin: 0 12px 8px 0; }
.store-badge img { height: 52px; width: auto; }
