:root {
  --display-font: Congenial, "Trebuchet MS", Aptos, Arial, Helvetica, sans-serif;
  --brand-orange: #f28c28;
  --brand-gold: #d4a83f;
  --brand-bordeaux: #7d2946;
  --brand-prune: #4e2f5f;
  --ink: #29262d;
  --muted: #6e6670;
  --paper: #fffaf1;
  --surface: #ffffff;
  --line: #e5d8c6;
  --shadow: 0 18px 50px rgba(64, 42, 32, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at left center, rgba(242,140,40,.16) 0, rgba(242,140,40,.08) 18%, rgba(255,248,232,0) 34%),
    radial-gradient(circle at right center, rgba(242,140,40,.16) 0, rgba(242,140,40,.08) 18%, rgba(255,248,232,0) 34%),
    linear-gradient(180deg, #fff3df 0, #fffdf9 28rem, #f8f3ec 100%);
  font-family: Aptos, Arial, Helvetica, sans-serif;
  line-height: 1.55;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 1000;
  background: #fff; color: #000; padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.hero {
  color: #fff;
  background:
    linear-gradient(115deg, rgba(255,150,37,.24) 0%, rgba(255,124,25,.18) 34%, rgba(120,24,44,.16) 100%),
    radial-gradient(circle at 50% 45%, rgba(255,211,83,.10) 0 12%, rgba(255,166,67,.02) 18%, rgba(255,132,33,.18) 62%, rgba(104,22,38,.28) 100%),
    url('assets/hero-orange.png');
  background-size: cover;
  background-position: center center;
  box-shadow: 0 8px 30px rgba(125,41,70,.22);
}
.hero-stars { text-align: center; letter-spacing: .6em; padding-top: 12px; opacity: .8; }
.hero-inner {
  width: min(1180px, calc(100% - 32px)); margin: 0 auto;
  display: grid; grid-template-columns: 180px 1fr; gap: 36px; align-items: center;
  padding: 24px 0 38px;
}
.brand-mark {
  width: 150px; aspect-ratio: 1;
  display: grid; place-items: center;
  background: rgba(255,248,236,.92);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(55, 16, 24, .22);
  padding: 10px;
}
.brand-mark img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 12px;
}
.hero h1 { margin: 0 0 8px; font: 700 clamp(2.1rem, 5vw, 4.3rem)/1.02 var(--display-font); text-shadow: 0 2px 12px rgba(73,20,20,.28); }
.hero p { margin: 0 0 14px; font-size: 1.08rem; }
.hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero h1 span { display: block; }
.hero h1 span + span { margin-top: .08em; }
.hero-copy p, .hero-copy a { display: block; }

.eyebrow, .section-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .78rem !important; font-weight: 800; }
.text-link { color: var(--brand-bordeaux); font-weight: 700; text-underline-offset: 3px; }
.text-link.light { color: #fff; }

main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.notice, .intro, .collection {
  margin: 28px 0; padding: 28px; background: rgba(255,255,255,.9);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.notice { display: grid; grid-template-columns: 46px 1fr; gap: 18px; }
.notice-icon {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  font-weight: 900; font-size: 1.2rem;
}
.privacy .notice-icon { background: #e5f3e8; color: #28643a; }
.warning .notice-icon { background: #fff0dc; color: #9a4b00; }
.notice h2, .intro h2, .collection h2 { margin: 0 0 8px; font: 700 1.8rem/1.2 var(--display-font); }
.notice p { margin: 0 0 10px; }
.compact-list { columns: 2; gap: 40px; margin: 10px 0; padding-left: 1.2rem; }
.compact-list li { break-inside: avoid; margin-bottom: 5px; }
.fine-print { color: var(--muted); font-size: .9rem; }
.intro { text-align: center; }
.intro > p { max-width: 850px; margin: 0 auto 18px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 0; margin: 22px 0 0; }
.steps li { border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; background: #fffaf2; font-weight: 700; font-size: .9rem; }
.steps span { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 6px; border-radius: 50%; background: var(--brand-bordeaux); color: #fff; }

.workspace { display: grid; grid-template-columns: minmax(360px, .82fr) minmax(520px, 1.18fr); gap: 24px; align-items: start; margin: 28px 0; }
.panel { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-panel { padding: 22px; }
.preview-panel { padding: 22px; position: sticky; top: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.panel-heading h2 { margin: 0; font: 700 1.8rem var(--display-font); }
.section-kicker { margin: 0 0 2px; color: var(--brand-bordeaux); }
.form-section { border: 0; margin: 0; padding: 22px 0; border-top: 1px solid #eee3d7; }
.form-section:first-of-type { border-top: 0; }
legend { padding: 0; margin-bottom: 12px; font: 700 1.15rem var(--display-font); }
.step-number { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f6e0bf; color: var(--brand-bordeaux); font-family: Aptos, Arial, sans-serif; font-size: .88rem; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="number"] {
  width: 100%; border: 1px solid #cdbba6; border-radius: 10px; padding: 12px 13px; background: #fffdf9; color: var(--ink);
  outline: none; transition: border .15s, box-shadow .15s;
}
input:focus { border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(242,140,40,.18); }
input.invalid { border-color: #b93232; box-shadow: 0 0 0 3px rgba(185,50,50,.12); }
.field-meta { display: flex; justify-content: space-between; gap: 14px; margin-top: 6px; color: var(--muted); font-size: .85rem; }
.counter { white-space: nowrap; }
.counter.near { color: #a55d00; font-weight: 700; }
.counter.over { color: #b93232; font-weight: 800; }
.field-message { min-height: 1.2em; margin: 6px 0 0; color: #a22222; font-size: .88rem; }
.help, .order-note { color: var(--muted); font-size: .91rem; }
.order-note { border-left: 3px solid var(--brand-gold); padding-left: 10px; }
.number-row { display: grid; grid-template-columns: 46px 90px 46px; gap: 8px; align-items: center; }
.number-row input { text-align: center; font-size: 1.15rem; font-weight: 800; }
.icon-button, .zoom-label {
  border: 1px solid #cdbba6; background: #fffaf2; color: var(--brand-bordeaux); border-radius: 10px; min-height: 44px; cursor: pointer; font-weight: 900;
}
.icon-button:hover, .zoom-label:hover { background: #f5e8d7; }
.icon-button.small { min-height: 34px; width: 34px; }

.answers-list { display: grid; gap: 10px; }
.answer-row { display: grid; grid-template-columns: 35px 1fr 74px; gap: 8px; align-items: start; }
.answer-index { display: grid; place-items: center; width: 32px; height: 42px; border-radius: 9px; background: #f6eadb; color: var(--brand-bordeaux); font-weight: 800; }
.answer-input-wrap { min-width: 0; }
.answer-input-wrap input { padding: 10px 11px; }
.answer-meta { display: flex; justify-content: flex-end; margin-top: 3px; color: var(--muted); font-size: .77rem; }
.answer-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.answer-controls button { min-height: 42px; border: 1px solid #d8cab9; background: #fff; border-radius: 9px; cursor: pointer; color: var(--brand-bordeaux); font-weight: 800; }
.answer-controls button:disabled { opacity: .35; cursor: default; }
.button-row { display: flex; gap: 10px; margin-top: 14px; }
.button-row.wrap { flex-wrap: wrap; }

.button {
  border: 0; border-radius: 11px; padding: 12px 16px; min-height: 44px; cursor: pointer; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.button.primary { background: var(--brand-bordeaux); color: #fff; box-shadow: 0 8px 22px rgba(125,41,70,.22); }
.button.primary:hover { background: #672038; }
.button.primary:disabled { background: #b8adb1; box-shadow: none; cursor: not-allowed; }
.button.primary.alternate { background: #3f5f6d; }
.button.primary.alternate:hover { background: #304b56; }
.button.secondary { background: #f4dfbd; color: #5b263d; border: 1px solid #d9b77b; }
.button.secondary:hover { background: #ecd09f; }
.button.ghost { background: #fff; color: var(--brand-bordeaux); border: 1px solid #cfbfae; }
.button.ghost:hover { background: #fff8ec; }
.button.small { padding: 8px 11px; min-height: 36px; font-size: .86rem; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 10px; }

.color-roles { display: grid; gap: 8px; }
.color-role {
  width: 100%; display: grid; grid-template-columns: 90px 30px 1fr 20px; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid #d5c5b3; border-radius: 10px; background: #fffdf9; cursor: pointer; text-align: left;
}
.color-role:hover { border-color: var(--brand-orange); }
.color-role-label { font-weight: 800; }
.swatch { width: 28px; height: 28px; border: 1px solid rgba(0,0,0,.15); border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.65); }
.chevron { font-size: 1.5rem; color: var(--muted); }
.contrast-status { margin-top: 10px; padding: 9px 11px; border-radius: 9px; font-size: .88rem; }
.contrast-status.good { background: #e7f4ea; color: #285c36; }
.contrast-status.warn { background: #fff1dc; color: #854d00; }
.contrast-status.bad { background: #fbe3e3; color: #8e2222; }
.hidden { display: none !important; }

.font-grid { display: grid; gap: 9px; }
.font-card { border: 1px solid #d8c8b7; border-radius: 11px; padding: 11px 12px; cursor: pointer; background: #fffdf9; }
.font-card.selected { border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(242,140,40,.14); }
.font-card input { position: absolute; opacity: 0; pointer-events: none; }
.font-name { display: block; font-weight: 800; font-size: .89rem; color: var(--brand-bordeaux); margin-bottom: 4px; }
.font-sample { display: block; font-size: 1.1rem; }
.aptos { font-family: Aptos, Arial, Helvetica, sans-serif; }
.garamond { font-family: Garamond, Georgia, "Times New Roman", serif; }
.comic { font-family: "Comic Sans MS", "Comic Sans", cursive; }

.preview-heading { margin-bottom: 10px; }
.zoom-controls { display: grid; grid-template-columns: 34px 62px 34px; gap: 5px; }
.zoom-label { min-height: 34px; font-size: .8rem; }
.canvas-viewport {
  overflow: auto; border: 1px solid #d9cbbd; border-radius: 12px; background: #eee7df;
  min-height: 320px; display: grid; place-items: start center; padding: 14px;
}
#previewCanvas { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 8px 25px rgba(37,25,19,.18); transform-origin: top center; }
.readiness { margin-top: 16px; padding: 15px; border-radius: 12px; background: #fff9ef; border: 1px solid #ead7ba; }
.readiness h3 { margin: 0 0 5px; font: 700 1.1rem var(--display-font); }
.readiness p { margin: 0; }
.readiness-summary-warning { color: #b01818; font-weight: 800; font-size: 1.14rem; line-height: 1.35; }
.readiness-summary-warning strong { font-weight: 900; }
.readiness-summary-ready { color: #285c36; font-weight: 700; }
.readiness-summary-error { color: var(--ink); font-weight: 600; }
.validation-list { margin: 8px 0 0; padding-left: 1.2rem; color: #872626; }
.validation-list:empty { display: none; }
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.download-grid .button { flex-direction: column; line-height: 1.2; min-height: 64px; }
.download-grid small { opacity: .82; font-weight: 600; }
.download-message { margin-top: 10px; min-height: 1.4em; color: #285c36; font-weight: 700; }

.collection { display: grid; grid-template-columns: 1fr 420px; gap: 28px; align-items: center; }
.collection-copy p { max-width: 630px; }
.book-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.book-row img { border-radius: 7px; box-shadow: 0 10px 24px rgba(57,35,28,.20); }
.book-row img:nth-child(2) { transform: translateY(-9px); }

footer { margin-top: 38px; padding: 26px 20px 34px; text-align: center; background: #3d2430; color: #f9efe4; }
footer p { margin: 0 0 10px; }
footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
footer a, .footer-link { color: #fff3de; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.jump-preview { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 40; border: 0; border-radius: 999px; background: var(--brand-bordeaux); color: #fff; padding: 12px 17px; box-shadow: 0 8px 28px rgba(60,20,35,.30); font-weight: 800; }

.modal { border: 0; padding: 0; background: transparent; width: min(760px, calc(100% - 24px)); }
.modal::backdrop { background: rgba(37,22,27,.62); backdrop-filter: blur(2px); }
.modal-card { background: #fffdf9; border-radius: 16px; padding: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.30); max-height: 88vh; overflow: auto; }
.modal-card.narrow { max-width: 520px; margin: auto; }
.modal-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 14px; }
.modal-heading h2 { margin: 0; font: 700 1.6rem var(--display-font); }
.close-button { border: 0; background: transparent; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--muted); }
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.palette-option { border: 1px solid #d9cab8; border-radius: 10px; padding: 8px; background: #fff; cursor: pointer; text-align: center; font-size: .76rem; min-height: 74px; }
.palette-option:hover, .palette-option.selected { border-color: var(--brand-orange); box-shadow: 0 0 0 2px rgba(242,140,40,.15); }
.palette-option .swatch { display: block; margin: 0 auto 5px; width: 34px; height: 34px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.legal-card p { max-width: 65ch; text-align: justify; text-justify: inter-word; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .collection { grid-template-columns: 1fr; }
  .book-row { max-width: 520px; }
}

@media (max-width: 760px) {
  main { width: min(100% - 20px, 1180px); }
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding: 22px 0 30px; }
  .brand-mark { width: 110px; margin: auto; }
  .hero-stars { letter-spacing: .3em; }
  .compact-list { columns: 1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:last-child { grid-column: 1 / -1; }
  .notice, .intro, .collection { padding: 20px; }
  .notice { grid-template-columns: 36px 1fr; gap: 12px; }
  .notice-icon { width: 34px; height: 34px; }
  .form-panel, .preview-panel { padding: 16px; }
  .panel-heading { align-items: flex-start; }
  .answer-row { grid-template-columns: 32px 1fr; }
  .answer-controls { grid-column: 2; width: 100px; }
  .download-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: repeat(3, 1fr); }
  .book-row { gap: 7px; }
  .jump-preview { display: block; }
  .field-meta { display: block; }
  .field-meta .counter { display: block; text-align: right; margin-top: 3px; }
}

@media (max-width: 430px) {
  .hero h1 { font-size: 2.15rem; }
  .steps { grid-template-columns: 1fr; }
  .steps li:last-child { grid-column: auto; }
  .panel-heading { display: block; }
  .panel-heading .button { margin-top: 10px; }
  .color-role { grid-template-columns: 74px 28px 1fr 18px; }
  .palette-grid { grid-template-columns: repeat(2, 1fr); }
  .button-row .button { width: 100%; }
}

@media print {
  .hero, main, footer, .jump-preview, dialog { display: none !important; }
}

.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.validation-link { border:0; padding:0; background:none; color:inherit; text-align:left; text-decoration:underline; cursor:pointer; font:inherit; }

.privacy h2 { text-align: center; }
.warning { text-align: center; }
.collection { text-align: center; grid-template-columns: 1fr; }
.collection-copy { display: flex; flex-direction: column; align-items: center; }
.collection-copy p { max-width: 760px; }
.book-row { max-width: 760px; margin: 0 auto; align-items: start; }
.book-row img:nth-child(2) { transform: none; }

.privacy .fine-print { text-align: center; max-width: 820px; margin: 0 auto; }
