/* Don't Use "Very": a notebook page on a desk. Red pen, highlighter, handwriting. All drawn in CSS and SVG. */
:root {
    --desk: #bfe4d6;
    --paper: #fffdf3;
    --line: #cfe0f4;
    --margin: #f29b97;
    --ink: #22304a;
    --muted: #6d7690;
    --red: #e0262f;
    --hl: #fff176;
    --display: "Permanent Marker", "Marker Felt", "Comic Sans MS", cursive;
    --body: "Patrick Hand", "Segoe Print", "Comic Sans MS", system-ui, sans-serif;
    --marg: clamp(1.4rem, 6vw, 4.6rem);
    --scribble: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M1 13 C 14 5, 26 17, 40 9 S 66 16, 80 8 S 94 12, 99 7' fill='none' stroke='%23e0262f' stroke-width='2.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0; padding: 2.4rem clamp(0.6rem, 3vw, 2rem) 3rem; background: var(--desk); color: var(--ink);
    font-family: var(--body); font-size: 1.3rem; line-height: 1.5;
}
a { color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 4px solid #5aa9e6; outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 30; }
.skip:focus { left: 0; }

/* the page itself */
.sheet {
    position: relative; max-width: 74rem; margin: 0 auto; background-color: var(--paper);
    background-image: repeating-linear-gradient(to bottom, transparent 0 35px, var(--line) 35px 36px);
    background-position: 0 14px;
    border: 3px solid var(--ink); border-radius: 6px; box-shadow: 9px 9px 0 var(--ink);
    padding-left: calc(var(--marg) + 1.1rem);
}
.sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--marg); width: 3px; background: var(--margin); }
.rings { position: absolute; top: -1.15rem; left: 0; right: 0; height: 2.1rem; display: flex; justify-content: space-evenly; padding: 0 1.2rem; pointer-events: none; z-index: 6; }
.rings i { display: block; width: 1.05rem; height: 2.1rem; border: 3px solid var(--ink); border-radius: 999px; background: linear-gradient(#fff 0 40%, #cfd5e3 40%); }
.pad { padding: 2.4rem clamp(1rem, 3vw, 2.4rem) 2rem 0; }

/* ---------- header ---------- */
.top { position: relative; padding-bottom: 0.5rem; }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 8.4vw, 6.4rem); line-height: 1; letter-spacing: -0.01em; transform: rotate(-1.4deg); transform-origin: left bottom; }
h1 .very { position: relative; display: inline-block; color: #8c95ab; padding: 0 0.1em; }
h1 .very::after { content: ""; position: absolute; left: -4%; right: -4%; top: 30%; height: 0.5em; background: var(--scribble) no-repeat center / 100% 100%; }
.tagline { margin: 0.9rem 0 0; font-size: clamp(1.35rem, 2.6vw, 1.75rem); max-width: 34rem; }
.pen { position: absolute; right: clamp(0rem, 3vw, 2rem); top: -0.4rem; width: clamp(64px, 9vw, 104px); transform: rotate(18deg); transform-origin: 50% 90%; animation: bob 4.2s ease-in-out infinite; pointer-events: none; }
.pen * { stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
@keyframes bob { 0%, 100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(10deg) translateY(-8px); } }

/* ---------- search ---------- */
.finder { margin-top: 2.2rem; max-width: 46rem; }
.finder label { display: block; font-family: var(--display); font-size: 1.5rem; transform: rotate(-1deg); }
.finder-row { display: flex; gap: 0.9rem; align-items: flex-end; margin-top: 0.3rem; }
#q { flex: 1; min-width: 0; font: inherit; font-size: 1.7rem; color: var(--ink); background: transparent; border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; padding: 0.3rem 0.1rem; }
#q::placeholder { color: #98a1b8; }
#q:focus { outline: none; border-bottom-color: var(--red); }
.btn { font-family: var(--display); font-size: 1.15rem; background: var(--hl); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px 20px 12px 20px; padding: 0.45rem 1rem; box-shadow: 3px 3px 0 var(--ink); transition: transform 0.15s, box-shadow 0.15s; white-space: nowrap; }
.btn:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.count { margin: 0.7rem 0 0; font-size: 1.1rem; color: var(--muted); min-height: 1.6rem; }

.intro { margin-top: 2rem; max-width: 40rem; }
.intro h2 { margin: 0 0 0.4rem; font-family: var(--display); font-weight: 400; font-size: 2rem; transform: rotate(-0.8deg); }
.intro p { margin: 0 0 0.9rem; text-wrap: pretty; }
.intro mark { background: linear-gradient(transparent 45%, var(--hl) 45% 90%, transparent 90%); color: inherit; padding: 0 0.15em; }
.intro .src { font-size: 1.05rem; color: var(--muted); }

/* ---------- letter tabs ---------- */
.tabs { position: sticky; top: 0; z-index: 8; margin: 2rem calc(-1 * clamp(1rem, 3vw, 2.4rem)) 0 calc(-1 * var(--marg) - 1.1rem); padding: 0.7rem clamp(1rem, 3vw, 2.4rem) 0 calc(var(--marg) + 1.1rem); display: flex; gap: 0.3rem; overflow-x: auto; background: var(--paper); border-bottom: 3px solid var(--ink); scrollbar-width: thin; }
.tabs a { flex: none; display: grid; place-items: center; min-width: 2.2rem; height: 2.5rem; padding: 0 0.5rem; font-family: var(--display); font-size: 1.15rem; color: var(--ink); text-decoration: none; background: var(--tab); border: 3px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0; transition: transform 0.15s; }
.tabs a:hover, .tabs a:focus-visible { transform: translateY(-4px); }
.tabs a.dim { opacity: 0.3; pointer-events: none; }

/* ---------- the swaps ---------- */
.letter { padding-top: 1.6rem; scroll-margin-top: 4.2rem; }
.letter h2 { display: inline-grid; place-items: center; width: 3.6rem; height: 3.6rem; margin: 0 0 0.6rem; font-family: var(--display); font-weight: 400; font-size: 2.2rem; background: var(--tab); border: 3px solid var(--ink); border-radius: 55% 45% 52% 48% / 48% 55% 45% 52%; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-5deg); }
.swaps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.4rem 1.2rem; }
.swap { width: 100%; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.15rem 0.55rem; text-align: left; background: transparent; border: 2px solid transparent; border-radius: 10px; padding: 0.3rem 0.5rem; transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.swap:hover, .swap:focus-visible { background: #fff; border-color: var(--ink); transform: translateY(-2px) rotate(-0.8deg); }
.orig { position: relative; color: #7b849b; padding: 0 0.05em; }
.orig::after { content: ""; position: absolute; left: -3%; right: -3%; top: 28%; height: 0.55em; background: var(--scribble) no-repeat center / 100% 100%; }
.arrow { width: 1.7rem; height: 0.9rem; flex: none; align-self: center; }
.arrow path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.alt { font-size: 1.5rem; line-height: 1.1; padding: 0 0.25rem; background: linear-gradient(transparent 50%, var(--hl) 50% 92%, transparent 92%); transform: rotate(-1deg); }
.swaps li:nth-child(5n+2) .alt { --hl: #ffc9e6; transform: rotate(0.8deg); }
.swaps li:nth-child(5n+3) .alt { --hl: #b9f6ca; }
.swaps li:nth-child(5n+4) .alt { --hl: #b6e3fb; transform: rotate(1deg); }
.swaps li:nth-child(5n) .alt { --hl: #ffd9a8; transform: rotate(-0.5deg); }
.swap.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 100% { background: transparent; } 15%, 60% { background: #fff6a8; border-color: var(--ink); } }

.empty { text-align: center; padding: 3rem 1rem; }
.empty svg { width: 7rem; }
.empty p { font-family: var(--display); font-size: 1.6rem; margin: 0.6rem 0 0; }

.toast { position: fixed; left: 50%; bottom: 1.6rem; z-index: 40; transform: translateX(-50%) rotate(-2deg) translateY(160%); background: #fff176; color: var(--ink); border: 3px solid var(--ink); border-radius: 6px 14px 8px 16px; box-shadow: 4px 4px 0 var(--ink); padding: 0.5rem 1.1rem; font-family: var(--display); font-size: 1.15rem; transition: transform 0.3s cubic-bezier(.2, .9, .3, 1.2); pointer-events: none; }
.toast.show { transform: translateX(-50%) rotate(-2deg) translateY(0); }

.foot { margin: 3rem 0 0; padding: 1.2rem 0 0; border-top: 3px dashed var(--line); font-size: 1.1rem; color: var(--muted); }
.foot p { margin: 0 0 0.3rem; }

@media (max-width: 640px) {
    body { font-size: 1.2rem; padding-top: 2rem; }
    .finder-row { flex-direction: column; align-items: stretch; }
    .pen { width: 44px; right: 0; top: -2.2rem; }
    .swaps { grid-template-columns: 1fr; }
    .sheet { box-shadow: 5px 5px 0 var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .pen, .swap.flash { animation: none; }
    .btn, .swap, .tabs a, .toast { transition: none; }
}

.t0 { --tab: #ff9aa2; } .t1 { --tab: #ffdf8a; } .t2 { --tab: #b5ead7; } .t3 { --tab: #9fd3f6; } .t4 { --tab: #d7b8ff; } .t5 { --tab: #ffc29a; }
.sr-copy { position: fixed; left: -9999px; top: 0; }


/* ===== v2: themes, families, the sticky note ===== */
.crumb { margin: 0 0 0.4rem; font-size: 1.05rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.theme-h1 { font-size: clamp(2.3rem, 7vw, 5rem); max-width: 14ch; }
.browse { margin-top: 2.2rem; }
.browse h2 { margin: 0 0 0.8rem; font-family: var(--display); font-weight: 400; font-size: 2rem; transform: rotate(-0.8deg); }
.browse.more { margin: 3rem 0 0; padding-top: 1.4rem; border-top: 3px dashed var(--line); }
.allwords { margin: 1.2rem 0 0; font-size: 1.2rem; }
.themes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.9rem 1.1rem; }
.theme { display: flex; flex-direction: column; gap: 0.1rem; min-height: 5.2rem; padding: 0.7rem 0.9rem 0.8rem; color: var(--ink); text-decoration: none; background: var(--tab); border: 3px solid var(--ink); border-radius: 6px 16px 8px 18px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(var(--r, -1deg)); transition: transform 0.15s, box-shadow 0.15s; }
.themes li:nth-child(even) .theme { --r: 1.1deg; }
.themes li:nth-child(3n) .theme { --r: -0.4deg; }
.theme:hover, .theme:focus-visible { transform: translate(-2px, -3px) rotate(0.5deg); box-shadow: 6px 7px 0 var(--ink); }
.theme.on { outline: 4px solid var(--ink); outline-offset: 3px; }
.theme-name { font-family: var(--display); font-size: 1.3rem; line-height: 1.1; }
.theme-n { font-size: 1rem; opacity: 0.75; }

.family { padding-top: 1.6rem; scroll-margin-top: 4.2rem; }
.family h2 { display: inline-block; margin: 0 0 0.7rem; padding: 0.15rem 0.9rem 0.25rem; font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.15; background: var(--tab); border: 3px solid var(--ink); border-radius: 8px 18px 10px 16px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1.2deg); }
.tabs a { white-space: nowrap; }

.swap { position: relative; }
.also { display: block; width: 100%; padding-left: 0.1rem; font-size: 1rem; color: var(--muted); }
.swaps li { align-self: start; }
.swap[aria-expanded="true"] { background: #fff; border-color: var(--ink); }

/* the sticky note that opens when you click a swap */
.note { position: absolute; z-index: 60; width: min(23rem, calc(100vw - 1.2rem)); padding: 1.3rem 1.3rem 1.1rem; background: #fff6a8; border: 3px solid var(--ink); border-radius: 6px 14px 8px 16px; box-shadow: 6px 6px 0 var(--ink); transform: rotate(-1.2deg); animation: pop 0.25s cubic-bezier(.2, 1.1, .3, 1.2); }
.note::before { content: ""; position: absolute; top: -13px; left: 50%; width: 76px; height: 24px; margin-left: -38px; background: rgba(224, 38, 47, 0.55); border: 1.5px dashed rgba(34, 48, 74, 0.4); transform: rotate(3deg); }
@keyframes pop { from { opacity: 0; transform: rotate(-4deg) scale(0.9) translateY(8px); } to { opacity: 1; transform: rotate(-1.2deg); } }
.note-x { position: absolute; top: 0.3rem; right: 0.45rem; width: 2rem; height: 2rem; font-size: 1.7rem; line-height: 1; background: transparent; border: 0; border-radius: 50%; color: var(--ink); }
.note-x:hover { background: rgba(34, 48, 74, 0.12); }
.note-from { margin: 0; font-size: 1.1rem; color: var(--muted); }
.note-word { margin: 0.1rem 0 0.2rem; font-family: var(--display); font-size: 2.4rem; line-height: 1.05; word-break: break-word; }
.note-why { margin: 0.3rem 0 0.9rem; font-size: 1.2rem; line-height: 1.35; text-wrap: pretty; }
.note-actions { display: flex; gap: 0.6rem; align-items: center; }
.note-also { margin: 0.9rem 0 0; padding-top: 0.7rem; border-top: 2px dashed rgba(34, 48, 74, 0.35); font-size: 1.05rem; }
.note-also .chip { display: inline-block; margin: 0.25rem 0.35rem 0 0; padding: 0.1rem 0.7rem 0.15rem; font: inherit; font-size: 1.15rem; background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--ink); transition: transform 0.12s; }
.note-also .chip:hover, .note-also .chip:focus-visible { transform: translateY(-2px) rotate(-2deg); background: var(--hl); }
.btn.done { background: #b9f6ca; }

@media (max-width: 640px) {
    .note { position: fixed; left: 0.6rem !important; right: 0.6rem; top: auto !important; bottom: 0.8rem; width: auto; transform: none; animation: slide 0.25s ease-out; }
    @keyframes slide { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
    .themes { grid-template-columns: 1fr 1fr; }
    .theme-name { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { .note, .theme { animation: none; transition: none; } }

/* ===== for-agents page ===== */
.agents section { margin-top: 2rem; max-width: 46rem; }
.agents h2 { margin: 0 0 0.5rem; font-family: var(--display); font-weight: 400; font-size: 2rem; transform: rotate(-0.8deg); }
.agents code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; background: #fff6a8; padding: 0 0.3em; border-radius: 4px; }
.promptbox { margin: 1.1rem 0 1.6rem; }
.promptbox h3 { margin: 0 0 0.3rem; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.prompt { margin: 0 0 0.7rem; padding: 0.9rem 1.1rem; white-space: pre-wrap; font: inherit; font-size: 1.15rem; line-height: 1.4; background: #fff; border: 3px dashed var(--ink); border-radius: 8px 16px 10px 14px; }
.files { list-style: none; margin: 0.6rem 0 0; padding: 0; columns: 2; column-gap: 2rem; }
.files li { break-inside: avoid; padding: 0.15rem 0; }
.files span { color: var(--muted); font-size: 1rem; }
@media (max-width: 640px) { .files { columns: 1; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-copy { position: fixed; left: -9999px; top: 0; }
