/* Kudo. Warm paper, real motion, nothing shouting. */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-regular.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-regular-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-italic-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #f4eee3;
  --bg-2: #ebe2d2;
  --surface: rgba(255, 252, 246, 0.74);
  --surface-solid: #fffcf6;
  --ink: #1f1b17;
  --ink-2: #6a6057;
  --ink-3: #9a8f84;
  --line: rgba(31, 27, 23, 0.12);
  --line-strong: rgba(31, 27, 23, 0.24);
  --accent: #c8573a;
  --accent-ink: #fff9f3;
  --accent-soft: rgba(200, 87, 58, 0.12);
  --danger: #b8402b;
  --ok: #3f8a5a;
  --env: #e4d4b9;
  --env-2: #ecdfc8;
  --env-3: #d6c3a3;
  --env-inner: #f3e9d8;
  --scrim: rgba(31, 27, 23, 0.4);
  --shadow-s: 0 1px 2px rgba(31, 27, 23, 0.06), 0 4px 12px rgba(31, 27, 23, 0.06);
  --shadow-m: 0 2px 6px rgba(31, 27, 23, 0.08), 0 16px 40px -12px rgba(31, 27, 23, 0.24);
  --shadow-l: 0 8px 20px -6px rgba(31, 27, 23, 0.2), 0 48px 90px -28px rgba(31, 27, 23, 0.4);
  --r-xl: 30px;
  --r-l: 22px;
  --r-m: 16px;
  --r-s: 12px;
  --serif: "Instrument Serif", ui-serif, "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Inter, Roboto, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.64, 0, 0.78, 0);
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --topbar-h: 64px;
  color-scheme: light;
}


/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-soft);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

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

[hidden] {
  display: none !important;
}

em {
  font-style: italic;
}

/* The desk: warm paper with visible fibre, a whisper of grain, and a faint dot grid.
   Colour washes sit on top so the page never reads as flat. */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 50% 50%, rgba(31, 27, 23, 0.16) 50%, transparent 55%) 0 0 / 24px 24px,
    radial-gradient(60% 50% at 8% 0%, rgba(240, 138, 75, 0.2), transparent 70%),
    radial-gradient(50% 45% at 100% 10%, rgba(127, 140, 230, 0.14), transparent 70%),
    radial-gradient(55% 50% at 80% 100%, rgba(67, 168, 120, 0.14), transparent 70%),
    radial-gradient(40% 40% at 0% 100%, rgba(233, 182, 80, 0.14), transparent 70%),
    linear-gradient(180deg, #f6f0e5 0%, #f1e9db 100%);
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.7;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.014 0.06' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.58 0 0 0 0 0.52 0 0 0 0 0.44 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  background-size: 600px 600px;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.36;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ---------- Type ---------- */

.eyebrow {
  margin: 0 0 0.6rem;
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hero__title,
.stage__title,
.sent__title,
.notfound__title,
.shelf__title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}
.hero__title em,
.stage__title em,
.sent__title em,
.notfound__title em {
  color: var(--accent);
}

/* ---------- Top bar: a translucent material the page scrolls under ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 18px;
  pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 55%, transparent), transparent);
  -webkit-mask: linear-gradient(to bottom, #000, transparent);
  mask: linear-gradient(to bottom, #000, transparent);
}
.topbar--quiet {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.topbar--quiet::after {
  display: none;
}
.wordmark {
  font: italic 400 1.7rem/1 var(--serif);
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 4px;
}
.topbar__link {
  font: 500 0.9rem/1 var(--sans);
  text-decoration: none;
  color: var(--ink-2);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color 160ms, border-color 160ms, transform 120ms var(--ease-out);
}
.topbar__link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.topbar__link:active {
  transform: scale(0.96);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font: 600 0.95rem/1 var(--sans);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 110ms var(--ease-out), background-color 160ms, box-shadow 160ms, color 160ms;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: scale(0.965);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 90%, var(--ink));
}
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  border-color: var(--line-strong);
}
.btn--big {
  min-height: 58px;
  padding: 0 28px;
  font-size: 1.05rem;
  width: 100%;
}
.btn--wide {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.btn.is-done {
  background: var(--ok);
  color: #fff;
}

/* ---------- Composer ---------- */

.compose {
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) 40px;
  max-width: 1120px;
  margin: 0 auto;
}
.hero {
  max-width: 720px;
  margin-bottom: clamp(28px, 5vw, 56px);
}
.hero__title {
  font-size: clamp(2.5rem, 4.2vw + 1.3rem, 4.6rem);
}
.hero__sub {
  margin: 1rem 0 0;
  font-size: clamp(1.02rem, 0.4vw + 0.9rem, 1.2rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 40ch;
}

.compose__layout {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .compose__layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
  }
  .preview {
    order: 2;
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
  }
}

.preview__stage {
  perspective: 1200px;
  perspective-origin: 50% 40%;
}
.preview__stage .kudo-card {
  transform-style: preserve-3d;
  will-change: transform;
}
.preview__hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* The desk: where writing happens. */
.desk {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(18px, 3vw, 30px);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.field__label {
  font: 600 0.92rem/1.3 var(--sans);
  color: var(--ink);
  padding: 0;
}
.field__meta {
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 6px;
}
.field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.field__row--from {
  align-items: center;
  flex-wrap: wrap;
}
.field__row--from .field__input {
  flex: 1 1 200px;
}
.field__count {
  font-size: 0.8rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 200ms;
}
.field__count.is-visible {
  opacity: 1;
}
.field__count.is-warn {
  color: var(--danger);
}
.field__input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--surface-solid);
  font-size: 1.05rem;
  line-height: 1.4;
  transition: border-color 140ms, box-shadow 140ms;
  -webkit-appearance: none;
  appearance: none;
}
.field__input::placeholder {
  color: var(--ink-3);
}
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field__textarea {
  resize: none;
  min-height: 130px;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.32;
  letter-spacing: -0.005em;
}
.field__textarea::placeholder {
  font-style: italic;
}
.field__error {
  margin: 0;
  min-height: 0;
  font-size: 0.85rem;
  color: var(--danger);
  max-height: 0;
  overflow: hidden;
  transition: max-height 240ms var(--ease-out), margin 240ms;
}
.field.has-error .field__error {
  max-height: 3em;
  margin-top: 2px;
}
.field.has-error .field__input,
.field.has-error .chips {
  border-color: var(--danger);
}
.field.is-shaking {
  animation: shake 420ms var(--ease-out);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.nudge {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 1.4em;
}
.nudge__btn {
  font: 500 0.85rem/1 var(--sans);
  color: var(--accent);
  padding: 6px 0;
  border-radius: 4px;
}
.nudge__btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nudge__text {
  font: italic 400 1rem/1.3 var(--serif);
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms, transform 400ms var(--ease-out);
}
.nudge__text.is-in {
  opacity: 1;
  transform: none;
}

/* Feeling chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
  border: 1px solid transparent;
  border-radius: var(--r-m);
}
.chip {
  --c: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 14px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  font: 500 0.9rem/1 var(--sans);
  transition: transform 120ms var(--ease-out), background-color 180ms, border-color 180ms, box-shadow 180ms;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.chip:active {
  transform: scale(0.95);
}
.chip__glyph {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  color: var(--c);
  transition: background-color 180ms, color 180ms, transform 240ms var(--pop);
}
.chip__glyph .glyph {
  width: 16px;
  height: 16px;
}
.chip[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface-solid));
  box-shadow: 0 0 0 1px var(--c) inset;
}
.chip[aria-pressed="true"] .chip__glyph {
  background: var(--c);
  color: #fff;
  transform: rotate(-8deg) scale(1.06);
}
.chip.is-full {
  opacity: 0.5;
}
.chips.is-wiggling {
  animation: wiggle 500ms var(--ease-out);
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
  75% { transform: rotate(-0.5deg); }
}

/* Paper swatches */
.papers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 0;
}
.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--sw1), var(--sw2));
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 0 0 2px var(--bg) inset, var(--shadow-s);
  transition: transform 200ms var(--pop), box-shadow 200ms;
  position: relative;
}
.swatch:hover {
  transform: scale(1.08);
}
.swatch:active {
  transform: scale(0.94);
}
.swatch[aria-checked="true"] {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px var(--bg) inset, 0 0 0 2px var(--ink);
}
.swatch__name {
  position: absolute;
  inset: auto;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Checkbox */
.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 0.9rem/1 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.check__box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-solid);
  display: grid;
  place-items: center;
  transition: background-color 160ms, border-color 160ms, transform 160ms var(--pop);
}
.check__box::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: 60% 60%;
  transition: transform 200ms var(--pop);
  margin-top: -2px;
}
.check input:checked + .check__box {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked + .check__box::after {
  transform: rotate(45deg) scale(1);
}
.check input:focus-visible + .check__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.check:active .check__box {
  transform: scale(0.9);
}
.field--from.is-anon .field__input {
  opacity: 0.45;
  pointer-events: none;
}

.desk__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding-top: 6px;
}
.desk__note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-3);
  text-align: center;
}

/* ---------- The kudo card ---------- */

.kudo-card {
  --paper-bg: #f8efdd;
  --paper-bg2: #f1e3c6;
  --paper-ink: #2c2118;
  --paper-accent: #c56a3e;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(28px, 6%, 34px) clamp(26px, 6%, 32px);
  border-radius: var(--r-l);
  background: linear-gradient(160deg, var(--paper-bg), var(--paper-bg2));
  color: var(--paper-ink);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--paper-ink) 9%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    var(--shadow-m);
  isolation: isolate;
  overflow: visible;
  max-width: 100%;
}
.kudo-card.is-dark-paper {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow-m);
}
.kudo-card__grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.6 0 0 0 0 0.6 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
.kudo-card.is-dark-paper .kudo-card__grain {
  mix-blend-mode: screen;
  opacity: 0.12;
}
.kudo-card > *:not(.kudo-card__grain) {
  position: relative;
  z-index: 1;
}
.kudo-card__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 14px;
}
.kudo-card__head::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin-top: 14px;
  border-radius: 2px;
  background: var(--paper-accent);
  opacity: 0.7;
}
.kudo-card__for {
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.62;
}
.kudo-card__to {
  font: italic 400 clamp(1.7rem, 2.4vw + 1rem, 2.1rem)/1.1 var(--serif);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.kudo-card__msg {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.3;
  letter-spacing: -0.008em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.kudo-card__msg.msg--l { font-size: 1.62rem; }
.kudo-card__msg.msg--m { font-size: 1.38rem; }
.kudo-card__msg.msg--s { font-size: 1.18rem; line-height: 1.36; }
.kudo-card__msg.msg--xs { font-size: 1.04rem; line-height: 1.42; }
.kudo-card__msg.is-placeholder {
  opacity: 0.4;
  font-style: italic;
}
.kudo-card__msg .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 520ms var(--d, 0ms), transform 640ms var(--ease-out) var(--d, 0ms);
}
.kudo-card__msg.is-shown .w {
  opacity: 1;
  transform: none;
}
.kudo-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
  font: 500 0.82rem/1.2 var(--sans);
}
.kudo-card__from {
  color: var(--paper-accent);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.kudo-card__date {
  opacity: 0.55;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Stickers sit on the card's edges like real ones would. */
.kudo-card > .kudo-card__stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.sticker {
  --sticker: var(--accent);
  --size: 56px;
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--sticker) 65%, #fff), var(--sticker) 62%, color-mix(in srgb, var(--sticker) 82%, #000));
  color: #fff;
  box-shadow: 0 0 0 3px var(--paper-bg, var(--surface-solid)), 0 6px 14px -4px rgba(0, 0, 0, 0.35), inset 0 -2px 4px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  will-change: transform;
}
.sticker .glyph {
  width: 52%;
  height: 52%;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}
.sticker--0 { top: -32px; right: -24px; transform: rotate(12deg); }
.sticker--1 { top: 44%; left: -36px; transform: rotate(-10deg); }
.sticker--2 { bottom: -36px; right: 14%; transform: rotate(7deg); }
.sticker--3 { top: -32px; left: 16%; transform: rotate(-6deg); }
.sticker.is-entering {
  animation: sticker-in 520ms var(--pop) both;
}
.sticker.is-leaving {
  animation: sticker-out 260ms var(--ease-in) both;
}
@keyframes sticker-in {
  from { scale: 0.2; opacity: 0; }
  to { scale: 1; opacity: 1; }
}
@keyframes sticker-out {
  to { scale: 0.3; opacity: 0; }
}
.sticker.is-floating {
  animation: float 5.2s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
.sticker--tappable {
  cursor: pointer;
  transition: filter 160ms;
}
.sticker--tappable:hover {
  filter: brightness(1.06);
}

.kudo-card--compact {
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: 18px;
}
.kudo-card--compact .kudo-card__head { padding-bottom: 8px; }
.kudo-card--compact .kudo-card__head::after { margin-top: 8px; width: 30px; }
.kudo-card--compact .kudo-card__to { font-size: 1.35rem; }
.kudo-card--compact .kudo-card__msg { font-size: 1rem !important; line-height: 1.35; }
.kudo-card--compact .kudo-card__foot { font-size: 0.72rem; }
.kudo-card--compact .sticker { --size: 36px; }
.kudo-card--compact .sticker--0 { top: -22px; right: -14px; }
.kudo-card--compact .sticker--1 { left: -24px; }
.kudo-card--compact .sticker--2 { bottom: -24px; }
.kudo-card--compact .sticker--3 { top: -22px; }

/* ---------- Shelf ---------- */

.shelf {
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.shelf__title {
  font-size: clamp(1.9rem, 2vw + 1rem, 2.6rem);
}
.shelf__sub {
  margin: 0.6rem 0 1.6rem;
  color: var(--ink-2);
  max-width: 48ch;
}
.shelf__group + .shelf__group {
  margin-top: 28px;
}
.shelf__label {
  margin: 0 0 12px;
  font: 600 0.8rem/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.shelf__row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 34px 26px 30px;
  margin: 0 -26px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.shelf__row::-webkit-scrollbar {
  display: none;
}
.mini {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  transition: transform 220ms var(--ease-out);
}
.mini:hover {
  transform: translateY(-4px);
}
.mini:active {
  transform: scale(0.98);
}
.mini .kudo-card__msg {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.mini__status {
  margin: 34px 4px 0;
  font-size: 0.78rem;
  color: var(--ink-3);
}

/* ---------- Envelope ---------- */

.envelope-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  width: 100%;
}
.envelope {
  --env-w: min(88vw, 400px);
  --env-h: calc(var(--env-w) * 0.66);
  position: relative;
  width: var(--env-w);
  height: var(--env-h);
  perspective: 1400px;
  transform-style: preserve-3d;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 30px 40px rgba(31, 27, 23, 0.22));
  will-change: transform, opacity;
}
.envelope__back {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: var(--env);
  z-index: 1;
}
.envelope__back::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--env-inner);
  clip-path: inset(0 round 18px);
}
.envelope__card-slot {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  top: 0;
  z-index: 2;
}
.envelope__card-slot .kudo-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(var(--env-h) * 1.02);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper-ink) 9%, transparent), 0 -6px 24px -12px rgba(0, 0, 0, 0.3);
  will-change: transform;
  cursor: grab;
}
.envelope__card-slot .kudo-card:active {
  cursor: grabbing;
}
.envelope__card-slot .kudo-card .kudo-card__stickers {
  display: none;
}
.envelope__front {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--env-2), var(--env));
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.envelope__front::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.18), transparent 45%, rgba(0, 0, 0, 0.05));
}
.envelope__flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 58%;
  z-index: 4;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, var(--env-3), var(--env));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transform: rotateX(0deg);
  will-change: transform;
  pointer-events: none;
}
.envelope.is-past-half .envelope__flap {
  z-index: 0;
}
.envelope__seal {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 5;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--paper-bg, var(--bg));
  background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--paper-accent, var(--accent)) 70%, #fff), var(--paper-accent, var(--accent)) 55%, color-mix(in srgb, var(--paper-accent, var(--accent)) 72%, #000));
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.22), inset 0 2px 3px rgba(255, 255, 255, 0.25), 0 6px 14px -4px rgba(0, 0, 0, 0.4);
  will-change: transform, opacity;
}
.envelope__seal .glyph {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.15));
}
.envelope__seal--btn {
  transition: filter 160ms;
}
.envelope__seal--btn:hover {
  filter: brightness(1.05);
}
.envelope.is-past-half .envelope__seal {
  visibility: hidden;
  pointer-events: none;
}
.envelope-wrap.is-detached {
  position: absolute;
  inset: 0;
  justify-content: center;
  pointer-events: none;
}

.stage__hint {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 0.9rem/1 var(--sans);
  color: var(--ink-2);
  transition: opacity 300ms;
}
.stage__arrow {
  width: 10px;
  height: 10px;
  border: solid currentColor;
  border-width: 2px 0 0 2px;
  transform: rotate(45deg);
  margin-top: 4px;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { translate: 0 2px; }
  50% { translate: 0 -3px; }
}

/* ---------- Open page ---------- */

.open {
  min-height: calc(100svh - var(--topbar-h));
  display: flex;
  align-items: stretch;
  padding: 0 clamp(16px, 4vw, 40px) 48px;
}
.stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vh, 48px);
  min-height: calc(100svh - var(--topbar-h) - 48px);
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.stage__intro {
  text-align: center;
  transition: opacity 400ms, transform 500ms var(--ease-out);
}
.stage__intro.is-out {
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
}
.stage__title {
  font-size: clamp(2.4rem, 4vw + 1.4rem, 4rem);
}

.reveal {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-top: 12px;
}
.reveal__card {
  width: 100%;
  max-width: 480px;
  perspective: 1200px;
}
.reveal__card .kudo-card {
  will-change: transform, max-height;
}
.reveal__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms, transform 700ms var(--ease-out);
}
.reveal__actions.is-in {
  opacity: 1;
  transform: none;
}
.reveal__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.reveal__heart-note,
.reveal__saved {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-3);
  text-align: center;
  min-height: 1.3em;
}
.reveal__saved a {
  color: var(--ink-2);
  text-underline-offset: 3px;
}

/* Heart button: press to send, hold to keep them coming. */
.heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 24px 0 16px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  font: 600 1rem/1 var(--sans);
  color: var(--ink);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.heart-btn__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, #e7647a 16%, transparent);
  position: relative;
}
.heart-btn__icon::before {
  content: "";
  width: 18px;
  height: 18px;
  background: #e7647a;
  clip-path: path("M9 17C5.2 13.6 2 11.2 2 7.9A3.6 3.6 0 0 1 9 5.9a3.6 3.6 0 0 1 7 2c0 3.3-3.2 5.7-7 9.1Z");
  transform-origin: 50% 55%;
}
.heart-btn.is-hot .heart-btn__icon {
  background: #e7647a;
}
.heart-btn.is-hot .heart-btn__icon::before {
  background: #fff;
}

/* ---------- Sent page ---------- */

.sent {
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) 60px;
  max-width: 1040px;
  margin: 0 auto;
}
.sent__hero {
  max-width: 640px;
  margin-bottom: clamp(28px, 5vw, 48px);
}
.sent__title {
  font-size: clamp(2.2rem, 3.4vw + 1.2rem, 3.8rem);
}
.sent__layout {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 860px) {
  .sent__layout {
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
  }
}
.sent__preview {
  perspective: 1200px;
}
.sent__preview .kudo-card {
  transform: rotate(-1.5deg);
}
.sent__panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.linkbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
}
.linkbox__label {
  font: 600 0.8rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.linkbox__row {
  display: flex;
  gap: 10px;
}
.linkbox__input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  color: var(--ink-2);
}
.linkbox__input:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--ink);
}
.status {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 400ms, background-color 400ms;
}
.status__dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: #e0a33a;
  box-shadow: 0 0 0 0 rgba(224, 163, 58, 0.5);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 163, 58, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(224, 163, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 163, 58, 0); }
}
.status.is-opened {
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, var(--surface));
}
.status.is-opened .status__dot {
  background: var(--ok);
  animation: none;
}
.status__title {
  margin: 0;
  font-weight: 600;
}
.status__sub {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.sent__note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.sent__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Sealing overlay (compose) ---------- */

.seal-stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 320ms;
}
.seal-stage.is-in {
  opacity: 1;
}
.seal-stage .envelope__card-slot .kudo-card {
  cursor: default;
}
.seal-stage .envelope__flap {
  transform: rotateX(-180deg);
}
.seal-stage .envelope__seal {
  opacity: 0;
}

/* ---------- Not found ---------- */

.notfound {
  min-height: calc(100svh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding: 40px clamp(16px, 4vw, 40px) 80px;
  max-width: 640px;
  margin: 0 auto;
}
.notfound__title {
  font-size: clamp(2.4rem, 4vw + 1rem, 4rem);
}
.notfound__sub {
  margin: 0 0 8px;
  color: var(--ink-2);
}

/* ---------- Footer, toast, effects ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 70;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 0.9rem/1.3 var(--sans);
  text-align: center;
  box-shadow: var(--shadow-m);
  opacity: 0;
  transform: translate(-50%, 20px) scale(0.96);
  transition: opacity 240ms, transform 420ms var(--ease-out);
  pointer-events: none;
}
.toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* ---------- Accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
  }
  .stage__arrow,
  .sticker.is-floating,
  .status__dot {
    animation: none !important;
  }
  .kudo-card__msg .w {
    transform: none;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .desk,
  .linkbox,
  .status,
  .seal-stage {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--surface-solid);
  }
}
@media (prefers-contrast: more) {
  .field__input,
  .chip,
  .btn--ghost,
  .heart-btn {
    border-color: var(--ink);
  }
}

/* Room for stickers that hang over the card's edges. */
.preview__stage,
.reveal__card,
.sent__preview {
  padding: 30px 30px 34px;
  margin: -30px -30px -34px;
}

/* ---------- Topbar extras ---------- */

.topbar__nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.topbar__link--quiet {
  border-color: transparent;
  background: transparent;
}
.btn--small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.88rem;
}

/* ---------- Wall banner on the composer ---------- */

.wall-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -8px 0 28px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  width: fit-content;
  max-width: 100%;
}
.wall-banner__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.wall-banner__text a {
  color: var(--ink);
  text-decoration: none;
}
.wall-banner__pin,
.wall-chip__pin,
.postcard__pin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f29bab, #c24169 70%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 -1px 2px rgba(0, 0, 0, 0.2);
  flex: 0 0 auto;
}

/* ---------- Voice recorder ---------- */

.voice {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 48px;
}
.voice__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  font: 500 0.92rem/1 var(--sans);
  color: var(--ink);
  transition: transform 110ms var(--ease-out), border-color 160ms, background-color 160ms;
}
.voice__btn:active {
  transform: scale(0.97);
}
.voice__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d94343;
  box-shadow: 0 0 0 3px rgba(217, 67, 67, 0.18);
}
.voice__btn.is-recording {
  border-color: #d94343;
  background: rgba(217, 67, 67, 0.08);
}
.voice__btn.is-recording .voice__dot {
  border-radius: 3px;
  animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(217, 67, 67, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(217, 67, 67, 0.08); }
}
.voice__meter {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}
.voice__meter i {
  display: block;
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleY(0.12);
  transform-origin: 50% 50%;
  transition: transform 60ms linear;
}
.voice__time {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.voice__done {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
}
.voice__play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.voice__play::before {
  content: "";
  position: absolute;
  left: 55%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--accent-ink);
}
.voice__play.is-playing::before {
  left: 50%;
  border-width: 0;
  width: 11px;
  height: 12px;
  background: linear-gradient(to right, var(--accent-ink) 0 35%, transparent 35% 65%, var(--accent-ink) 65%);
}
.voice__len {
  font-size: 0.88rem;
  color: var(--ink-2);
}
.voice__remove {
  font: 500 0.85rem/1 var(--sans);
  color: var(--accent);
  padding: 6px 4px;
}

/* ---------- Unlock later ---------- */

.check--row {
  padding: 4px 0;
}
.unlock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}
.unlock .field__input {
  max-width: 320px;
}
.unlock__note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* ---------- Walls: start one ---------- */

.walls {
  margin-top: clamp(56px, 8vw, 96px);
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@media (min-width: 800px) {
  .walls {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 40px;
  }
}
.walls__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 2vw + 1rem, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.walls__title em {
  color: var(--accent);
}
.walls__sub {
  margin: 0.6rem 0 0;
  color: var(--ink-2);
  max-width: 44ch;
}
.walls__form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.walls__form .field__input {
  flex: 1 1 200px;
}

/* ---------- Shelf badges ---------- */

.mini__status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mini__badge {
  font: 600 0.72rem/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.mini__badge--opened {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.mini__badge--sealed {
  color: #b27e12;
  border-color: rgba(178, 126, 18, 0.4);
}
.mini__meta {
  font-size: 0.78rem;
  color: var(--ink-3);
}
.mini__reaction {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sticker);
  color: #fff;
  box-shadow: 0 0 0 2px var(--bg);
}
.mini__reaction .glyph {
  width: 13px;
  height: 13px;
}
.shelf__walls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wall-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  text-decoration: none;
  font: 500 0.92rem/1 var(--sans);
  color: var(--ink);
  transition: transform 160ms var(--ease-out), border-color 160ms;
}
.wall-chip:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

/* ---------- Open page: countdown, shake, voice, reactions, pass it along ---------- */

.countdown {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 22px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
}
.countdown__label {
  margin: 0;
  font: 600 0.78rem/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.countdown__time {
  margin: 2px 0;
  font: 400 2.2rem/1 var(--serif);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.countdown__note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.shake-btn {
  font: 500 0.88rem/1 var(--sans);
  color: var(--ink-2);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
}

.voice-play {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 22px 0 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 600 0.95rem/1 var(--sans);
  box-shadow: var(--shadow-m);
  transition: transform 110ms var(--ease-out);
}
.voice-play:active {
  transform: scale(0.97);
}
.voice-play__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex: 0 0 auto;
}
.voice-play__icon::before {
  content: "";
  position: absolute;
  left: 56%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent #fff;
}
.voice-play.is-playing .voice-play__icon::before {
  left: 50%;
  border-width: 0;
  width: 10px;
  height: 12px;
  background: linear-gradient(to right, #fff 0 35%, transparent 35% 65%, #fff 65%);
}
.voice-play__bars {
  display: none;
  align-items: center;
  gap: 3px;
  height: 20px;
}
.voice-play.is-playing .voice-play__bars {
  display: inline-flex;
}
.voice-play__bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--bg);
  animation: bars 0.9s ease-in-out infinite;
  transform-origin: 50% 50%;
}
.voice-play__bars i:nth-child(2) { animation-delay: 0.15s; }
.voice-play__bars i:nth-child(3) { animation-delay: 0.3s; }
.voice-play__bars i:nth-child(4) { animation-delay: 0.45s; }
.voice-play__bars i:nth-child(5) { animation-delay: 0.6s; }
@keyframes bars {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.reactions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
}
.reactions__label {
  margin: 0;
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.reactions__row {
  display: flex;
  gap: 10px;
}
.reaction {
  --c: var(--accent);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 16%, var(--surface-solid));
  border: 1.5px solid transparent;
  color: var(--c);
  transition: transform 140ms var(--pop), background-color 160ms, border-color 160ms, color 160ms;
  will-change: transform;
}
.reaction .glyph {
  width: 24px;
  height: 24px;
}
.reaction:hover {
  transform: translateY(-2px) scale(1.05);
}
.reaction[aria-pressed="true"] {
  background: var(--c);
  color: #fff;
  border-color: color-mix(in srgb, var(--c) 60%, #000);
  box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--c) 70%, transparent);
}

.pass {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pass__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
}
.pass__text {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.3;
  min-height: 72px;
  resize: none;
}
.pass__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pass__share {
  text-align: center;
}
.pass__note {
  margin: 0 0 10px;
  color: var(--ink-2);
}

/* Lines added along the way, inside the card */
.kudo-card__lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px dashed color-mix(in srgb, var(--paper-ink) 25%, transparent);
}
.kudo-card__line {
  margin: 0;
  font: 400 1.05rem/1.35 var(--serif);
  overflow-wrap: anywhere;
}
.kudo-card__line strong {
  font: 600 0.78rem/1 var(--sans);
  color: var(--paper-accent);
  margin-right: 4px;
}
.kudo-card--compact .kudo-card__lines {
  display: none;
}

/* ---------- Sent page extras ---------- */

.linkbox__extras {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.linkbox__extras a {
  color: var(--ink-2);
  text-underline-offset: 3px;
}
.status__body {
  min-width: 0;
  flex: 1;
}
.status__reaction {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.9rem;
}
.status__sticker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sticker);
  color: #fff;
  box-shadow: 0 0 0 2px var(--surface-solid);
  flex: 0 0 auto;
}
.status__sticker .glyph {
  width: 16px;
  height: 16px;
}
.status__lines {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.status__lines-title {
  margin: 0 0 6px;
  font: 600 0.78rem/1.3 var(--sans);
  color: var(--ink-2);
}
.status__lines .kudo-card__line {
  font-size: 1rem;
}
.status__lines .kudo-card__line strong {
  color: var(--accent);
}

/* ---------- Wall page ---------- */

.wall {
  padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 40px) 80px;
  max-width: 1200px;
  margin: 0 auto;
}
.wall__hero {
  max-width: 720px;
  margin-bottom: clamp(28px, 5vw, 48px);
}
.wall__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 4vw + 1.2rem, 4.2rem);
  letter-spacing: -0.022em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}
.wall__sub {
  margin: 0.8rem 0 0;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.wall__admin {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 520px;
}
.wall__admin p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 40px 30px;
  padding: 30px 10px 10px;
}
.postcard {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  transform: rotate(var(--lean, 0deg));
  transition: transform 260ms var(--ease-out);
  will-change: transform;
}
.postcard:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  z-index: 2;
}
.postcard__pin {
  position: absolute;
  top: -8px;
  left: 50%;
  margin-left: -8px;
  width: 16px;
  height: 16px;
  z-index: 5;
}
.postcard .kudo-card__msg {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.wall__empty {
  text-align: center;
  padding: 60px 0;
  color: var(--ink-2);
}
.wall__empty p {
  margin: 0 0 16px;
  font: italic 400 1.4rem/1.3 var(--serif);
}

/* ---------- Print page ---------- */

.print {
  padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 40px) 80px;
  max-width: 980px;
  margin: 0 auto;
}
.print__intro {
  margin: 0 0 28px;
  color: var(--ink-2);
  max-width: 56ch;
}
.print__sheet {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
@media (min-width: 820px) {
  .print__sheet {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.print__front,
.print__back {
  width: 100%;
  max-width: 420px;
  min-height: 300px;
}
.print__back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 34px;
  border-radius: var(--r-l);
  background: #fff;
  color: var(--paper-ink);
  border: 1.5px dashed color-mix(in srgb, var(--paper-ink) 30%, transparent);
  text-align: center;
}
.print__qr {
  width: 150px;
  height: 150px;
}
.print__qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.print__scan {
  margin: 0;
  font: 400 1.1rem/1.3 var(--serif);
  max-width: 24ch;
}
.print__link {
  margin: 0;
  font: 500 0.78rem/1.3 var(--sans);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.print__brand {
  margin: 8px 0 0;
  font: italic 400 1.3rem/1 var(--serif);
  color: var(--paper-accent);
}
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; }
  .bg, .print-hide, .toast, .fx-canvas { display: none !important; }
  .print { padding: 0; max-width: none; }
  .print__sheet { grid-template-columns: 1fr 1fr; gap: 12mm; }
  .print__front, .print__back { box-shadow: none !important; max-width: none; break-inside: avoid; }
  .kudo-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sticker { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Agents page ---------- */

.docs {
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) 80px;
  max-width: 760px;
  margin: 0 auto;
}
.docs__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 3.6vw + 1.2rem, 3.8rem);
  letter-spacing: -0.022em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}
.docs__title em {
  color: var(--accent);
}
.docs__lead {
  margin: 1rem 0 0;
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 56ch;
}
.docs__section {
  margin-top: 40px;
}
.docs__section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.8rem;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}
.docs__section p {
  margin: 0 0 12px;
  color: var(--ink-2);
}
.docs__section code {
  font: 0.88em/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--ink);
}
.docs__code {
  margin: 12px 0 16px;
  padding: 16px 18px;
  border-radius: var(--r-m);
  background: var(--ink);
  color: var(--bg);
  overflow-x: auto;
  font: 0.86rem/1.5 ui-monospace, "SF Mono", Menlo, monospace;
}
.docs__code code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.docs__list {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--ink-2);
}
.docs__list li {
  margin-bottom: 8px;
}
.docs a {
  color: var(--accent);
  text-underline-offset: 3px;
}
