/* Kroraina Press — lapis and gold, after the cover of Book 1 */

@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/ebgaramond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/ebgaramond-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/assets/fonts/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f1e6;
  --surface: #efe7d6;
  --text: #1c2233;
  --muted: #5b6070;
  --line: #ddd3bf;
  --lapis: #1b2a4e;
  --gold: #8f6a24;
  --link: #1b2a4e;
  --btn-bg: #1b2a4e;
  --btn-text: #f6efe0;
  --cover-shadow: 0 1px 2px rgb(20 25 40 / 0.15), 0 10px 28px -8px rgb(20 25 40 / 0.35);

  --serif: "EB Garamond", "Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --display: "Cinzel", "Trajan Pro", "EB Garamond", Georgia, serif;
  --wrap: 64rem;
  --narrow: 38rem;
  --gutter: 1.25rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1729;
    --surface: #16213a;
    --text: #ece4d3;
    --muted: #a3a8b6;
    --line: #26324d;
    --gold: #d4b06a;
    --link: #e2c789;
    --btn-bg: #d4b06a;
    --btn-text: #111a2e;
    --cover-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 30px -8px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1729;
  --surface: #16213a;
  --text: #ece4d3;
  --muted: #a3a8b6;
  --line: #26324d;
  --gold: #d4b06a;
  --link: #e2c789;
  --btn-bg: #d4b06a;
  --btn-text: #111a2e;
  --cover-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 30px -8px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-family: var(--display); font-size: clamp(1.8rem, 6vw, 2.6rem); letter-spacing: 0.02em; }
p { margin: 0 0 1em; }
cite { font-style: italic; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.center { text-align: center; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.9rem;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.lead { font-size: 1.2rem; color: var(--muted); }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.5rem 1rem; z-index: 10; }


/* Header */
.site-header { position: relative; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.header-actions { display: flex; align-items: center; gap: 1.25rem; flex: none; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.mark { width: 2rem; height: 2rem; border-radius: 50%; flex: none; }
.brand-name { font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.6rem;
}
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.nav a[aria-current] { box-shadow: inset 0 -1px 0 var(--gold); }
.icon-btn {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { color: var(--text); }
.theme-toggle { margin-left: -0.6rem; margin-right: -0.6rem; }
.menu-toggle, .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.icon-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

main { padding-bottom: 4rem; }

/* Home hero */
.hero { text-align: center; padding-top: 3.5rem; padding-bottom: 3rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-lead { max-width: 36rem; margin: 0 auto; font-size: clamp(1.45rem, 5vw, 1.9rem); line-height: 1.4; color: var(--text); text-wrap: balance; }

/* Shelf */
.books-section { text-align: center; padding-top: 1.5rem; }
.shelf {
  list-style: none; margin: 0 auto; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 2rem 1.25rem;
}
.shelf-item { width: min(13rem, calc(50% - 0.625rem)); }
.shelf-link { display: block; text-decoration: none; color: var(--text); }
.cover { width: 100%; aspect-ratio: 5 / 8; object-fit: cover; border-radius: 2px; box-shadow: var(--cover-shadow); }
a.shelf-link .cover { transition: transform 0.25s ease, box-shadow 0.25s ease; }
a.shelf-link:hover .cover { transform: translateY(-4px); }
.shelf-num {
  display: block; margin-top: 1rem;
  font-family: var(--display); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
}
.shelf-title { display: block; margin-top: 0.2rem; font-size: 1.15rem; line-height: 1.3; }
a.shelf-link:hover .shelf-title { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

.cover-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem;
  padding: 1rem; text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
}
.ph-series { font-family: var(--display); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ph-title { font-family: var(--display); font-size: 1.1rem; line-height: 1.25; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.is-forthcoming .shelf-title { color: var(--muted); }
.shelf-soon { display: block; margin-top: 0.15rem; font-style: italic; font-size: 0.95rem; color: var(--muted); }

/* Series blurb on home */
.series-blurb { margin-top: 4.5rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.series-blurb p:first-child::first-letter {
  font-family: var(--display); float: left; font-size: 3.3em; line-height: 0.85;
  margin: 0.05em 0.1em 0 0; color: var(--gold);
}
.more { margin-top: 1.5rem; font-family: var(--display); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* Generic page head */
.page-head { padding-top: 3rem; padding-bottom: 2rem; text-align: center; }
.page-head .lead { max-width: 34rem; margin-inline: auto; }

/* Book page */
.book {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-top: 2.5rem;
}
.book-cover { width: min(17rem, 70vw); margin: 0 auto; }
.book-info { text-align: center; }
.book-title { font-size: clamp(2rem, 8vw, 3rem); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0; }
.book-subtitle { display: block; margin: 0.45rem 0 0.75rem; font-family: var(--serif); font-style: italic; font-size: 1.3rem; font-weight: 400; line-height: 1.35; letter-spacing: 0; text-transform: none; color: var(--muted); text-wrap: balance; }
.book-byline { font-family: var(--display); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.9rem; margin-bottom: 1.75rem; }
.buy { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.btn {
  display: inline-block;
  min-width: 15rem;
  padding: 0.85rem 1.75rem;
  background: var(--btn-bg); color: var(--btn-text);
  font-family: var(--display); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; text-align: center; border-radius: 3px;
  transition: filter 0.2s ease;
}
.buy-soon { margin: 0; font-style: italic; font-size: 1.1rem; color: var(--muted); }
.btn:hover { color: var(--btn-text); filter: brightness(1.15); }
.book-desc { max-width: var(--narrow); margin: 1rem auto 0; font-size: 1.2rem; }
.book-desc p { text-wrap: pretty; }

@media (min-width: 48rem) {
  .book {
    grid-template-columns: 20rem 1fr;
    grid-template-areas: "cover info" "cover desc";
    column-gap: 3.5rem;
    row-gap: 0;
    align-items: start;
    padding-top: 4rem;
  }
  .book-cover { grid-area: cover; width: 100%; position: sticky; top: 2rem; }
  .book-info { grid-area: info; text-align: left; padding-top: 0.5rem; }
  .book-desc { grid-area: desc; margin: 2.5rem 0 0; }
  .buy { align-items: flex-start; }
}

.series-box { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.series-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.series-list li { display: flex; align-items: baseline; gap: 0.9rem; padding: 0.6rem 0; border-bottom: 1px dotted var(--line); }
.series-list .n { font-family: var(--display); color: var(--gold); width: 1.2rem; flex: none; }
.series-list .t, .series-list a { flex: 1; }
.series-list li:not([aria-current]) .t { color: var(--muted); }
.series-list .s { font-size: 0.95rem; font-style: italic; color: var(--muted); }
.cover-note { font-size: 0.95rem; color: var(--muted); font-style: italic; }
.cover-note cite { font-style: normal; }

/* About */
.about { padding-top: 3rem; }
.avatar { width: 6.5rem; height: 6.5rem; border-radius: 50%; margin: 0 auto 1.5rem; }
.about h1 { text-align: center; margin-bottom: 1.5rem; }
.about > p { text-wrap: pretty; }
.contact { margin-top: 2.5rem; padding: 1.75rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; text-align: center; }
.contact p { margin-bottom: 0.4rem; }
.email { font-size: 1.3rem; overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; text-align: center; color: var(--muted); font-size: 1rem; }
.mark-footer { width: 2.5rem; height: 2.5rem; margin: 0 auto 1rem; }
:root[data-theme="dark"] .mark { box-shadow: 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { box-shadow: 0 0 0 1px var(--line); } }
.site-footer p { margin: 0.2rem 0; }
.site-footer a { color: var(--muted); }
.copyright { font-family: var(--display); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 0.75rem !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.ph-soon { font-style: italic; font-size: 0.95rem; color: var(--muted); }

/* Journal */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.post-list li:first-child { padding-top: 0.4rem; }
.post-list time, .post-head time {
  font-family: var(--display); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.post-list h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; margin: 0.3rem 0 0.35rem; }
.post-list h3 a { color: var(--text); text-decoration: none; }
.post-list h3 a:hover { color: var(--gold); }
.post-list p { margin: 0; color: var(--muted); }
.feed-link, .home-journal .more { margin-top: 1.5rem; font-family: var(--display); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; }
.home-journal { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--line); }

.post { padding-top: 3rem; }
.post-head { text-align: center; margin-bottom: 2.5rem; }
.post-head h1 { margin-bottom: 0.5rem; }
.prose { font-size: 1.2rem; }
.prose p { text-wrap: pretty; }
.prose h2 { font-family: var(--display); font-size: 1.35rem; margin-top: 2.2em; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 2px solid var(--gold); color: var(--muted); font-style: italic; }
.prose img { margin: 2em auto; border-radius: 2px; }
.post-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 1rem; }
.post-foot a { color: var(--muted); }

/* Narrow phones: three nav items + toggle need the room */
/* Phones: logo and name stay put; the nav folds into a menu button. */
@media (max-width: 40rem) {
  .header-actions { gap: 0; margin-right: -0.6rem; }
  .theme-toggle { margin: 0; }
  .js .menu-toggle { display: grid; }
  .js .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.25rem 1.25rem 0.75rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px -16px rgba(0, 0, 0, 0.35);
  }
  .js .nav.is-open { display: flex; }
  .js .nav a { font-size: 0.9rem; padding-block: 0.9rem; }
  .js .nav a + a { border-top: 1px solid var(--line); }
  .js .nav a[aria-current] { box-shadow: none; color: var(--gold); }
}
@media (max-width: 22.5rem) {
  .wrap.header-row { padding-inline: 1rem; }
  .brand-name { font-size: 1rem; letter-spacing: 0.1em; }
}

/* Series on home and books pages */
.books-section .eyebrow { margin-bottom: 0.4rem; }
.series-short { max-width: 30rem; margin: 0 auto 2rem; color: var(--muted); font-style: italic; text-wrap: balance; }
.series-name { font-family: var(--display); font-size: clamp(1.35rem, 5vw, 1.8rem); text-align: center; margin-bottom: 2rem; }
.series-group + .series-group { margin-top: 4rem; border-top: 1px solid var(--line); padding-top: 3rem; }
.series-group .series-blurb { margin-top: 3.5rem; }
.nowrap { white-space: nowrap; }
