/* Reset, page frame, typography. */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint dotted texture so the cream never reads as flat grey-white. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(var(--paper-deep) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  opacity: 0.7;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}
h2 {
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
}
h3 {
  font-size: 1.05rem;
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

/* One visible focus treatment everywhere. Never removed. */
:focus-visible {
  outline: var(--bw-thick) dashed var(--ink);
  outline-offset: 3px;
}

/* --- layout ------------------------------------------------------------- */

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--gap) var(--gap) 64px;
}

.page--wide {
  max-width: 900px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.stack--sm {
  gap: var(--gap-sm);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.row--tight {
  gap: var(--gap-xs);
}

.spacer {
  flex: 1 1 auto;
}

.center-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--gap);
}

/* --- text helpers -------------------------------------------------------- */

.muted {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* --- decorative blobs ---------------------------------------------------- */

.blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blobs span {
  position: absolute;
  display: block;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-blob);
  opacity: 0.35;
}

.blobs span:nth-child(1) {
  width: 220px;
  height: 190px;
  top: -60px;
  right: -50px;
  background: var(--butter);
  transform: rotate(-8deg);
}

.blobs span:nth-child(2) {
  width: 170px;
  height: 150px;
  bottom: 8%;
  left: -70px;
  background: var(--peri);
  border-radius: var(--r-blob-alt);
  transform: rotate(12deg);
}

.blobs span:nth-child(3) {
  width: 120px;
  height: 110px;
  bottom: -40px;
  right: 12%;
  background: var(--mint);
  transform: rotate(-4deg);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
