/* YoungShakespeare.fyi — shared styles */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/eb-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/eb-garamond-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo Black"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/archivo-black-latin-400-normal.woff2") format("woff2"); }

:root {
  --paper: #F5EEDF;      /* parchment */
  --panel: #FFFBF2;
  --ink: #2A2019;        /* iron-gall brown-black */
  --muted: #5E5243;
  --rule: #DCCDB0;
  --indigo: #2E2A55;     /* the book cover */
  --accent: #3A3270;
  --accent-ink: #FFFFFF;
  --gold: #9A7424;
  --wood: #1B130C;
  --font: "Atkinson Hyperlegible", Arial, Helvetica, sans-serif;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --menu: "Archivo Black", "Arial Black", "Arial Bold", Gadget, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #16120E; --panel: #201A14; --ink: #F1E8D8; --muted: #C2B49E; --rule: #3E3428;
  --indigo: #C9C2FF; --accent: #B9AEFF; --accent-ink: #15121F; --gold: #DDB65E; color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #16120E; --panel: #201A14; --ink: #F1E8D8; --muted: #C2B49E; --rule: #3E3428;
  --indigo: #C9C2FF; --accent: #B9AEFF; --accent-ink: #15121F; --gold: #DDB65E; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 19px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; background: #fff; color: #000; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header, banner and menu ---------- */
.site-head { background: var(--wood); color: #fff; }
.menu { font-family: var(--menu); font-weight: 400; text-transform: uppercase; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.menu a { color: #fff; text-decoration: none; display: block; letter-spacing: 0.02em; text-shadow: 0 2px 4px rgba(0,0,0,.85), 0 0 14px rgba(0,0,0,.6); border-bottom: 3px solid transparent; }
.menu a:hover { border-bottom-color: rgba(255,255,255,.7); }
.menu a[aria-current="page"] { border-bottom-color: #E5C26A; }
.menu .long { white-space: pre; }

.banner { position: relative; max-width: 1600px; margin: 0 auto; }
.banner img { width: 100%; }

/* Home page: menu sits on the wood above the parchment */
.home .menu { position: absolute; inset: 0 0 auto 0; padding: 0.55vw 2vw 1.6vw;
  background: linear-gradient(rgba(15,9,4,.62), rgba(15,9,4,.35) 60%, rgba(15,9,4,0)); }
.home .menu ul { gap: 0 clamp(14px, 2.3vw, 40px); }
.home .menu a { font-size: clamp(15px, 1.86vw, 26.67px); /* 26.67px = 20pt */ line-height: 1.35; }
@media (min-width: 1600px) { .home .menu { padding: 9px 32px 26px; } }

/* Inner pages: menu bar, then a smaller banner on a blurred backdrop */
.inner .menu { background: linear-gradient(#120C07, #1F160E); padding: 12px 16px 10px; border-bottom: 1px solid #3a2a1a; }
.inner .menu ul { gap: 4px clamp(16px, 2.6vw, 44px); }
.inner .menu a { font-size: clamp(14px, 1.7vw, 26.67px); line-height: 1.4; }
.inner .banner { max-width: none; background: #1B130C url("img/banner-blur.jpg") center / cover; }
.inner .banner img { width: min(100%, 640px); margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,.55); }
.inner .banner a { display: block; }

@media (max-width: 760px) {
  .home .menu { position: static; background: linear-gradient(#120C07, #1F160E); padding: 10px 12px; }
  .menu ul { gap: 2px 18px !important; }
  .menu a { font-size: 14.5px !important; line-height: 1.6; }
  .menu .long { display: none; }
}

/* ---------- Page body ---------- */
main { display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.prose { max-width: 70ch; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); margin: 0 0 .5em; }
h3 { font-size: 1.4rem; margin: 0 0 .35em; }
p { margin: 0 0 1em; }
.kicker { font-family: var(--font); font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 .6em; }
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.fleuron { text-align: center; color: var(--gold); font-family: var(--serif); font-size: 1.6rem; margin: 0; padding: 8px 0 0; }

.hero { padding: 56px 0 48px; text-align: center; }
.hero .claim { font-family: var(--serif); font-size: clamp(1.75rem, 3.6vw, 2.75rem); line-height: 1.2; max-width: 30ch; margin: 0 auto .5em; font-weight: 500; }
.hero .claim em { color: var(--accent); }
.hero .lede { max-width: 62ch; margin: 0 auto; color: var(--muted); font-size: 1.05rem; }

.twocol { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .twocol { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.aside { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 22px 24px; }
.aside h3 { font-size: 1.25rem; }
.aside ul { margin: 0; padding-left: 1.1em; }
.aside li { margin-bottom: .45em; }
.small { font-size: .88rem; color: var(--muted); }
blockquote { margin: 0 0 1em; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: 1.18rem; font-style: italic; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
@media (max-width: 900px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--gold); transform: translateY(-2px); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .go { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--accent); }

/* Book */
.book { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .book { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.book figure { margin: 0; }
.book figure img { border-radius: 6px; box-shadow: 0 18px 40px rgba(40,25,10,.28); }
.book figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.badges li { border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 2px 12px; font-size: .82rem; font-weight: 700; letter-spacing: .04em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.facts div { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; }
.facts b { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; color: var(--accent); }
.facts span { font-size: .85rem; color: var(--muted); line-height: 1.35; display: block; }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* Interest form */
.interest { background: var(--panel); border: 1px solid var(--rule); border-top: 4px solid var(--gold); border-radius: 12px; padding: 24px; margin-top: 8px; }
.interest h3 { margin-bottom: .2em; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; margin-top: 14px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 4px; }
input[type=text], input[type=email], select, textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 1.5px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea { min-height: 90px; resize: vertical; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.btn { display: inline-block; font: inherit; font-weight: 700; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 12px 22px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.1); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.form-status { margin: 12px 0 0; font-weight: 700; }
.form-status.ok { color: #2F6B2F; } .form-status.err { color: #A23A2A; }
:root[data-theme="dark"] .form-status.ok { color: #8FD18F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-status.ok { color: #8FD18F; } :root:not([data-theme="light"]) .form-status.err { color: #FF9C8A; } }

.author { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 28px; align-items: start; }
.author img { border-radius: 50%; width: 140px; height: 140px; object-fit: cover; object-position: 50% 22%; border: 3px solid var(--gold); }
@media (max-width: 600px) { .author { grid-template-columns: minmax(0, 1fr); } }

/* Paper pages */
.paper-head { padding: 48px 0 8px; }
.paper-head .byline { font-family: var(--serif); font-size: 1.25rem; color: var(--muted); margin: 0 0 1.2em; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 14px 16px; margin: 0 0 24px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; font-size: .92rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 1.6rem; height: 1rem; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); display: inline-block; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 28px; }
.viewer-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; background: var(--wood); color: #F1E8D8; padding: 8px 16px; font-size: .9rem; border-radius: 10px 10px 0 0; }
.viewer-bar button { font: inherit; font-weight: 700; background: #3a2c1e; color: #fff; border: 1px solid #5a4630; border-radius: 6px; padding: 4px 12px; cursor: pointer; min-width: 2.4rem; }
.viewer-bar button:hover { background: #4a3826; }
.viewer-bar .grp { display: flex; gap: 6px; align-items: center; }
.viewer { background: #5B4E40; padding: 18px 12px 28px; border-radius: 0 0 10px 10px; display: grid; gap: 16px; justify-items: center; overflow-x: auto; -webkit-user-select: none; user-select: none; }
.pg { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.4); position: relative; max-width: 100%; }
.pg canvas { display: block; width: 100%; height: 100%; }
.pg .num { position: absolute; right: -2px; bottom: -22px; font-size: .75rem; color: #E9DFCF; }
.viewer .loading { color: #F1E8D8; padding: 40px; text-align: center; }
@media print { .viewer, .viewer-bar { display: none !important; } .noprint-msg { display: block !important; } }
.noprint-msg { display: none; }

/* Footer */
.site-foot { margin-top: 64px; background: var(--wood); color: #D9CBB4; font-size: .88rem; padding: 32px 0 40px; }
.site-foot a { color: #F0D894; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 32px; justify-content: space-between; }
.site-foot p { margin: 0 0 .4em; }
@media (min-width: 901px) { .book figure, .twocol .aside { position: sticky; top: 24px; } }
@media (max-width: 760px) { .home .banner { display: flex; flex-direction: column; } .home .menu { order: -1; } }
