/* Čmáranice – čistý web ve stylu aplikace. Rámečky a ikony kreslí sketch.js „fixou“. */
:root {
  --ink: #121212;
  --paper: #fdfbf6;
  --card: #ffffff;
  --muted: #6b675f;
  --hand: "Chalkboard SE", "Patrick Hand", "Comic Sans MS", system-ui, sans-serif;
  --max: 1080px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 19px/1.5 var(--hand); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }

/* Ruční kresba */
.sk { position: relative; isolation: isolate; }
.sk > *:not(svg) { position: relative; }
.sk-line { display: block; height: 6px; line-height: 0; }
.sk-line svg { display: block; }
.doodle { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.12em; }

/* Navigace – tenká, nahoře přilepená jako na apple.com */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  padding-bottom: 6px;
}
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 54px; }
.nav .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 19px; margin-right: auto; }
.nav .brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav a.link { text-decoration: none; font-size: 15px; color: var(--muted); }
.nav a.link:hover, .nav a.link[aria-current] { color: var(--ink); }
.nav .sk-line { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; }

/* Tlačítka – ručně obtažená, plná nebo prázdná */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px;
  font: 700 19px var(--hand); text-decoration: none; color: var(--paper); cursor: pointer;
  transition: transform .15s;
}
.btn.ghost { color: var(--ink); }
.btn:hover { transform: rotate(-1deg) scale(1.03); }
.textlink { font-size: 19px; text-decoration: none; }
.textlink:hover { text-decoration: underline; }
.textlink::after { content: " ›"; }

/* Sekce – jedna myšlenka, hodně vzduchu */
section { padding: 96px 0; }
/* Zvětšená razítka před plácnutím a ořezky nesmí stránku rozšířit do strany. */
main { overflow-x: clip; }
.eyebrow { font-size: 17px; color: var(--muted); margin: 0 0 6px; }
h1 { font-size: clamp(44px, 8vw, 88px); line-height: 1.02; letter-spacing: -0.5px; margin: 0 0 18px; }
h2 { font-size: clamp(34px, 6vw, 60px); line-height: 1.06; letter-spacing: -0.3px; margin: 0 0 16px; }
.sub { font-size: clamp(20px, 2.4vw, 26px); color: var(--muted); max-width: 30em; margin: 0 auto 30px; }
.actions { display: flex; gap: 26px; justify-content: center; align-items: center; flex-wrap: wrap; }

.hero { padding: 72px 0 0; }
.hero .shot { margin: 56px auto 0; max-width: 360px; }

/* Screenshot v ručně kresleném rámečku (obrys jde přes obrázek) */
.shot { border-radius: 30px; }
.shot img { border-radius: 30px; }
.shots { display: flex; gap: 34px; justify-content: center; align-items: flex-start; margin-top: 54px; }
.shots .shot { flex: 0 1 300px; }
.shots .shot:nth-child(1) { transform: rotate(-2deg); margin-top: 40px; }
.shots .shot:nth-child(3) { transform: rotate(2deg); margin-top: 40px; }
.shot.solo { max-width: 340px; margin: 54px auto 0; }
.shot.solo:nth-of-type(odd) { transform: rotate(-1.5deg); }
.tablet { max-width: 760px; margin: 54px auto 0; border-radius: 28px; }
.tablet img { border-radius: 28px; }

/* Zadání dne */
.prompt-wrap { max-width: 720px; margin: 40px auto 0; position: relative; }
.prompt { padding: 54px 30px 44px; font-size: clamp(28px, 4.4vw, 46px); font-weight: 700; text-align: center; transform: rotate(-1deg); min-height: 1.2em; }
.label { position: absolute; top: -16px; left: 50%; transform: translateX(-50%) rotate(-2deg); z-index: 3; padding: 6px 16px; color: var(--paper); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; white-space: nowrap; }

/* Tři kroky */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px; margin-top: 60px; text-align: center; }
.steps .doodle { font-size: 64px; margin-bottom: 12px; }
.steps h3 { font-size: 26px; margin: 0 0 8px; }
.steps p { margin: 0; color: var(--muted); }

/* Výhody */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 54px; text-align: left; }
.tile { padding: 28px 26px; }
.tile .doodle { font-size: 40px; margin-bottom: 14px; }
.tile h3 { margin: 0 0 6px; font-size: 22px; }
.tile p { margin: 0; color: var(--muted); font-size: 17px; }

.stamp { display: inline-block; padding: 6px 18px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; transform: rotate(-6deg); margin-bottom: 26px; }

/* Textové stránky */
.doc { max-width: 720px; margin: 0 auto; padding: 64px 0 40px; }
.doc h1 { font-size: clamp(38px, 6vw, 56px); margin-bottom: 6px; }
.doc h2 { font-size: 25px; margin: 38px 0 6px; letter-spacing: 0; }
.doc p, .doc li { font-size: 18px; }
.doc .meta { color: var(--muted); font-size: 16px; margin: 0 0 30px; }
.faq { display: grid; gap: 22px; margin-top: 30px; }
.faq .sk { padding: 22px 24px; }
.faq h2 { margin: 0 0 6px; font-size: 22px; }
.faq p { margin: 0; color: var(--muted); }

/* Patička */
footer { padding: 40px 0 56px; font-size: 14px; color: var(--muted); }
footer .row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

/* ---------- Animace (anim.js) – jako v aplikaci ---------- */
/* Ikony se „vaří“ – tři podoby čáry se střídají jako Wobble. */
.doodle, .doodle-svg { filter: url(#boil); }

/* Obsah sekcí vyjede zespodu, rámečky a ikony se dokreslí fixou. */
.js .rv { opacity: 0; translate: 0 22px; transition: opacity .7s ease, translate .8s cubic-bezier(.2,.8,.2,1); }
.js .rv.in { opacity: 1; translate: 0 0; }
.js .sk-frame .ink, .js .sk-line .ink { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(.5,0,.3,1) .1s; }
.js .in > .sk-frame .ink, .js .sk-line.in .ink { stroke-dashoffset: 0; }
.js .doodle { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s ease .25s; }
.js .doodle.in { stroke-dashoffset: 0; }

/* Razítko se plácne – z velka dolů s pérováním (jako „Splněno“ po odeslání). */
.js .stamp { opacity: 0; scale: 2.8; transition: scale .42s cubic-bezier(.3,1.7,.5,1) .35s, opacity .15s linear .35s; }
.js .stamp.in { opacity: 1; scale: 1; }

/* Odpočet do nové výzvy */
.countdown { margin: 34px 0 0; color: var(--muted); font-size: 18px; }
.countdown b { color: var(--ink); font-size: 24px; font-variant-numeric: tabular-nums; margin-left: 4px; }

/* Plátno: screenshot a vedle zkušební plátno */
.duo { display: flex; gap: 56px; justify-content: center; align-items: center; margin-top: 54px; }
.duo .shot { flex: 0 1 320px; transform: rotate(-1.5deg); }
.play { flex: 0 1 350px; text-align: left; }
.play-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 18px; font-size: 22px; font-weight: 700; min-height: 3.6em; }
.label-ink { padding: 5px 14px; color: var(--paper); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; transform: rotate(-2deg); font-weight: 400; }
.pad { aspect-ratio: 2 / 3; }
.pad canvas { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); touch-action: none; cursor: crosshair; border-radius: 14px; }
.pad .pad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; transition: opacity .3s; }
.pad .pad-hint.gone { opacity: 0; }
.pad .stamp.done { position: absolute; top: 18px; right: -14px; z-index: 3; font-size: 22px; transform: rotate(10deg); margin: 0; }
.pad.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }
.tools { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.tool { width: 48px; height: 48px; display: grid; place-items: center; border: 0; background: none; color: var(--ink); cursor: pointer; padding: 0; transition: transform .12s; }
.tool .doodle { font-size: 26px; }
.tool.on { color: var(--paper); }
.tool:active, .btn:active { transform: translate(2px, 2px); }
.tools .btn { margin-left: auto; padding: 10px 18px; border: 0; background: none; white-space: nowrap; font-size: 17px; }

/* Ukázka stupňů série */
.streak { max-width: 520px; margin: 50px auto 0; padding: 26px 28px 20px; text-align: left; }
.streak-top { display: flex; align-items: center; gap: 18px; }
.streak-ico { display: block; width: 74px; height: 74px; flex: none; }
.streak-ico svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.streak-ico.pop { animation: pop .45s cubic-bezier(.3,1.7,.5,1); }
@keyframes pop { from { scale: .4; rotate: -20deg; } to { scale: 1; rotate: 0deg; } }
.streak-text b { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.streak-text span { font-size: 19px; color: var(--muted); }
.streak-title { display: block; color: var(--ink) !important; font-size: 24px !important; font-weight: 700; min-height: 1.3em; }
.streak input[type=range] { width: 100%; margin: 20px 0 6px; accent-color: var(--ink); }
.streak-note { margin: 0; font-size: 15px; color: var(--muted); }

/* Ořezky vyletí z Papírnictví */
.shop-wrap { position: relative; max-width: 340px; margin: 0 auto; }
.coins { position: absolute; top: 70px; right: -70px; width: 150px; height: 120px; pointer-events: none; z-index: 4; }
.coin-chip { position: absolute; right: 0; top: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 16px; white-space: nowrap; transform: rotate(6deg); }
.coin-chip .doodle { font-size: 20px; }
.coins .shav { position: absolute; right: 40px; top: 46px; font-size: 26px; opacity: 0; }
.js .coins .coin-chip { opacity: 0; scale: .4; transition: scale .4s cubic-bezier(.3,1.7,.5,1) .3s, opacity .2s .3s; }
.js .coins.in .coin-chip { opacity: 1; scale: 1; }
.js .coins.in .shav { animation: shave 1.4s cubic-bezier(.2,.8,.3,1) forwards; }
.coins .shav:nth-of-type(2) { --x: -80px; --y: -50px; --r: 200deg; animation-delay: .35s !important; }
.coins .shav:nth-of-type(3) { --x: -40px; --y: -80px; --r: 140deg; animation-delay: .45s !important; }
.coins .shav:nth-of-type(4) { --x: 10px; --y: -90px; --r: 260deg; animation-delay: .4s !important; }
.coins .shav:nth-of-type(5) { --x: 50px; --y: -60px; --r: 120deg; animation-delay: .5s !important; }
.coins .shav:nth-of-type(6) { --x: -100px; --y: 0px; --r: 300deg; animation-delay: .55s !important; }
@keyframes shave { 0% { opacity: 0; translate: 0 0; rotate: 0deg; } 20% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; translate: var(--x) var(--y); rotate: var(--r); } }

/* Razítko přes kresby party */
.shots { position: relative; }
.shots .stamp.land { position: absolute; z-index: 5; left: 50%; top: 10px; margin: 0; font-size: 22px; transform: translateX(-50%) rotate(-8deg); }

@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .stamp, .js .coins .coin-chip { opacity: 1; translate: none; scale: none; transition: none; }
  .js .sk-frame .ink, .js .sk-line .ink, .js .doodle { stroke-dashoffset: 0; transition: none; }
  .doodle, .doodle-svg { filter: none; }
  .coins .shav { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  section { padding: 64px 0; }
  .nav a.link { display: none; }
  .nav a.link.keep { display: inline; }
  .steps, .grid { grid-template-columns: 1fr; gap: 34px; }
  .shots { gap: 14px; }
  .shots .shot:nth-child(1), .shots .shot:nth-child(3) { display: none; }
  .shots .shot { flex-basis: 270px; }
  .hero .shot, .shot.solo { max-width: 280px; }
  .duo { flex-direction: column; gap: 46px; }
  .duo .shot { width: 260px; flex: none; }
  .play { width: 100%; max-width: 360px; flex: none; }
  .coins { right: -10px; top: -30px; }
}

/* Kreslená tužka místo kurzoru (jen myš) */
.pencil-cursor, .pencil-cursor * { cursor: none !important; }
.pencil-cursor input[type=range] { cursor: none !important; }
.pen { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .2s; will-change: transform; }
.pen svg { display: block; transform-origin: 4px 36px; transition: transform .15s ease; }
.pen.lift svg { transform: rotate(-10deg) translate(2px, -3px); }
.pen.press svg { transform: rotate(6deg) scale(.92); }
.pen-trail { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 999; pointer-events: none; }
