/*
  claybitner.com shared styles.
  Colours come from the 2025 profile photo: chambray shirt, summer-leaf background, tortoiseshell frames.
  Light mode is the pale shirt; dark mode wears the shirt.
*/

:root {
  color-scheme: light;
  --bg: #eef0f3;
  --panel: #f8f9fb;
  --panel-2: #e4e8ee;
  --ink: #1f2635;
  --muted: #3f485a;
  --line: #cfd4dd;
  --night: #1f2635;
  --night-ink: #f8f9fb;
  --link: #4f6a1f;
  --leaf: #c4d17e;
  --leaf-ink: #1f2635;
  --chambray: #657590;
  --tortoise: #7a3b2a;
  --btn-shadow: #1f2635;
  --focus: #4f6a1f;
  --shade: 31 38 53;
  --shadow:
    0 1px 2px rgb(var(--shade) / .06),
    0 6px 14px rgb(var(--shade) / .08),
    0 18px 36px rgb(var(--shade) / .09);
  --shadow-hover:
    0 2px 4px rgb(var(--shade) / .07),
    0 14px 28px rgb(var(--shade) / .11),
    0 34px 68px rgb(var(--shade) / .13);
  --radius: 8px;
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --spring: cubic-bezier(.3, 1.5, .5, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #46546f;
    --panel: #57688c;
    --panel-2: #5f6e8b;
    --ink: #ffffff;
    --muted: #e2e7ef;
    --line: #8592ab;
    --night: #29324a;
  --tape-alpha: .88;
    --tape-alpha: .88;
    --link: #d6e09a;
    --leaf: #d6e09a;
    --leaf-ink: #1f2635;
    --chambray: #b9c3d3;
    --tortoise: #e3a58c;
    --btn-shadow: #1f2635;
    --focus: #d6e09a;
    --shade: 15 19 28;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #46546f;
  --panel: #57688c;
  --panel-2: #5f6e8b;
  --ink: #ffffff;
  --muted: #e2e7ef;
  --line: #8592ab;
  --night: #29324a;
  --tape-alpha: .88;
  --link: #d6e09a;
  --leaf: #d6e09a;
  --leaf-ink: #1f2635;
  --chambray: #b9c3d3;
  --tortoise: #e3a58c;
  --btn-shadow: #1f2635;
  --focus: #d6e09a;
  --shade: 15 19 28;
}

* {
  box-sizing: border-box;
}

h1, h2, h3 {
  text-wrap: balance;
}

p, li, blockquote {
  text-wrap: pretty;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  scroll-padding-bottom: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: clip;
  transition: background-color .3s ease, color .3s ease;
}

img {
  max-width: 100%;
}

a {
  color: var(--link);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
  transition: background-size .2s ease, color .2s ease;
}

a:hover {
  background-size: 100% .45em;
  background-image: linear-gradient(rgb(from var(--leaf) r g b / .55), rgb(from var(--leaf) r g b / .55));
  color: var(--ink);
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .2s ease;
}

.skip-link:focus {
  transform: none;
  transition: none;
}

.sound-toggle:focus-visible,
.theme-toggle:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.015em;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  font-size: 16px;
  isolation: isolate;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  border-bottom: 1px solid var(--line);
  background: rgb(from var(--bg) r g b / .82);
  backdrop-filter: blur(14px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  background: none;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform .45s var(--spring);
}

.brand:hover {
  background: none;
  color: var(--ink);
}

.brand:hover img {
  transform: rotate(-14deg) scale(1.12);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px 26px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  background: linear-gradient(var(--leaf), var(--leaf)) 0 calc(100% - 10px) / 0 3px no-repeat;
  transition: color .16s ease, background-size .22s var(--spring);
}

.nav a:hover,
.nav a[aria-current] {
  color: var(--ink);
  background-size: 100% 3px;
}

/* ---------- buttons: hop up on hover, squish into the shadow on press ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.button {
  --lift: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 52px;
  padding: 0 24px;
  border: 1.5px solid var(--btn-shadow);
  border-radius: var(--radius);
  background: var(--leaf);
  color: var(--leaf-ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 4px 4px 0 var(--btn-shadow);
  transform: translate(calc(var(--lift) * -1), calc(var(--lift) * -1));
  translate: var(--mx, 0px) var(--my, 0px);
  transition:
    transform .32s var(--spring),
    box-shadow .32s var(--spring),
    translate .25s ease-out,
    background-color .2s ease;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffff;
  border-radius: 50%;
  transform: scale(0);
  opacity: .38;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}

/* The arrow sits in the right padding, so it never pushes the label off centre. */
.button::after {
  content: "→";
  position: absolute;
  right: 7px;
  top: 50%;
  margin-top: -.55em;
  line-height: 1.1;
  opacity: 0;
  transform: translateX(-10px) rotate(-30deg);
  transition: opacity .2s ease, transform .4s var(--spring);
}

.button:hover {
  --lift: 3px;
  background-image: none;
  color: var(--leaf-ink);
  box-shadow: 7px 7px 0 var(--btn-shadow);
  animation: button-wobble .55s ease;
}

.button:hover::before {
  transform: scale(2.4);
}

.button:hover::after {
  opacity: 1;
  transform: none;
}

.button:active {
  --lift: -4px;
  box-shadow: 0 0 0 var(--btn-shadow);
  transition-duration: .08s;
  animation: none;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 0 var(--ink);
}

.button.secondary::before {
  background: var(--leaf);
  opacity: 1;
}

.button.secondary:hover {
  color: var(--leaf-ink);
  border-color: var(--btn-shadow);
  box-shadow: 6px 6px 0 var(--btn-shadow);
}

@keyframes button-wobble {
  0% { rotate: 0deg; }
  25% { rotate: -2.5deg; }
  55% { rotate: 1.5deg; }
  80% { rotate: -.5deg; }
  100% { rotate: 0deg; }
}

/* ---------- link rows ---------- */

.link-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  background: none;
  transition: transform .3s var(--spring), opacity .2s ease, color .2s ease;
}

.link-row::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--leaf);
  transform: translateY(-50%) scale(0);
  transition: transform .35s var(--spring);
}

.link-row span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  text-align: right;
}

.link-row span::after {
  content: "→";
  display: inline-block;
  margin-left: .35em;
  transition: transform .35s var(--spring);
}

.link-row:hover {
  background: none;
  color: var(--ink);
  transform: translateX(10px);
}

.link-row:hover::before {
  transform: translateY(-50%) scale(1.6);
}

.link-row:hover span::after {
  transform: translateX(5px) rotate(-12deg);
}

/* ---------- profile card ---------- */

.profile-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform .4s var(--spring), box-shadow .3s ease;
  isolation: isolate;
  outline: none;
}

.profile-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.profile-card::before,
.profile-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.profile-card::before {
  inset: -14px;
  z-index: -1;
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 24%, rgb(from var(--leaf) r g b / .6), transparent 28%),
    radial-gradient(circle at 84% 30%, rgb(from var(--chambray) r g b / .5), transparent 28%),
    radial-gradient(circle at 60% 100%, rgb(from var(--tortoise) r g b / .3), transparent 32%);
  filter: blur(16px);
  transition: opacity .25s ease;
}

.profile-card::after {
  inset: 14px;
  border-radius: 6px;
  background: linear-gradient(105deg, transparent 20%, rgb(255 255 255 / .5) 42%, transparent 62%);
  translate: -125% 0;
  mix-blend-mode: soft-light;
}

.profile-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
  transform-origin: 50% 65%;
}

.profile-card:hover,
.profile-card:focus-within {
  transform: translateY(-6px) rotate(-1deg) scale(1.01);
  box-shadow: var(--shadow-hover);
  animation: profile-pop .6s cubic-bezier(.2, .9, .25, 1.25);
}

.profile-card:hover::before,
.profile-card:focus-within::before {
  opacity: 1;
}

.profile-card:hover::after,
.profile-card:focus-within::after {
  opacity: 1;
  animation: shimmer-sweep .85s cubic-bezier(.16, 1, .3, 1);
}

.profile-card:hover img,
.profile-card:focus-within img {
  animation: photo-wiggle .7s cubic-bezier(.2, .8, .2, 1);
}

.speck {
  position: absolute;
  z-index: 2;
  top: var(--top, 10%);
  left: var(--left, 85%);
  width: var(--size, 9px);
  height: var(--size, 9px);
  border-radius: 999px;
  background: var(--color, var(--leaf));
  box-shadow: 0 0 0 3px var(--panel);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.profile-card:hover .speck,
.profile-card:focus-within .speck {
  animation: orbit-speck var(--dur, 900ms) cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--delay, 0ms);
}

@keyframes profile-pop {
  35% { transform: translateY(-12px) rotate(-1.5deg) scale(1.02); }
}

@keyframes shimmer-sweep {
  to { translate: 210% 0; }
}

@keyframes photo-wiggle {
  30% { transform: rotate(.6deg) scale(1.015); }
  68% { transform: rotate(-.5deg) scale(1.012); }
}

@keyframes orbit-speck {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  35%, 75% { opacity: .95; }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--x, 12px)), calc(-50% + var(--y, -28px))) scale(1);
  }
}

/* ---------- tape: holds the photo and the cards on ---------- */

.tape {
  position: absolute;
  z-index: 3;
  top: var(--y, 0);
  left: var(--x, 0);
  width: 84px;
  height: 26px;
  background:
    linear-gradient(90deg, rgb(255 255 255 / .18), rgb(255 255 255 / .42) 50%, rgb(255 255 255 / .18)),
    rgb(from var(--tint, var(--leaf)) r g b / var(--tape-alpha, .62));
  box-shadow: 0 1px 2px rgb(var(--shade) / .14);
  clip-path: polygon(0 8%, 6% 0, 12% 10%, 18% 0, 24% 8%, 100% 0, 96% 50%, 100% 100%, 22% 92%, 16% 100%, 10% 90%, 4% 100%, 0 92%, 3% 50%);
  transform: rotate(var(--rot, -8deg));
  transform-origin: 50% 50%;
  pointer-events: none;
  backdrop-filter: blur(1px);
  transition: transform .45s var(--spring);
}

/* the corner peels up a little when you touch what it holds */
.profile-card:hover .tape,
.quote:hover .tape,
.taped:hover .tape {
  transform: rotate(calc(var(--rot, -8deg) * 1.15)) translateY(-3px) scale(1.04);
}

.taped {
  position: relative;
}

/* ---------- particles ---------- */

.particle-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}

.whimsy-particle {
  position: absolute;
  top: var(--py);
  left: var(--px);
  width: var(--size, 8px);
  height: var(--size, 8px);
  border-radius: var(--r, 999px);
  background: var(--color, var(--leaf));
  box-shadow: 0 0 0 2px var(--bg);
  animation: particle-fling var(--dur, 820ms) cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes particle-fling {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0deg); }
  18%, 72% { opacity: .95; }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + (cos(var(--angle)) * var(--distance))),
        calc(-50% + (sin(var(--angle)) * var(--distance)))
      )
      scale(.85)
      rotate(var(--spin, 120deg));
  }
}

/* ---------- theme toggle (sits above the sound toggle) ---------- */

.theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 80;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(from var(--panel) r g b / .9);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: transform .45s var(--spring), background-color .2s ease;
}

.theme-toggle:hover {
  transform: rotate(-24deg) scale(1.08);
  background: var(--leaf);
  color: var(--leaf-ink);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.theme-toggle .moon,
:root.dark .theme-toggle .sun {
  display: none;
}

:root.dark .theme-toggle .moon {
  display: block;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 48px 0 64px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .button {
    translate: none;
  }
}

@media (max-width: 760px) {
  /* Keep the photo's corner tape inside the 16px gutter on phones. */
  .profile-card > .tape:first-of-type { --x: -4px !important; }
  .profile-card > .tape:nth-of-type(2) { --x: calc(100% - 80px) !important; }

  /* The mat is thin on phones, so the resting sticker hangs off the tile's top edge instead. */
  .work-frame + .chip { top: -12px; }
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  .nav a {
    padding-inline: 6px;
  }

  .wrap {
    width: calc(100% - 32px);
  }

  .actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .link-row::before {
    display: none;
  }
}

/* ---------- work tiles: the screenshot lifts and stickers pop out from behind it ---------- */

.work-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  background: none;
  isolation: isolate;
}

.work-tile:hover {
  background: none;
  color: var(--ink);
}

.work-frame {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6%;
  aspect-ratio: var(--ratio, 16 / 11);
  padding: clamp(14px, 2.2vw, 30px) clamp(14px, 2.2vw, 30px) 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--tile, var(--panel-2));
  transition: transform .5s var(--spring), box-shadow .3s ease;
}

.work-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 10px 30px rgb(15 19 28 / .22);
  transform-origin: 50% 100%;
  transition: transform .55s var(--spring);
}

.work-frame.phones img {
  width: 41%;
  border-radius: 20px 20px 0 0;
}

.work-frame.phones img + img {
  margin-bottom: -12%;
}

.work-tile:hover .work-frame,
.work-tile:focus-visible .work-frame {
  transform: translateY(-6px) rotate(var(--tilt, -.8deg));
  box-shadow: var(--shadow-hover);
}

.work-tile:hover .work-frame img,
.work-tile:focus-visible .work-frame img {
  transform: translateY(-10px) scale(1.035);
}

.work-tile:hover .work-frame.phones img + img {
  transform: translateY(-22px) rotate(4deg) scale(1.035);
}

.chip {
  position: absolute;
  z-index: 2;
  top: var(--cy, 12%);
  left: var(--cx, 70%);
  padding: 7px 12px 8px;
  border: 1.5px solid var(--btn-shadow);
  border-radius: 999px;
  background: var(--chip, var(--leaf));
  box-shadow: 3px 3px 0 var(--btn-shadow);
  color: var(--chip-ink, var(--leaf-ink));
  font: 600 13px/1 var(--sans);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(var(--fx, 0px), var(--fy, 28px)) scale(.5) rotate(0deg);
  transition: opacity .18s ease var(--d, 0ms), transform .6s var(--spring) var(--d, 0ms);
}

.chip + .chip { --d: 70ms; --chip: #ffffff; --chip-ink: #1f2635; --cr: 5deg; }
.chip + .chip + .chip { --d: 140ms; --chip: var(--tortoise); --chip-ink: #ffffff; --cr: -3deg; }

:root.dark .chip + .chip + .chip {
  --chip-ink: #1f2635;
}

/* The resting sticker sits up in the coloured mat, clear of the screenshot's headline. */
.work-frame + .chip {
  top: 8px;
  opacity: 1;
  transform: translate(-4px, 4px) scale(.82) rotate(calc(var(--cr, -6deg) * 1.6));
}

.work-tile:hover .chip,
.work-tile:focus-visible .chip {
  opacity: 1;
  transform: translate(0, 0) scale(1) rotate(var(--cr, -6deg));
}

.work-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 16px;
  line-height: 1.4;
}

.work-meta strong {
  font-weight: 600;
}

.work-meta strong::after {
  content: "↗";
  display: inline-block;
  margin-left: .3em;
  color: var(--link);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity .2s ease, transform .4s var(--spring);
}

.work-tile:hover .work-meta strong::after,
.work-tile:focus-visible .work-meta strong::after {
  opacity: 1;
  transform: none;
}

.work-meta span {
  color: var(--muted);
}

.work-tile:focus-visible {
  outline: none;
}

.work-tile:focus-visible .work-frame {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

/* ---------- films: the poster loads first, YouTube only after a click ---------- */

.film {
  position: relative;
  margin: 0;
}

.film-play {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #1f2635;
  cursor: pointer;
}

.film-play img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--spring), filter .3s ease;
}

.film-play:hover img,
.film-play:focus-visible img {
  transform: scale(1.05) rotate(-.6deg);
  filter: saturate(1.12);
}

.film-icon {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  border: 1.5px solid var(--btn-shadow);
  border-radius: 999px;
  background: var(--leaf);
  box-shadow: 4px 4px 0 var(--btn-shadow);
  color: var(--leaf-ink);
  font: 600 15px/1 var(--sans);
  transform-origin: 20% 80%;
  transition: transform .45s var(--spring), box-shadow .3s var(--spring);
}

.film-icon::after {
  content: "Play";
}

.film-icon[data-time]::after {
  content: "Play  " attr(data-time);
  white-space: pre;
}

.film-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform .45s var(--spring);
}

.film-play:hover .film-icon svg,
.film-play:focus-visible .film-icon svg {
  transform: scale(1.25);
}

.film-play:hover .film-icon,
.film-play:focus-visible .film-icon {
  transform: translate(-3px, -3px) rotate(-4deg);
  box-shadow: 7px 7px 0 var(--btn-shadow);
}

.film-play:active .film-icon {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--btn-shadow);
  transition-duration: .08s;
}

.film-play:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.film iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  background: #1f2635;
}

.film figcaption {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.film figcaption strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

/* ---------- a hand-drawn underline ---------- */

.scribble {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.scribble svg {
  position: absolute;
  z-index: -1;
  left: -3%;
  bottom: -.06em;
  width: 106%;
  height: .34em;
  overflow: visible;
  pointer-events: none;
}

.scribble path {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: scribble-draw 1s .45s cubic-bezier(.65, 0, .25, 1) forwards;
}

@keyframes scribble-draw {
  to { stroke-dashoffset: 0; }
}

/* ---------- kind words ---------- */

.word {
  position: relative;
  margin: 0;
  padding: 28px 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform .45s var(--spring), box-shadow .3s ease;
}

.word:nth-child(odd) { --lean: -1deg; }
.word:nth-child(even) { --lean: 1.1deg; }

.word:hover {
  transform: translateY(-6px) rotate(var(--lean));
  box-shadow: var(--shadow-hover);
}

.word blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.32;
}

.word figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
}

.word figcaption strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.word:hover .tape {
  transform: rotate(calc(var(--rot, -8deg) * 1.15)) translateY(-3px) scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .scribble path {
    stroke-dashoffset: 0;
    animation: none;
  }

  .chip {
    transition: none;
  }
}

@media (hover: none) {
  .chip:not(.work-frame + .chip) {
    display: none;
  }
}

.word blockquote p {
  margin: 0;
}

/* ---------- handwritten notes ---------- */

.scrawl {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  color: var(--tortoise);
  font: 600 25px/1 Caveat, "Comic Sans MS", cursive;
  white-space: nowrap;
  pointer-events: none;
  rotate: var(--lean, -6deg);
}

.scrawl svg {
  width: 54px;
  height: 40px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scrawl path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: scribble-draw .8s 1.1s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .scrawl path {
    stroke-dashoffset: 0;
    animation: none;
  }
}

/* ---------- touch: no hover jumps left behind after a tap ---------- */

@media (hover: none) {
  .theme-toggle:hover,
  .card:hover,
  .word:hover,
  .work-tile:hover .work-frame,
  .work-tile:hover .work-frame img {
    transform: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 76px;
  }

  .theme-toggle {
    right: 70px;
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .scrawl {
    font-size: 22px;
  }
}

/* ---------- phone: the floating toggles wait until you've scrolled past the hero ---------- */

@media (max-width: 760px) {
  .theme-toggle,
  .sound-toggle {
    transition: opacity .25s ease, translate .35s var(--spring), visibility .25s;
  }

  :root:not(.past-hero) .theme-toggle,
  :root:not(.past-hero) .sound-toggle {
    opacity: 0;
    visibility: hidden;
    translate: 0 16px;
  }
}

/* ---------- sign-off ---------- */

.sign-off {
  position: static;
  margin: 0 0 22px;
  font-size: 30px;
  --lean: -2deg;
}

.sign-off svg {
  width: 70px;
  height: 30px;
}
