/* Mobile-first, no frameworks. Wattle Writers brand (matches the KDP covers and Etsy shop):
   cream paper, near-black ink, wattle gold and gum-leaf green. */
@font-face { font-family: 'Edu QLD Beginner'; src: url(/assets/fonts/qld.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Edu NSW ACT Foundation'; src: url(/assets/fonts/nsw.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Edu VIC WA NT Beginner'; src: url(/assets/fonts/vic.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Edu SA Beginner'; src: url(/assets/fonts/sa.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Edu TAS Beginner'; src: url(/assets/fonts/tas.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Playwrite NZ Basic'; src: url(/assets/fonts/nz.woff2) format('woff2'); font-weight: 100 400; font-display: swap; }

:root {
  --paper: #f6f1e7;
  --card: #ffffff;
  --ink: #222228;
  --muted: #5b5a63;
  --teal: #3f7a4a;        /* gum-leaf green: primary actions */
  --teal-dark: #2c5a35;
  --sun: #f0be2e;         /* wattle yellow */
  --coral: #b9861a;       /* wattle gold (the rule under the logo) */
  --maroon: #7b1c3a;      /* KDP cover accent */
  --line: #e4dccb;
  --radius: 16px;
  --display: 'Edu QLD Beginner', 'Edu NSW ACT Foundation', 'Comic Sans MS', system-ui, sans-serif;
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--ui); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--coral); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; font-weight: 600; margin: 1.2em 0 0.4em; }
h1 { font-size: clamp(2rem, 7vw, 3.2rem); margin-top: 0.4em; }
h2 { font-size: clamp(1.5rem, 5vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p, ul, ol { margin: 0 0 1em; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 9; }

/* header / footer */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding-top: 10px; padding-bottom: 10px; }
.logo { font-family: var(--display); font-size: 1.5rem; font-weight: 700; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo svg { width: 34px; height: 34px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.95rem; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 2px; }
.nav a:hover, .nav a[aria-current] { color: var(--teal-dark); }
.site-foot { margin-top: 64px; background: #ece4d3; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.site-foot .wrap { padding-top: 28px; padding-bottom: 36px; }
.foot-cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { margin: 4px 0; }
@media (min-width: 720px) { .foot-cols { grid-template-columns: 2fr 1fr 1fr; } }

/* hero */
.hero { padding-top: 28px; padding-bottom: 8px; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.pill { display: inline-block; background: #fbecc0; color: #6b4b00; border-radius: 999px; padding: 3px 12px; font-size: 0.85rem; font-weight: 600; }

/* cards + grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.state-links { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); padding: 0; list-style: none; }
@media (min-width: 720px) { .state-links { grid-template-columns: repeat(4, 1fr); } }
.state-links a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.state-links a strong { display: block; font-family: var(--display); font-size: 1.25rem; }
.state-links a span { font-size: 0.85rem; color: var(--muted); }
.state-links a:hover { border-color: var(--teal); }

/* forms */
label { display: block; font-weight: 600; margin: 0 0 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: 0.88rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], select {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-color: var(--teal); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--teal); }
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 1.05rem; border: 0; border-radius: 999px; padding: 13px 24px; background: var(--teal); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--teal-dark); color: #fff; }
.btn.alt { background: var(--coral); }
.btn.alt:hover { background: #966b10; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.msg { min-height: 1.4em; font-size: 0.95rem; }
.msg.err { color: #a3261a; }
.msg.ok { color: #1d6b2c; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details { background: #f8f3e8; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
summary { cursor: pointer; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 600; margin-bottom: 6px; }
.themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.themes label { font-weight: 500; border: 2px solid var(--line); border-radius: 12px; padding: 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; background: #fff; }
.themes input { accent-color: var(--teal); }
.themes label:has(input:checked) { border-color: var(--teal); background: #eef5ec; }
.swatch { display: inline-flex; gap: 2px; margin-left: auto; }
.swatch i { width: 10px; height: 10px; border-radius: 50%; display: block; }

/* generator */
.gen { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .gen { grid-template-columns: 5fr 6fr; } }
.preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(60, 40, 0, 0.08); overflow: hidden; aspect-ratio: 210 / 297; }
.preview svg { display: block; width: 100%; height: 100%; }
.preview.loading { display: grid; place-items: center; color: var(--muted); }
.private { font-size: 0.9rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.private svg { flex: none; width: 18px; height: 18px; margin-top: 3px; }

/* book */
.book-previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.book-previews .preview { border-radius: 6px; }
.price { font-family: var(--display); font-size: 2.2rem; font-weight: 700; color: var(--coral); }
.facts { list-style: none; padding: 0; }
.facts li { padding: 8px 0 8px 30px; border-bottom: 1px dashed var(--line); position: relative; }
.facts li::before { content: ''; position: absolute; left: 4px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--sun); }
.notice { background: #fdf3d6; border-left: 6px solid var(--sun); border-radius: 12px; padding: 14px 16px; }
.notice.teal { background: #eef5ec; border-color: var(--teal); }
.timeline { display: grid; grid-template-columns: 1fr; gap: 8px; counter-reset: step; padding: 0; list-style: none; }
@media (min-width: 720px) { .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.timeline li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.timeline li strong { display: block; }

/* text pages */
.prose h2 { margin-top: 1.6em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 4px 0 0; }
.sample { font-size: clamp(2rem, 8vw, 3.4rem); line-height: 1.3; background: #fff; border-radius: 12px; padding: 6px 14px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.small { font-size: 0.88rem; color: var(--muted); }
/* keep grid children from forcing horizontal scroll on phones */
.grid > *, .gen > *, .book-previews > * { min-width: 0; }
h1, h2 { overflow-wrap: break-word; hyphens: auto; }
html, body { overflow-x: clip; }

/* brand additions */
.hero h1 .hl { background: linear-gradient(transparent 62%, #f6dc8a 62%); padding: 0 .1em; }
.rule { width: 120px; height: 5px; background: var(--coral); border-radius: 3px; margin: 10px 0 14px; }
.closed { background: #fff; border: 2px dashed var(--coral); border-radius: 14px; padding: 14px 16px; }
.closed strong { display: block; font-size: 1.1rem; }
.coming { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .coming { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.coming .card h3 { margin-top: 0; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--maroon); }
.dedication-preview { font-size: .95rem; color: var(--teal-dark); background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.counter { float: right; font-weight: 400; font-size: .85rem; color: var(--muted); }
.etsy-band { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
@media (max-width: 520px) { .nav { margin-left: 0; width: 100%; justify-content: space-between; } .nav a { font-size: .92rem; } }
main > section + section { margin-top: 28px; }
.notice .timeline { grid-template-columns: 1fr; }
.themes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.swatch i { width: 8px; height: 8px; }
/* UX round: preview placement, richer preview, upsell, strip */
.mini-cover { display: none; }
@media (max-width: 859px) {
  /* home: the live sheet sits directly under the name and state fields */
  .gen { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  .gen > form.card { display: contents; }
  .gen > form.card > * { order: 5; }
  .gen > form.card > .field { order: 1; }
  .gen > .preview { order: 2; margin: 4px 0 14px; }
  .gen > form.card > details { order: 3; }
  /* book: small sticky cover while filling the form */
  .mini-cover { display: flex; position: sticky; top: 0; z-index: 4; gap: 12px; align-items: center; background: var(--card); border-bottom: 1px solid var(--line); margin: -20px -20px 14px; padding: 8px 20px; border-radius: var(--radius) var(--radius) 0 0; }
}
.mini-page { width: 64px; aspect-ratio: 210 / 297; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; flex: none; }
.mini-page svg { display: block; width: 100%; height: 100%; }
.book-card { overflow: visible; }
.book-previews { grid-template-columns: repeat(4, 1fr); }
.book-previews button.preview { padding: 0; cursor: zoom-in; font: inherit; }
.strip { list-style: none; padding: 0; margin: 6px 0 8px; font-size: .9rem; color: var(--teal-dark); }
.strip li { padding-left: 18px; position: relative; margin: 2px 0; }
.strip li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.closed-signup { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.upsell { margin-top: 14px; display: flex; gap: 12px; align-items: center; background: #fdf3d6; border-radius: 12px; padding: 12px; }
.upsell .mini-page { width: 56px; }
.upsell p { margin: 0 0 6px; }
dialog.zoom { border: 0; padding: 0; background: transparent; max-width: min(96vw, 720px); width: 100%; }
dialog.zoom::backdrop { background: rgba(20, 20, 24, .78); }
dialog.zoom .preview { box-shadow: none; }
dialog.zoom button.close { position: absolute; top: 8px; right: 8px; border: 0; border-radius: 999px; background: #fff; font-size: 1.4rem; width: 40px; height: 40px; cursor: pointer; }
