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

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-hand);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.025) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.02) 0%, transparent 50%),
    repeating-linear-gradient(0deg, transparent 0px, transparent 23px, rgba(74,85,104,0.04) 23px, rgba(74,85,104,0.04) 24px);
}

h1, h2, h3, h4 { font-family: var(--font-script); font-weight: 700; margin: 0; line-height: 1.1; }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }

button { font-family: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
input, select, textarea {
  font-family: var(--font-hand); font-size: 16px;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink-2);
  border-radius: var(--r-soft-sm);
  padding: 8px 12px;
  outline: none;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-pop);
}

.boot {
  display: flex; align-items: center; justify-content: center;
  min-height: 80vh; font-family: var(--font-script); font-size: 28px;
  color: var(--ink-3);
}

/* sketchy borders */
.sketch-box {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r-soft);
  position: relative;
  box-shadow: var(--shadow-soft);
}
.sketch-box-soft {
  background: var(--paper);
  border: 1.5px solid var(--ink-2);
  border-radius: var(--r-soft-sm);
}
.sketch-circle {
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.scribble-underline {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 Q 30 1, 60 4 T 120 4 T 198 4' stroke='%23e85d3a' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 6px;
  padding-bottom: 6px;
}
.highlight {
  background: linear-gradient(180deg, transparent 55%, var(--highlight) 55%, var(--highlight) 90%, transparent 90%);
  padding: 0 3px;
}

/* sketchy buttons */
.btn-sketch {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--r-soft);
  padding: 8px 16px;
  box-shadow: var(--shadow-pop);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.btn-sketch:hover { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 rgba(31,29,26,0.22); }
.btn-sketch:active { transform: translate(1px, 1px); box-shadow: 1px 2px 0 rgba(31,29,26,0.15); }
.btn-sketch.primary { background: var(--accent); color: #fff; border-color: var(--ink); }
.btn-sketch.ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn-sketch:disabled { opacity: 0.5; cursor: not-allowed; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.tiny { font-size: 13px; }
.big { font-size: 22px; }
.huge { font-size: 38px; font-family: var(--font-script); }

.stack > * + * { margin-top: 14px; }

/* utility chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-hand);
  font-size: 14px; font-weight: 700;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-2);
  border-radius: var(--r-soft-sm);
  padding: 4px 10px;
  cursor: pointer;
}
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
