/* Doodle Rocket - notebook doodle theme (same inks as the game) */

/* The game's handwriting: GreenPiloww for letters, Pijamas for numbers + punctuation */
@font-face {
  font-family: "Doodle";
  src: url("fonts/GreenPiloww.ttf") format("truetype");
  unicode-range: U+0041-005A, U+0061-007A;
  font-display: swap;
}
@font-face {
  font-family: "Doodle";
  src: url("fonts/Pijamas.ttf") format("truetype");
  unicode-range: U+0020-0040, U+005B-0060, U+007B-00FF, U+2010-2027;
  font-display: swap;
}

:root {
  --paper: #f4f1e8;
  --card: #fbf6e9;
  --ink: #1f2a5c;
  --ink-soft: #4b5582;
  --rule: #c4d3ea;
  --margin: #e8a0a0;
  --red: #d8432f;
  --yellow: #ffe27a;
  --gold: #ffd23f;
  --green: #bfe6a3;
  --blue: #aed9f4;
  --pink: #ffc2cf;
  --orange: #ffcb8e;
  --tape: rgba(236, 214, 150, 0.75);
  --hand: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --hand2: 18px 225px 18px 255px / 255px 18px 225px 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
  font: 18px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* red margin lines, like a school notebook */
body::before {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: 44px;
  width: 6px;
  border-left: 2px solid var(--margin);
  border-right: 1.5px solid var(--margin);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

h1, h2, h3, .doodle {
  font-family: "Doodle", "Comic Sans MS", "Chalkboard SE", cursive;
  font-weight: normal;
  letter-spacing: 0.5px;
  line-height: 1.15;
}
h1 { font-size: clamp(44px, 8vw, 84px); margin: 0 0 12px; text-shadow: 4px 4px 0 var(--yellow); }
h2 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 14px; text-shadow: 3px 3px 0 var(--yellow); }
h3 { font-size: 26px; margin: 26px 0 6px; color: var(--red); }

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 20px 0 64px; }

/* ---------- header */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(244, 241, 232, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--ink);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: 46px; border-radius: 12px; border: 3px solid var(--ink); transform: rotate(-4deg); }
.brand span { font-family: "Doodle", cursive; font-size: 30px; text-shadow: 2px 2px 0 var(--yellow); }
.nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  font-family: "Doodle", cursive; font-size: 20px;
  color: var(--ink); text-decoration: none;
  padding: 4px 12px; border: 2.5px solid transparent; border-radius: var(--hand);
}
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--ink); background: var(--yellow); }

/* ---------- red zigzag, like the edges of every level */
.zigzag {
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='18'%3E%3Cpath d='M0 15 L7 3 L14 15 L21 3 L28 15' fill='none' stroke='%23d8432f' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E") repeat-x center;
  margin: 34px 0;
}

/* ---------- notes & cards */
.note {
  position: relative;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--hand);
  box-shadow: 5px 6px 0 rgba(31, 42, 92, 0.16);
  padding: 30px 32px;
}
.note.tape::before, .note.tape::after {
  content: ""; position: absolute; top: -16px; width: 92px; height: 30px;
  background: var(--tape); border-radius: 3px;
}
.note.tape::before { left: 18px; transform: rotate(-8deg); }
.note.tape::after { right: 18px; transform: rotate(7deg); }
.note.yellow { background: var(--yellow); }
.note.green { background: var(--green); }
.note.blue { background: var(--blue); }
.note.pink { background: var(--pink); }
.note.orange { background: var(--orange); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Doodle", cursive; font-size: 24px;
  color: var(--ink); text-decoration: none;
  background: var(--yellow);
  border: 3px solid var(--ink); border-radius: var(--hand2);
  padding: 10px 26px;
  box-shadow: 4px 4px 0 rgba(31, 42, 92, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { color: var(--ink); transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 6px 7px 0 rgba(31, 42, 92, 0.22); }
.btn.alt { background: var(--card); }
.btn svg { width: 26px; height: 26px; }

/* ---------- hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 56px 0 10px; }
.hero p.lead { font-size: 21px; color: var(--ink-soft); max-width: 34em; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.hero-art { position: relative; }
.hero-art img.cover { width: 100%; height: auto; display: block; border: 3px solid var(--ink); border-radius: var(--hand); box-shadow: 6px 7px 0 rgba(31, 42, 92, 0.18); transform: rotate(1.5deg); }
.hero-art .rocket {
  position: absolute; width: 96px; right: -14px; top: -34px;
  border-radius: 22px; border: 3px solid var(--ink);
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(8deg); } 50% { transform: translateY(-12px) rotate(2deg); } }

/* ---------- features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 26px; }
.feature { padding: 22px 24px; }
.feature:nth-child(odd) { transform: rotate(-0.8deg); }
.feature:nth-child(even) { transform: rotate(0.7deg); }
.feature h3 { margin-top: 0; color: var(--ink); font-size: 28px; }
.feature p { margin: 0; }
.feature .icon { font-size: 34px; line-height: 1; margin-bottom: 8px; display: block; }

/* ---------- screenshots */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; margin-top: 26px; }
.shot { margin: 0; background: var(--card); border: 3px solid var(--ink); border-radius: 10px; padding: 10px 10px 4px; box-shadow: 5px 6px 0 rgba(31, 42, 92, 0.16); }
.shot:nth-child(odd) { transform: rotate(-1deg); }
.shot:nth-child(even) { transform: rotate(1deg); }
.shot img { width: 100%; height: auto; display: block; border-radius: 4px; border: 2px solid var(--ink); }
.shot figcaption { font-family: "Doodle", cursive; font-size: 22px; text-align: center; padding: 6px 0 2px; }

/* ---------- legal / text pages */
.page { padding: 50px 0 20px; }
.legal { max-width: 820px; }
.legal .meta { color: var(--ink-soft); font-size: 16px; margin-top: -4px; }
.legal p, .legal li { color: #253066; }
.legal ul { padding-left: 1.3em; }
.legal li { margin: 6px 0; }
.legal li::marker { color: var(--red); }
.summary { margin: 22px 0 30px; }
.summary ul { margin: 6px 0 0; }
table.facts { width: 100%; border-collapse: collapse; margin: 14px 0 6px; font-size: 16px; }
table.facts th, table.facts td { border: 2px solid var(--ink); padding: 8px 12px; text-align: left; vertical-align: top; background: var(--card); }
table.facts th { background: var(--yellow); font-weight: 700; }
code, kbd { background: var(--card); border: 2px solid var(--ink); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; }

details { border: 3px solid var(--ink); border-radius: var(--hand2); background: var(--card); padding: 12px 20px; margin: 14px 0; box-shadow: 4px 4px 0 rgba(31, 42, 92, 0.12); }
details summary { cursor: pointer; font-family: "Doodle", cursive; font-size: 24px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; display: inline-block; width: 1.1em; color: var(--red); font-family: "Doodle", cursive; }
details[open] summary::before { content: "-"; }
details p { margin: 8px 0 4px; }

/* ---------- footer */
footer { margin-top: 60px; border-top: 3px solid var(--ink); background: rgba(251, 246, 233, 0.9); position: relative; z-index: 1; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; padding-top: 22px; padding-bottom: 26px; font-size: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer a { color: var(--ink); }
footer .copy { margin-left: auto; color: var(--ink-soft); }

/* ---------- 404 */
.lost { text-align: center; padding: 90px 0 40px; }
.lost img { width: 130px; border-radius: 28px; border: 3px solid var(--ink); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- phones */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 34px; }
  .hero-art { max-width: 520px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body::before { left: 14px; }
  .wrap { padding: 0 16px 0 30px; }
  .features, .shots { grid-template-columns: 1fr; }
  .note { padding: 22px 20px; }
  .nav { margin-left: 0; }
  .nav a { font-size: 18px; padding: 2px 8px; }
  .hero-art .rocket { width: 70px; right: -6px; }
  footer .copy { margin-left: 0; }
  table.facts { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art .rocket, .lost img { animation: none; }
  .btn, .btn:hover { transition: none; transform: none; }
}
