/* ---------------------------------------------------------------
   lucca's site. paper, ink, one blue pen.
   handwritten on purpose. viewed best with the lights you prefer.
   --------------------------------------------------------------- */

:root {
  --paper: #f7f3ea;
  --ink: #201c17;
  --ink-soft: #5f5749;
  --pen: #2b50c8;          /* ballpoint blue */
  --pen-soft: rgba(43, 80, 200, 0.55);
  --red: #c4553d;          /* margin-line red */
  --line: rgba(32, 28, 23, 0.16);
  --card: #fbf8f1;
  --shadow: 0 1px 2px rgba(32, 28, 23, 0.08), 0 6px 18px rgba(32, 28, 23, 0.07);
  --tape: rgba(224, 205, 155, 0.5);
  --sel: rgba(43, 80, 200, 0.22);
}

[data-theme="dark"] {
  --paper: #141110;
  --ink: #ece5d6;
  --ink-soft: #a1988a;
  --pen: #92a9f5;
  --pen-soft: rgba(146, 169, 245, 0.6);
  --red: #d4705c;
  --line: rgba(236, 229, 214, 0.16);
  --card: #1b1815;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.35);
  --tape: rgba(203, 178, 122, 0.22);
  --sel: rgba(146, 169, 245, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #141110;
    --ink: #ece5d6;
    --ink-soft: #a1988a;
    --pen: #92a9f5;
    --pen-soft: rgba(146, 169, 245, 0.6);
    --red: #d4705c;
    --line: rgba(236, 229, 214, 0.16);
    --card: #1b1815;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.35);
    --tape: rgba(203, 178, 122, 0.22);
    --sel: rgba(146, 169, 245, 0.3);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.05rem/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

/* faint paper grain over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--sel); }

.display { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -0.01em; }
.hand { font-family: "Caveat", "Segoe Script", cursive; font-size: 1.35rem; line-height: 1.3; color: var(--ink-soft); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.78rem; letter-spacing: 0.01em; }
.micro { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

a { color: var(--pen); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-style: wavy; }

kbd {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05em 0.4em;
  background: var(--card);
}

.skip {
  position: absolute; left: -999px; top: 0.5rem; z-index: 100;
  background: var(--card); padding: 0.4rem 0.8rem; border-radius: 6px;
}
.skip:focus { left: 0.5rem; }

:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; border-radius: 2px; }

/* ---------- top bar ---------- */
.top {
  display: flex; justify-content: space-between; align-items: baseline;
  max-width: 44rem; margin: 0 auto; padding: 1.4rem 1.4rem 0;
}
.wordmark { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.05rem; }
.top-right { color: var(--ink-soft); }

/* ---------- the page column ---------- */
.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.4rem 4rem;
  position: relative;
}

/* notebook margin line, wide screens only */
@media (min-width: 1150px) {
  body::after {
    content: "";
    position: fixed;
    top: 0; bottom: 0;
    left: calc(50% - 25rem);
    width: 1px;
    background: var(--red);
    opacity: 0.25;
    pointer-events: none;
  }
}

section { margin-top: 5rem; position: relative; }

/* ---------- hero ---------- */
.hero { margin-top: 16vh; min-height: 40vh; }
.greeting { margin: 0 0 0.6rem; font-size: 1.5rem; }
h1.display {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 1.2rem;
}
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 36rem; }

/* squiggle underline */
.u { position: relative; white-space: nowrap; }
.squig {
  position: absolute; left: 0; right: 0; bottom: -0.18em;
  width: 100%; height: 0.28em; overflow: visible;
}
.squig path {
  fill: none; stroke: var(--pen); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 130; stroke-dashoffset: 130;
  animation: draw 0.9s 0.5s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- headings ---------- */
.h2 { font-size: 1.7rem; margin: 0 0 1.1rem; display: inline-block; position: relative; }
.h2-aside { font-size: 1.2rem; }
.h-under {
  position: absolute; left: -2%; right: -4%; bottom: 0.05em; height: 0.32em;
  background: var(--pen);
  opacity: 0.16;
  transform: rotate(-0.6deg);
  border-radius: 2px;
  pointer-events: none;
}

/* ---------- now ---------- */
.now-list { padding-left: 1.1rem; margin: 0 0 0.9rem; }
.now-list li { margin: 0.45rem 0; }
.now-list li::marker { content: "- "; color: var(--pen); }

.status-line { margin: -0.4rem 0 1.4rem; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 1.4rem; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.5rem 1.3rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.35s ease;
}
.tilt-a { transform: rotate(-0.5deg); }
.tilt-b { transform: rotate(0.45deg); }
.card:hover { transform: rotate(0deg) translateY(-3px); }

.tape {
  position: absolute; top: -0.6rem; left: 50%;
  width: 5.2rem; height: 1.25rem;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--tape);
  border-left: 1px dashed rgba(0,0,0,0.08);
  border-right: 1px dashed rgba(0,0,0,0.08);
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.card p { margin: 0.5rem 0; font-size: 0.95rem; }
.stack { color: var(--ink-soft); }
.card-note { color: var(--ink-soft); font-size: 1.15rem; }

/* ---------- the pile ----------
   four index cards stacked on a desk. rolo.js adds .rolo-on and drives each
   slot's --d (0 = the one you're reading, 3 = bottom of the pile). every
   transform lives on the SLOT, never the card: the card's own transform is
   spoken for by tilt-a/tilt-b and by the tape incident (.fallen/.pinned).
   no js, or "spread them out" on, and this is the plain grid it always was. */
.rolo-slot { position: relative; }

.cards.rolo-on {
  display: block;
  position: relative;
  margin-top: 2.4rem;          /* room for the back of the pile to lean up */
  touch-action: pan-y;         /* horizontal is ours, vertical is the page's */
  --step-x: 17px;              /* how far each card behind leans right */
  --step-y: -11px;             /* and up */
}
/* a narrow screen cannot spare 51px of lean, or the page scrolls sideways */
@media (max-width: 560px) {
  .cards.rolo-on { --step-x: 8px; --step-y: -6px; }
}

.cards.rolo-on .rolo-slot {
  --d: 0;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: calc(20 - var(--d));
  opacity: calc(1 - var(--d) * 0.28);
  transform:
    translate3d(calc(var(--d) * var(--step-x)), calc(var(--d) * var(--step-y)), 0)
    scale(calc(1 - var(--d) * 0.038))
    rotate(calc(var(--d) * 1.1deg));
  transform-origin: 50% 100%;
  transition: transform 0.52s cubic-bezier(0.22, 0.86, 0.3, 1),
              opacity 0.42s ease;
  will-change: transform;
}

/* only the front card is live. the rest are scenery until they come forward. */
.cards.rolo-on .rolo-slot[inert] { pointer-events: none; }
.cards.rolo-on .rolo-slot:not(.is-front) .card { box-shadow: var(--shadow); }
.cards.rolo-on .rolo-slot.is-front .card {
  box-shadow: var(--shadow), 0 26px 34px -24px rgba(0, 0, 0, 0.38);
}

/* the front card sits in the flow of the pile's measured height */
.cards.rolo-on .rolo-slot.is-front { position: relative; }

/* ---------- pile controls ---------- */
.rolo-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0.35rem;
  margin: 1.5rem 0 0;
}

.rolo-arm {
  appearance: none; border: 0; background: none;
  padding: 0.25rem 0.5rem;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.rolo-arm svg { display: block; width: 42px; height: 20px; overflow: visible; }
.rolo-arm svg path {
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.rolo-arm:hover { color: var(--pen); transform: translateY(-1px); }
.rolo-arm[data-dir="-1"]:hover { transform: translateX(-3px); }
.rolo-arm[data-dir="1"]:hover { transform: translateX(3px); }
.rolo-arm:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; }

.rolo-count {
  min-width: 8.5rem; text-align: center;
  margin: 0; font-size: 1.25rem;
  color: var(--ink-soft);
  user-select: none;
}

/* the thumbtacks. one per card, the front one pressed in. */
.rolo-tacks { display: flex; justify-content: center; gap: 0.55rem; margin: 0.5rem 0 0; }
.rolo-tack {
  appearance: none; padding: 0; cursor: pointer;
  width: 12px; height: 12px; border-radius: 50%;
  background: transparent;
  border: 1.6px solid var(--ink-soft);
  opacity: 0.55;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.rolo-tack:hover { opacity: 1; transform: scale(1.15); }
.rolo-tack[aria-current="true"] {
  background: var(--pen); border-color: var(--pen);
  opacity: 1;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}
.rolo-tack:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; }

.rolo-spread {
  display: block; margin: 0.9rem auto 0;
  background: none; border: 0; padding: 0.2rem 0.4rem;
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 1.15rem; color: var(--ink-soft);
  cursor: pointer; border-radius: 4px;
  text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.rolo-spread:hover { color: var(--pen); }
.rolo-spread:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

/* dragging the pile: no text selection mid-flick, and kill the transition so
   the card tracks the finger instead of lagging behind it */
.cards.rolo-dragging { user-select: none; }
.cards.rolo-dragging .rolo-slot { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .cards.rolo-on .rolo-slot { transition: none; }
  .rolo-arm, .rolo-tack { transition: none; }
}

/* ---------- margin notes ---------- */
.note {
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 1.2rem; line-height: 1.25;
  color: var(--ink-soft);
  width: 11rem;
}
.arrow { width: 3rem; height: 2rem; display: block; margin-bottom: 0.2rem; }
.arrow path { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 1150px) {
  .note { position: absolute; }
  .note-right { right: -14rem; top: 3rem; transform: rotate(1.5deg); }
  .note-left { left: -14.5rem; top: 6rem; transform: rotate(-1.5deg); text-align: right; }
  .note-left .arrow { margin-left: auto; }
}
@media (max-width: 1149.9px) {
  .note { margin: 1.2rem 0 0; transform: rotate(-0.5deg); }
  .arrow { display: none; }
}

/* ---------- guestbook ---------- */
.guest-list { list-style: none; padding: 0.2rem 0 0 0.4rem; font-size: 1.3rem; }
.guest-list li { margin: 0.5rem 0; }

/* ---------- say hi ---------- */
.big-link { font-family: "Fraunces", Georgia, serif; font-size: 1.5rem; font-weight: 600; }
.say-hi { line-height: 2.1; }
.hi-extras { padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.95rem; }
.hi-extras li { margin: 0.4rem 0; }
.hi-extras li::marker { content: "✎ "; color: var(--pen); }

/* ---------- footer ---------- */
.foot { margin-top: 6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.foot p { margin: 0.5rem 0; }
.foot-read { font-size: 1.35rem; color: var(--pen); }
.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--pen); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px; font-size: inherit;
}
.linkish:hover { text-decoration-style: wavy; }

/* ---------- lamp cord ---------- */
.cord {
  position: fixed; top: 0; right: clamp(1rem, 6vw, 4rem); z-index: 20;
  background: none; border: none; padding: 0 6px; cursor: grab;
  touch-action: none;
}
.cord:active { cursor: grabbing; }
.cord-line { stroke: var(--ink-soft); stroke-width: 1.5; fill: none; }
.cord-knob { fill: var(--ink-soft); }
.cord:hover .cord-knob { fill: var(--pen); }
[data-theme="dark"] .cord-knob { filter: drop-shadow(0 0 6px rgba(146, 169, 245, 0.7)); }

/* ---------- floating tools ---------- */
.tool {
  position: fixed; z-index: 20;
  width: 2.6rem; height: 2.6rem;
  display: grid; place-items: center;
  background: var(--card); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s, background-color 0.35s;
}
.tool:hover { color: var(--pen); transform: rotate(-8deg); }
.pencil-btn { left: 1.1rem; bottom: 1.1rem; }
.pencil-btn svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.pencil-btn.on { color: var(--pen); background: var(--paper); transform: rotate(-35deg); }
.term-btn { right: 1.1rem; bottom: 1.1rem; font-size: 0.9rem; }

.pencil-hud {
  position: fixed; left: 4.4rem; bottom: 1.75rem; z-index: 20;
  color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* the drawing canvas */
.doodle {
  position: absolute; top: 0; left: 0; z-index: 3;
  pointer-events: none;
}
body.drawing .doodle { pointer-events: auto; cursor: crosshair; touch-action: none; }

/* ---------- ghost cursor ---------- */
.ghost {
  position: absolute; top: 0; left: 0; z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  will-change: transform;
}
.ghost.show { opacity: 0.65; }
.ghost svg { display: block; filter: blur(0.4px) drop-shadow(0 1px 2px rgba(0,0,0,0.25)); }
.ghost svg path { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.3; }
.ghost-tag {
  position: absolute; left: 14px; top: 16px;
  font-family: "Caveat", cursive; font-size: 1.05rem; white-space: nowrap;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0 0.6rem;
}
.ghost-ping {
  position: absolute; z-index: 14;
  width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--pen-soft);
  pointer-events: none;
  animation: ping 0.9s ease-out forwards;
}
@keyframes ping { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(4); opacity: 0; } }

/* ---------- terminal ---------- */
.term {
  position: fixed; left: 50%; bottom: 0; z-index: 30;
  transform: translateX(-50%);
  width: min(46rem, 100vw);
  max-height: 55vh;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
}
.term-body { overflow-y: auto; padding: 1rem 1.1rem 0.4rem; white-space: pre-wrap; line-height: 1.55; }
.term-body a { color: var(--pen); }
.term-line { display: flex; gap: 0.5rem; padding: 0.4rem 1.1rem 0.9rem; align-items: baseline; }
.term-prompt { color: var(--pen); font-size: 0.85rem; }
.term-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--ink); font-size: 0.85rem; caret-shape: block;
}
.term-dim { color: var(--ink-soft); }

/* ---------- blueprint mode (konami) ---------- */
body.blueprint * { outline: 1px dashed color-mix(in srgb, var(--pen) 30%, transparent); outline-offset: -1px; }
body.blueprint::before { opacity: 0; }
body.blueprint {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 2rem 2rem;
}
.bp-note {
  position: absolute; z-index: 25;
  font-family: "Caveat", cursive; font-size: 1.05rem;
  color: var(--pen);
  background: var(--paper);
  border: 1px dashed var(--pen-soft);
  padding: 0 0.5rem; border-radius: 4px;
  pointer-events: none;
}

/* ---------- hover tooltip (the eavestroughs clause) ---------- */
.tip {
  border-bottom: 1px dotted var(--ink-soft);
  cursor: help;
  position: relative;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 1.7em; left: 50%;
  transform: translateX(-50%) rotate(-1.2deg);
  width: max-content; max-width: 15rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0.1rem 0.65rem;
  border-radius: 6px;
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 1.1rem; line-height: 1.25;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 12;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
/* tips that live at the very top of the page open downward instead */
.tip-down::after { bottom: auto; top: 1.9em; }

/* ---------- the coffee is still warm ---------- */
.coffee { position: relative; }
.steam {
  position: absolute; bottom: 92%;
  width: 5px; height: 15px;
  border-radius: 50%;
  background: var(--ink-soft);
  filter: blur(3px);
  opacity: 0;
  pointer-events: none;
}
.steam.s1 { left: 14%; }
.steam.s2 { left: 44%; }
.steam.s3 { left: 70%; }
.coffee-note:hover .steam.s1 { animation: steamrise 2.6s ease-in-out infinite; }
.coffee-note:hover .steam.s2 { animation: steamrise 2.2s ease-in-out 0.9s infinite; }
.coffee-note:hover .steam.s3 { animation: steamrise 2.9s ease-in-out 1.5s infinite; }
@keyframes steamrise {
  0%   { opacity: 0; transform: translate(0, 2px) scale(1, 0.7); }
  25%  { opacity: 0.45; }
  60%  { transform: translate(3px, -16px) scale(1.1, 1.15); }
  100% { opacity: 0; transform: translate(-2px, -30px) scale(1.25, 1.3); }
}

/* ---------- the spoilers ---------- */
.spoilers { margin-top: 2.2rem; }
.spoiler-btn {
  background: var(--card);
  border: 1px dashed var(--ink-soft);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 1.25rem;
  padding: 0.35rem 1.1rem;
  cursor: pointer;
  transform: rotate(-0.8deg);
  transition: transform 0.2s, color 0.2s, border-color 0.2s;
}
.spoiler-btn:hover { transform: rotate(0.8deg) translateY(-1px); color: var(--pen); border-color: var(--pen-soft); }
.spoiler-panel {
  position: relative;
  margin-top: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.4rem 1.1rem;
  transform: rotate(0.3deg);
}
.spoiler-title { margin: 0 0 0.8rem; font-size: 1.4rem; }
.spoiler-list { margin: 0; padding-left: 1.2rem; font-size: 0.92rem; }
.spoiler-list li { margin: 0.55rem 0; }
.spoiler-list li::marker { content: "✎ "; color: var(--pen); }
code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
.spoiler-end { margin: 0.9rem 0 0; font-size: 1.2rem; }

/* ---------- the vouch card ---------- */
.vouch-btn {
  background: var(--card);
  border: 1px dashed var(--pen-soft);
  border-radius: 8px;
  color: var(--pen);
  font-size: 1.3rem;
  padding: 0.35rem 1.1rem;
  cursor: pointer;
  transform: rotate(-1deg);
  transition: transform 0.2s, border-color 0.2s;
}
.vouch-btn:hover { transform: rotate(0.6deg) translateY(-1px); border-color: var(--pen); }
.vouch-wrap {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 1rem;
}
.vouch-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--ink) 30%, transparent);
  backdrop-filter: blur(2px);
}
.vouch-card {
  position: relative;
  width: min(24rem, 94vw);
  max-height: 88vh; overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 1.8rem 1.5rem 1.3rem;
  margin: 0;
}
#vouch-pin { position: absolute; top: -14px; left: 55%; width: 30px; height: auto;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3)); z-index: 2; }
.vouch-title { margin: 0 0 0.2rem; font-size: 1.6rem; color: var(--ink); }
.vouch-card label {
  display: block;
  font-family: "Caveat", cursive; font-size: 1.25rem;
  color: var(--ink-soft);
  margin-top: 0.9rem;
}
.vouch-card input {
  display: block; width: 100%;
  background: none; border: none;
  border-bottom: 1px dashed var(--line);
  padding: 0.25rem 0.1rem;
  font: 1rem system-ui, sans-serif;
  color: var(--ink);
  outline: none;
}
.vouch-card input:focus { border-bottom-color: var(--pen); border-bottom-style: solid; }
.v-opt { font-size: 0.95rem; opacity: 0.75; }
.v-role-note { margin: 0.9rem 0 -0.4rem; font-size: 1.15rem; color: var(--pen); transform: rotate(-0.6deg); }
.v-actions { display: flex; gap: 1rem; align-items: center; margin-top: 1.4rem; }

/* the cord is a real rope now - verlet nodes, drawn every frame from js.
   overflow stays visible so it can swing and stretch past its little box. */
.cord svg { overflow: visible; }

/* about's seasonal margin note sits lower than coffee */
@media (min-width: 1150px) {
  #about .note-left { top: 1rem; }
}

/* ---------- blueprint pixel confessions ---------- */
.bp-dim {
  position: absolute; z-index: 25;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.68rem;
  color: var(--pen);
  background: var(--paper);
  border: 1px solid var(--pen-soft);
  border-radius: 3px;
  padding: 0 0.3rem;
  pointer-events: none;
}
#bp-live {
  position: fixed; z-index: 60;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--paper);
  background: var(--pen);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  pointer-events: none;
  box-shadow: var(--shadow);
}

/* ---------- the cord can only take so much ---------- */
.cord.snapped { pointer-events: none; }
.cord.repaired::after {
  content: "";
  position: absolute;
  left: 3px; top: 30px;
  width: 20px; height: 9px;
  background: var(--tape);
  border-left: 1px dashed rgba(0, 0, 0, 0.12);
  border-right: 1px dashed rgba(0, 0, 0, 0.12);
  transform: rotate(-14deg);
}
/* ---------- the second snap: duct tape + a real switch ---------- */
.cord:disabled, .cord.dead { cursor: default; }
.cord.dead:hover .cord-knob { fill: var(--ink-soft); }
.ducttape {
  position: absolute; left: -6px; z-index: 3;
  width: 44px; height: 13px;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #b9bec5, #8f959c 55%, #a5abb2);
  clip-path: polygon(0 10%, 4% 0, 96% 5%, 100% 14%, 98% 86%, 100% 95%, 93% 100%, 3% 95%, 0 88%, 2% 50%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  opacity: 0.95;
}
[data-theme="dark"] .ducttape { filter: brightness(0.75); }
.ducttape.dt1 { top: 22px; transform: rotate(9deg); }
.ducttape.dt2 { top: 48px; transform: rotate(-12deg); }

.wallswitch {
  position: fixed; z-index: 20;
  top: 26px; right: calc(clamp(1rem, 6vw, 4rem) + 48px);
  width: 34px; height: 54px;
  display: grid; place-items: center;
  background: var(--card);
  border: 1.5px solid var(--ink-soft);
  border-radius: 6px;
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 0;
  animation: drillin 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* the plate screws. every real switch has them. */
.wallswitch::before, .wallswitch::after {
  content: "";
  position: absolute; left: 50%; translate: -50% 0;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-soft);
}
.wallswitch::before { top: 4px; }
.wallswitch::after { bottom: 4px; }
.ws-nub {
  width: 13px; height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink-soft) 70%, var(--paper)), var(--ink-soft) 62%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease;
}
[data-theme="dark"] .ws-nub { transform: scaleY(-1); }
.wallswitch:hover .ws-nub { background: linear-gradient(180deg, color-mix(in srgb, var(--pen) 60%, var(--paper)), var(--pen) 62%); }
.wallswitch:active .ws-nub { transform: scale(0.92); }
[data-theme="dark"] .wallswitch:active .ws-nub { transform: scaleY(-1) scale(0.92); }
@keyframes drillin {
  0%   { transform: rotate(-540deg) scale(0.1); opacity: 0; }
  70%  { transform: rotate(14deg) scale(1.06); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* ---------- the physics panel (terminal: `physics`) ---------- */
.phys-panel {
  position: fixed; top: 120px; right: 12px; z-index: 35;
  width: 240px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.7rem 0.9rem 0.8rem;
}
.phys-title { margin: 0 0 0.4rem; font-size: 1.35rem; position: relative; }
.phys-x { position: absolute; right: -2px; top: -2px; text-decoration: none; font-size: 1rem; }
.phys-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0 0.5rem;
  margin: 0.35rem 0;
  color: var(--ink-soft);
  cursor: pointer;
}
.phys-row b { font-weight: 600; color: var(--pen); }
.phys-row input { grid-column: 1 / -1; width: 100%; accent-color: var(--pen); margin: 0; }
.phys-reset {
  margin-top: 0.5rem;
  background: none;
  border: 1px dashed var(--ink-soft); border-radius: 6px;
  color: var(--ink-soft);
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}
.phys-reset:hover { color: var(--pen); border-color: var(--pen-soft); }
.phys-note { margin: 0.45rem 0 0; color: var(--ink-soft); }

/* ---------- the race (terminal: `race`) ---------- */
.race-banner {
  position: fixed; left: 0; right: 0; top: 50%; height: 400px;
  transform: translateY(-50%);
  z-index: 80;
  pointer-events: none;
  display: grid; place-items: center;
  transition: opacity 0.5s ease;
}
.race-banner.done { opacity: 0; }
.race-flag {
  position: absolute; inset: 0;
  background: repeating-conic-gradient(#141110 0% 25%, #f7f3ea 0% 50%);
  background-size: 80px 80px;
  opacity: 0.4;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}
.race-count {
  position: relative;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1.3;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  padding: 0 0.55em;
  box-shadow: var(--shadow);
}

.cord-fall {
  position: fixed; z-index: 21;
  pointer-events: none;
  animation: cordfall 1.3s cubic-bezier(0.5, 0, 0.9, 0.4) forwards;
}
@keyframes cordfall {
  to { transform: translateY(108vh) rotate(74deg); opacity: 0.4; }
}
.spark {
  position: fixed; z-index: 41;
  width: 4px; height: 4px;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkfly 0.7s ease-out forwards;
}
@keyframes sparkfly {
  to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
/* the lights actually flicker now: a full-screen overlay that stutters for a
   couple of seconds. dark room in light mode, sputtering bulb in dark mode.
   (an overlay on purpose - a filter on body would turn it into a containing
   block and rip every position:fixed element out of the viewport.) */
.flick {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
  background: #000;
  opacity: 0;
  animation: flickpulse 2.4s steps(1, end) both;
}
[data-theme="dark"] .flick { background: #ffe9bd; }
@keyframes flickpulse {
  0%   { opacity: 0; }
  4%   { opacity: 0.75; }
  9%   { opacity: 0; }
  15%  { opacity: 0.5; }
  22%  { opacity: 0; }
  34%  { opacity: 0.85; }
  42%  { opacity: 0.12; }
  50%  { opacity: 0.7; }
  58%  { opacity: 0; }
  72%  { opacity: 0.45; }
  80%  { opacity: 0; }
  88%  { opacity: 0.8; }
  100% { opacity: 0; }
}

/* ---------- paper-scrap confetti ---------- */
.confetti {
  position: fixed; top: -18px; z-index: 45;
  pointer-events: none;
  border-radius: 1px;
  animation-name: confettifall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes confettifall {
  to { transform: translate(var(--cx), 110vh) rotate(var(--rot)); opacity: 0.85; }
}

/* ---------- the tape incident ---------- */
.card .tape { cursor: grab; touch-action: none; }
.card .tape:active { cursor: grabbing; }
.tape.peeled {
  transition: transform 0.55s ease-in, opacity 0.55s ease-in;
  transform: translate(-50%, 0) translate(48px, -72px) rotate(38deg);
  opacity: 0;
}
.card.fallen { transform: rotate(2.8deg) translateY(13px); transition: transform 0.5s cubic-bezier(0.3, 1.1, 0.5, 1); }
/* pinned notes hang a little crooked (random tilt from js) and lift at the
   bottom, since only the top is actually attached now */
.card.pinned {
  transform: rotate(var(--pin-tilt, 0.5deg));
  box-shadow: var(--shadow), 0 18px 22px -15px rgba(0, 0, 0, 0.4);
}
.card.pinned::after {
  content: "";
  position: absolute; right: 0; bottom: 0;
  width: 30px; height: 30px;
  background: linear-gradient(315deg,
    var(--paper) 46%,
    rgba(0, 0, 0, 0.16) 50%,
    color-mix(in srgb, var(--card) 86%, #fff) 55%,
    var(--card) 72%);
  box-shadow: -4px -4px 8px rgba(0, 0, 0, 0.15);
  border-top-left-radius: 3px;
}
.pin {
  position: absolute; z-index: 5;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
  animation: pinpop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: 50% 30%;
}
@keyframes pinpop {
  from { scale: 0; }
  70%  { scale: 1.25; }
  to   { scale: 1; }
}
.lmouse { position: absolute; z-index: 17; pointer-events: none; }
.lmouse svg path { fill: var(--ink); stroke: var(--paper); stroke-width: 1; }
.lmouse-tag {
  position: absolute; left: 14px; top: 16px;
  font-family: "Caveat", cursive; font-size: 1.05rem; white-space: nowrap;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  padding: 0 0.6rem;
}

/* toast for little announcements */
.toast {
  position: fixed; left: 50%; bottom: 4.4rem; z-index: 40;
  transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  font-family: "Caveat", cursive; font-size: 1.15rem;
  padding: 0.35rem 1rem; border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0; translate: 0 6px;
  transition: opacity 0.3s, translate 0.3s;
  pointer-events: none;
  max-width: min(92vw, 30rem); text-align: center;
  rotate: var(--toast-rot, 0deg);
}
.toast.show { opacity: 1; translate: 0 0; }
/* anchored toasts drop the pill and become handwriting at the scene,
   on a translucent paper slip so they stay readable over anything */
.toast.anchored {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(2px);
  color: var(--ink);
  box-shadow: none;
  border-radius: 8px;
  padding: 0.15rem 0.6rem;
  font-size: 1.4rem;
  line-height: 1.15;
  width: max-content;
  max-width: 16rem;
  z-index: 46;
  text-shadow:
    0 0 5px var(--paper), 0 0 10px var(--paper),
    0 0 16px var(--paper), 0 0 24px var(--paper);
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .squig path { stroke-dashoffset: 0; animation: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .hero { margin-top: 10vh; }
  section { margin-top: 3.6rem; }
  .cord svg { height: 64px; }
  .top { padding-top: 1.1rem; padding-right: 3.4rem; }
}

/* ---------------------------------------------------------------
   print = résumé. ctrl+p swaps the whole lowercase site for the
   real, serious, one-page résumé. the site keeps our secret.
   --------------------------------------------------------------- */
.print-only { display: none; }

@media print {
  @page { margin: 1.5cm; }

  /* everything on screen disappears; only the résumé prints */
  body > *:not(.print-resume) { display: none !important; }
  body::before, body::after { display: none !important; }
  .print-only.print-resume { display: block; }

  body {
    background: #fff;
    color: #111;
    font: 10pt/1.45 Georgia, "Times New Roman", serif;
  }
  .print-resume h1 {
    margin: 0;
    font: 700 19pt/1.1 Georgia, serif;
    letter-spacing: 0.01em;
  }
  .print-resume .r-sub { margin: 2pt 0 0; font-size: 10.5pt; color: #333; }
  .print-resume .r-contact { margin: 3pt 0 0; font-size: 9pt; color: #444; }
  .print-resume header { border-bottom: 1.5pt solid #111; padding-bottom: 6pt; margin-bottom: 8pt; }
  .print-resume h2 {
    font: 700 10.5pt/1.2 Georgia, serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 0.75pt solid #999;
    margin: 10pt 0 4pt;
    padding-bottom: 1.5pt;
  }
  .print-resume h3 { font: 700 10pt/1.3 Georgia, serif; margin: 6pt 0 0; }
  .print-resume .r-meta { font-style: italic; font-size: 9pt; color: #444; margin: 0 0 2pt; }
  .print-resume p { margin: 2pt 0; }
  .print-resume ul { margin: 2pt 0 0; padding-left: 14pt; }
  .print-resume li { margin: 1.5pt 0; }
  .print-resume .r-skills p { margin: 1.5pt 0; }
  .print-resume a { color: #111; text-decoration: none; }
  .print-resume section { break-inside: avoid; margin: 0; }
}
