:root {
  --paper: #fbfaf5;
  --rule: #d8e2f0;
  --margin: #e9a59a;
  --ink: #26252e;
  --muted: #55535e;
  --line: #d9d6cc;
  --accent: #b5452f;
  --tape: rgba(240, 205, 110, 0.78);
  --note: #fdeea3;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(var(--rule) 1px, transparent 1px);
  background-size: 100% 36px;
}

body::before {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: 4%;
  width: 2px;
  background: var(--margin);
  pointer-events: none;
}

a { color: #2f4f8f; }
a:hover { color: #1d3260; }

img { max-width: 100%; height: auto; display: block; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(20px, 7vw, 80px);
  position: relative;
}

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10;
}
.skip:focus { left: 8px; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding: 24px 0 8px;
}
.logo {
  font-family: var(--hand); font-weight: 700; font-size: 36px; line-height: 1;
  color: var(--ink); text-decoration: none; padding: 6px 0;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.site-nav a {
  display: inline-block; font-weight: 600; font-size: 17px; text-decoration: none;
  color: var(--ink); background: #fff; border: 1px solid var(--line);
  padding: 9px 15px; min-height: 44px;
}
.site-nav a:hover { border-color: var(--ink); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Type */
h1, h2, .hand { font-family: var(--hand); font-weight: 700; line-height: 1; margin: 0; }
h1 { font-size: clamp(56px, 9vw, 96px); }
h2 { font-size: clamp(40px, 6vw, 56px); }
.lede { font-size: 20px; color: #45434d; max-width: 32rem; margin: 20px 0 0; }

.button {
  display: inline-block; font-weight: 600; font-size: 18px; text-decoration: none;
  padding: 12px 22px; min-height: 44px; border: 1px solid var(--ink); color: var(--ink); background: #fff;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button:hover { color: inherit; filter: brightness(0.95); }
.button.primary:hover { color: #fff; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Taped paper */
.taped { position: relative; background: #fff; border: 1px solid var(--line); padding: 12px 12px 16px; }
.taped::before {
  content: ""; position: absolute; top: -13px; left: 50%; width: 92px; height: 26px; margin-left: -46px;
  background: var(--tape); transform: rotate(-3deg);
}
.tilt-a { transform: rotate(-1.6deg); }
.tilt-b { transform: rotate(1.2deg); }
.tilt-c { transform: rotate(-0.6deg); }
.tilt-d { transform: rotate(1.8deg); }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding: 40px 0 80px; }
.hero-text { flex: 1 1 320px; }
.hero-art { flex: 1 1 380px; margin: 0; transform: rotate(2deg); }
.hero-art figcaption, .card figcaption { padding-top: 10px; }

/* Sections */
.block { padding-bottom: 80px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 32px; }
.block-head a { font-weight: 600; }

/* Drawing grid: natural shapes, never cropped */
.gallery { columns: 3 260px; column-gap: 36px; }
.card { break-inside: avoid; margin: 0; padding: 18px 0 22px; display: inline-block; width: 100%; text-decoration: none; color: var(--ink); }
.card:hover { color: var(--ink); }
.card:hover .taped { border-color: #a9a59a; }
.card:focus-visible { outline: 3px solid #2f4f8f; outline-offset: 6px; }
.card .taped { transition: transform 0.15s ease; }
.card:hover .taped { transform: rotate(0deg) scale(1.01); }
.title { font-family: var(--hand); font-size: 30px; line-height: 1.1; display: block; }
.meta { font-size: 15px; color: var(--muted); }

/* Section tabs */
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.tab {
  display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-top: 10px solid var(--tab, var(--accent)); padding: 14px;
}
.tab:hover { color: var(--ink); border-color: #a9a59a; border-top-color: var(--tab, var(--accent)); }
.tab .thumb { aspect-ratio: 4 / 3; background: #f3f1ea; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tab .thumb img { width: 100%; height: 100%; object-fit: contain; }
.tab .title { font-size: 34px; }

/* Section page */
.page-head { padding: 32px 0 40px; }
.page-head .lede { margin-top: 12px; }
.section-mark { display: inline-block; width: 56px; height: 10px; background: var(--tab, var(--accent)); margin-bottom: 18px; }

/* Single drawing */
.drawing { padding: 24px 0 72px; }
.drawing-art { margin: 0 auto; max-width: max-content; }
.drawing-art img { max-height: 78vh; width: auto; margin: 0 auto; }
.drawing-info { max-width: 40rem; margin: 40px auto 0; text-align: center; }
.drawing-info h1 { font-size: clamp(48px, 8vw, 80px); }
.drawing-info .meta { font-size: 17px; margin-top: 10px; }
.drawing-info .desc { font-size: 19px; margin: 18px 0 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 40px auto 0; max-width: 40rem; }
.pager a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.breadcrumb { font-size: 16px; padding-top: 16px; }
.breadcrumb a { font-weight: 600; }

/* About */
.about { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 32px 0 80px; }
.about-art { flex: 0 1 300px; margin: 0; transform: rotate(-2.5deg); }
.note { flex: 1 1 340px; background: var(--note); padding: 32px 36px; transform: rotate(0.8deg); }
.note p { font-family: var(--hand); font-weight: 500; font-size: 29px; line-height: 1.3; color: #3a3320; margin: 0 0 16px; }
.note p:last-child { margin-bottom: 0; }
.note .contact { font-family: var(--body); font-size: 18px; line-height: 1.5; margin-top: 24px; color: #3a3320; }
.note .contact a { color: #7a2b1c; font-weight: 600; overflow-wrap: anywhere; }

/* Contact form */
.contact-form { max-width: 40rem; padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 80px; }
.contact-form label { font-weight: 600; margin-top: 14px; }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: #fff;
  border: 1px solid #8f8c99; padding: 10px 12px; min-height: 44px; width: 100%;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid #2f4f8f; outline-offset: 1px; border-color: #2f4f8f; }
.contact-form .cf-turnstile { margin: 20px 0 8px; min-height: 65px; }
.contact-form .button { align-self: flex-start; cursor: pointer; }
.form-error { background: #fbe3dd; color: #7a2b1c; border: 1px solid #e3a99a; padding: 10px 14px; margin: 0 0 6px; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  border-top: 2px solid var(--ink); padding: 24px 0 40px; font-size: 16px; color: #45434d;
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  body::before { left: 10px; }
  .hero { padding-top: 16px; gap: 36px; }
  .gallery { column-gap: 24px; }
  .note p { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .card .taped { transition: none; }
}
