:root {
  --cork: #b98b5c;
  --cork-dark: #8f653c;
  --cork-light: #d1a676;
  --paper: #fffdf5;
  --ink: #222222;
  --muted: #555049;
  --pin: #c8102e;
  --pin-blue: #1f5fa8;
  --frame: #5b3a1e;
  --type: "American Typewriter", "Courier New", Courier, monospace;
  --body: Georgia, "Times New Roman", serif;
  --gutter: clamp(14px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 1.0625rem/1.6 var(--body);
  background-color: var(--cork);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(90, 55, 25, 0.35) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(255, 230, 190, 0.35) 0 1px, transparent 1.5px),
    radial-gradient(circle at 40% 80%, rgba(90, 55, 25, 0.25) 0 1.5px, transparent 2px),
    radial-gradient(circle at 85% 15%, rgba(255, 230, 190, 0.25) 0 1px, transparent 1.5px);
  background-size: 9px 9px, 13px 13px, 17px 17px, 7px 7px;
  border: clamp(8px, 1.6vw, 18px) solid var(--frame);
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: #9a1428; text-underline-offset: 0.2em; }
h1, h2 { margin: 0; font-family: var(--type); font-weight: 700; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--pin-blue); outline-offset: 3px; }
.skip { position: absolute; left: var(--gutter); top: -80px; z-index: 20; background: var(--paper); color: var(--ink); padding: 0.6rem 1rem; border: 2px solid var(--ink); }
.skip:focus { top: 24px; }

/* Cards and pins */
.card { background: var(--paper); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 10px 22px -10px rgba(40, 20, 0, 0.6); padding: clamp(18px, 3vw, 28px); position: relative; }
.pinned::before {
  content: ""; position: absolute; top: -9px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a98 0 18%, var(--pin) 45%, #7d0a1c 100%);
  box-shadow: 2px 4px 4px rgba(0, 0, 0, 0.35); z-index: 2;
}

/* Header */
.site-header { padding: clamp(26px, 4vw, 44px) var(--gutter) 0; }
.masthead { max-width: 760px; margin: 0 auto; text-align: center; transform: rotate(-1deg); background: var(--paper); padding: 1.4rem 1.25rem 1.1rem; box-shadow: 0 10px 22px -10px rgba(40, 20, 0, 0.6); position: relative; }
.brand { font-family: var(--type); font-weight: 700; font-size: clamp(1.9rem, 6vw, 3rem); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.tagline { color: var(--muted); margin-top: 0.2rem; font-style: italic; }
.masthead ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.25rem; margin: 0.9rem 0 0; padding: 0.7rem 0 0; list-style: none; border-top: 2px dashed #cfc7b6; }
.masthead nav a { font-family: var(--type); color: var(--ink); text-decoration: none; }
.masthead nav a:hover { color: var(--pin); text-decoration: underline; }

/* Maker */
.maker {
  max-width: 1180px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 64px); align-items: start;
}
.form-card { transform: rotate(0.6deg); }
.form-card h1 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
.hint { color: var(--muted); margin: 0.3rem 0 1.25rem; font-size: 0.98rem; }
.field { margin-bottom: 1rem; }
.field label, .swatches legend { display: block; font-family: var(--type); font-size: 0.95rem; margin-bottom: 0.3rem; padding: 0; }
.field label span { color: var(--muted); font-family: var(--body); font-style: italic; }
.field input:not([type="range"]), .field textarea {
  width: 100%; font: 400 1.05rem/1.45 var(--body); color: var(--ink); background: #fff; border: 2px solid #3a3a3a; border-radius: 3px; padding: 0.55rem 0.65rem;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--pin-blue); outline-offset: 1px; }
.field input[type="range"] { width: 100%; accent-color: var(--pin); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.help { font-size: 0.9rem; color: var(--muted); margin-top: 0.3rem; }
.swatches { border: 0; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.swatches legend { width: 100%; }
.swatches label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.swatches input { accent-color: var(--pin); width: 1.05rem; height: 1.05rem; }
.sw { width: 1.2rem; height: 1.2rem; border: 1px solid #555; display: inline-block; }
.sw-white { background: #ffffff; } .sw-canary { background: #fff3a6; } .sw-sky { background: #d6ecff; } .sw-mint { background: #d8f5e2; } .sw-rose { background: #ffdfe6; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.btn { font: 700 1rem/1 var(--type); background: var(--ink); color: var(--paper); border: 2px solid var(--ink); padding: 0.8rem 1.2rem; cursor: pointer; }
.btn:hover { background: var(--pin); border-color: var(--pin); }
.btn-plain { background: transparent; color: var(--ink); }
.btn-plain:hover { color: var(--paper); }
.status { min-height: 1.5em; margin-top: 0.6rem; color: var(--muted); font-style: italic; }

.preview-wrap { position: sticky; top: 20px; }
.preview-label { display: inline-block; font-family: var(--type); background: var(--paper); padding: 0.2rem 0.6rem; margin-bottom: 0.9rem; transform: rotate(-2deg); box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.5); }

/* Flyer */
.flyer {
  position: relative; color: #111; aspect-ratio: 8.5 / 11; display: flex; flex-direction: column;
  padding: clamp(18px, 4vw, 40px) clamp(16px, 3.5vw, 36px) 0; transform: rotate(-1.2deg);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15), 0 22px 40px -18px rgba(40, 20, 0, 0.75);
}
.flyer::before { content: ""; position: absolute; top: -10px; left: 50%; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #9cc6ff 0 18%, var(--pin-blue) 45%, #0d2f57 100%); box-shadow: 2px 4px 4px rgba(0, 0, 0, 0.35); }
.paper-white { background: #ffffff; } .paper-canary { background: #fff3a6; } .paper-sky { background: #d6ecff; } .paper-mint { background: #d8f5e2; } .paper-rose { background: #ffdfe6; }
.flyer h2 { font-size: clamp(1.8rem, 5vw, 3.1rem); line-height: 1.05; text-align: center; overflow-wrap: anywhere; text-transform: uppercase; letter-spacing: -0.01em; }
.p-body { margin: 1rem 0; font-size: clamp(1rem, 2.2vw, 1.3rem); white-space: pre-wrap; text-align: center; overflow-wrap: anywhere; }
.p-meta { margin: 0 auto; display: grid; gap: 0.35rem; font-size: clamp(0.95rem, 2vw, 1.15rem); }
.p-meta div { display: flex; gap: 0.6rem; justify-content: center; }
.p-meta dt { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.p-meta dd { margin: 0; }
.p-take { margin-top: auto; text-align: center; font-size: 0.95rem; padding-bottom: 0.5rem; }
.tabs { list-style: none; margin: 0 calc(-1 * clamp(16px, 3.5vw, 36px)); padding: 0; display: flex; border-top: 2px dashed #333; height: clamp(110px, 22%, 170px); }
.tabs li {
  flex: 1; min-width: 0; border-right: 2px dashed #333; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg); font-size: clamp(0.6rem, 1.6vw, 0.85rem); line-height: 1.1; padding: 0.4rem 0.15rem; overflow: hidden; text-align: center;
}
.tabs li:first-child { border-right: 0; }

.type-typewriter h2, .type-typewriter .p-body, .type-typewriter .p-meta, .type-typewriter .tabs, .type-typewriter .p-take { font-family: var(--type); }
.type-marker h2, .type-marker .p-body, .type-marker .p-meta, .type-marker .tabs, .type-marker .p-take { font-family: "Marker Felt", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; }
.type-classic h2, .type-classic .p-body, .type-classic .p-meta, .type-classic .tabs, .type-classic .p-take { font-family: Georgia, "Times New Roman", serif; }
.type-classic h2 { text-transform: none; font-style: italic; }

/* Notes */
.notes {
  max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) clamp(48px, 7vw, 88px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: clamp(28px, 4vw, 40px); align-items: start;
}
.notes h2 { font-size: 1.35rem; margin-bottom: 0.7rem; }
.notes ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; }
.notes p + ul, .notes ul + p, .notes p + p { margin-top: 0.7rem; }
.small { font-size: 0.95rem; color: var(--muted); }
.cols { columns: 2; column-gap: 1.5rem; display: block !important; }
.cols li { margin-bottom: 0.3rem; break-inside: avoid; }
.note-a { transform: rotate(-1.6deg); background: #fff8d6; }
.note-b { transform: rotate(1.2deg); }
.note-c { transform: rotate(-0.7deg); background: #e9f4ff; }
.note-c::before { background: radial-gradient(circle at 35% 30%, #9cc6ff 0 18%, var(--pin-blue) 45%, #0d2f57 100%); }
.note-d { transform: rotate(1.8deg); background: #eaf8ee; }
.notes .card { transition: transform 0.25s ease; }
.notes .card:hover { transform: rotate(0deg) translateY(-4px); }

.site-footer { padding: 0 var(--gutter) 40px; text-align: center; }
.site-footer .card { display: inline-block; transform: rotate(-0.8deg); padding: 0.8rem 1.1rem; font-size: 0.95rem; }

@media (max-width: 880px) {
  .maker { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .cols { columns: 1; }
  body { border-width: 8px; }
}

@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; border: 0; }
  body * { visibility: hidden; }
  .flyer, .flyer * { visibility: visible; }
  .flyer { position: fixed; inset: 0; transform: none; box-shadow: none; aspect-ratio: auto; height: 100%; padding: 14mm 12mm 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .flyer::before { display: none; }
  .flyer h2 { font-size: 46pt; }
  .p-body { font-size: 18pt; }
  .p-meta { font-size: 15pt; }
  .tabs { margin: 0 -12mm; height: 50mm; }
  .tabs li { font-size: 10pt; }
}

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