/* Poo Chute: Ink & Paper. Colors come from PooChute/Ink/InkPen.swift (enum Ink). */
:root {
  --ink: #1e1b1a;
  --soft: #8f877a;
  --paper: #f3eee1;
  --paper-dark: #e8e2d1;
  --red: #c63b2f;
  --poo: #8a5a2e;
  --poo-dark: #6b4221;
  --gold: #c9a326;
  --sky: #9c8cdb;
  --sea: #6fb3c9;
  --grass: #8fb86a;
  --sand: #e9c77a;
  --hand: "Marker Felt", "Chalkboard SE", "Comic Neue", "Segoe Print", "Bradley Hand", cursive;
  --note: "Noteworthy", "Chalkboard SE", "Segoe Print", "Bradley Hand", cursive;
  --body: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sketch: 255px 18px 225px 16px / 16px 225px 18px 255px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  color: var(--ink);
  font: 18px/1.55 var(--body);
  background-color: var(--paper);
  /* paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--poo-dark); }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 4px; }

h1, h2, h3 { font-family: var(--hand); font-weight: 700; line-height: 1.1; letter-spacing: .01em; margin: 0 0 .4em; }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1100px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* red-pencil underline under headings */
.scribble { position: relative; display: inline-block; }
.scribble::after {
  content: ""; position: absolute; left: -4px; right: -6px; bottom: -.12em; height: .32em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M2 9 C40 3 80 12 120 6 S180 4 198 8' fill='none' stroke='%23c63b2f' stroke-width='3.2' stroke-linecap='round'/%3E%3Cpath d='M8 12 C60 8 120 13 190 10' fill='none' stroke='%23c63b2f' stroke-width='1.6' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  z-index: -1;
}

/* ---------- header ---------- */
.top { padding: 18px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.5rem var(--hand); }
.brand img { width: 44px; height: 44px; border-radius: 11px; border: 2.5px solid var(--ink); }
.top nav { display: flex; gap: 18px; font-family: var(--note); font-weight: 700; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--red); }

/* ---------- hero ---------- */
.hero { padding: 30px 0 50px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(3.2rem, 10vw, 6.2rem); margin-bottom: .15em; transform: rotate(-2deg); transform-origin: left; }
.hero h1 .o { color: var(--poo); }
.tagline { font: 700 clamp(1.3rem, 3vw, 1.7rem)/1.25 var(--note); margin-bottom: .8em; }
.tagline em { color: var(--red); font-style: normal; }
.lede { font-size: 1.12rem; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px;
  background: var(--ink); color: var(--paper); text-decoration: none;
  border-radius: var(--sketch); font: 700 1.05rem var(--note);
  box-shadow: 4px 5px 0 var(--poo);
}
.badge svg { width: 22px; height: 22px; fill: currentColor; }
.badge small { display: block; font: 600 .72rem var(--body); opacity: .8; letter-spacing: .04em; text-transform: uppercase; }
.badge:hover { color: var(--paper); transform: rotate(-1deg); }
.note { font: 700 1rem var(--note); color: var(--soft); }

.hero-art { position: relative; }
.frame {
  margin: 0; background: #fff; padding: 10px; border: 3px solid var(--ink);
  border-radius: var(--sketch); box-shadow: 7px 8px 0 rgba(30,27,26,.85);
}
.frame img { display: block; width: 100%; height: auto; border-radius: 8px; aspect-ratio: 2622 / 1206; object-fit: cover; background: var(--paper-dark); }
.hero-art .frame { transform: rotate(1.8deg); }
.hero-art .splat { position: absolute; width: 120px; left: -40px; bottom: -42px; opacity: .55; z-index: -1; }
.tape {
  position: absolute; width: 110px; height: 30px; top: -14px; left: 50%; margin-left: -55px; transform: rotate(-4deg);
  background: rgba(233, 199, 122, .65); border: 1px solid rgba(30,27,26,.15);
}

/* ---------- sections ---------- */
section { padding: 56px 0; }
.intro { max-width: 40em; margin-bottom: 26px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: s; }
.steps li {
  position: relative; padding: 26px 22px 20px; background: rgba(255,255,255,.55);
  border: 2.5px solid var(--ink); border-radius: var(--sketch);
}
.steps li:nth-child(2) { transform: rotate(.8deg); }
.steps li:nth-child(3) { transform: rotate(-.6deg); }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: -20px; left: 18px; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--red); color: #fff; font: 700 1.3rem var(--hand); border-radius: 50% 46% 52% 48%; border: 2.5px solid var(--ink);
}
.steps h3 { margin-top: 4px; }
.steps p { margin: 0; }

.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.shots figure:nth-child(odd) { transform: rotate(-1deg); }
.shots figure:nth-child(even) { transform: rotate(1deg); }
.shots figcaption { font: 700 1rem var(--note); padding: 8px 4px 0; }

/* poops */
.poops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.poop { text-align: center; padding: 16px 12px; border: 2px dashed rgba(30,27,26,.45); border-radius: 18px; background: rgba(255,255,255,.35); }
.poop svg { width: 92px; height: 80px; display: block; margin: 0 auto 6px; }
.poop h3 { font-size: 1.25rem; margin-bottom: .2em; }
.poop p { font-size: .95rem; margin: 0; }
.poop .power { display: inline-block; margin-top: 8px; font: 700 .8rem var(--note); color: var(--red); border: 1.5px solid var(--red); border-radius: 99px; padding: 1px 10px; }

/* worlds */
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.world { position: relative; padding: 20px 18px 18px; border: 2.5px solid var(--ink); border-radius: var(--sketch); overflow: hidden; background: #fff; isolation: isolate; }
.world::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background: var(--w, var(--grass)); mask: radial-gradient(130% 90% at 30% 110%, #000 40%, transparent 72%); -webkit-mask: radial-gradient(130% 90% at 30% 110%, #000 40%, transparent 72%); }
.world .num { font: 700 .85rem var(--note); color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.world h3 { margin: .2em 0 .35em; }
.world p { font-size: .95rem; margin: 0; }
.more { margin-top: 22px; font: 700 1.05rem var(--note); }

/* features */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 30px; list-style: none; padding: 0; margin: 0; }
.facts li { padding-left: 38px; position: relative; }
.facts li::before { content: "✓"; position: absolute; left: 0; top: -4px; font: 700 1.6rem var(--hand); color: var(--red); }
.facts strong { font-family: var(--note); font-size: 1.08rem; }

/* footer */
footer { padding: 40px 0 50px; border-top: 2px dashed rgba(30,27,26,.3); margin-top: 30px; font-size: .95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--note); font-weight: 700; }
footer nav a { color: var(--ink); }

/* ---------- document pages (privacy, support) ---------- */
.doc { padding: 20px 0 40px; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); transform: rotate(-1.5deg); transform-origin: left; }
.doc h2 { font-size: 1.7rem; margin-top: 1.6em; }
.doc .meta { font: 700 1rem var(--note); color: var(--soft); }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: .45em; }
.card { padding: 18px 22px; border: 2.5px solid var(--ink); border-radius: var(--sketch); background: rgba(255,255,255,.55); margin: 18px 0; }
.card p:last-child { margin: 0; }
details { border-bottom: 2px dashed rgba(30,27,26,.3); padding: 14px 0; }
details summary { cursor: pointer; font: 700 1.2rem var(--hand); list-style: none; padding-right: 28px; position: relative; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 4px; top: -2px; color: var(--red); font-size: 1.5rem; }
details[open] summary::after { content: "–"; }
details > div { padding-top: 10px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .worlds { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .top nav { gap: 12px; font-size: .95rem; }
  .brand span { display: none; }
  .steps, .shots, .facts { grid-template-columns: 1fr; }
  .poops { grid-template-columns: repeat(2, 1fr); }
  .steps { gap: 32px; }
  section { padding: 40px 0; }
}
@media (max-width: 480px) { .worlds { grid-template-columns: 1fr; } .poops { grid-template-columns: repeat(2, 1fr); } }

/* world tints (classes, not inline styles, so the CSP can forbid inline styles) */
.w1 { --w: #a7a49a; } .w2 { --w: #9c8cdb; } .w3 { --w: #e9b44c; } .w4 { --w: #6fb3c9; } .w5 { --w: #c9774b; } .w6 { --w: #cf4b3a; }
svg.defs { position: absolute; }
