/* FUNCATION Books — site styles */
:root {
  --paper: #fbf6ec;
  --paper-2: #f3ead8;
  --card: #ffffff;
  --ink: #1d2321;
  --ink-2: #4a524f;
  --line: #e4d8bf;
  --teal: #155d61;
  --teal-deep: #0d3b3e;
  --teal-soft: #e3f0ef;
  --gold: #b8871f;
  --gold-bright: #e8b64c;
  --gold-soft: #f6e2ae;
  --focus: #1a73e8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29,35,33,.06), 0 8px 24px rgba(29,35,33,.08);
  --shadow-lg: 0 18px 50px rgba(13,59,62,.25);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --wrap: 1160px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem; /* 19px — comfortable for large-print readers */
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--teal-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--teal-deep); }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.45rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--teal-deep); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { font-family: var(--font-body); font-weight: 700; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 .6em; }
.lead { font-size: 1.28rem; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 52px; padding: .7em 1.4em; border-radius: 999px; font-weight: 700; font-size: 1.05rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; font-family: var(--font-body); }
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold-bright); color: #1b1608; box-shadow: 0 6px 18px rgba(184,135,31,.35); }
.btn-gold:hover { background: #f0c25c; color: #1b1608; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal-deep); border-color: currentColor; }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal-deep); }
.btn-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251,246,236,.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--teal-deep); }
.brand img { width: 46px; height: 46px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.brand b { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .06em; line-height: 1; display: block; }
.brand small { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1rem; padding: 10px 14px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--teal-soft); color: var(--teal-deep); }
.nav .btn { margin-left: 8px; min-height: 44px; padding: .5em 1.1em; font-size: .98rem; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 10px 14px; border-radius: 999px; border: 2px solid var(--teal-deep); color: var(--teal-deep); min-height: 44px; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--teal-deep); color: #fff; }
.menu nav { position: absolute; right: 0; top: calc(100% + 10px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; display: grid; min-width: 230px; }
.menu nav a { text-decoration: none; color: var(--ink); font-weight: 700; padding: 12px 14px; border-radius: 10px; }
.menu nav a:hover { background: var(--teal-soft); }
@media (max-width: 860px) { .nav { display: none; } .menu { display: block; } }

/* Hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% 20%, #1d777b 0%, transparent 60%), linear-gradient(140deg, var(--teal-deep), #135356); color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg fill='%23ffffff' fill-opacity='.05' font-family='Courier New,monospace' font-weight='700' font-size='22'%3E%3Ctext x='8' y='30'%3EH%3C/text%3E%3Ctext x='58' y='30'%3EI%3C/text%3E%3Ctext x='108' y='30'%3ES%3C/text%3E%3Ctext x='158' y='30'%3ET%3C/text%3E%3Ctext x='8' y='80'%3EO%3C/text%3E%3Ctext x='58' y='80'%3ER%3C/text%3E%3Ctext x='108' y='80'%3EY%3C/text%3E%3Ctext x='158' y='80'%3EA%3C/text%3E%3Ctext x='8' y='130'%3EZ%3C/text%3E%3Ctext x='58' y='130'%3EE%3C/text%3E%3Ctext x='108' y='130'%3EU%3C/text%3E%3Ctext x='158' y='130'%3ES%3C/text%3E%3Ctext x='8' y='180'%3EN%3C/text%3E%3Ctext x='58' y='180'%3EI%3C/text%3E%3Ctext x='108' y='180'%3EL%3C/text%3E%3Ctext x='158' y='180'%3EE%3C/text%3E%3C/g%3E%3C/svg%3E"); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: italic; color: var(--gold-bright); font-weight: 500; }
.hero .lead { color: #d7ebe9; }
.hero .eyebrow { color: var(--gold-bright); }
.hero-points { list-style: none; padding: 0; margin: 22px 0 30px; display: grid; gap: 8px; color: #e9f4f3; }
.hero-points li { display: flex; gap: 10px; align-items: flex-start; }
.hero-points li::before { content: ""; flex: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: var(--gold-bright) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='%231b1608' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.cover-fan { position: relative; height: 520px; }
.cover-fan a { position: absolute; width: 42%; border-radius: 6px; box-shadow: var(--shadow-lg); transition: transform .25s ease; }
.cover-fan img { border-radius: 6px; }
.cover-fan a:nth-child(1) { left: 2%; top: 70px; transform: rotate(-8deg); }
.cover-fan a:nth-child(2) { left: 15%; top: 20px; transform: rotate(-3deg); }
.cover-fan a:nth-child(3) { left: 29%; top: 0; transform: rotate(1deg); z-index: 3; }
.cover-fan a:nth-child(4) { left: 43%; top: 30px; transform: rotate(5deg); z-index: 2; }
.cover-fan a:nth-child(5) { left: 54%; top: 110px; transform: rotate(9deg); z-index: 1; }
.cover-fan a:hover { transform: translateY(-10px) rotate(0); z-index: 5; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; }
  .cover-fan { height: 360px; max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 520px) { .cover-fan { height: 280px; } }

/* Trust strip */
.strip { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.strip ul { list-style: none; margin: 0; padding: 18px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.strip li { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--teal-deep); font-size: 1rem; }
.strip li span { flex: none; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); font-family: var(--font-display); color: var(--gold); font-size: 1.1rem; }
@media (max-width: 860px) { .strip ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .strip ul { grid-template-columns: 1fr; } }

/* Sections */
.section { padding: 84px 0; }
.section-alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: linear-gradient(150deg, var(--teal-deep), #145457); color: #e6f2f1; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--gold-bright); }
.section-head { margin-bottom: 40px; }
@media (max-width: 640px) { .section { padding: 60px 0; } }

/* Book grid */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px; }
.book-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.book-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 18px 40px rgba(29,35,33,.14); }
.book-card .cover { display: block; background: linear-gradient(160deg, var(--paper-2), #e9dcc0); padding: 22px 22px 0; }
.book-card .cover img { border-radius: 4px 4px 0 0; box-shadow: 0 10px 24px rgba(0,0,0,.25); aspect-ratio: 612 / 792; object-fit: cover; width: 100%; }
.book-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.book-card h3 { font-size: 1.25rem; margin: 0; }
.book-card h3 a { color: var(--teal-deep); text-decoration: none; }
.book-card h3 a::after { content: ""; position: absolute; inset: 0; }
.book-card { position: relative; }
.book-card p { font-size: 1rem; color: var(--ink-2); margin: 0; }
.book-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-deep); }
.tag-gold { background: var(--gold-soft); color: #5c430b; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.section-dark .feature { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.feature .ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-soft); color: #5c430b; margin-bottom: 16px; }
.section-dark .feature .ico { background: rgba(232,182,76,.18); color: var(--gold-bright); }
.feature .ico svg { width: 28px; height: 28px; }
.feature h3 { font-size: 1.25rem; }
.feature p { margin: 0; font-size: 1.02rem; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.flip > :first-child { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } .split.flip > :first-child { order: 0; } }
.page-stack { position: relative; max-width: 470px; margin: 0 auto; }
.page-stack img { border-radius: 6px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: #fff; }
.page-stack img + img { position: absolute; width: 62%; right: -6%; bottom: -8%; transform: rotate(4deg); }
@media (max-width: 520px) { .page-stack img + img { right: 0; } }

/* Checklist */
.check { list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 10px; }
.check li { position: relative; padding-left: 36px; }
.check li::before { content: ""; position: absolute; left: 0; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }

/* Bookshelf keepsake callout */
.keepsake { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gold-bright); border-radius: 14px; padding: 20px 22px; margin-top: 26px; }
.keepsake .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-soft); color: #5c430b; }
.keepsake .ico svg { width: 28px; height: 28px; }
.keepsake b { font-family: var(--font-display); font-size: 1.25rem; color: var(--teal-deep); display: block; margin-bottom: 4px; }
.keepsake p { margin: 0; color: var(--ink-2); font-size: 1.02rem; }
.keepsake-dark { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); border-left-color: var(--gold-bright); margin-top: 28px; }
.keepsake-dark b { color: #fff; }
.keepsake-dark p { color: #d7ebe9; }
.keepsake-dark .ico { background: rgba(232,182,76,.18); color: var(--gold-bright); }
@media (max-width: 480px) { .keepsake { grid-template-columns: 1fr; } }

/* Breadcrumbs */
.crumbs { font-size: .95rem; padding-top: 18px; color: var(--ink-2); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--gold); }
.crumbs a { color: var(--ink-2); }

/* Book page */
.book-hero { padding: 28px 0 72px; }
.book-hero .wrap > .grid { display: grid; grid-template-columns: 420px 1fr; gap: 56px; align-items: start; margin-top: 18px; }
.book-hero .cover-big { position: sticky; top: 100px; }
.book-hero .cover-big img { border-radius: 6px; box-shadow: var(--shadow-lg); }
.book-hero h1 { font-size: clamp(2rem, 3.8vw, 3rem); }
.book-hero .subtitle { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--ink-2); margin-top: -.2em; }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 26px 0; overflow: hidden; }
.specs div { padding: 16px 12px; text-align: center; border-right: 1px solid var(--line); }
.specs div:last-child { border-right: 0; }
.specs b { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--teal-deep); line-height: 1.1; }
.specs span { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); font-weight: 700; }
@media (max-width: 980px) { .book-hero .wrap > .grid { grid-template-columns: 1fr; gap: 32px; } .book-hero .cover-big { position: static; max-width: 300px; margin: 0 auto; } }
@media (max-width: 520px) { .book-hero .cover-big { max-width: 230px; } }
@media (max-width: 520px) { .specs { grid-template-columns: 1fr 1fr; } .specs div:nth-child(2) { border-right: 0; } .specs div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.buy-note { font-size: .95rem; color: var(--ink-2); margin-top: 12px; }

.topics { columns: 3 220px; column-gap: 28px; padding: 0; margin: 0; list-style: none; counter-reset: t; }
.topics li { break-inside: avoid; padding: 9px 0 9px 46px; position: relative; border-bottom: 1px dashed var(--line); font-size: 1.02rem; }
.topics.numbered li { counter-increment: t; }
.topics.numbered li::before { content: counter(t); position: absolute; left: 0; top: 8px; width: 32px; height: 28px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-deep); font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.topics:not(.numbered) li { padding-left: 26px; }
.topics:not(.numbered) li::before { content: "◆"; position: absolute; left: 2px; top: 10px; color: var(--gold); font-size: .8rem; }

.samples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.samples figure { margin: 0; }
.samples button { all: unset; cursor: zoom-in; display: block; border-radius: 8px; }
.samples button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.samples img { border-radius: 6px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; aspect-ratio: 900/1165; object-fit: cover; width: 100%; }
.samples figcaption { font-size: .98rem; color: var(--ink-2); margin-top: 12px; text-align: center; }
@media (max-width: 800px) { .samples { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

.facts { display: grid; gap: 14px; counter-reset: f; padding: 0; list-style: none; }
.facts li { counter-increment: f; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gold-bright); border-radius: 10px; padding: 16px 20px 16px 64px; position: relative; }
.facts li::before { content: counter(f); position: absolute; left: 18px; top: 14px; font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); font-weight: 700; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 700; font-size: 1.1rem; padding: 18px 36px 18px 0; position: relative; color: var(--teal-deep); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 1.7rem; color: var(--gold); font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-2); }

/* CTA band */
.cta-band { background: linear-gradient(120deg, #f6e2ae, #f0cd7a); border-radius: 22px; padding: 44px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta-band h2 { margin: 0 0 .3em; color: #2b2108; }
.cta-band p { margin: 0; color: #4c3b10; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; padding: 30px 24px; } }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 820px); max-height: 94vh; }
dialog.lightbox::backdrop { background: rgba(10,25,26,.86); }
dialog.lightbox img { max-height: 88vh; width: auto; margin: 0 auto; border-radius: 6px; background: #fff; }
dialog.lightbox form { text-align: right; margin-bottom: 10px; }
dialog.lightbox button { background: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 1rem; cursor: pointer; font-family: var(--font-body); }

/* Article / prose */
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.6em 0; padding: 18px 24px; border-left: 5px solid var(--gold-bright); background: var(--card); border-radius: 0 12px 12px 0; font-family: var(--font-display); font-size: 1.2rem; font-style: italic; color: var(--teal-deep); }
.prose .callout { background: var(--teal-soft); border-radius: 14px; padding: 22px 24px; margin: 1.6em 0; }
.prose .callout p:last-child { margin: 0; }
.prose img { border-radius: 10px; }
.article-head { padding: 40px 0 10px; }
.article-meta { color: var(--ink-2); font-size: .98rem; }
.inline-book { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 1.6em 0; text-decoration: none; color: var(--ink); }
.inline-book img { border-radius: 4px; box-shadow: var(--shadow); }
.inline-book b { font-family: var(--font-display); color: var(--teal-deep); font-size: 1.2rem; display: block; margin-bottom: 4px; }
.inline-book span { color: var(--ink-2); font-size: 1rem; }
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 10px; position: relative; box-shadow: var(--shadow); }
.post-card h3 { margin: 0; font-size: 1.3rem; }
.post-card h3 a { text-decoration: none; color: var(--teal-deep); }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card p { margin: 0; color: var(--ink-2); font-size: 1rem; }

/* Puzzle hub cards */
.puzzle-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.puzzle-card { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.puzzle-card img { border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.puzzle-card h3 { margin: 0 0 4px; font-size: 1.2rem; }
.puzzle-card h3 a { text-decoration: none; color: var(--teal-deep); }
.puzzle-card h3 a::after { content: ""; position: absolute; inset: 0; }
.puzzle-card p { margin: 0; font-size: .98rem; color: var(--ink-2); }

/* Word search game */
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
@media (max-width: 960px) { .ws { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .ws-board { padding: 6px; border-radius: 12px; } .ws .wrap, .section .ws { margin-left: -8px; margin-right: -8px; } }
.ws-board { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(10px, 2.4vw, 24px); box-shadow: var(--shadow); }
.ws-grid-wrap { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.ws-grid { display: grid; gap: 0; font-family: "Courier New", ui-monospace, monospace; font-weight: 700; }
.ws-grid span { aspect-ratio: 1; min-width: 0; min-height: 0; line-height: 1; overflow: hidden; display: grid; place-items: center; font-size: min(1.6rem, calc((100vw - 56px) / var(--n, 15) * .7)); color: var(--ink); cursor: pointer; border-radius: 50%; position: relative; z-index: 1; }
.ws-grid span.sel { background: rgba(232,182,76,.45); }
.ws-grid span.kb { outline: 3px solid var(--focus); outline-offset: -3px; }
.ws-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ws-lines line { stroke-linecap: round; opacity: .38; }
.ws-side h2 { font-size: 1.5rem; }
.ws-status { font-weight: 700; color: var(--teal-deep); margin: 0 0 12px; font-size: 1.1rem; }
.ws-words { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.ws-words li { font-weight: 700; letter-spacing: .04em; font-size: 1.02rem; padding: 4px 0; }
.ws-words li.found { text-decoration: line-through; text-decoration-thickness: 2px; color: #8a918e; }
.ws-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.ws-tools .btn { min-height: 46px; font-size: .98rem; padding: .5em 1.1em; }
.ws-done { display: none; margin-top: 20px; background: var(--gold-soft); border-radius: 14px; padding: 18px 20px; }
.ws-done.show { display: block; }
.ws-done p { margin: 0 0 12px; font-weight: 700; color: #3d2f0a; }
.ws-help { font-size: .95rem; color: var(--ink-2); margin-top: 14px; }
.clues { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 0; list-style: none; }
.clues li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-size: 1.02rem; }
.clues b { display: block; font-family: var(--font-display); color: var(--teal-deep); font-size: 1.15rem; letter-spacing: .02em; }
@media (max-width: 700px) { .clues { grid-template-columns: 1fr; } }
.print-only { display: none; }

/* Word story: background from the book, revealed when a word is found */
.ws-story { margin: 0 0 20px; }
.ws-story [hidden] { display: none !important; }
.ws-story-empty { background: var(--teal-soft); border-radius: 14px; padding: 16px 18px; }
.ws-story-empty b { font-family: var(--font-display); color: var(--teal-deep); font-size: 1.15rem; display: block; margin-bottom: 2px; }
.ws-story-empty p { margin: 0; font-size: .98rem; color: var(--ink-2); }
.ws-story-card { position: relative; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gold-bright); border-radius: 14px; padding: 16px 44px 16px 20px; box-shadow: var(--shadow); }
.ws-story-card.pop { animation: ws-pop .35s ease; }
.ws-story-card .eyebrow { margin: 0 0 2px; }
.ws-story-word { font-size: 1.45rem; letter-spacing: .03em; margin: 0 0 8px; }
.ws-story-text { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.6; }
.ws-story-src { margin: 0; font-size: .88rem; color: var(--ink-2); }
.ws-story-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper-2); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ws-story-close:hover { background: var(--line); }
@keyframes ws-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 960px) {
  /* On phones/tablets the word list sits below the grid, so float the story card over the bottom of the screen */
  .ws-story-card { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-height: 50vh; overflow: auto; box-shadow: 0 10px 40px rgba(13,59,62,.35); }
}

/* Story list below the puzzle: locked until the word is found (only when the game script is running) */
.clue-text { margin: 4px 0 0; }
.clue-lock { display: none; margin: 4px 0 0; color: var(--ink-2); font-style: italic; font-size: .95rem; }
.ws-js .clues li:not(.unlocked) { background: transparent; border-style: dashed; }
.ws-js .clues li:not(.unlocked) .clue-text { display: none; }
.ws-js .clues li:not(.unlocked) .clue-lock { display: block; }
.ws-js .clues li.unlocked b::after { content: " ✓"; color: var(--gold); }

/* Footer */
.site-footer { background: #0b2f31; color: #bcd5d3; padding: 64px 0 28px; margin-top: 0; font-size: 1rem; }
.site-footer a { color: #e7f2f1; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h2 { font-family: var(--font-body); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright); margin-bottom: 14px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.foot-brand img { width: 56px; height: 56px; border-radius: 12px; }
.foot-brand b { font-family: var(--font-display); color: #fff; font-size: 1.4rem; letter-spacing: .06em; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 44px; padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .92rem; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* 404 */
.notfound { text-align: center; padding: 100px 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* Print: puzzle pages print as a clean, large worksheet */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .crumbs, .no-print, .ws-tools, .ws-status, .ws-help, .ws-done, .cta-band, .section-alt, nav { display: none !important; }
  .print-only { display: block; }
  .section { padding: 0 !important; }
  .ws { grid-template-columns: 1fr; gap: 12px; }
  .ws-board { border: 2px solid #000; box-shadow: none; border-radius: 0; padding: 8px; }
  .ws-grid span { font-size: 18pt; color: #000; background: none !important; }
  .ws-lines { display: none; }
  .ws-words { grid-template-columns: repeat(4, 1fr); }
  .ws-words li.found { text-decoration: none; color: #000; }
  .ws-print-title { font-family: Georgia, serif; font-size: 20pt; margin: 0 0 6px; }
  .print-break { break-before: page; }
  .ws-story { display: none !important; }
  .clues li .clue-text { display: block !important; }
  .clues li .clue-lock { display: none !important; }
  .clues li b::after { content: none !important; }
}
