*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
:root {
  --bg: #1b1f1a;
  --line: rgba(242, 216, 167, 0.05);
  --card: #232823;
  --card-2: #2b312a;
  --ink: #f2ecdf;
  --sub: #b8b2a4;
  --straw: #e3a5b1;
  --mug: #96a886;
  --border: rgba(242, 236, 223, 0.15);
  --shadow: rgba(0, 0, 0, 0.5);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #faf6ee;
  --line: rgba(38, 48, 43, 0.06);
  --card: #fffdfa;
  --card-2: #f3eee2;
  --ink: #26302b;
  --sub: #5a5f55;
  --straw: #9b5968;
  --mug: #627058;
  --border: rgba(38, 48, 43, 0.18);
  --shadow: rgba(38, 48, 43, 0.16);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { touch-action: manipulation; }
a { color: var(--straw); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--straw);
  outline-offset: 3px;
}
.page {
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 23px, var(--line) 23px, var(--line) 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, var(--line) 23px, var(--line) 24px);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: max(14px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 14px max(22px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.wordmark {
  color: var(--ink);
  font: 800 15px/1 ui-monospace, monospace;
  letter-spacing: 2px;
  text-decoration: none;
}
.wordmark span { color: var(--straw); }
.topbar nav { display: flex; justify-content: center; gap: 8px; }
.topbar nav a, .theme-toggle {
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-2);
  padding: 6px 11px;
  font: 600 10px/1.2 ui-monospace, monospace;
  letter-spacing: 0.9px;
  text-decoration: none;
}
.topbar nav a[aria-current="page"] { color: var(--ink); border-color: var(--straw); }
.theme-toggle { cursor: pointer; }
.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(38px, 7vw, 80px) max(22px, env(safe-area-inset-right)) 64px max(22px, env(safe-area-inset-left));
}
.intro { max-width: 760px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--mug);
  font: 700 11px/1.4 ui-monospace, monospace;
  letter-spacing: 3px;
}
h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
h1 span { color: var(--straw); font-size: 0.42em; letter-spacing: 0; }
.intro > p:last-child {
  max-width: 64ch;
  margin: 22px 0 0;
  color: var(--sub);
  font-size: 15px;
  line-height: 1.7;
}
.signature-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.2fr);
  gap: 12px 28px;
  align-items: end;
  margin: 34px 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--straw);
  border-radius: 9px;
  background: var(--card);
}
.signature-card h2 {
  margin: 0 0 5px;
  font: 700 13px/1.3 ui-monospace, monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.signature-card h2 span { color: var(--mug); font-size: 9px; }
.signature-card p { margin: 0; color: var(--sub); font-size: 12px; line-height: 1.5; }
.signature-form { display: flex; gap: 8px; }
.signature-form input {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  padding: 9px 11px;
}
.signature-form button {
  color: var(--ink);
  border: 1px dashed var(--straw);
  border-radius: 6px;
  background: var(--card-2);
  padding: 8px 12px;
  font: 700 10px/1.2 ui-monospace, monospace;
  letter-spacing: 0.7px;
  cursor: pointer;
}
.signature-status { grid-column: 2; font-family: ui-monospace, monospace; }
.chalk-card {
  margin-top: 18px;
  padding: clamp(14px, 2.5vw, 24px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 14px 34px -18px var(--shadow);
}
.chalk-boardwrap {
  position: relative;
  overflow: hidden;
  border: clamp(7px, 1.3vw, 11px) solid #57452f;
  border-radius: 8px;
  background: #26302a;
  box-shadow: inset 0 0 44px rgba(0, 0, 0, 0.35);
}
.chalk-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: radial-gradient(120% 90% at 50% 40%, rgba(242, 236, 223, 0.05), transparent 70%);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.chalk-canvas--live { position: absolute; inset: 0; height: 100%; background: none; pointer-events: none; }
.chalk-canvas.is-drawing { cursor: crosshair; touch-action: none; }
.chalk-tip, .chalk-livetag {
  position: absolute;
  z-index: 2;
  max-width: calc(100% - 8px);
  overflow: hidden;
  color: #f2ecdf;
  white-space: nowrap;
  pointer-events: none;
  text-overflow: ellipsis;
}
.chalk-tip {
  padding: 2px 8px;
  border: 1px solid rgba(242, 236, 223, 0.2);
  border-radius: 5px;
  background: #2b312a;
  font: 10px/1.5 ui-monospace, monospace;
}
.chalk-livetag {
  font: 15px/1.2 "Comic Sans MS", cursive;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  transition: left 0.08s linear, top 0.08s linear;
}
.chalk-tray { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.chalk-pickup, .chalk-tool, .chalk-identity-link {
  min-height: 34px;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  padding: 6px 10px;
  font: 600 10px/1.25 ui-monospace, monospace;
  letter-spacing: 0.75px;
  cursor: pointer;
}
.chalk-pickup { border-style: dashed; border-color: var(--straw); font-size: 11px; }
.chalk-tool:hover, .chalk-identity-link:hover { border-color: var(--straw); }
.chalk-tool.danger { color: var(--straw); }
.chalk-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chalk-tools[hidden] { display: none; }
.chalk-stick {
  width: 34px;
  height: 14px;
  padding: 0;
  border: 1px solid rgba(242, 236, 223, 0.25);
  border-radius: 3px;
  cursor: pointer;
}
.chalk-stick--0 { background: #f2ecdf; }
.chalk-stick--1 { background: #edb2c0; }
.chalk-stick--2 { background: #a9c79b; }
.chalk-stick--3 { background: #9fbad1; }
.chalk-stick--4 { background: #efd9a7; }
.chalk-stick--5 { background: #c4b5e0; }
.chalk-stick:nth-child(odd) { transform: rotate(-2deg); }
.chalk-stick:nth-child(even) { transform: rotate(2deg); }
.chalk-stick.is-active, .chalk-tool.is-active, .chalk-size.is-active { outline: 2px solid var(--straw); outline-offset: 2px; }
.chalk-sizes { display: inline-flex; align-items: center; gap: 4px; }
.chalk-size {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}
.chalk-size::after { content: ""; display: block; border-radius: 50%; background: var(--sub); }
.chalk-size--0::after { width: 3px; height: 3px; }
.chalk-size--1::after { width: 6px; height: 6px; }
.chalk-size--2::after { width: 10px; height: 10px; }
.chalk-size.is-active::after { background: var(--ink); }
.chalk-identity {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding-left: 7px;
  border-left: 2px solid var(--straw);
}
.chalk-identity-name {
  max-width: 170px;
  overflow: hidden;
  font: 700 9px/1.3 ui-monospace, monospace;
  letter-spacing: 0.6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chalk-identity-link { min-height: 28px; padding: 4px 7px; color: var(--mug); font-size: 8px; }
.chalk-status {
  margin-left: auto;
  color: var(--sub);
  font: 600 9px/1.4 ui-monospace, monospace;
  letter-spacing: 0.8px;
}
.chalk-dust {
  position: absolute;
  z-index: 1;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(242, 236, 223, 0.5);
  filter: blur(1px);
  pointer-events: none;
  animation: chalk-dust 0.9s ease-out forwards;
}
@keyframes chalk-dust {
  from { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(calc(-50% + var(--dust-dx, 8px)), calc(-50% - 26px)) scale(2.2); }
}
.chalk-wipe {
  position: absolute;
  inset-block: 0;
  left: -25%;
  z-index: 1;
  width: 22%;
  background: linear-gradient(90deg, transparent, rgba(242, 236, 223, 0.08), rgba(20, 26, 22, 0.35), transparent);
  pointer-events: none;
  animation: chalk-wipe 0.55s ease-in-out forwards;
}
@keyframes chalk-wipe { to { left: 105%; } }
.house-note {
  margin: 18px 0 0;
  color: var(--sub);
  text-align: center;
  font: 10px/1.6 ui-monospace, monospace;
  letter-spacing: 0.5px;
}
.not-found { max-width: 680px; margin: 18vh auto 0; padding: 24px; }
.not-found h1 { font-size: clamp(36px, 7vw, 64px); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; gap: 12px; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  .signature-card { grid-template-columns: 1fr; }
  .signature-status { grid-column: 1; }
  .chalk-pickup { flex: 1 1 100%; min-height: 44px; }
  .chalk-status { flex: 1 0 100%; margin-left: 0; }
  .chalk-stick { width: 44px; height: 28px; }
  .chalk-size, .chalk-tool, .chalk-identity-link { min-height: 44px; }
  .chalk-identity { flex: 1 1 100%; justify-content: space-between; }
}
@media (max-width: 520px) {
  .shell { padding-inline: max(14px, env(safe-area-inset-right)); }
  .topbar { padding-inline: 14px; }
  .theme-toggle { padding-inline: 9px; }
  .signature-form { flex-direction: column; }
  .signature-form button { min-height: 44px; }
  .chalk-card { padding: 10px; }
  .chalk-boardwrap { border-width: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .chalk-dust, .chalk-wipe { display: none; animation: none; }
}
