@import "/fonts/fonts.css";

/* A Romanian school notebook (caiet dictando): ballpoint-blue headings, graphite text, the teacher's red pen.
   Dark mode is the same notebook under a desk lamp at night. */
:root {
  --paper: #fdfdfb;
  --rule: #c9d6ea;
  --margin: #e8a0a8;
  --text: #34353b;
  --ink: #233d91;
  --red: #c81e2b;
  --muted: #5d616c;
  --hand: "Playwrite RO", "Segoe Script", cursive;
  --serif: "Literata", Georgia, serif;
  --line: 1.75rem;
  --band: #f2eee4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1d24; --rule: #30364a; --margin: #6e3d47; --text: #e2e4ea; --ink: #bccaf3; --red: #ff8f8a; --muted: #a0a5b2; --band: #23262f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1d24; --rule: #30364a; --margin: #6e3d47; --text: #e2e4ea; --ink: #bccaf3; --red: #ff8f8a; --muted: #a0a5b2; --band: #23262f;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 1.0625rem/var(--line) var(--serif); font-optical-sizing: auto; }
a { color: var(--ink); text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
h1, h2 { font-family: var(--hand); font-weight: 300; color: var(--ink); line-height: 1.35; margin: 0 0 1rem; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin-top: 2rem; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); margin-top: 3rem; }
p { margin: 0 0 1rem; }
mark { background: color-mix(in srgb, var(--red) 18%, transparent); color: inherit; padding: 0 0.1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 1rem; z-index: 9; }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
.wrap.wide { max-width: 64rem; }

/* header and footer sit on the notebook's top and bottom margins */
.site-head { border-bottom: 2px solid var(--margin); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.75rem; flex-wrap: wrap; }
.brand { font-family: var(--hand); font-size: 1.8rem; line-height: 1.6; text-decoration: none; color: var(--ink); }
.brand::after { content: ""; display: block; height: 3px; background: var(--red); border-radius: 3px; transform: rotate(-1.5deg); margin-top: -0.35rem; }
.nav { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; margin-left: auto; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline wavy var(--red); }
.site-foot { margin-top: 5rem; border-top: 2px solid var(--margin); color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.site-foot .wrap { padding-block: 2rem; }
.prefs { display: flex; gap: 0.75rem 1.5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.prefs label { display: inline-flex; gap: 0.5rem; align-items: center; cursor: pointer; }
.prefs input { accent-color: var(--red); width: 1.1rem; height: 1.1rem; }

/* the notebook page: dictando ruling, red margin line, text sitting on the lines */
.page {
  margin: 0 0 1rem;
  padding: var(--line) 1rem var(--line) 3.4rem;
  background:
    linear-gradient(to right, transparent 2.4rem, var(--margin) 2.4rem, var(--margin) calc(2.4rem + 2px), transparent calc(2.4rem + 2px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-position: 0 0, 0 0.32rem;
  font-size: 1.125rem;
}
.page p { margin: 0; }
.page .line { padding-left: 1.05rem; text-indent: -1.05rem; }
.hero { margin-bottom: 2.5rem; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 4.8rem); margin: 2.5rem 0 1.5rem; }
.hero-actions { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.joke-title { font-size: clamp(1.5rem, 4.5vw, 2.2rem); }

/* the teacher's notes: red handwriting */
.tags { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 0.25rem 0 0; font-family: var(--hand); font-size: 0.88rem; line-height: 1.9; color: var(--red); }
.tags a { color: var(--red); text-decoration: none; }
.tags a:hover { text-decoration: underline; }
.sources { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.sources a { color: inherit; }

/* bleep: the red pen scribbles over swear words; the footer setting turns it off */
.bleep { color: transparent; background: var(--red); border-radius: 0.35em 0.15em 0.4em 0.2em; -webkit-user-select: none; user-select: none; }

.gate { border: 2px dashed var(--red); padding: 1.25rem; margin-bottom: 1rem; }

/* lists */
.lede { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.list > li { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; }
.list > li > a { display: block; text-decoration: none; color: var(--text); }
.list > li > a:hover .ex { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); }
.ex .l { display: block; }
.ex .l.d { padding-left: 0.9em; text-indent: -0.9em; }
.groups, .filters, .cloud { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 1.5rem; }
.filters strong { color: var(--red); font-weight: 600; }
.popular { color: var(--muted); }
.ages { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 2rem; }
.ages a { display: block; padding: 1rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--text); }
.ages strong { display: block; font-family: var(--hand); font-weight: 300; font-size: 1.3rem; line-height: 2; color: var(--ink); }
.ages .count { display: block; color: var(--red); font-family: var(--hand); font-size: 0.9rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.prose ul { padding-left: 1.2rem; }

/* buttons: a blue ballpoint blob */
button, .btn {
  font: inherit; font-family: var(--hand); font-size: 1.05rem; line-height: 1.6; color: var(--paper); background: var(--ink);
  border: 0; border-radius: 0.45rem 0.7rem 0.5rem 0.8rem; padding: 0.45rem 1.2rem; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--red); color: var(--paper); }
button.small { font-size: 0.9rem; padding: 0.2rem 0.9rem; }

/* search box, written on a ruled line */
.search { position: relative; display: flex; gap: 0.75rem; margin: 1.5rem 0; }
.search input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; color: var(--text); background: transparent;
  border: 0; border-bottom: 2px solid var(--ink); padding: 0.4rem 0.1rem; border-radius: 0;
}
.search input::placeholder { color: var(--muted); }
/* focus: the line under the box turns red and thicker (not colour alone), instead of an outline around it */
.search input:focus { outline: none; border-bottom: 3px solid var(--red); padding-bottom: calc(0.4rem - 1px); }
.search.big input { font-size: 1.25rem; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 0.25rem 0 0; padding: 0; list-style: none;
  background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.14);
}
.suggest li { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); cursor: pointer; line-height: 1.45; }
.suggest li:last-child { border-bottom: 0; }
.suggest li[aria-selected="true"], .suggest li:hover { background: color-mix(in srgb, var(--rule) 45%, transparent); }

@media (max-width: 32rem) {
  .page { padding-left: 2.6rem; background-position: -0.8rem 0, 0 0.32rem; font-size: 1.05rem; }
  .search { flex-direction: column; }
  .search button { align-self: flex-start; }
}
/* one moment of motion: the headline is written in, like chalk */
@media (prefers-reduced-motion: no-preference) {
  .chalk { animation: write 1.6s cubic-bezier(.4, 0, .2, 1) both; }
  @keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}

/* votes: two small buttons and, once enough people voted, the teacher's grade circled in red */
.below { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
.vote { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0; }
.vote button {
  font-family: var(--serif); font-size: 0.85rem; line-height: 1.4; padding: 0.15rem 0.65rem; border-radius: 1rem;
  background: transparent; color: var(--ink); border: 1px solid var(--rule);
}
.vote button:hover { background: transparent; color: var(--red); border-color: var(--red); }
.vote button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.vote .n { font-variant-numeric: tabular-nums; }
.grade {
  font-family: var(--hand); color: var(--red); font-size: 0.95rem; padding: 0 0.55rem;
  border: 2px solid var(--red); border-radius: 50% 45% 55% 48% / 55% 50% 48% 52%; transform: rotate(-4deg);
}

/* header search: the magnifier drops the box down under itself, on every page; the menu stays */
.hsearch { position: relative; display: flex; align-items: center; }
.loop { display: inline-flex; padding: 0.4rem; margin: -0.4rem -0.4rem -0.4rem 0; color: var(--ink); border-radius: 50%; }
.loop:hover, .loop[aria-expanded="true"] { color: var(--red); }
.search.head {
  display: none; position: absolute; right: -0.5rem; top: calc(100% + 0.9rem); z-index: 6; width: min(32rem, calc(100vw - 2rem));
  margin: 0; padding: 0.6rem 0.75rem 0.75rem; background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.14);
}
.site-head.searching .search.head { display: flex; flex-direction: row; }
.search.head input { font-size: 1.05rem; padding-block: 0.25rem; }
.search.head button { font-size: 0.95rem; padding: 0.2rem 0.9rem; align-self: auto; }
.search.head .qpanel, .search.head .suggest { left: -1px; right: -1px; margin-top: -1px; }

/* the panel under an empty, focused box: your recent searches and the popular ones, in the teacher's red notes */
.qpanel {
  display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 0.25rem; padding: 0.75rem 1rem 1rem;
  grid-template-columns: 1fr 1fr; gap: 0.5rem 1.5rem; background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.14);
}
html.js .search:focus-within:not(.typing) .qpanel { display: grid; }
.qtitle { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 0.25rem; font-family: var(--hand); font-size: 0.9rem; color: var(--red); }
.qpanel ol { list-style: none; margin: 0; padding: 0; }
.qpanel ol:empty::after { content: "Nimic încă."; color: var(--muted); font-size: 0.92rem; }
.qpanel li { display: flex; align-items: center; gap: 0.25rem; border-bottom: 1px solid var(--rule); }
.qpanel li a { flex: 1; min-width: 0; padding: 0.3rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.qpanel li a:hover, .qpanel li a:focus-visible { text-decoration: underline wavy var(--red); }
.qforget, .qclear { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0.1rem 0.4rem; }
.qforget:hover, .qclear:hover { background: none; color: var(--red); }
.qclear { font-family: var(--serif); font-size: 0.8rem; }
.qrecent:has(ol:empty) .qclear { display: none; }
@media (max-width: 32rem) { .qpanel { grid-template-columns: 1fr; } }

/* footer totals */
.stats strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* a joke's video: a phone-shaped player */
/* our videos (views.ts player): 9:16, framed like a photo pinned in the notebook, platform links under it */
.clip { margin: 0 0 1rem; max-width: 20rem; }
.clip video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; background: #000; border: 2px solid var(--ink); border-radius: 0.6rem; }
.clip figcaption { margin-top: 0.4rem; font-size: 0.95rem; }
ul.videos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1.5rem 1.25rem; }
ul.videos h3 { margin: 0.2rem 0 0.1rem; font-size: 1.05rem; }
ul.videos .clip { max-width: none; margin: 0; }

/* votes: thumbs; down is the same thumb turned over */
.vote button { display: inline-flex; align-items: center; gap: 0.35rem; }
.vote button svg { display: block; }
.vote button.down svg { transform: rotate(180deg); }

/* Bulă, the chat agent: a round photo that breathes and glances, on a page torn from the same notebook */
.face { --face: 3.25rem; display: inline-block; flex: none; width: var(--face); height: var(--face); border-radius: 50%; overflow: hidden;
  background: #cfc3b6; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); transform: rotate(var(--tilt, 0deg)); transition: transform 1.6s ease-in-out; }
.face-in { position: relative; display: block; width: 100%; height: 100%; animation: breathe 4.8s ease-in-out infinite; transform-origin: 50% 85%; }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 60ms linear; }
.face img.on { opacity: 1; }
@keyframes breathe { 50% { transform: translateY(-1.5%) scale(1.025); } }
@media (prefers-reduced-motion: reduce) { .face-in { animation: none; } .face { transition: none; } }

.bula-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 20; display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.3rem 1.1rem 0.3rem 0.3rem; border-radius: 3rem; border: 0; background: var(--ink); color: var(--paper);
  font-family: var(--hand); font-size: 1rem; box-shadow: 0 0.4rem 1.2rem rgb(0 0 0 / 0.22); cursor: pointer;
}
.bula-fab:hover { background: var(--red); color: var(--paper); }
.bula-fab .face { --face: 3.6rem; box-shadow: none; }
.bula.open .bula-fab-label { display: none; }
.bula.open .bula-fab { padding-right: 0.3rem; }

.bula-panel {
  position: fixed; right: 1rem; bottom: 4.6rem; z-index: 20; width: min(25rem, calc(100vw - 2rem)); height: min(37rem, calc(100dvh - 6rem));
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--red);
  box-shadow: 0 0.8rem 2.4rem rgb(0 0 0 / 0.22);
}
.bula-panel[hidden] { display: none; }
.bula-panel.inline { position: static; width: auto; height: min(38rem, 80dvh); box-shadow: none; margin: 1.5rem 0; }
.bula-panel.inline { position: relative; inset: auto; } /* not the floating panel's right/bottom offsets */
.bula-panel.wide { width: min(58rem, calc(100vw - 2rem)); height: calc(100dvh - 6rem); }
.bula-head { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 0.75rem; border-bottom: 2px solid var(--margin); }
.bula-head .face { --face: 5.25rem; }
.bula-panel.wide .bula-head .face, .bula-panel.inline .bula-head .face { --face: 7.5rem; }
.bula-panel.wide .bula-who h2, .bula-panel.inline .bula-who h2 { font-size: 1.8rem; }
.bula-panel.wide .bula-log, .bula-panel.wide .bula-chips, .bula-panel.wide .bula-ask, .bula-panel.wide .bula-note { padding-inline: max(0.9rem, calc((100% - 40rem) / 2)); }
.bula-who { flex: 1; min-width: 0; }
.bula-who h2 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.bula-status { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.bula-tools { display: flex; align-self: flex-start; gap: 0.1rem; }
.bula-icon { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.bula-icon:hover, .bula-icon[aria-expanded="true"] { background: color-mix(in srgb, var(--rule) 45%, transparent); color: var(--red); }
.bula-icon[hidden] { display: none; }
.bula-wide .shrink, .bula-wide[aria-pressed="true"] .grow { display: none; }
.bula-wide[aria-pressed="true"] .shrink { display: inline; }

/* the history list slides over the conversation */
.bula-past { position: absolute; left: 0; right: 0; top: var(--head, 7rem); bottom: 0; z-index: 2; overflow-y: auto; padding: 0.75rem 0.9rem; background: var(--paper); }
.bula-past[hidden] { display: none; }
.bula-past h3 { margin: 0 0 0.5rem; font-family: var(--hand); font-weight: 300; font-size: 1rem; color: var(--red); }
.bula-past ol { list-style: none; margin: 0; padding: 0; }
.bula-past button { display: grid; width: 100%; text-align: left; gap: 0.1rem; padding: 0.55rem 0.4rem; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  background: none; color: var(--text); font: inherit; cursor: pointer; }
.bula-past button:hover, .bula-past button[aria-current="true"] { background: color-mix(in srgb, var(--rule) 35%, transparent); color: var(--text); }
.bula-past .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bula-past .m { color: var(--muted); font-size: 0.8rem; }

.bula-log { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0.9rem 0.9rem 0.5rem; overscroll-behavior: contain; }
.bula-log li { margin: 0 0 0.8rem; }
.bula-log p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.bula-log .bula p { border-left: 2px solid var(--margin); padding-left: 0.75rem; }
.bula-log .waiting p { display: flex; align-items: center; gap: 0.6rem; color: var(--muted, #6b6b6b); font-family: var(--hand); font-size: 0.95rem; }
.bula-log .dots { display: inline-flex; gap: 0.25rem; }
.bula-log .dots i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--ink); animation: bula-dot 1.1s ease-in-out infinite; }
.bula-log .dots i:nth-child(2) { animation-delay: 0.15s; }
.bula-log .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bula-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-0.35rem); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bula-log .dots i { animation: none; opacity: 0.6; } }
.bula-log .user { text-align: right; }
.bula-log .user p { display: inline-block; text-align: left; max-width: 85%; padding: 0.35rem 0.7rem; color: var(--ink);
  background: color-mix(in srgb, var(--rule) 40%, transparent); border-radius: 0.9rem 0.9rem 0.2rem 0.9rem; }
.bula-log a { font-family: var(--hand); font-size: 0.9rem; color: var(--red); }

.bula-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 0.9rem 0.6rem; }
.bula-chips[hidden] { display: none; }
.bula-chips button { font: inherit; font-size: 0.82rem; line-height: 1.3; padding: 0.3rem 0.7rem; border-radius: 1rem; text-align: left;
  background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.bula-chips button:hover { background: transparent; color: var(--red); border-color: var(--red); }
.bula-ask { display: flex; gap: 0.5rem; align-items: flex-end; padding: 0.5rem 0.9rem; border-top: 1px solid var(--rule); }
/* the question box: two lines to start, grows with the text (agent.js) up to about a third of the panel, then scrolls */
.bula-ask textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 1.02rem; line-height: 1.5; color: var(--text);
  background: color-mix(in srgb, var(--rule) 18%, var(--paper)); border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); border-radius: 0.6rem 0.6rem 0.2rem 0.2rem;
  padding: 0.55rem 0.75rem; min-height: calc(3em + 1.2rem); overflow-y: hidden; }
.bula-ask textarea:focus { outline: none; border-color: var(--red); border-bottom-width: 3px; }
.bula-ask button { font-size: 0.95rem; padding: 0.45rem 1rem; }
.bula-note { margin: 0; padding: 0 0.9rem 0.6rem; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }

@media (max-width: 32rem) {
  .bula-panel:not(.inline) { right: 0; left: 0; bottom: 0; width: auto; height: 88dvh; border-left: 0; border-right: 0; }
  .bula.open .bula-fab { display: none; }
  .bula-fab-label { font-size: 0.95rem; }
  .bula-wide { display: none; }
  .bula-head .face { --face: 4.25rem; }
}


/* Bulă's photos (views.ts photo): snapshots taped onto the notebook page, a little crooked */
.poza { position: relative; margin: 0; padding: 0.55rem 0.55rem 0; background: #fff; rotate: -2deg;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 10px 24px -8px rgb(30 40 70 / 0.35); }
.poza::before { content: ""; position: absolute; top: -0.65rem; left: 50%; width: 38%; height: 1.4rem; translate: -50% 0; rotate: 4deg;
  background: rgb(238 224 168 / 0.72); box-shadow: 0 1px 1px rgb(0 0 0 / 0.06); }
.poza img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; background: var(--rule); }
.poza figcaption { padding: 0.45rem 0.25rem 0.6rem; font-family: var(--hand); font-size: 0.95rem; line-height: 1.3; text-align: center; color: var(--ink); }
:root[data-theme="dark"] .poza { background: #e6e2d8; }
:root[data-theme="dark"] .poza img { filter: brightness(0.9); }
:root[data-theme="dark"] .poza figcaption { color: #233d91; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .poza { background: #e6e2d8; }
  :root:not([data-theme="light"]) .poza img { filter: brightness(0.9); }
  :root:not([data-theme="light"]) .poza figcaption { color: #233d91; }
}
/* the homepage: the joke on the left, two snapshots stacked on the right (under the joke on small screens) */
.home-hero { display: grid; gap: 0 3.5rem; grid-template-areas: "hero" "search" "stack"; }
.home-hero .hero { grid-area: hero; margin-bottom: 0.5rem; }
.hero-sub { color: var(--muted); margin: -0.75rem 0 1.25rem; }
.home-search { grid-area: search; }
.stack { grid-area: stack; position: relative; width: min(62%, 18rem); margin: 2.5rem auto 0.5rem; }
.stack-front { z-index: 1; rotate: 3deg; }
.stack-back { position: absolute; inset: 0; z-index: 0; rotate: -9deg; translate: -24% 5%; scale: 0.84; }
@media (min-width: 60rem) {
  .home-hero { grid-template-columns: minmax(0, 1fr) 20rem; grid-template-areas: "hero stack" "search stack"; align-items: start; }
  .stack { width: 100%; margin: 8rem 0 0; }
}
/* the ages: their own band across the page, the four snapshots in one row on wide screens */
.band { margin-top: 4rem; padding: 0.5rem 0 3rem; background: var(--band); border-block: 2px solid var(--margin); }
.band h2 { margin-top: 2.25rem; margin-bottom: 0.5rem; }
.band .lede { margin-bottom: 2rem; }
.ages { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(1rem, 3vw, 2.5rem); }
@media (min-width: 56rem) { .ages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ages a { padding: 0; border: 0; line-height: 1.55; }
.ages strong { margin-top: 0.4rem; }
.ages .poza { margin: 0.75rem 0.35rem 0.6rem; transition: rotate 0.25s, translate 0.25s; }
.ages a:nth-child(even) .poza { rotate: 2deg; }
.ages a:hover .poza, .ages a:focus-visible .poza { rotate: 0deg; translate: 0 -0.3rem; }
.ages .poza figcaption { font-size: clamp(0.75rem, 2.4vw, 0.95rem); }
@media (prefers-reduced-motion: reduce) { .ages .poza { transition: none; } }
/* four more jokes, each on its own scrap of the notebook */
.more { display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); margin-bottom: 1.25rem; }
.more .card { margin: 0; color: var(--text); text-decoration: none; font-size: 1.02rem; outline: 1px solid var(--rule); transition: outline-color 0.2s; }
.more .card:hover { color: var(--text); outline: 2px solid var(--ink); }
/* where he turns up: the notebook's table of contents, with dot leaders */
.cuprins { list-style: none; margin: 0 0 1rem; padding: 0; columns: 3 14rem; column-gap: 3rem; }
.cuprins li { break-inside: avoid; }
.cuprins a { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.2rem 0; text-decoration: none; }
.cuprins span:first-child { flex: 1; display: flex; gap: 0.5rem; }
.cuprins span:first-child::after { content: ""; flex: 1; border-bottom: 2px dotted var(--rule); translate: 0 -0.3em; }
.cuprins a:hover span:first-child { text-decoration: underline; }
.cuprins .n { font-family: var(--hand); font-size: 0.85rem; color: var(--red); }
/* the invitation to the chat */
.talk { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.5rem 2.5rem; align-items: center; margin-top: 4rem;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem); border: 2px dashed var(--rule); border-radius: 0.7rem 0.4rem 0.8rem 0.5rem; }
.talk h2 { margin-top: 0; }
.talk-poza { rotate: -4deg; }
@media (max-width: 32rem) { .talk { grid-template-columns: 1fr; } .talk-poza { width: 9rem; } }
/* joke and age pages: Bulă in the right margin, only where the margin is wide enough */
.with-poza { position: relative; }
.margin-poza { display: none; }
@media (min-width: 76rem) {
  .margin-poza { display: block; position: absolute; left: calc(100% + 2.5rem); top: 1.5rem; width: min(17rem, calc((100vw - 46rem) / 2 - 4.5rem)); margin: 0; rotate: 2.5deg; }
}

/* the notebook's spiral: punched holes along the bottom of the header */
.site-head { position: relative; }
.site-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.55rem; height: 0.7rem; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--text) 22%, transparent) 0 0.2rem, var(--paper) 0.22rem 0.3rem, transparent 0.32rem) 0 0 / 1.6rem 100% repeat-x; }
