/* Knocko pages: a hand-made picture book. White paper, black ink, one twilight blue accent,
   wood tones only where Knocko appears. Fonts: Amatic SC (titles, labels) and Source Serif 4 (text),
   both SIL Open Font License, see assets/fonts/OFL-*.txt. */
@font-face {
  font-family: "Amatic SC"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/knocko/assets/fonts/AmaticSC-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Amatic SC"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/knocko/assets/fonts/AmaticSC-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/knocko/assets/fonts/SourceSerif4-Variable.ttf") format("truetype");
}

:root {
  color-scheme: light;
  --paper: #FFFFFF; --ink: #1D1B19; --ink2: #5A554F; --line: #D9D4CC;
  --twilight: #3E3E8C; --wood: #C08A4E; --bark: #8A5A2B;
  --hand: "Amatic SC", "Chalkboard SE", "Marker Felt", cursive;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  /* An uneven radius makes a thin border look drawn by hand. */
  --sketch: 255px 18px 225px 16px / 16px 225px 18px 255px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--serif); font-optical-sizing: auto; font-weight: 400;
  font-size: 19px; line-height: 1.6; overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--twilight); overflow-wrap: anywhere; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; border: 1px solid var(--ink); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.text { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; }
main { position: relative; z-index: 1; }

/* Labels and titles in Amatic SC */
.caption, .counter, nav, .availability, .scroll-cue, .art-slot figcaption {
  font-family: var(--hand); letter-spacing: 0.06em;
}
.caption { font-size: 22px; text-transform: uppercase; color: var(--ink2); font-weight: 400; line-height: 1.3; }
nav.crumbs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 28px; }
nav.crumbs a { text-decoration: none; color: var(--ink2); }
nav.crumbs a[lang] { margin-left: auto; color: var(--twilight); }

h1, h2, h3 { font-family: var(--hand); font-weight: 700; line-height: 1.05; color: var(--ink); letter-spacing: 0.03em; }
h1 { font-size: clamp(64px, 14vw, 128px); margin: 8px 0 0; }
h2 { font-size: clamp(44px, 7vw, 72px); margin: 0 0 16px; text-align: center; }
h3 { font-size: 34px; margin: 0 0 6px; }
p, li { font-size: 19px; }
ul { padding-left: 22px; }

main.text h1 { font-size: clamp(56px, 11vw, 88px); }
main.text h2 { font-size: 40px; text-align: left; margin: 44px 0 6px; }
main.text .caption { margin-bottom: 0; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 12px; position: relative; z-index: 1; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--hand); font-weight: 700; font-size: 38px; color: var(--bark); text-decoration: none; letter-spacing: 0.04em; }
.wordmark img { width: 40px; height: 40px; border-radius: 10px; }
.topbar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; font-size: 26px; font-weight: 700; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }

/* Hero */
.hero { text-align: center; padding-top: 8px; padding-bottom: 40px; }
.hero h1 { color: var(--bark); }
.tagline { font-family: var(--hand); font-size: clamp(32px, 5vw, 46px); line-height: 1.15; margin: 0 0 24px; letter-spacing: 0.04em; }
.hero .art-slot { max-width: 560px; margin: 0 auto 24px; }
.intro { max-width: 640px; margin: 0 auto 20px; font-size: 20px; }
.availability {
  display: inline-block; margin: 8px 0 0; padding: 4px 22px; border: 2px solid var(--twilight); border-radius: var(--sketch);
  color: var(--twilight); font-size: 28px; font-weight: 700;
}
.availability-note { font-size: 16px; color: var(--ink2); margin: 10px 0 0; }
.scroll-cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 40px;
  font-size: 24px; text-transform: uppercase; color: var(--ink); text-decoration: none;
}
.scroll-cue svg { width: 28px; height: 18px; stroke: var(--ink); animation: knocko-nudge 2.4s ease-in-out infinite; }
@keyframes knocko-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Illustration slots. Placeholders until the art exists; the slot keeps the final aspect ratio
   so the real picture drops in without a layout shift. */
.art-slot {
  position: relative; margin: 0; aspect-ratio: 3 / 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 2px dashed var(--line); border-radius: var(--sketch); background: var(--paper);
}
.art-slot.square { aspect-ratio: 1 / 1; max-width: 420px; margin-left: auto; margin-right: auto; }
.art-slot img { display: block; width: 28%; max-width: 200px; height: auto; border-radius: 22%; }
.art-slot.square img { width: 34%; }
.art-slot figcaption { font-size: 22px; color: var(--ink2); text-transform: uppercase; }
/* Once real art is in place (class has-art), the slot shows it edge to edge. */
.art-slot.has-art { border: 0; }
.art-slot.has-art img { width: 100%; max-width: none; border-radius: 0; }

/* Story */
.story { padding-top: 48px; padding-bottom: 32px; }
.story > header { text-align: center; margin-bottom: 24px; }
.story > header .caption { margin: 0; }
.spread { max-width: 860px; margin: 0 auto; padding: 40px 0 72px; text-align: center; }
.spread .lines { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.6; margin: 32px auto 8px; max-width: 640px; }
.spread .lines span { display: block; text-wrap: balance; }
.counter { display: block; font-size: 26px; color: var(--twilight); font-weight: 400; }
.afterword { max-width: 720px; margin: 0 auto; padding: 24px 0 48px; text-align: center; }
.afterword h3 { font-size: 48px; margin: 4px 0 8px; }
.afterword .caption { margin: 28px auto 0; }
.afterword p { margin: 0 auto; max-width: 620px; }
.ornament { display: block; width: 120px; height: 16px; margin: 0 auto 32px; stroke: var(--wood); fill: none; }

/* Sections */
.section { padding-top: 56px; padding-bottom: 56px; position: relative; }
.section + .section::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 160px; height: 2px; margin-left: -80px;
  background: var(--line); border-radius: 2px; transform: rotate(-1deg);
}
.band, .band-night { background: transparent; }
.lead { font-size: 19px; color: var(--ink2); max-width: 640px; margin: 0 auto 8px; text-align: center; }

.steps, .features, .times { display: grid; gap: 28px 32px; margin-top: 24px; }
.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.times { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; margin-left: auto; margin-right: auto; }
.card { background: transparent; padding: 0; border: 0; }
.steps .card, .times .card { text-align: center; }
.card p { margin: 0; }
.card .num {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 4px;
  border: 2px solid var(--wood); border-radius: 48% 52% 50% 46% / 52% 46% 54% 48%;
  font-family: var(--hand); font-weight: 700; font-size: 32px; color: var(--bark);
}
.time-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.time-list li { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--twilight); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 24px; }
.price { font-weight: 600; color: var(--bark); }

/* Inside the app: three screenshots in simple white frames */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; max-width: 760px; margin: 24px auto 0; padding: 0; list-style: none; }
.gallery figure { margin: 0; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 30px; box-shadow: 0 6px 18px rgba(29, 27, 25, 0.06); }
.gallery figcaption { font-family: var(--hand); font-size: 24px; color: var(--ink2); margin-top: 6px; text-align: center; letter-spacing: 0.06em; }
.screen { display: block; width: 100%; border-radius: 22px; }

.privacy-points { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin: 8px 0 16px; }
.privacy-points li { font-family: var(--hand); font-size: 28px; font-weight: 700; padding: 0 16px; border: 2px solid var(--ink); border-radius: var(--sketch); }

.box { border: 2px dashed var(--line); border-radius: var(--sketch); padding: 20px 24px; margin: 24px 0; }
main.text .box h2 { margin-top: 0; }

details { border-bottom: 1px solid var(--line); padding: 12px 0; margin: 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 19px; }
details p { margin: 8px 0 0; }

/* Footer */
.footer { padding-top: 32px; padding-bottom: 48px; margin-top: 16px; border-top: 1px solid var(--line); text-align: center; position: relative; z-index: 1; }
main.text .footer { padding-bottom: 0; margin-top: 56px; text-align: left; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin-bottom: 8px; font-size: 26px; font-weight: 700; }
main.text .footer nav { justify-content: flex-start; }
.footer p { font-size: 16px; color: var(--ink2); margin: 0; font-family: var(--serif); letter-spacing: 0; text-transform: none; }

/* Falling wood shavings and sparkles: decoration only, behind the content. */
.shavings { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.shavings span {
  position: absolute; top: -24px; left: var(--x); width: var(--s, 8px); height: calc(var(--s, 8px) * 0.45);
  background: var(--wood); border-radius: 50% 50% 50% 50% / 100% 100% 0 0; opacity: 0.32;
  animation: knocko-fall var(--d, 22s) linear var(--delay, 0s) infinite;
}
.shavings span.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--twilight); opacity: 0.22; }
.shavings span.bark { background: var(--bark); opacity: 0.22; }
@keyframes knocko-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(28px, 52vh, 0) rotate(160deg); }
  100% { transform: translate3d(-12px, 106vh, 0) rotate(340deg); }
}

@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 18px; }
  p, li { font-size: 18px; }
  .features, .times { grid-template-columns: minmax(0, 1fr); }
  .gallery { gap: 10px; }
  .gallery figure { padding: 5px; border-radius: 18px; }
  .gallery figcaption { font-size: 20px; }
  .screen { border-radius: 14px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .topbar nav { justify-content: flex-start; font-size: 24px; }
  .spread { padding: 24px 0 56px; }
  .art-slot img { width: 34%; }
  .art-slot figcaption { font-size: 19px; }
  .caption { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .shavings { display: none; }
  .scroll-cue svg { animation: none; }
  [data-parallax] { transform: none !important; }
}
