/* Baseline: the Slop Factory idea 33 mock. Bright colours are for decoration and big
   headlines; the darker *-ink shades are for text that has to pass WCAG AA. */
:root {
  --paper: #fffdf4;
  --ink: #222;
  --red: #ff4d6d;
  --blue: #3a7bd5;
  --green: #38b000;
  --yellow: #ffd60a;
  --purple: #9b5de5;
  --orange: #ff8c42;
  --line: #c9e3ff;
  --red-ink: #e0254f;
  --blue-ink: #2f6bc4;
  --green-ink: #2d7a00;
  --note: #666;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; } /* keep jump targets clear of the sticky nav */

body {
  margin: 0;
  color: var(--ink);
  font: 21px/1.45 "Patrick Hand", "Gaegu", cursive;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 70px, #ffb3c1 70px, #ffb3c1 72px, transparent 72px),
    repeating-linear-gradient(var(--paper) 0 33px, var(--line) 33px 35px);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M4 28l4-10L22 4l6 6L14 24z' fill='%23ffd60a' stroke='%23222' stroke-width='2'/%3E%3Cpath d='M4 28l4-10 6 6z' fill='%23f4a261' stroke='%23222' stroke-width='2'/%3E%3Cpath d='M4 28l2-5 3 3z' fill='%23222'/%3E%3C/svg%3E") 2 30, auto;
}

a { color: var(--blue-ink); }
/* the footer's "cookies" button looks like the links beside it */
.link-button { font: inherit; color: var(--blue-ink); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }

/* Cookie consent banner (cookies.js), in the site's paper-and-crayon palette */
#cc-main {
  --cc-font-family: "Patrick Hand", cursive;
  --cc-bg: var(--paper);
  --cc-primary-color: var(--ink);
  --cc-secondary-color: #444;
  --cc-btn-primary-bg: var(--red-ink);
  --cc-btn-primary-color: #fff;
  --cc-btn-primary-border-color: var(--ink);
  --cc-btn-primary-hover-bg: var(--ink);
  --cc-btn-primary-hover-color: #fff;
  --cc-btn-primary-hover-border-color: var(--ink);
  --cc-btn-secondary-bg: #fff;
  --cc-btn-secondary-color: var(--ink);
  --cc-btn-secondary-border-color: var(--ink);
  --cc-btn-secondary-hover-bg: var(--yellow);
  --cc-btn-secondary-hover-color: var(--ink);
  --cc-btn-secondary-hover-border-color: var(--ink);
  --cc-separator-border-color: var(--line);
  --cc-toggle-on-bg: var(--green-ink);
  --cc-toggle-off-bg: #999;
  --cc-toggle-readonly-bg: var(--line);
  --cc-cookie-category-block-bg: #fff;
  --cc-cookie-category-block-border: var(--line);
  --cc-cookie-category-block-hover-bg: var(--paper);
  --cc-cookie-category-expanded-block-bg: #fff;
  --cc-footer-bg: var(--paper);
  --cc-footer-border-color: var(--line);
  --cc-modal-border-radius: 14px;
  --cc-btn-border-radius: 10px;
  --cc-link-color: var(--blue-ink);
}
#cc-main .cm, #cc-main .pm { border: 3px solid var(--ink); font-size: 17px; }
#cc-main .cm__title, #cc-main .pm__title { font-family: "Gaegu", cursive; font-size: 26px; }
h1, h2, h3 { font-family: "Gaegu", cursive; font-weight: 700; margin: 0 0 .3em; line-height: 1.05; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px 0 96px; }

.crayon { border: 3px solid var(--ink); border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; }
.tilt-l { rotate: -1.5deg; }
.tilt-r { rotate: 1.2deg; }
.wobble { display: inline-block; animation: wob 2.4s ease-in-out infinite; }
@keyframes wob { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
.pop { animation: pop .4s ease-out; }
@keyframes pop { from { scale: .85; rotate: -3deg; opacity: 0; } }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 30; background: var(--yellow); padding: 4px 12px; }

/* nav */
nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 253 244 / .94);
  border-bottom: 3px dashed var(--ink);
  backdrop-filter: blur(4px);
}
nav .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo {
  font-family: "Rubik Bubbles", cursive;
  font-size: 32px;
  color: var(--red);
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--ink);
  letter-spacing: 1px;
}
.logo span { color: var(--blue); }
nav ul { display: flex; gap: 6px; list-style: none; margin: 0 0 0 auto; padding: 0; }
nav li a { display: block; padding: 4px 12px; text-decoration: none; color: var(--ink); font-size: 20px; border-radius: 12px; }
nav li a:hover, nav li a:focus-visible { background: var(--yellow); rotate: -3deg; }
.mom { font-size: 15px; background: #fff; padding: 4px 10px; margin-left: 8px; white-space: nowrap; }

/* hero */
.hero { padding: 48px 0 30px; display: grid; grid-template-columns: 1.2fr .9fr; gap: 30px; align-items: center; }
.hero h1 { font-size: 76px; }
.hero h1 .r { color: var(--red); }
.hero h1 .b { color: var(--blue); }
.hero h1 .g { color: var(--green-ink); }
.hero h1 .p { color: var(--purple); }
.hero p.big { font-size: 26px; margin: .4em 0 1em; }
.sticker { display: inline-block; background: var(--yellow); padding: 4px 14px; font-size: 18px; margin-bottom: 14px; }
.hl { background: linear-gradient(transparent 55%, var(--yellow) 55%); }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; filter: drop-shadow(5px 6px 0 rgb(0 0 0 / .12)); }
.speech { position: absolute; top: -44px; right: 70px; background: #fff; padding: 10px 14px; font-size: 19px; max-width: 200px; }
.speech::after { content: ""; position: absolute; bottom: -18px; left: 30px; border: 10px solid transparent; border-top-color: var(--ink); }

.btn {
  display: inline-block;
  font: inherit;
  font-size: 22px;
  padding: 10px 22px;
  background: var(--red-ink);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: translate .1s, rotate .1s, box-shadow .1s;
}
.btn:hover { translate: -2px -2px; rotate: -1deg; box-shadow: 6px 6px 0 var(--ink); }
.btn:active { translate: 3px 3px; box-shadow: 1px 1px 0 var(--ink); }
.btn.blue { background: var(--blue-ink); }
.btn.green { background: var(--green-ink); }
.btn.white { background: #fff; color: var(--ink); }

/* sections */
section { padding: 48px 0; }
.sec-title { font-size: 52px; margin-bottom: 6px; }
.sec-sub { font-size: 22px; color: #555; margin: 0 0 26px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: #fff; padding: 20px 22px; box-shadow: 5px 6px 0 rgb(0 0 0 / .15); position: relative; }
.card h3 { font-size: 30px; }
.tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 90px;
  height: 26px;
  background: rgb(255 214 10 / .7);
  translate: -50% 0;
  rotate: -4deg;
  border: 1px dashed #b89a00;
}
.emoji { font-size: 44px; display: block; margin-bottom: 4px; }
.note { font-size: 16px; color: var(--note); font-style: italic; }

/* episode slots, filled by episodes.js */
.episode { margin: 28px auto 0; max-width: 760px; text-align: center; }
.episode .note { display: block; }
.episode iframe, .episode .play {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0;
  background: var(--ink);
  box-shadow: 5px 6px 0 rgb(0 0 0 / .15);
  overflow: hidden;
  cursor: pointer;
}
.episode .play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sign {
  display: inline-block;
  margin: 0 0 6px;
  padding: 4px 16px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  font-family: "Gaegu", cursive;
  font-weight: 700;
  font-size: 1.3rem;
  rotate: -2deg;
}

/* Sertifikit Tree: nested lists drawn top-down, info panel beside it */
.tree-box { background: #fff; padding: 20px; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 20px; align-items: start; }
/* big screens: the box reaches past the page column so the card table wraps less */
@media (min-width: 1240px) {
  .tree-box { margin: 0 -70px; }
  .cert-tree { position: sticky; top: 90px; } /* side by side: stays in view beside a long info panel */
}
/* narrower: the card goes under the tree at full width instead of being squeezed beside it */
@media (max-width: 1239px) { .tree-box { grid-template-columns: 1fr; } }
.cert-tree ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cert-tree li { display: flex; flex-direction: column; align-items: center; }
/* family-tree lines: a stub down from the parent, a bar across the children, a stub down into each child */
.cert-tree ul ul { position: relative; flex-wrap: nowrap; gap: 8px; padding-top: 14px; }
/* the lines are strips of the generated masking tape, overlapping where they meet */
.cert-tree { --tape-h: url(img/tree/tape-1.png) center / 100% 100% no-repeat; --tape-v: url(img/tree/tape-2-v.png) center / 100% 100% no-repeat; }
.cert-tree li li:nth-child(even) { --tape-v: url(img/tree/tape-1-v.png) center / 100% 100% no-repeat; }
.cert-tree ul ul::before { content: ""; position: absolute; top: -2px; left: 50%; width: 10px; height: 20px; margin-left: -5px; background: var(--tape-v); }
.cert-tree li li { position: relative; }
.cert-tree li li::before {
  content: "";
  width: 10px;
  height: 16px;
  background: var(--tape-v);
}
.cert-tree li li::after { content: ""; position: absolute; top: 0; left: -4px; right: -4px; height: 10px; background: var(--tape-h); }
.cert-tree li li:first-child::after { left: 50%; }
.cert-tree li li:last-child::after { right: 50%; }
.cert-tree li li:only-child::after { content: none; }
/* the naughty list hangs beside its CA on a dotted "publishes" line, outside the family tree */
.has-list { position: relative; }
.list-side { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
/* the word sits above a strip of tape; the bottom margin lifts the strip to the middle of the CA's box */
.publishes { width: 60px; margin: 0 4px 18px; padding-bottom: 12px; font: 14px/16px "Patrick Hand", cursive; color: var(--note); text-align: center; background: url(img/tree/tape-2.png) bottom / 100% 10px no-repeat; }
.list-side .node { min-width: 0; white-space: normal; max-width: 132px; }
.cert-tree li.broken::before { border-left-color: var(--red-ink); }
.cert-tree > ul { flex-direction: column; align-items: center; } /* the sneeky CA stands apart, under the tree */
.cert-tree > ul > li + li { margin-top: 18px; } /* the sneeky CA stands apart */

.node {
  position: relative;
  isolation: isolate;
  min-width: 110px;
  padding: 10px 14px;
  white-space: nowrap; /* the emoji stays on the label's line */
  font: 700 20px/1.2 "Gaegu", cursive;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
/* paper craft: each box is one of the generated cut-paper cards (img/tree, from docs/ai-video/site.json), tinted to its colour */
.node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fill, #fff) var(--card) center / 100% 100% no-repeat;
  background-blend-mode: multiply;
  -webkit-mask: var(--card) center / 100% 100% no-repeat;
  mask: var(--card) center / 100% 100% no-repeat;
}
.node { --card: url(img/tree/card-1.png); }
.cert-tree li:nth-child(even) > .node, .list-side .node { --card: url(img/tree/card-2.png); }
.node small { display: block; font: 14px "Patrick Hand", cursive; }
.leaf > .node { cursor: grab; }
.broken > .node, .untrusted > .node { outline: 3px dashed var(--red-ink); outline-offset: 3px; }
.node[aria-pressed="true"] { outline: 4px solid var(--red); outline-offset: 2px; }
.node.drop { outline: 4px dashed var(--yellow); outline-offset: 3px; }
.node:focus-visible, .tree-info button:focus-visible, .btn:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 3px; }

.tree-info { background: var(--paper); padding: 18px; min-height: 280px; }
.tree-info { font-size: 18px; }
.tree-info h3 { font-size: 26px; color: var(--blue-ink); }
.tag { display: inline-block; font-size: 15px; padding: 1px 10px; border: 2px solid var(--ink); border-radius: 20px; margin: 2px 4px 2px 0; background: #e9ffe0; }
.tag.warn { background: #ffe0e6; }
.tree-info table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.tree-info th, .tree-info td { text-align: left; vertical-align: top; padding: 3px 8px 3px 0; border-bottom: 1px dashed var(--line); font-weight: 400; }
.tree-info th { color: var(--blue-ink); }
.tree-info td:last-child { font: 12.5px/1.4 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.tree-info thead th { font-size: 13px; color: var(--note); }
.verdict { margin: 12px 0; padding: 8px 12px; background: #fff; }
.verdict p { margin: 0; }
.verdict.ok { background: #e9ffe0; }
.verdict.bad { background: #ffe0e6; }
.tree-info button { font: inherit; font-size: 18px; padding: 2px 12px; margin: 2px; background: #fff; cursor: pointer; }
.tree-info button:hover { background: var(--yellow); }

/* Make Your Own Sertifikit */
.maker { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.form { background: #fff; padding: 24px; }
.form label { display: block; font-size: 20px; margin: 12px 0 4px; }
.form input:not([type="checkbox"]), .form select {
  width: 100%;
  font: inherit;
  font-size: 20px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 12px 4px 14px 6px;
  background: var(--paper);
  cursor: auto;
}
.form input:focus-visible, .form select:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 2px; }
.form .check { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 19px; }
.check input { width: 22px; height: 22px; }
.form-btns { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

.cert {
  position: relative;
  min-height: 420px;
  padding: 28px;
  text-align: center;
  background: #fffbe0;
  border: 6px double var(--ink);
  border-radius: 8px;
  box-shadow: 6px 8px 0 rgb(0 0 0 / .15);
  overflow: hidden;
}
.cert h3 { font-family: "Rubik Bubbles", cursive; font-size: 34px; font-weight: 400; color: var(--purple); }
.cert .name { display: inline-block; font: 700 40px "Gaegu", cursive; border-bottom: 3px dotted var(--ink); padding: 0 20px; margin: 6px 0; overflow-wrap: anywhere; }
.cert dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 16px 0 0; text-align: left; font-size: 17px; }
.cert dt { font-weight: 700; color: var(--blue-ink); }
.cert dd { margin: 0; overflow-wrap: anywhere; }
.cert .seal { display: block; width: 96px; height: 96px; margin: 8px 0 -8px auto; rotate: 8deg; }
.cert.empty { display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--note); }
.cert.denied { background: #ffe9ec; }
.big-emoji { font-size: 70px; }
.stamp {
  position: absolute;
  top: 40%;
  left: 50%;
  translate: -50% -50%;
  rotate: -18deg;
  padding: 2px 20px;
  font-family: "Rubik Bubbles", cursive;
  font-size: 56px;
  color: var(--red-ink);
  border: 6px solid var(--red-ink);
  border-radius: 12px;
  opacity: .85;
  pointer-events: none;
  animation: slam .35s ease-out;
}
@keyframes slam { from { scale: 2.5; opacity: 0; } }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 50;
  padding: 12px 22px;
  font-size: 21px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  translate: -50% 140px;
  transition: translate .3s;
}
.toast.show { translate: -50% 0; }
.confetti { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 60; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { translate: 0 110vh; rotate: 720deg; } }

/* Big Words Dictshunary flip cards */
.flips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flip { perspective: 900px; }
.flip-in {
  position: relative;
  display: grid; /* both faces share one cell, so the card grows to fit the longer side */
  width: 100%;
  min-height: 300px;
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .6s;
}
.flip-in[aria-pressed="true"] { transform: rotateY(180deg); }
.face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
  backface-visibility: hidden;
  box-shadow: 4px 5px 0 rgb(0 0 0 / .15);
}
.face.front { font: 700 34px "Gaegu", cursive; }
.face.front .note { font-weight: 400; font-size: 15px; font-family: "Patrick Hand", cursive; color: #444; } /* #666 is under 4.5:1 on the pastel fronts */
.face.back { transform: rotateY(180deg); background: #fff; font-size: 17px; line-height: 1.3; justify-content: flex-start; }
.face.back .note { font-size: 14px; }
.flip-in:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 4px; }
.flip .doc { display: block; margin-top: 10px; font-size: 15px; text-align: center; }
.c1 { background: #ffd6de; } .c2 { background: #d6ecff; } .c3 { background: #dcffd0; } .c4 { background: #fff1b8; }
.c5 { background: #ecdcff; } .c6 { background: #ffe2cc; } .c7 { background: #d0fff4; } .c8 { background: #f3f3f3; }

/* Hacker Box */
.cmds { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.cmds button { font: inherit; font-size: 18px; padding: 4px 14px; background: #fff; cursor: pointer; }
.cmds button:hover { background: var(--yellow); }
.cmds button:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 3px; }
.term {
  min-height: 240px;
  margin: 0;
  padding: 18px;
  font: 15px/1.5 ui-monospace, Consolas, monospace;
  color: #e8e8ff;
  white-space: pre;
  overflow-x: auto; /* keep real column layout; scroll inside the box on phones */
  background: #1e1e3f;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 6px 0 rgb(0 0 0 / .2);
}
.term:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 3px; }
.term .p { color: var(--yellow); }
.term .c { color: #9fffa0; }
.term .k { color: #ff9fb2; }
.term .cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-notes { margin-top: 14px; min-height: 2em; }
.term-notes p { margin: 0 0 6px; }

/* Quiz */
#quiz .sec-title, #quiz .sec-sub { text-align: center; }
.quiz { background: #fff; padding: 26px; max-width: 760px; margin: 0 auto; }
.quiz-tools { margin: 0 0 12px; text-align: right; }
.quiz-tools .btn { font-size: 16px; padding: 4px 12px; }
.q { font: 700 28px/1.2 "Gaegu", cursive; margin: 6px 0 0; }
.q:focus { outline: none; }
.opts { display: grid; gap: 10px; margin: 16px 0; }
.opt { font: inherit; font-size: 21px; text-align: left; padding: 10px 16px; background: var(--paper); color: var(--ink); cursor: pointer; }
.opt:hover:not(:disabled) { background: #fff6c7; }
.opt:disabled { cursor: default; }
.opt.right { background: #c8ffb5; }
.opt.wrong { background: #ffc6cf; }
.opt:focus-visible, .quiz .btn:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 3px; }
.fb { min-height: 34px; font-size: 22px; margin: 0 0 12px; }
.progress { height: 16px; margin-bottom: 16px; background: #eee; border: 3px solid var(--ink); border-radius: 20px; overflow: hidden; }
.progress div { height: 100%; background: repeating-linear-gradient(45deg, var(--green) 0 10px, #5ed22c 10px 20px); transition: width .4s; }
.quiz-end { text-align: center; }
.stars { font-size: 30px; letter-spacing: 4px; }
.quiz .big { font-size: 24px; }
.sticker-form { max-width: 420px; margin: 0 auto 18px; text-align: left; }
.sticker-form label { display: block; margin-bottom: 4px; }
.sticker-form input { width: 100%; font: inherit; font-size: 20px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 12px 4px 14px 6px; background: var(--paper); cursor: auto; margin-bottom: 12px; }
.sticker-form input:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 2px; }

/* side pages in Dad's voice: same paper, plain type */
.grown-up-page main { font: 18px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; max-width: 860px; padding-top: 32px; padding-bottom: 48px; }
.grown-up-page h1 { font-size: 52px; }
.grown-up-page h2 { font-size: 34px; margin-top: 1.4em; }
.grown-up-page .lede { font-size: 20px; }
.grown-up-page li { margin-bottom: 8px; }
.grown-up-page code { font-size: 15px; background: #fff; padding: 1px 4px; border-radius: 4px; }
.grown-up-page nav ul { display: flex; } /* the back link stays on phones */
.grown-up-page nav li a { font-family: "Patrick Hand", cursive; }

/* easy to read letters: plain type for the dictionary (and the quiz) */
.readable .flips, .readable .flips *, .readable .quiz, .readable .quiz * { font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important; font-style: normal; }
.readable .face.front { font-size: 28px; }

/* /movies */
.movies { padding-top: 32px; padding-bottom: 48px; }
.movie { margin-bottom: 36px; }
.movie h2 { font-size: 36px; }
.movie .episode { margin: 16px 0; }
.movie details { margin: 12px 0; }
.movie summary { cursor: pointer; font-weight: 700; }
.movie summary:focus-visible { outline: 4px solid var(--blue-ink); outline-offset: 3px; }
nav .side-nav { display: flex; } /* the back link stays on phones */

/* /sticker and /revoked */
.sticker-page, .revoked-page { padding-top: 32px; padding-bottom: 48px; }
.sticker-card { max-width: 640px; text-align: center; }
.sticker-card img { display: block; margin: 0 auto 12px; max-width: 100%; height: auto; }
.sticker-card dl, .crl-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; text-align: left; margin: 12px 0; }
.sticker-card dt, .crl-meta dt { color: var(--blue-ink); }
.sticker-card dd, .crl-meta dd { margin: 0; overflow-wrap: anywhere; }
.sticker-card .note, .crl-table .note { display: block; }
.sticker-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.crl-table { width: 100%; border-collapse: collapse; text-align: left; }
.crl-table caption { font: 700 24px "Gaegu", cursive; text-align: left; margin-bottom: 6px; }
.crl-table th, .crl-table td { padding: 6px 10px 6px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.crl-table th { color: var(--blue-ink); font-weight: 400; }
.revoked-page .big { font-size: 24px; }
.sticker-card code, .crl-meta code, .crl-table code { font-size: 16px; }

footer { border-top: 3px dashed var(--ink); padding: 30px 0 50px; font-size: 18px; text-align: center; }
footer .episode { margin-bottom: 20px; }

@media (max-width: 880px) {
  .wrap { padding: 0 18px 0 84px; }
  .hero, .tree-box, .maker { grid-template-columns: 1fr; }
  .cert-tree { position: static; }
  .grid3 { grid-template-columns: 1fr; }
  .flips { grid-template-columns: repeat(2, 1fr); }
  /* phones: nav scrolls away with the page and its links become a swipeable row */
  nav { position: static; }
  html { scroll-padding-top: 0; }
  nav .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 18px; }
  nav ul:not(.side-nav) { order: 3; width: 100%; margin: 0; overflow-x: auto; white-space: nowrap; }
  .grown-up-page nav ul, nav .side-nav { order: 0; width: auto; margin-left: auto; }
  .hero h1 { font-size: 54px; }
}

@media (max-width: 600px) {
  .sticker-card dl, .crl-meta { grid-template-columns: 1fr; gap: 0; }
  .sticker-card dd, .crl-meta dd { margin-bottom: 8px; }
  .flips { grid-template-columns: 1fr; }
  .flip-in { min-height: 260px; }
  body { background-image:
    linear-gradient(90deg, transparent 30px, #ffb3c1 30px, #ffb3c1 32px, transparent 32px),
    repeating-linear-gradient(var(--paper) 0 33px, var(--line) 33px 35px); }
  .wrap { padding: 0 16px 0 44px; }
  .logo { font-size: 26px; }
  .sec-title { font-size: 40px; }
  .hero h1 { font-size: 46px; }
  /* phones: the tree becomes an indented list */
  .cert-tree ul, .cert-tree li { display: block; }
  .cert-tree li li { padding-left: 22px; margin-top: 8px; background: var(--tape-v); background-position: left top; background-size: 10px 100%; }
  .cert-tree li li::before, .cert-tree li li::after, .cert-tree ul ul::before { content: none; }
  .cert-tree ul ul { padding-top: 0; }
  .node { width: 100%; text-align: left; }
  .list-side { position: static; transform: none; margin: 8px 0 0 18px; }
  .list-side .node { max-width: none; }
  .tree-info thead { display: none; }
  .tree-info tr { display: grid; grid-template-columns: 1fr 1fr; padding: 4px 0; border-bottom: 1px dashed var(--line); }
  .tree-info th, .tree-info td { border: 0; padding: 0 8px 0 0; }
  .tree-info td:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wobble, .pop, .stamp, .term .cursor { animation: none; }
  .toast, .flip-in, .progress div { transition: none; }
  .btn, nav li a { transition: none; }
}
