/* HookCheck v3 — the graded worksheet system.
   --pencil darkened to #6E6A5E for text roles (AA contrast on paper);
   --pencil-line keeps the old lighter value for decorative rules only. */
:root {
  --paper: #FCFBF8; --ink: #161513; --pen: #D92B21; --pen-dark: #B01F17;
  --pencil: #6E6A5E; --pencil-line: #8A8578; --highlight: #FFE84A;
  --line: #E4E0D6; --grid: rgba(22,21,19,0.045);
  --shadow: 6px 6px 0 var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font-family: 'Archivo', sans-serif;
  background: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px), var(--paper);
  background-size: 28px 28px, 28px 28px, auto; min-height: 100vh;
}
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.margin-line { position: fixed; top: 0; bottom: 0; left: max(14px, calc(50% - 350px)); width: 2px; background: var(--pen); opacity: 0.3; pointer-events: none; z-index: 1; }

/* ---------- header ---------- */
.topnav { position: sticky; top: 0; z-index: 40; background: rgba(252,251,248,0.92); backdrop-filter: blur(6px); border-bottom: 1.5px solid var(--ink); }
.topnav-inner { max-width: 640px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.logo { font-family: 'Anton', sans-serif; font-size: 24px; line-height: 1; cursor: pointer; letter-spacing: 0.01em; user-select: none; }
.logo a { color: inherit; text-decoration: none; }
.logo span { color: var(--pen); }
.authbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { border: 1.5px solid var(--ink); padding: 7px 12px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.06em; cursor: pointer; background: #fff; color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.pill:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.pill:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.pill.red { background: var(--pen); border-color: var(--ink); color: #fff; }
.pill.gold { background: var(--highlight); }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 24px 90px; position: relative; z-index: 2; }
.counter { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--pencil); padding: 12px 2px 0; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 8px; position: relative; }
.hero h1 { font-family: 'Anton', sans-serif; font-size: clamp(42px, 9.5vw, 72px); line-height: 0.98; margin: 0; text-transform: uppercase; letter-spacing: 0.005em; }
.hero h1 .circled { position: relative; color: var(--pen); white-space: nowrap; }
.hero h1 .circled svg { position: absolute; inset: -18% -14%; width: 128%; height: 136%; overflow: visible; }
.hero h1 .circled path { fill: none; stroke: var(--pen); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: drawcircle 0.9s 0.5s ease-out forwards; }
.hero p.sub { font-size: 17px; line-height: 1.6; color: var(--ink); max-width: 480px; margin: 22px 0 0; }
.hero p.sub mark { background: linear-gradient(transparent 55%, var(--highlight) 55%); padding: 0 2px; }
.hero .cta-row { display: flex; align-items: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.hero .fineprint { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--pencil); letter-spacing: 0.04em; }

/* ---------- cards & buttons ---------- */
.card { background: #fff; border: 1.5px solid var(--ink); box-shadow: var(--shadow); padding: 24px; }
.btn { padding: 16px 26px; background: var(--pen); color: #fff; border: 1.5px solid var(--ink); font-family: 'Anton', sans-serif; font-size: 17px; letter-spacing: 0.06em; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-1px,-1px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn.dark { background: var(--ink); }
.btn.gold { background: var(--highlight); color: var(--ink); }
.btn.full { width: 100%; margin-top: 20px; }
.link-btn { background: none; border: none; color: var(--pencil); font-size: 13px; cursor: pointer; text-decoration: underline; display: block; margin: 14px auto 0; }

.rule { display: flex; align-items: center; gap: 12px; margin: 44px 0 18px; }
.rule span { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pen); font-weight: 600; white-space: nowrap; }
/* hand-ruled line: a slightly wavy pen stroke instead of a flat rule */
.rule::after { content: ""; height: 7px; flex: 1; opacity: 0.9; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 7' preserveAspectRatio='none'%3E%3Cpath d='M0 4 Q 15 1.5, 30 3.5 T 60 3.5 Q 75 5.5, 90 3.5 T 120 4' fill='none' stroke='%23161513' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left center / 120px 7px; }

/* ---------- upload ---------- */
.drop { border: 2.5px dashed var(--ink); background: #fff; padding: 52px 24px; text-align: center; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; box-shadow: var(--shadow); }
.drop:hover { transform: translate(-1px,-1px); box-shadow: 7px 7px 0 var(--ink); }
.drop.over { border-color: var(--pen); background: rgba(217,43,33,0.05); border-style: solid; }
.drop h2 { font-family: 'Anton', sans-serif; font-size: 22px; margin: 0 0 8px; letter-spacing: 0.03em; }
.drop p { font-size: 13.5px; color: var(--pencil); margin: 0; }
.privacy { font-size: 12.5px; line-height: 1.55; color: var(--pencil); margin: 14px 2px 0; text-align: center; }

/* resume-chain state of the drop zone */
.resume { border: 2.5px solid var(--pen); background: #fff; padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.resume img { width: 54px; height: 96px; object-fit: cover; border: 1.5px solid var(--ink); flex-shrink: 0; }
.resume .meta { flex: 1; min-width: 0; }
.resume .tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.12em; color: var(--pen); font-weight: 600; }
.resume h3 { font-family: 'Anton', sans-serif; font-size: 18px; margin: 4px 0 2px; }
.resume p { font-size: 13px; color: var(--pencil); margin: 0; }

/* homework check (outcome prompt) */
.homework { position: relative; background: #fff; border: 1.5px dashed var(--ink); box-shadow: var(--shadow); padding: 22px 20px 18px; margin: 26px 0 6px; }
.homework .tag { position: absolute; top: -12px; left: 18px; background: var(--pen); color: #fff; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.12em; padding: 4px 10px; }
.homework p { font-size: 14.5px; line-height: 1.55; margin: 0 0 12px; }
.homework .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.homework input { flex: 1; min-width: 140px; padding: 11px 12px; border: 1.5px solid var(--ink); font-size: 16px; font-family: 'IBM Plex Mono', monospace; }

/* recovery banner */
.banner { background: var(--highlight); border: 1.5px solid var(--ink); box-shadow: var(--shadow); padding: 14px 18px; margin: 20px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.banner p { margin: 0; font-size: 14px; flex: 1; min-width: 200px; }

/* ---------- sample & steps & pricing ---------- */
.sample { position: relative; background: #fff; border: 1.5px dashed var(--ink); box-shadow: var(--shadow); padding: 30px 24px 24px; margin-top: 16px; }
.sample-tag { position: absolute; top: -12px; left: 18px; background: var(--ink); color: #fff; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.12em; padding: 4px 10px; }
.sample .item:last-of-type { border-bottom: none; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; align-items: baseline; padding: 16px 18px; background: #fff; border: 1.5px solid var(--ink); }
.step .n { font-family: 'Anton', sans-serif; font-size: 30px; color: var(--pen); flex-shrink: 0; width: 34px; }
.step h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.step p { font-size: 14px; line-height: 1.55; margin: 0; color: #3d3b37; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
.plan { background: #fff; border: 1.5px solid var(--ink); padding: 24px 22px; position: relative; }
.plan.hot { box-shadow: var(--shadow); }
.plan .flag { position: absolute; top: -13px; right: 14px; background: var(--highlight); border: 1.5px solid var(--ink); font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.1em; padding: 4px 9px; transform: rotate(2deg); }
.plan h3 { font-family: 'Anton', sans-serif; font-size: 20px; margin: 0; letter-spacing: 0.04em; }
.plan .price { font-family: 'Anton', sans-serif; font-size: 40px; margin: 10px 0 2px; }
.plan .price small { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--pencil); }
.plan ul { list-style: none; padding: 0; margin: 16px 0 0; }
.plan li { font-size: 14px; line-height: 1.5; padding: 7px 0 7px 24px; border-bottom: 1px dashed var(--line); position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 2px; color: var(--pen); font-weight: 700; }
.plan .btn { width: 100%; margin-top: 18px; font-size: 15px; padding: 13px; }

/* ---------- form ---------- */
label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pencil); display: block; margin: 18px 0 6px; }
input[type=text] { width: 100%; padding: 13px 14px; border: 1.5px solid var(--ink); background: #fff; font-size: 16px; font-family: 'Archivo', sans-serif; }
input[type=text]:focus { box-shadow: 3px 3px 0 var(--highlight); }
video { width: 100%; max-height: 400px; background: #000; display: block; margin-top: 26px; border: 1.5px solid var(--ink); box-shadow: var(--shadow); }

/* ---------- grading progress: the rubric fills in line by line ---------- */
.grading { padding: 60px 0; }
.grading .penloop { font-family: 'Anton', sans-serif; font-size: 30px; animation: pulse 1.4s ease-in-out infinite; margin: 0 0 26px; letter-spacing: 0.05em; text-align: center; }
.rubric { max-width: 380px; margin: 0 auto; }
.rubric .r-line { display: flex; align-items: center; gap: 10px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--pencil); padding: 9px 0; border-bottom: 1px dashed var(--line); }
.rubric .r-line .mark { width: 20px; text-align: center; color: var(--pen); font-weight: 700; }
.rubric .r-line.done { color: var(--ink); }
.rubric .r-line.active .mark { animation: pulse 1.2s ease-in-out infinite; }
.r-note { font-size: 12px; color: var(--pencil); margin-top: 14px; text-align: center; min-height: 18px; }
.upbar { height: 10px; border: 1.5px solid var(--ink); background: #fff; margin-top: 8px; }
/* a progress fill IS its width; animating transform would misrepresent upload progress. brief, one-off. */
/* deliberate-ignore layout-animation */
.upbar i { display: block; height: 100%; background: var(--pen); width: 0%; transition: width .3s; } /* deliberate-ignore round-stat */

/* ---------- results ---------- */
.stamp-wrap { padding: 48px 0 10px; text-align: center; position: relative; }
.stamp { display: inline-block; padding: 20px 38px; border: 6px solid var(--pen); color: var(--pen); transform: rotate(-8deg); font-family: 'Anton', sans-serif; line-height: 1; background: rgba(252,251,248,0.9); box-shadow: 0 0 0 2px rgba(217,43,33,0.15); animation: stampIn 0.45s cubic-bezier(0.2,0.8,0.3,1) both; position: relative; z-index: 2; }
/* ink splat flash behind the stamp — blooms as the stamp lands */
.splat { position: absolute; top: 12px; left: 50%; width: 280px; height: 280px; transform: translateX(-50%); pointer-events: none; z-index: 1; }
.splat path { fill: var(--pen); opacity: 0; animation: splatIn 0.5s 0.28s ease-out both; transform-origin: center; }
@keyframes splatIn { 0% { opacity: 0; transform: scale(0.3) rotate(-10deg); } 35% { opacity: 0.22; } 100% { opacity: 0.09; transform: scale(1) rotate(0deg); } }
.stamp .letter { font-size: 80px; }
.stamp .sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.18em; margin-top: 8px; }
.overall { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--pencil); margin-top: 24px; }
.roast { font-family: 'Caveat', 'Bradley Hand', cursive; font-size: 26px; line-height: 1.3; color: var(--pen); text-align: center; margin: 18px auto 0; max-width: 440px; transform: rotate(-1.2deg); }
.delta { font-family: 'IBM Plex Mono', monospace; font-size: 13px; margin-top: 10px; display: inline-block; padding: 3px 10px; border: 1.5px solid var(--ink); background: #fff; }
.delta.up { background: var(--highlight); transform: rotate(-2deg); animation: deltaSlam 0.4s 1s cubic-bezier(0.2,0.8,0.3,1) both; }
@keyframes deltaSlam { 0% { transform: rotate(-2deg) scale(2); opacity: 0; } 60% { transform: rotate(-2deg) scale(0.95); opacity: 1; } 100% { transform: rotate(-2deg) scale(1); opacity: 1; } }
/* triumph: a brief shower of red checks over the stamp.
   accelerating curve = gravity; falling particles speed up. not a UI entrance. */
/* deliberate-ignore ease-in-ui */
.checkfall { position: absolute; top: 6px; color: var(--pen); font-weight: 700; pointer-events: none; z-index: 3; opacity: 0; animation: checkFall 1.4s ease-in both; }
@keyframes checkFall { 0% { opacity: 0; transform: translateY(-12px) rotate(-8deg); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(150px) rotate(14deg); } }
/* staggered section cascade after the stamp lands */
.reveal { animation: riseIn 0.45s ease-out both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* filmstrip: the hook timeline, taped to the page */
.filmstrip-wrap { position: relative; margin-top: 6px; }
.filmstrip-wrap::before { content: ""; position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-2deg); width: 90px; height: 22px; background: rgba(255,232,74,0.75); border: 1px solid rgba(22,21,19,0.15); z-index: 3; }
.filmstrip { display: flex; gap: 0; overflow-x: auto; background: var(--ink); padding: 12px 8px; border: 1.5px solid var(--ink); box-shadow: var(--shadow); scroll-snap-type: x mandatory; }
.frame { flex: 0 0 auto; width: 96px; margin: 0 4px; scroll-snap-align: start; position: relative; }
.frame img { width: 96px; height: 170px; object-fit: cover; display: block; border: 2px solid #fff; }
/* contact-sheet feel: slight alternating tilt, like prints laid on a lightbox */
.frame:nth-child(odd) img { transform: rotate(-1.1deg); }
.frame:nth-child(even) img { transform: rotate(0.9deg); }
.frame.flagged img { border-color: var(--pen); }
.frame.flagged::after { content: ""; position: absolute; inset: 6px; border: 3px solid var(--pen); border-radius: 50%; transform: rotate(-4deg) scaleX(1.15); pointer-events: none; }
.frame .t { font-family: 'Caveat', 'Bradley Hand', cursive; font-size: 15px; color: #fff; text-align: center; padding-top: 4px; }
/* the hook window: red-marked frames + a handwritten caption under the strip */
.frame.hookwin .t { color: var(--pen); }
.frame.hookwin img { box-shadow: 0 -3px 0 var(--pen); }
.hookcap { font-family: 'Caveat', 'Bradley Hand', cursive; font-size: 19px; color: var(--pen); margin: 8px 0 0 6px; transform: rotate(-1.4deg); }
.framenote { font-size: 13.5px; line-height: 1.5; margin: 10px 0 0; padding-left: 14px; position: relative; }
.framenote b { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--pen); margin-right: 6px; }
.framenote::before { content: "✎"; position: absolute; left: 0; color: var(--pen); font-size: 12px; }

.item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.item h3 { font-weight: 700; font-size: 15px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.item h3 .cscore { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--pencil); font-weight: 400; margin-left: 8px; }
.item h3 .fixedstamp { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.1em; color: #fff; background: var(--pen); padding: 2px 8px; margin-left: 8px; transform: rotate(-2deg); animation: deltaSlam 0.35s 1.1s cubic-bezier(0.2,0.8,0.3,1) both; }
.item .verdict { margin: 0 0 8px; font-size: 14.5px; line-height: 1.6; }
.item .prev { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: var(--pencil); text-decoration: line-through; text-decoration-color: rgba(110,106,94,0.6); }
.item .fix { margin: 0; font-size: 14px; line-height: 1.55; color: var(--pen); font-weight: 500; }
.item .fix b { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em; margin-right: 6px; font-weight: 600; }

.copyline { display: block; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--ink); padding: 12px 14px; margin-bottom: 10px; font-size: 14.5px; font-family: 'Archivo', sans-serif; color: var(--ink); cursor: pointer; line-height: 1.5; transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s; }
.copyline:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px,-1px); }
.copyline.copied { background: var(--highlight); }
.copyline small { float: right; font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--pencil); margin-left: 8px; }
.risk { font-size: 14.5px; line-height: 1.6; margin: 0 0 10px; background: var(--highlight); display: inline-block; padding: 4px 10px; border: 1.5px solid var(--ink); }
.err h2 { font-family: 'Anton', sans-serif; font-size: 24px; color: var(--pen); margin-bottom: 10px; }
.paywall { margin-top: 22px; }
.paywall h3 { font-family: 'Anton', sans-serif; font-size: 20px; margin: 0 0 8px; }
.paywall p { font-size: 14px; line-height: 1.6; margin: 0 0 4px; }

/* fix-loop CTA block */
.fixloop { background: #fff; border: 2.5px solid var(--pen); box-shadow: var(--shadow); padding: 22px; margin-top: 34px; position: relative; }
.fixloop h3 { font-family: 'Anton', sans-serif; font-size: 20px; margin: 0 0 8px; color: var(--pen); }
.fixloop p { font-size: 14px; line-height: 1.6; margin: 0 0 14px; }

/* share card variant tabs */
.sharewrap { margin-top: 26px; text-align: center; }
.sharewrap img.preview { max-width: 280px; width: 100%; border: 1.5px solid var(--ink); box-shadow: var(--shadow); }
.vtabs { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.vtabs .pill.on { background: var(--ink); color: #fff; }

/* ---------- history: report-card dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 480px) { .dash { grid-template-columns: 1fr 1fr; } .dash .statcard:last-child { grid-column: span 2; } }
.statcard { background: #fff; border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 14px 12px 10px; text-align: center; }
.statcard .statnum { font-family: 'Anton', sans-serif; font-size: 34px; color: var(--pen); line-height: 1; }
.statcard .statlbl { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 0.12em; color: var(--pencil); margin-top: 6px; }
.sparkwrap { background: #fff; border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 14px 14px 10px; margin-bottom: 16px; }
.spark { width: 100%; height: auto; display: block; }
.spark .youline { fill: none; stroke: var(--pen); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--pen); }
.spark .feedline { stroke: var(--pencil-line); stroke-width: 1.4; stroke-dasharray: 5 5; }
.spark .feedlbl { font-family: 'IBM Plex Mono', monospace; font-size: 8px; fill: var(--pencil); }
.sparklbl { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 0.12em; color: var(--pencil); margin-top: 8px; text-align: center; }

/* ---------- history (chains) ---------- */
.chain { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--ink); background: #fff; margin-bottom: 12px; box-shadow: 3px 3px 0 var(--ink); text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.chain:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }
.chain img, .chain-thumb { width: 44px; height: 78px; object-fit: cover; border: 1.5px solid var(--ink); flex-shrink: 0; background: var(--line); display: block; }
.chain .arc { font-family: 'Anton', sans-serif; font-size: 24px; color: var(--pen); flex-shrink: 0; min-width: 84px; }
.chain .arc small { font-size: 13px; color: var(--pencil); font-family: 'IBM Plex Mono', monospace; }
.chain .arc .arc3 { font-size: 17px; }
.chain .meta { flex: 1; min-width: 0; }
.chain .meta .date { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--pencil); }
.chain .meta .line2 { font-size: 13px; line-height: 1.4; margin-top: 3px; }
.skel { height: 74px; border: 1.5px solid var(--line); background: repeating-linear-gradient(90deg, #fff, #fff 40px, var(--paper) 40px, var(--paper) 80px); margin-bottom: 12px; animation: pulse 1.6s ease-in-out infinite; }

footer { margin-top: 70px; padding-top: 18px; border-top: 1.5px solid var(--ink); font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--pencil); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
footer a { color: var(--pencil); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; z-index: 50; border: 1.5px solid #fff; }
.hidden { display: none !important; }

/* ---------- identity chip + account menu ---------- */
.idwrap { position: relative; }
.idchip { position: relative; width: 40px; height: 40px; background: none; border: none; padding: 0; cursor: pointer; font-family: 'Anton', sans-serif; }
.idchip .idletter { font-size: 20px; line-height: 40px; display: block; color: var(--ink); }
.idchip svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); overflow: visible; pointer-events: none; }
.idchip svg path { fill: none; stroke: var(--pen); stroke-width: 6; stroke-linecap: round; }
.idchip:hover .idletter { color: var(--pen); }
.idmenu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: #fff; border: 1.5px solid var(--ink); box-shadow: var(--shadow); z-index: 45; }
.idmenu-who { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--pencil); padding: 12px 14px 10px; border-bottom: 1px dashed var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idmenu a, .idmenu button, .idmenu .pill { display: block; width: 100%; text-align: left; background: none; border: none; box-shadow: none; padding: 12px 14px; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink); cursor: pointer; text-decoration: none; border-bottom: 1px dashed var(--line); transition: none; }
.idmenu a:hover, .idmenu button:hover, .idmenu .pill:hover { background: var(--highlight); transform: none; box-shadow: none; }
.idmenu .pill.gold { background: none; color: var(--pen); font-weight: 600; }
.idmenu .pill.gold:hover { background: var(--highlight); color: var(--ink); }
.idmenu #signout { color: var(--pencil); border-bottom: none; }

/* ---------- worksheet doodles ---------- */
/* tape corners: drop <i class="tape tl/tr"> inside any position:relative card */
.tape { position: absolute; width: 74px; height: 24px; background: rgba(255,232,74,0.55); border: 1px solid rgba(22,21,19,0.14); box-shadow: 0 1px 2px rgba(22,21,19,0.08); pointer-events: none; z-index: 3; }
.tape.tl { top: -11px; left: 22px; transform: rotate(-5deg); }
.tape.tr { top: -11px; right: 22px; transform: rotate(4deg); }

/* teacher margin notes: live in the real page margin on wide screens */
.margin-note { display: none; font-family: 'Caveat', 'Bradley Hand', cursive; font-size: 21px; line-height: 1.15; color: var(--pen); pointer-events: none; }
@media (min-width: 880px) {
  .margin-note { display: block; position: absolute; width: 120px; right: -140px; transform: rotate(4deg); }
}

/* tally marks (red pen count) */
.tallyrow { display: inline-flex; gap: 6px; vertical-align: -5px; margin-right: 8px; }
.tallygroup { width: 26px; height: 17px; }
.tallygroup path { stroke: var(--pen); stroke-width: 3.4; stroke-linecap: round; fill: none; }
.tallygroup path.cross { stroke: var(--ink); stroke-width: 3; }

/* empty-state doodle */
.doodle-empty { width: 92px; height: 115px; color: var(--pencil-line); display: block; margin: 0 auto 12px; }
.empty-state { text-align: center; padding: 26px 0 8px; }
.empty-state p { color: var(--pencil); font-size: 14px; margin: 0; }
.empty-state .margin-note { display: block; position: static; transform: rotate(-2.5deg); width: auto; margin-top: 8px; }

/* social proof band: tally marks + one real number */
.proofband { display: flex; align-items: center; gap: 4px; margin: 34px 0 -12px; padding: 12px 16px; background: #fff; border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.proofband span { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink); }

/* footer red-pen stamp */
.footstamp { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 0.14em; color: var(--pen); border: 2px solid var(--pen); padding: 4px 9px; transform: rotate(-3deg); opacity: 0.75; }

@keyframes stampIn { 0% { transform: rotate(-8deg) scale(2.4); opacity: 0; } 60% { transform: rotate(-8deg) scale(0.94); opacity: 1; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes drawcircle { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } html { scroll-behavior: auto; } }
