/* Pencilbox. Paper-white page, ink-black type, one crayon accent (tomato). Headings: Fraunces; body: Atkinson Hyperlegible. */
:root {
  --paper: #fbf8f1;
  --card: #ffffff;
  --ink: #1f1c17;
  --ink-2: #4f4a40;
  --line: #e4ddcd;
  --accent: #c23f1f;
  --accent-ink: #9e3217;
  --soft: #f3ede0;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 'Atkinson Hyperlegible', system-ui, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin-top: 0; }
h3 { font-size: 1.15rem; }
p, figcaption, li { margin: 0 0 1em; text-wrap: pretty; }
::placeholder { color: #6b6457; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* header */
header.site { border-bottom: 1px solid var(--line); background: var(--paper); }
header.site .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.25rem; }
.brand svg { width: 30px; height: 30px; }
header.site nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
header.site nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* hero + tool */
.hero { padding: 40px 0 28px; }
.hero .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 36em; }
.facts { font-size: .92rem; color: var(--ink-2); margin: -4px 0 18px; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: var(--soft); color: var(--ink-2); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: .95rem; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; border: 2px dashed #cfc5b0; border-radius: 12px; background: var(--paper); text-align: center; padding: 16px; cursor: pointer; }
.drop.over { border-color: var(--accent); background: #fff4ef; }
.drop strong { font-size: 1.02rem; }
.drop span { font-size: .88rem; color: var(--ink-2); }
.drop img.thumb { max-height: 150px; width: auto; border-radius: 8px; }
textarea { width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; resize: vertical; background: var(--paper); }
label.small, .small { font-size: .9rem; color: var(--ink-2); }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.levels label { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; font-size: .92rem; background: var(--paper); }
.levels input { accent-color: var(--accent); margin-right: 6px; }
.levels label:has(input:checked) { border-color: var(--ink); background: #fff; }
.levels em { display: block; font-style: normal; color: var(--ink-2); font-size: .82rem; margin-top: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; padding: 13px 24px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-ink); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.go { width: 100%; margin-top: 16px; }
.status { min-height: 1.6em; margin: 10px 0 0; font-size: .95rem; color: var(--ink-2); }
.hint { font-size: .85rem; color: var(--ink-2); margin: 10px 0 0; }

/* example / result */
.result { position: relative; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(60, 45, 20, .35); padding: 10px; }
.sheet img { width: 100%; aspect-ratio: 2 / 3; max-height: min(78vh, 760px); object-fit: contain; background: #fff; }
.from { position: absolute; left: -18px; bottom: 54px; width: 42%; transform: rotate(-4deg); background: #fff; padding: 6px 6px 22px; border: 1px solid var(--line); box-shadow: 0 10px 24px -14px rgba(60, 45, 20, .5); }
.from span { position: absolute; bottom: 3px; left: 8px; font-size: .75rem; color: var(--ink-2); }
.cap { font-size: .88rem; color: var(--ink-2); margin: 10px 0 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.actions[hidden] { display: none; }

/* sections */
section.band { padding: 44px 0; border-top: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); font-weight: 700; margin-bottom: 8px; }
.pair { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pair figure { margin: 0; }
.pair figcaption { font-size: .88rem; color: var(--ink-2); margin-top: 6px; }
.pair img { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.themes a { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.themes a img { aspect-ratio: 2 / 3; object-fit: cover; }
.themes a span { display: block; padding: 8px 12px; font-weight: 700; }
.themes a:hover { border-color: var(--ink); }
.price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 760px; }
.price > div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.price .amt { font-family: 'Fraunces', Georgia, serif; font-size: 2rem; font-weight: 600; }
.price ul { padding-left: 1.1em; margin: 8px 0 14px; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 8px 0 0; color: var(--ink-2); }

/* gallery pages */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.gallery figcaption { font-size: .9rem; margin: 8px 2px 4px; }
.gallery .row { display: flex; gap: 8px; margin: 6px 2px 2px; flex-wrap: wrap; }
.gallery .row a, .gallery .row button { font: inherit; font-size: .85rem; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer; }
.gallery .row a:hover, .gallery .row button:hover { border-color: var(--ink); }
.crumbs { font-size: .88rem; color: var(--ink-2); margin: 22px 0 8px; }
.crumbs a { color: var(--ink-2); }
.cta { background: var(--soft); border-radius: var(--r); padding: 22px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 36px 0 0; }
.cta p { margin: 0; max-width: 36em; }

/* name page */
.namebox { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
.namebox input[type=text], .namebox select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }
.namebox label { display: block; margin: 0 0 12px; font-weight: 700; font-size: .95rem; }
canvas#name-canvas { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 40px -24px rgba(60, 45, 20, .35); }

/* modal */
dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 24px; max-width: 440px; width: calc(100% - 32px); background: #fff; color: var(--ink); }
dialog::backdrop { background: rgba(31, 28, 23, .45); }
dialog input[type=email] { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; margin: 6px 0 12px; }

footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: .9rem; color: var(--ink-2); margin-top: 40px; }
footer.site .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
footer.site nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--ink-2); }
.prose h2 { margin-top: 1.6em; }

@media (max-width: 860px) {
  .hero .grid, .namebox { grid-template-columns: 1fr; gap: 28px; }
  .from { left: 6px; width: 38%; }
  .steps, .pair { grid-template-columns: 1fr; }
  .price { grid-template-columns: 1fr; }
  header.site nav { margin-left: 0; gap: 14px; }
  header.site .wrap { padding-top: 10px; padding-bottom: 10px; }
}
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #fff; }
  #print-area img { max-width: 100%; max-height: 100%; }
  @page { margin: 10mm; }
}
