/* zynlo.app/books, on top of site.css (site-src/pages/books.html; docs/BOOKS.md §9).
 * Everything shared (type, keys, header, band, close card, questions, footer) is site.css's own;
 * this adds only the book's objects: a Kindle, a reading phone, a tablet, a page of the book, the
 * shelf, the page gallery and the downloads. Lexend is the book's face and appears only where the
 * book itself is shown; it is served from here, not from a font host. */

@font-face { font-family: "Lexend"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/lexend-400.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/lexend-600.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/lexend-700.woff2") format("woff2"); }

:root, html[data-mode="day"] {
  --book: "Lexend", var(--sans);
  --paper-ink: #111826; --paper-ink2: rgba(17,24,38,0.6);
  --kindle: linear-gradient(160deg, #2A2B2E 0%, #18191B 55%, #0E0F10 100%);
  --kindle-rim: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 0 0 1px rgba(255,255,255,0.04);
  --tablet: linear-gradient(150deg, #E9E7E3 0%, #CFCCC6 48%, #B9B5AE 100%);
  --object: 0 2px 3px rgba(17,24,38,0.16), 0 34px 60px -26px rgba(17,24,38,0.55);
}
html[data-mode="night"] {
  --paper-ink: #111826; --paper-ink2: rgba(17,24,38,0.62);
  --kindle-rim: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.08);
  --tablet: linear-gradient(150deg, #4A5068 0%, #2B3147 48%, #1B2033 100%);
  --object: 0 2px 4px rgba(0,0,0,0.4), 0 40px 70px -26px rgba(0,0,0,0.9);
}
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) {
    --kindle-rim: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.08);
    --tablet: linear-gradient(150deg, #4A5068 0%, #2B3147 48%, #1B2033 100%);
    --object: 0 2px 4px rgba(0,0,0,0.4), 0 40px 70px -26px rgba(0,0,0,0.9);
  }
}

/* "Books" beside the wordmark, in a group of its own so the header's gaps don't move it */
.top .brand { display: flex; align-items: center; gap: 12px; flex: none; }
.books-mark { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg3); white-space: nowrap; }
/* with no language picker on this page, the menu button itself takes the free space */
html.nav-collapse .top .menu { margin-inline-start: auto; }
@media (max-width: 900px) { .top .menu { margin-inline-start: auto; } }
.block.flush { padding-top: 0; }

/* ─── the hero: the chapter on a Kindle and a phone ─────────────────────── */
.books-hero { padding: 80px 0 60px; }
.books-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; }
.books-hero .statement { margin-top: 22px; }
.books-hero .lead { margin-top: 26px; font-size: 20px; }
.stage { position: relative; height: clamp(420px, 46vw, 580px); }
.stage .kindle { position: absolute; inset-inline-start: 2%; top: 0; --w: clamp(250px, 30vw, 380px); transform: rotate(-2.2deg); }
/* the phones are 3D stills, the same titanium iPhone as balum.app (balum-ads src/site/PhoneStill.jsx) */
.p3d { display: block; height: auto; }
.stage .p3d { position: absolute; inset-inline-end: 0; bottom: -4%; width: clamp(180px, 21vw, 290px); }
@media (prefers-reduced-motion: no-preference) {
  .stage .kindle { animation: books-lift .9s cubic-bezier(.2,.7,.2,1) both; }
  .stage .p3d { animation: books-lift .9s .12s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes books-lift { from { translate: 0 14px; } to { translate: 0 0; } }
}

/* ─── the objects ─────────────────────────────────────────────────────── */
/* A Kindle: matte black, a flat e-ink screen, a slightly deeper chin. Black at any hour. */
.kindle { width: var(--w); padding: calc(var(--w) * .055) calc(var(--w) * .055) calc(var(--w) * .1); border-radius: calc(var(--w) * .05);
  background: var(--kindle); box-shadow: var(--kindle-rim), var(--object); flex: none; }
.kindle .screen { aspect-ratio: 1072 / 1448; overflow: hidden; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.5); background: #EDEBE4; }
.kindle img { width: 100%; height: 100%; object-fit: cover; }
/* A tablet, for the PDF. */
.tablet { width: var(--w); padding: calc(var(--w) * .045); border-radius: calc(var(--w) * .07); background: var(--tablet); box-shadow: var(--frame-shadow); flex: none; }
.tablet .screen { aspect-ratio: 3 / 4; border-radius: calc(var(--w) * .035); overflow: hidden; background: #DCD9D2; display: grid; place-items: center; box-shadow: 0 0 0 1.5px rgba(0,0,0,.55); }
.tablet img { height: 96%; width: auto; box-shadow: 0 2px 10px rgba(0,0,0,.18); }

/* ─── the story: the cover as a book, its facts as a list ─────────────── */
.story-split .title .sub { display: block; color: var(--fg3); }
.story-split .lead { margin-top: 22px; }
.book { position: relative; width: min(100%, 360px); margin: 0 auto; }
.book img { width: 100%; height: auto; border-radius: 4px 12px 12px 4px; box-shadow: var(--object), inset 0 0 0 1px rgba(0,0,0,.06); }
.book::before { content: ""; position: absolute; inset-inline-start: 7px; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,.14); z-index: 2; border-radius: 2px; }
.facts { margin-top: 34px; display: grid; }
.facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; box-shadow: inset 0 -1px 0 var(--hair); }
.facts li:last-child { box-shadow: none; }
.facts b { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.facts span { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg3); text-align: end; font-variant-numeric: tabular-nums; }

/* ─── try it: a page of the book, in the book's face ──────────────────── */
.leaf { max-width: 720px; margin: 54px auto 0; border-radius: var(--r-card); padding: clamp(26px, 5vw, 52px); background: var(--paper); color: var(--paper-ink); box-shadow: var(--shadow-paper); }
.leaf .scene { display: flex; align-items: baseline; gap: 12px; font-family: var(--book); }
.leaf .scene b { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.leaf .scene span { font-size: 14px; color: var(--paper-ink2); }
.leaf .text { margin-top: 22px; font-family: var(--book); font-size: clamp(17px, 2.1vw, 20px); line-height: 1.7; }
.leaf .text p + p { margin-top: 12px; }
.leaf .text p.big { font-size: clamp(30px, 4vw, 40px); font-weight: 700; line-height: 1.2; margin-top: 18px; }
.w { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted rgba(28,41,70,.55);
  text-decoration-thickness: 1.5px; text-underline-offset: 5px; border-radius: 4px; transition: background-color .2s; }
.w:hover { background: rgba(28,41,70,.07); }
.w:focus-visible { outline: 2px solid #1C2946; outline-offset: 2px; }
.w[aria-pressed="true"] { background: #1C2946; color: #F7F5F1; text-decoration-color: transparent; box-shadow: 0 0 0 4px #1C2946; }
.gloss { margin-top: 28px; min-height: 64px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding-top: 20px; box-shadow: inset 0 1px 0 rgba(17,24,38,.14); }
.gloss .k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-ink2); width: 100%; }
.gloss b { font-family: var(--book); font-size: 22px; font-weight: 600; }
.gloss i { font-style: normal; font-family: var(--book); font-size: 15px; color: var(--paper-ink2); }
.gloss em { font-style: normal; font-size: 18px; color: var(--paper-ink); }

/* ─── the books: one shelf per language, six covers on each ──────────────── */
.lang { margin-top: 64px; padding-top: 36px; box-shadow: inset 0 1px 0 var(--hair); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2.2fr); gap: 40px; align-items: start; }
.lang + .lang { margin-top: 48px; }
.lang-head .object-title { font-size: 26px; }
.lang-head .object-title span { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--fg3); }
.lang-head .note { margin-top: 16px; font-size: 15.5px; }
.lang-head .when { margin-top: 18px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg3); }
.lang-head .when a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.covers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.covers figure { display: grid; gap: 12px; align-content: start; }
.covers img { width: 100%; height: auto; aspect-ratio: 360 / 510; border-radius: 2px 6px 6px 2px; box-shadow: var(--shadow-paper); transition: transform .3s; }
.covers figure:hover img { transform: translateY(-4px); }
.covers figcaption { font-size: 12.5px; line-height: 1.35; color: var(--fg2); }
.covers figcaption b { display: block; color: var(--fg); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }

/* ─── read anywhere: three objects standing on one line ───────────────── */
.shelf { display: grid; grid-template-columns: 1.05fr .78fr 1.17fr; grid-template-rows: auto auto; column-gap: clamp(24px, 4vw, 56px); margin-top: 70px; }
.shelf figure { grid-row: span 2; display: grid; grid-template-rows: subgrid; justify-items: center; align-items: end; min-width: 0; }
.shelf figcaption { align-self: start; margin-top: 26px; text-align: center; max-width: 22em; }
.shelf figcaption .note { margin-top: 6px; font-size: 15px; }
.shelf .kindle { --w: min(100%, 300px); }
.shelf .p3d { width: min(100%, 236px); }
.shelf .tablet { --w: min(100%, 360px); }

/* ─── inside: the PDF's own pages, in a row ───────────────────────────── */
.pages { margin-top: 56px; display: grid; grid-auto-flow: column; grid-auto-columns: clamp(200px, 24vw, 270px); gap: 22px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 10px 2px 30px; scrollbar-width: thin; }
.pages figure { scroll-snap-align: start; display: grid; gap: 14px; align-content: start; }
.pages img { width: 100%; height: auto; aspect-ratio: 148 / 210; object-fit: cover; border-radius: 3px; box-shadow: var(--shadow-paper); transition: transform .3s; }
.pages figure:hover img { transform: translateY(-4px); }
.pages figcaption { font-size: 13.5px; line-height: 1.45; color: var(--fg2); }
.pages figcaption b { display: block; color: var(--fg); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.hint { font-size: 13px; color: var(--fg3); margin-top: -8px; }

/* ─── with zynlo: the night band ──────────────────────────────────────── */
.band .books-band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 70px; align-items: center; }
.books-band .title { margin-top: 18px; }
.books-band .lead { margin-top: 22px; }
.loop { margin-top: 40px; display: grid; counter-reset: step; }
.loop li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 14px; padding: 20px 0; box-shadow: inset 0 -1px 0 rgba(247,245,241,0.09); }
.loop li:last-child { box-shadow: none; }
.loop li::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; color: #0C1120; background: #F7F5F1; }
.loop .object-title { font-size: 18px; }
.loop .note { grid-column: 2; font-size: 15px; margin-top: 2px; }
.books-band .p3d { width: min(100%, 300px); margin: 0 auto; }

/* ─── the close: the downloads on the navy card ───────────────────────── */
.downloads { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.downloads .key { height: 58px; flex-direction: column; gap: 4px; padding: 0 24px; min-width: 150px; }
.downloads .key small { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: .6; }
.close-card .downloads .key.ghost { background: transparent; color: #F7F5F1; box-shadow: inset 0 0 0 1.5px rgba(247,245,241,0.3); }
.close-card .fine { margin: 22px auto 0; max-width: 34em; font-size: 13.5px; line-height: 1.5; color: rgba(247,245,241,0.55); }

@media (max-width: 960px) {
  .books-hero { padding: 48px 0 30px; }
  .books-hero .wrap, .band .books-band { grid-template-columns: minmax(0, 1fr); }
  .stage { height: clamp(380px, 112vw, 560px); }
  .stage .kindle { --w: clamp(220px, 62vw, 360px); inset-inline-start: 0; }
  .stage .p3d { width: clamp(160px, 44vw, 270px); }
  .shelf { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 64px; }
  .shelf figure { grid-row: auto; grid-template-rows: auto auto; }
  .story-split .book { order: -1; width: min(70%, 300px); }
  .lang { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .covers { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
}
@media (max-width: 560px) {
  .downloads .key { flex: 1 1 100%; }
}
.close-card .kick { color: rgba(247,245,241,0.5); }

/* ─── the free chapter: the email form on the navy card ───────────────── */
.signup { max-width: 540px; margin: 34px auto 0; text-align: start; }
.signup .row { display: flex; flex-wrap: wrap; gap: 10px; }
.signup input[type="email"] { flex: 1 1 240px; min-width: 0; height: 56px; border: 0; border-radius: var(--r-pill); padding: 0 18px;
  font: 500 16.5px var(--sans); color: #F7F5F1; background: rgba(247,245,241,0.1); box-shadow: inset 0 0 0 1.5px rgba(247,245,241,0.24); }
.signup input[type="email"]::placeholder { color: rgba(247,245,241,0.45); }
.signup input[type="email"]:focus { outline: none; box-shadow: inset 0 0 0 2px #F7F5F1; }
.signup .key { flex: 1 1 auto; height: 56px; }
.signup .news { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; line-height: 1.45; color: rgba(247,245,241,0.72); cursor: pointer; }
.signup .news input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #F7F5F1; }
.signup .vh, .signup .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.close-card .status { margin: 18px auto 0; max-width: 34em; font-size: 15px; line-height: 1.5; color: #F7F5F1; }
.close-card .status:empty { display: none; }
.close-card .fine a { color: #F7F5F1; text-decoration: underline; text-underline-offset: 3px; }

/* which book: French A1 or Turkish chapter 1, two pills on the navy card */
.signup .pick { border: 0; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.signup .pick label { position: relative; display: block; cursor: pointer; }
.signup .pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.signup .pick span { display: block; padding: 12px 16px; border-radius: 14px; box-shadow: inset 0 0 0 1.5px rgba(247,245,241,0.24); color: rgba(247,245,241,0.72); font-size: 13px; line-height: 1.35; transition: background .2s, box-shadow .2s; }
.signup .pick span b { display: block; font-size: 15.5px; font-weight: 600; color: #F7F5F1; }
.signup .pick input:checked + span { background: rgba(247,245,241,0.12); box-shadow: inset 0 0 0 2px #F7F5F1; }
.signup .pick input:focus-visible + span { outline: 2px solid #F7F5F1; outline-offset: 2px; }

/* "stop" from an email: a strip at the top of the page saying what happened */
.books-notice { background: var(--filled-bg); color: var(--filled-fg); }
.books-notice p { padding: 14px 0; font-size: 15px; font-weight: 600; }
/* site.css has no [hidden] rule, and .downloads and .signup set their own display */
.close-card [hidden] { display: none !important; }

/* Chapter 1 free, the books on sale soon (Sel, 27 Oct): the launch list under the free chapter, in the same card;
 * three languages to choose from; a language's own page (/books/french…) and its six covers */
a.books-mark { text-decoration: none; }
a.books-mark:hover { color: var(--fg); }
.signup .pick.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.signup .pick.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.launch { max-width: 540px; margin: 48px auto 0; padding-top: 38px; box-shadow: inset 0 1px 0 rgba(247,245,241,0.16); }
.launch .object-title { margin-top: 12px; font-size: 22px; color: #F7F5F1; }
.launch .note { margin-top: 8px; font-size: 15px; line-height: 1.5; color: rgba(247,245,241,0.7); }
.launch .signup { margin-top: 22px; }
.launch .signup .key.ghost { background: transparent; color: #F7F5F1; box-shadow: inset 0 0 0 1.5px rgba(247,245,241,0.5); }
.launch .signup .key.ghost:hover { box-shadow: inset 0 0 0 1.5px #F7F5F1; }
.launch .status { margin-top: 14px; }
.lang-head .object-title a { color: inherit; text-decoration: none; }
.lang-head .object-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.covers figcaption .when-line { display: block; margin-top: 4px; color: var(--fg3); }
.covers figcaption .state { display: block; margin-top: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg2); }
.covers figcaption .state a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.covers.levels { margin-top: 48px; }
.lang-hero .book { width: min(100%, 380px); }
@media (max-width: 560px) {
  .signup .pick.three { grid-template-columns: minmax(0, 1fr); }
  .signup .pick.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The close card's paper layers are tilted (site.css). This card is tall, with the free chapter and the launch list,
 * so on a phone their corners reached past the screen and the page could be dragged sideways (Sel, 27 Oct). Clip the
 * section sideways only: the layers' shadows above and below still show. */
.close { overflow-x: clip; }
