:root {
  --inner-blue: #007cc3;
  --outer-blue: #17479e;
  --ink: #14213d;
  --muted: #5f6f82;
  --paper: #fffdf8;
  --sand: #f4efe4;
  --sky: #edf7fc;
  --line: #d8e2ec;
  --card: #fff;
  --warm: #f7b267;
  --shadow: 0 18px 50px rgba(20, 33, 61, .12);
  --radius: 24px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7fbff 0%, var(--paper) 34%, #fff 100%);
  font-size: 16px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: var(--outer-blue); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--inner-blue); }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .75rem 1rem; border: 2px solid var(--outer-blue); border-radius: 999px; z-index: 20; }
.site-header { position: sticky; top: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(216,226,236,.75); z-index: 10; }
.nav-wrap { max-width: var(--max); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.25rem; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { width: 225px; max-width: 54vw; }
.nav-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .65rem .8rem; font: inherit; }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--sky); color: var(--outer-blue); }
.button, .nav-links .pay-link { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; border-radius: 999px; background: var(--outer-blue); color: #fff !important; padding: .72rem 1.05rem; text-decoration: none; font-weight: 800; border: 0; box-shadow: 0 8px 24px rgba(23,71,158,.22); cursor: pointer; }
.button:hover, .nav-links .pay-link:hover { background: #0f367e; color: #fff; }
.button.secondary { background: #fff; color: var(--outer-blue) !important; border: 1px solid var(--line); box-shadow: none; }
.button.subtle { background: var(--sky); color: var(--outer-blue) !important; box-shadow: none; }
.button[aria-disabled="true"], button:disabled { opacity: .58; cursor: not-allowed; }
.external::after { content: "↗"; font-size: .85em; margin-left: .25rem; }

.container { max-width: var(--max); margin: auto; padding: 0 1.25rem; }
.hero { position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 9% 20%, rgba(0,124,195,.18), transparent 34%), radial-gradient(circle at 92% 18%, rgba(247,178,103,.2), transparent 24%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0,1.03fr) minmax(330px,.97fr); gap: 2.5rem; align-items: center; min-height: calc(100vh - 82px); padding: 4rem 1.25rem 3rem; }
h1, h2, h3 { line-height: 1.05; margin: 0 0 1rem; }
h1 { font-size: clamp(2.6rem, 7vw, 5.9rem); letter-spacing: -.065em; }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.045em; }
h3 { font-size: 1.35rem; }
.lead { font-size: clamp(1.06rem, 2vw, 1.28rem); color: #38475a; max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin: 1.6rem 0; }
.locator-panel, .card { background: rgba(255,255,255,.91); border: 1px solid rgba(216,226,236,.92); border-radius: var(--radius); box-shadow: var(--shadow); }
.locator-panel { padding: 1.25rem; margin-top: 1.35rem; }
.locator-row { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; }
.field { display: grid; gap: .35rem; }
label { font-weight: 800; }
.input, select, textarea { width: 100%; border: 1px solid #b9c6d5; background: #fff; border-radius: 14px; min-height: 48px; padding: .75rem .9rem; font: inherit; color: var(--ink); }
textarea { min-height: 150px; resize: vertical; }
.help, .muted { color: var(--muted); }
.help { font-size: .92rem; }

.featured-panel { position: relative; min-height: 580px; border-radius: 34px; padding: 1.35rem; background: linear-gradient(180deg, rgba(23,71,158,.14), rgba(0,124,195,.07)); overflow: hidden; }
.featured-copy { max-width: 23rem; position: relative; z-index: 2; }
.featured-panel h2 { font-size: clamp(1.55rem, 2.4vw, 2.35rem); letter-spacing: -.03em; }
.featured-panel .button { position: absolute; left: 1.35rem; bottom: 1.35rem; z-index: 3; }
.market-showcase { position: absolute; inset: 8.2rem 1rem 5.2rem; perspective: 900px; }
.book-card { --accent: var(--inner-blue); position: absolute; display: block; width: min(78%, 360px); min-height: 172px; overflow: hidden; border-radius: 28px; padding: 1.3rem; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.34); box-shadow: 0 24px 60px rgba(16,36,73,.2); background: linear-gradient(135deg, var(--outer-blue), var(--accent)); transform: translate(calc(var(--i) * 24px), calc(var(--i) * 42px)) rotate(calc(-4deg + var(--i) * 1.45deg)); z-index: calc(10 - var(--i)); }
.book-card:nth-child(n+5) { opacity: .72; }
.book-card img { position: absolute; right: .85rem; top: .85rem; width: 88px; opacity: .9; filter: drop-shadow(0 8px 14px rgba(0,0,0,.22)); pointer-events: none; }
.book-card strong { display: block; font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1; margin: 4.2rem 0 .45rem; position: relative; z-index: 1; }
.book-card span { position: relative; z-index: 1; color: rgba(255,255,255,.88); }
.blue-band { background: linear-gradient(135deg, var(--outer-blue), var(--inner-blue)); color: #fff; }
.blue-band .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.blue-band p { margin: 0; font-weight: 800; }

.section { padding: 4.2rem 0; }
.section.tight { padding: 2.5rem 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.utility-card, .market-card, .contact-card { padding: 1.25rem; }
.utility-card { min-height: 170px; display: flex; flex-direction: column; justify-content: space-between; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; }
.compact-locator { padding-top: 3.2rem; }
.locator-card { padding: 1.25rem; }
.directory-tools { display: grid; grid-template-columns: minmax(0,2fr) 1fr; gap: .85rem; margin: 1rem 0 1.25rem; }
.states { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0 1rem; }
.chip { --accent: var(--outer-blue); border: 1px solid color-mix(in srgb, var(--accent), #fff 62%); background: #fff; border-radius: 999px; padding: .45rem .7rem; min-height: 40px; color: #173a78; font-weight: 800; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--outer-blue); color: #fff; border-color: var(--outer-blue); }
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.market-card { --accent: var(--inner-blue); --accent-soft: #f1f8fd; position: relative; overflow: hidden; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(180deg, #fff 0%, var(--accent-soft) 100%); }
.state-az { --accent: #d67a2f; --accent-soft: #fff6e9; }
.state-ca { --accent: #007cc3; --accent-soft: #eef8fd; }
.state-co { --accent: #4d79b8; --accent-soft: #f1f6ff; }
.state-id { --accent: #17479e; --accent-soft: #edf3ff; }
.state-nm { --accent: #0f8fb7; --accent-soft: #edfafd; }
.state-or { --accent: #326d8f; --accent-soft: #edf7fa; }
.state-default { --accent: var(--inner-blue); --accent-soft: #f1f8fd; }
.state-ribbon { position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--accent); }
.market-mark { position: absolute; right: .8rem; top: .8rem; width: 78px; opacity: .18; pointer-events: none; }
.market-card h3 { margin-bottom: .35rem; position: relative; z-index: 1; }
.market-card p { position: relative; z-index: 1; }
.state-name { color: var(--accent); font-weight: 850; margin: 0 0 .35rem; padding-left: .35rem; }
.market-card.is-highlighted { outline: 4px solid var(--warm); outline-offset: 4px; animation: marketPulse 1.4s ease-out 1; }
@keyframes marketPulse { 0% { box-shadow: 0 0 0 0 rgba(247,178,103,.55), var(--shadow); } 100% { box-shadow: 0 0 0 18px rgba(247,178,103,0), var(--shadow); } }
.notice { border: 1px solid #b8d8ef; background: #eff8ff; border-radius: 18px; padding: 1rem; color: #193f65; }
.warning { border-color: #f3d28f; background: #fff8e8; color: #684300; }

.ad-diagram-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.25rem; margin: 1.25rem 0; }
.ad-diagram-card { padding: 1.25rem; }
.ad-diagram-wide { grid-column: 1 / -1; }
.ad-art { margin: 0; }
.ad-interactive { position: relative; }
.ad-art svg { display: block; width: 100%; height: auto; }
.page-paper { fill: #fffdf2; stroke: #18233a; stroke-width: 1.6; }
.page-rule { fill: #d8e9f7; stroke: #18233a; stroke-width: .8; }
.copy-line { stroke: #8aa2b8; stroke-width: 1.2; opacity: .65; }
.page-edge-marker { fill: #111; pointer-events: none; }
.placement-outline { fill: #fff; stroke: #111827; stroke-width: 2; }
.placement-label { fill: #18233a; font-family: Arial, sans-serif; font-weight: 800; user-select: none; }
.placement-label-active { opacity: 0; }
.placement-target { fill: transparent; stroke: transparent; cursor: pointer; }
.placement-target:hover, .placement-target:focus, .placement-target.is-active { fill: #fff7d6; fill-opacity: .9; stroke: #f59e0b; stroke-width: 4; filter: drop-shadow(0 0 7px rgba(247,178,103,.95)); }
.placement-target:hover + .placement-label-active, .placement-target:focus + .placement-label-active, .placement-target.is-active + .placement-label-active { opacity: 1; }
.ad-tooltip { position: absolute; z-index: 3; left: 50%; top: 1rem; width: min(17rem, calc(100% - 2rem)); transform: translateX(-50%); display: grid; gap: .15rem; padding: .7rem .85rem; border: 1px solid #e8b24f; border-radius: 12px; color: #3f2b00; background: #fffaf0; box-shadow: 0 10px 24px rgba(20,33,61,.16); font-size: .9rem; pointer-events: none; }
.ad-tooltip strong { color: var(--outer-blue); font-size: 1rem; }
.ad-tooltip span:nth-child(2) { font-weight: 800; }
.glossary-card { padding: 1.25rem; margin: 1.25rem 0; }
.glossary-card ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; padding-left: 1.25rem; }
.ad-tables { display: grid; gap: 1rem; }
.ad-table-card { padding: 1.25rem; min-width: 0; max-width: 100%; overflow: hidden; }
.table-wrap { position: relative; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.size-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: .96rem; }
.size-table th, .size-table td { padding: .68rem .55rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.size-table th { color: var(--outer-blue); }
.size-table thead th { font-size: .82rem; line-height: 1.2; vertical-align: bottom; white-space: normal; }
.size-table th:first-child, .size-table td:first-child { position: sticky; left: 0; z-index: 1; width: 5rem; min-width: 5rem; background: #fff; box-shadow: 1px 0 0 var(--line), 7px 0 10px rgba(20,33,61,.04); white-space: normal; }
.size-table thead th:first-child { z-index: 2; background: #f8fbff; }
.standard-size-table th:not(:first-child), .standard-size-table td:not(:first-child) { min-width: 9.25rem; }
.cover-size-table th:not(:first-child), .cover-size-table td:not(:first-child) { min-width: 9rem; }
.cover-size-table th:first-child, .cover-size-table td:first-child { width: 5.8rem; min-width: 5.8rem; }
.table-format, .table-context { display: block; }
.table-format { font-weight: 850; white-space: nowrap; }
.table-context { margin-top: .16rem; color: var(--muted); font-size: .76rem; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.cover-reference { margin-top: 2rem; }
.cover-format + .cover-format { margin-top: 1.5rem; }
.cover-format > h3 { margin: 0 0 .75rem; color: var(--outer-blue); }


.contact-section { padding-top: 1.4rem; }
.contact-grid { display: grid; grid-template-columns: minmax(245px,.72fr) minmax(0,1.28fr); gap: 1.8rem; align-items: start; }
.contact-list { display: grid; gap: .8rem; position: sticky; top: 94px; }
.contact-item { padding: 1.1rem; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.contact-main { display: grid; gap: 1rem; }

.contact-workflow .form-grid { padding: 1.6rem; }
.form-grid { display: grid; gap: 1rem; }
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.checkbox-line { display: flex; align-items: center; gap: .6rem; }
.form-note { color: var(--muted); font-size: .92rem; margin: 0; }
.form-result { border-radius: 16px; padding: 1rem; border: 1px solid var(--line); background: var(--sky); }
.form-result.is-error { background: #fff8e8; border-color: #f3d28f; color: #684300; }
.form-result.is-success { background: #eaf8ef; border-color: #b7e2c4; color: #176235; }
.turnstile-slot { min-height: 70px; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; }
.turnstile-message { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: .9rem; }
.turnstile-message.is-error { color: #684300; }

.reader-page { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: #f7fbff; }
.reader-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem clamp(.75rem, 2vw, 1.5rem); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); z-index: 2; }
.reader-brand { display: flex; align-items: center; }
.reader-brand img { width: clamp(145px, 18vw, 225px); height: auto; }
.reader-back { min-height: 40px; display: inline-flex; align-items: center; padding: .45rem .8rem; border-radius: 999px; background: var(--sky); font-weight: 800; text-decoration: none; }
.reader-main { min-height: 0; overflow: hidden; }
.reader-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .4rem; padding: clamp(.45rem, 1vw, .8rem) clamp(.6rem, 2vw, 1.5rem) 0; }
.reader-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.reader-titlebar h1 { font-size: clamp(1.35rem, 3vw, 2.4rem); letter-spacing: -.04em; margin: 0; }
.reader-titlebar span, .reader-kicker { color: var(--muted); font-size: .82rem; font-weight: 800; margin: 0; }
.reader-frame-wrap { min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #dfeaf3; box-shadow: var(--shadow); }
.publuu-reader { display: block; width: 100%; height: 100%; min-height: 0; border: 0; }
.reader-fallback { margin: 0; text-align: right; font-size: .82rem; }
.reader-footer { padding: .25rem .75rem; text-align: right; background: #102449; font-size: .72rem; }
.reader-footer a { color: #d9e7f7; }
.reader-unavailable { padding-top: 3rem; }

.site-footer { background: #102449; color: #e7eef9; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 1rem; padding: 2.4rem 1.25rem; }
.footer-logo { filter: brightness(1.35); }
.site-footer a { color: #fff; }
.site-footer .muted { color: #b9c8dc; }
.tiny, .build-note { font-size: .86rem; }
.page-hero { padding: 4rem 0 2.2rem; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }

@supports not (color: color-mix(in srgb, white, black)) {
  .chip { border-color: var(--line); }
}

@media (max-width: 1000px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-grid { min-height: auto; padding-top: 2.8rem; }
  .featured-panel { min-height: 500px; }
  .market-showcase { inset-top: 7.8rem; }
  .grid, .market-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .directory-tools, .pay-card { grid-template-columns: 1fr; }
  .ad-diagram-grid { grid-template-columns: 1fr; }
  .brand img { width: 190px; }
  .contact-list { position: static; }
}

@media (max-width: 680px) {
  .nav-toggle { display: inline-flex; }
  .nav-links { position: absolute; left: 1rem; right: 1rem; top: calc(100% + .5rem); display: none; flex-direction: column; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: .6rem; box-shadow: var(--shadow); }
  .nav-links[data-open="true"] { display: flex; }
  .nav-links a { justify-content: center; }
  .hero-actions, .locator-row { display: grid; grid-template-columns: 1fr; }
  .grid, .market-grid, .footer-grid { grid-template-columns: 1fr; }
  .featured-panel { min-height: 455px; }
  .market-showcase { inset: 8rem .8rem 4.5rem; }
  .book-card { width: 85%; min-height: 145px; transform: translate(calc(var(--i) * 15px), calc(var(--i) * 28px)) rotate(calc(-4deg + var(--i) * 1.45deg)); }
  .book-card strong { margin-top: 3.1rem; font-size: 1.7rem; }
  .book-card img { width: 66px; }
  .book-card:nth-child(n+5) { display: none; }
  .blue-band .container { display: grid; }
  .section { padding: 3rem 0; }
  .nav-wrap { padding: .7rem 1rem; }
  .brand img { width: 170px; }
  h1 { font-size: 2.65rem; }
  .card, .locator-panel { border-radius: 20px; }
  .contact-workflow .form-grid { padding: 1.1rem; }
  .glossary-card ul { grid-template-columns: 1fr; }
  .ad-table-card { padding: 1rem; }
  .size-table th, .size-table td { padding: .6rem .55rem; }
  .reader-header { padding: .35rem .65rem; }
  .reader-back { font-size: .86rem; }
  .reader-shell { padding: .35rem .45rem 0; gap: .25rem; }
  .reader-titlebar h1 { font-size: 1.25rem; }
  .reader-titlebar span { font-size: .72rem; }
  .reader-frame-wrap { border-radius: 10px; }
  .reader-fallback { font-size: .75rem; }
  .ad-tooltip { top: .6rem; width: min(15rem, calc(100% - 1.2rem)); font-size: .82rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .book-card { animation: deckNudge 9s ease-in-out infinite; animation-delay: calc(var(--i) * .55s); }
  @keyframes deckNudge { 0%, 100% { margin-top: 0; } 50% { margin-top: -7px; } }
  .button, .chip, .nav-links a, .intent-card, .book-card { transition: .18s ease; }
  .book-card:hover { transform: translate(calc(var(--i) * 24px), calc(var(--i) * 38px)) rotate(calc(-3deg + var(--i) * 1.2deg)); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .book-card, .market-card.is-highlighted { animation: none !important; } }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 3px; }
