/* Layout: an old fable book. A framed title page with a flower wreath, chapters with drop caps,
   bookplate cards, a contents page with dotted leaders and a cloth bound cover. Fonts are self hosted (GDPR). */
@font-face { font-family: "IM Fell English"; src: url("fonts/fell-roman.woff2") format("woff2"); font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/fell-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url("fonts/fell-sc.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/garamond.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/garamond-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }

:root {
  --paper: #f3ebdd;       /* aged page */
  --paper-deep: #eadfca;  /* endpaper */
  --ink: #2b231d;         /* sepia ink */
  --ink-soft: #5e4f42;
  --rose: #8e3a46;        /* madder rose: links, buttons, flowers */
  --rose-ink: #fbf5ec;
  --rose-tint: #efc9cc;
  --rose-inner: #e3a9ae;
  --leaf: #4d6a44;
  --leaf-tint: #d3e2c7;
  --gilt: #b88a3b;
  --gilt-light: #d9b86f;
  --cloth: #3b5743;       /* book cloth */
  --frame: #b8a07a;       /* printed rules */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.37 0 0 0 0 0.27 0 0 0 0 0.16 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --smallcaps: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --body: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1814; --paper-deep: #261f19; --ink: #ecdfc8; --ink-soft: #b9a991; --rose: #e39ba5; --rose-ink: #1d1814;
    --rose-tint: #5b2e35; --rose-inner: #77424b; --leaf: #9fbd92; --leaf-tint: #2e3c2a; --gilt: #d6b26a; --gilt-light: #e2c47f;
    --cloth: #2c4434; --frame: #6e5c45; --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.93 0 0 0 0 0.87 0 0 0 0 0.78 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1d1814; --paper-deep: #261f19; --ink: #ecdfc8; --ink-soft: #b9a991; --rose: #e39ba5; --rose-ink: #1d1814;
  --rose-tint: #5b2e35; --rose-inner: #77424b; --leaf: #9fbd92; --leaf-tint: #2e3c2a; --gilt: #d6b26a; --gilt-light: #e2c47f;
  --cloth: #2c4434; --frame: #6e5c45; --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.93 0 0 0 0 0.87 0 0 0 0 0.78 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--body); font-size: 1.16rem; line-height: 1.6;
  background-color: var(--paper); background-image: var(--grain);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--gilt); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.45rem; }
p { margin: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; }
.skip:focus { left: 1rem; }

.wrap { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 700px; }
.center { text-align: center; }
.stack { display: grid; gap: 1rem; }
.smallcaps { font-family: var(--smallcaps); letter-spacing: .06em; }
.chapter { font-family: var(--smallcaps); color: var(--gilt); letter-spacing: .14em; font-size: 1rem; }
.lead { font-size: 1.25rem; color: var(--ink-soft); font-style: italic; max-width: 58ch; }
.center .lead { margin-inline: auto; }

/* ornaments: colors come from the theme tokens */
.orn { display: block; width: 100%; height: auto; overflow: visible; }
.o-stem { fill: none; stroke: var(--leaf); stroke-width: 1.3; stroke-linecap: round; }
.o-curl { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; stroke-linecap: round; }
.o-leaf { fill: var(--leaf-tint); stroke: var(--leaf); stroke-width: 1; }
.o-vein { fill: none; stroke: var(--leaf); stroke-width: .7; }
.o-petal { fill: var(--rose-tint); stroke: var(--rose); stroke-width: 1; }
.o-inner { fill: var(--rose-inner); }
.o-center { fill: var(--gilt); stroke: var(--rose); stroke-width: .6; }
.o-berry { fill: var(--rose); }
.gilt .o-leaf, .gilt .o-petal, .gilt .o-inner { fill: none; stroke: var(--gilt-light); }
.gilt .o-stem, .gilt .o-vein { stroke: var(--gilt-light); }
.gilt .o-center, .gilt .o-berry { fill: var(--gilt-light); stroke: none; }
.divider { max-width: 300px; margin-inline: auto; }

/* header */
.site-header { padding-block: 1.25rem .5rem; text-align: center; }
.wordmark { font-family: var(--smallcaps); font-size: 1.6rem; letter-spacing: .08em; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.6rem; margin-top: .4rem; font-family: var(--smallcaps); font-size: 1.05rem; letter-spacing: .06em; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--rose); text-decoration: underline; }

/* buttons, set like printed labels */
.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--smallcaps); font-size: 1.1rem; letter-spacing: .08em;
  padding: .6rem 1.4rem .7rem; border-radius: 3px; text-decoration: none; border: 1px solid var(--rose); line-height: 1.2; }
.btn-primary { background: var(--rose); color: var(--rose-ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--rose); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--rose); background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.center .btn-row { justify-content: center; }

section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

/* title page */
.titlepage { position: relative; max-width: 780px; margin: 1rem auto 0; padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1.25rem, 6vw, 4rem);
  border: 1px solid var(--frame); outline: 1px solid var(--frame); outline-offset: -9px; text-align: center; display: grid; gap: 1.1rem; justify-items: center; }
.titlepage .corner { position: absolute; width: clamp(64px, 14vw, 116px); }
.titlepage .c-tl { top: 14px; left: 14px; }
.titlepage .c-tr { top: 14px; right: 14px; transform: scaleX(-1); }
.titlepage .c-bl { bottom: 14px; left: 14px; transform: scaleY(-1); }
.titlepage .c-br { bottom: 14px; right: 14px; transform: scale(-1, -1); }
.wreath-box { position: relative; width: min(240px, 62vw); }
.wreath-box .monogram { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-style: italic; font-size: clamp(2.6rem, 9vw, 3.6rem); color: var(--rose); padding-bottom: 6%; }
.titlepage h1 { max-width: 16ch; }
.titlepage .btn-row { justify-content: center; }
.titlepage .byline { font-family: var(--smallcaps); letter-spacing: .08em; color: var(--ink-soft); font-size: 1.02rem; }

/* drop cap opening */
.opening { max-width: 640px; margin-inline: auto; }
.opening p { font-size: 1.28rem; }
.opening p::first-letter { float: left; font-family: var(--display); font-size: 4.1rem; line-height: .82; padding: .32rem .5rem 0 0; color: var(--rose); }

/* bookplate cards */
.plates { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.5rem; margin-top: 2.25rem; }
.plate { position: relative; background: var(--paper-deep); border: 1px solid var(--frame); outline: 1px solid var(--frame); outline-offset: -7px;
  padding: 1.75rem 1.6rem 1.8rem; display: grid; gap: .9rem; align-content: center; min-width: 0; }
.plate .sprig { width: 64px; margin-inline: auto; }
.plate h3 { text-align: center; }
.plate .from { text-align: center; font-family: var(--smallcaps); letter-spacing: .08em; color: var(--ink-soft); font-size: .95rem; }
.plate .btn-row { justify-content: center; margin-top: .25rem; }

/* contents with dotted leaders */
.contents { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.contents li { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.contents .num { font-family: var(--smallcaps); color: var(--gilt); min-width: 2.2rem; }
.contents .title { min-width: 0; }
.contents .leader { flex: 1; border-bottom: 2px dotted var(--frame); transform: translateY(-.3rem); min-width: 1.5rem; }
.contents .page { font-family: var(--smallcaps); color: var(--ink-soft); white-space: nowrap; }

/* the book, cloth bound */
.cover { width: 100%; max-width: 270px; aspect-ratio: 3 / 4; background: var(--cloth); color: var(--gilt-light); border-radius: 3px 9px 9px 3px; padding: 1rem;
  box-shadow: inset 8px 0 0 rgba(0,0,0,.2), inset 10px 0 0 rgba(255,255,255,.05), 0 20px 34px -18px rgba(0,0,0,.65); display: flex; }
.cover-inner { border: 1px solid var(--gilt-light); outline: 1px solid var(--gilt-light); outline-offset: -5px; width: 100%; display: grid; align-content: center; justify-items: center; gap: .4rem; text-align: center; padding: .8rem; }
.cover .orn { width: 62%; }
.cover .t1 { font-family: var(--display); font-size: 1.55rem; line-height: 1.1; }
.cover .t2 { font-family: var(--display); font-style: italic; font-size: .9rem; line-height: 1.3; opacity: .9; }
.cover .t3 { font-family: var(--smallcaps); letter-spacing: .14em; font-size: .8rem; }
.book-band { background: var(--paper-deep); border-block: 1px solid var(--frame); }
.book-band .wrap { display: grid; grid-template-columns: 270px 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.book-band .stack { min-width: 0; }

/* sales page */
.sales-hero .wrap { display: grid; grid-template-columns: 300px 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.sales-hero .stack { min-width: 0; gap: 1.1rem; }
.price { font-family: var(--display); font-size: 2rem; }
.price small { display: block; font-family: var(--body); font-size: 1rem; color: var(--ink-soft); font-style: italic; }
.bookpage { position: relative; background: var(--paper-deep); border: 1px solid var(--frame); padding: clamp(1.5rem, 5vw, 2.75rem); display: grid; gap: 1rem; margin-top: 1.75rem; }
.bookpage .story { font-style: italic; color: var(--ink-soft); font-size: 1.2rem; }
.bookpage .story::first-letter { float: left; font-family: var(--display); font-style: normal; font-size: 3.6rem; line-height: .82; padding: .28rem .45rem 0 0; color: var(--rose); }
.bookpage h4 { font-family: var(--smallcaps); font-weight: 400; letter-spacing: .08em; font-size: 1.1rem; margin: 0; color: var(--leaf); }
.bookpage ol { margin: 0; padding-left: 1.3rem; display: grid; gap: .35rem; }
.bookpage .tip { border-top: 1px solid var(--frame); padding-top: .9rem; }
.particulars { display: grid; gap: .55rem; margin-top: 1.5rem; }
.particulars div { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.particulars dt { font-family: var(--smallcaps); letter-spacing: .06em; }
.particulars dt::after { content: ""; display: inline-block; width: 2.5rem; border-bottom: 2px dotted var(--frame); margin-left: .5rem; transform: translateY(-.25rem); }
.particulars dd { margin: 0; color: var(--ink-soft); min-width: 0; flex: 1 1 18rem; }
.notice { border: 1px solid var(--frame); outline: 1px solid var(--frame); outline-offset: -6px; padding: 1.6rem 1.75rem; display: grid; gap: .6rem; background: var(--paper-deep); }
details { border-bottom: 1px dotted var(--frame); padding-block: .85rem; }
details summary { cursor: pointer; font-family: var(--display); font-size: 1.2rem; }
details p { margin-top: .45rem; color: var(--ink-soft); }
.state-launch { display: none; }
body.launched .state-prelaunch { display: none; }
body.launched .state-launch { display: grid; }

/* legal pages */
.legal { padding-block: clamp(2rem, 5vw, 3.5rem); }
.legal h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin-bottom: 1.2rem; }
.legal h2 { font-size: 1.45rem; margin: 2rem 0 .6rem; }
.legal p, .legal li { max-width: 68ch; }
.legal p + p { margin-top: .7rem; }
.legal ul { padding-left: 1.3rem; display: grid; gap: .4rem; }
.legal address { font-style: normal; }
.lang-switch { display: flex; gap: 1.25rem; margin-bottom: 1.5rem; font-family: var(--smallcaps); letter-spacing: .06em; }
.updated { color: var(--ink-soft); font-style: italic; margin-top: 2.5rem; }

/* contact form */
.contact-form { display: grid; gap: 1.1rem; max-width: 34rem; margin-top: 1.6rem; position: relative; }
.contact-form label { display: grid; gap: .35rem; font-family: var(--smallcaps); letter-spacing: .04em; color: var(--ink-soft); }
.contact-form input, .contact-form textarea { font-family: var(--body); font-size: 1.1rem; color: var(--ink); background: var(--paper-deep);
  border: 1px solid var(--frame); border-radius: 3px; padding: .6rem .75rem; width: 100%; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.contact-form textarea { resize: vertical; min-height: 9rem; }
.contact-form button { justify-self: start; cursor: pointer; }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .98rem; color: var(--ink-soft); }
.form-error { display: none; border-left: 3px solid var(--rose); padding: .4rem .9rem; margin-top: 1rem; }
.form-error:target { display: block; }

/* follow */
.follow { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.4rem; }

/* footer */
.site-footer { padding-block: 1.5rem 2.75rem; text-align: center; color: var(--ink-soft); font-size: 1rem; }
.site-footer .wrap { display: grid; gap: .9rem; justify-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; font-family: var(--smallcaps); letter-spacing: .06em; }
.site-footer nav a { color: var(--ink); }
.site-footer p { max-width: 60ch; }

@media (max-width: 760px) {
  .book-band .wrap, .sales-hero .wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .book-band .btn-row, .sales-hero .btn-row { justify-content: center; }
  .sales-hero .lead, .book-band .lead { margin-inline: auto; }
  .cover { max-width: 230px; }
  .titlepage { outline-offset: -6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
