/* Biblioteko — splash, About and Kinsu, on a deep-space sky.
   Colours come from the master wordmark v1 (biblioteko_ops/biblioteko/brand/marks/master-wordmark)
   and the brand's darks taken deeper: navy, ultramarine, teal and purple. The sky itself is drawn by
   js/sky.js; the gradient on <html> stands in for it without JavaScript or WebGL. */

/* Alegreya, served from this site: fonts/ holds Google Fonts' own compressed files (Alegreya v41,
   SIL Open Font License, see fonts/OFL.txt). One variable file per style covers weights 400 and 500.
   The accented-Latin file (Esperanto's ĉ ĝ ĥ ĵ ŝ ŭ, among others) downloads only if a page uses one. */
@font-face {
  font-family: "Alegreya"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/alegreya-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/alegreya-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya"; font-style: italic; font-weight: 400 500; font-display: swap;
  src: url("fonts/alegreya-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya"; font-style: italic; font-weight: 400 500; font-display: swap;
  src: url("fonts/alegreya-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* The fallback, shown while Alegreya loads or if it can't: Georgia, resized to Alegreya's width and
   given Alegreya's line metrics, so the text doesn't jump when Alegreya arrives. Measured on this
   page's text, 2026-11-28: Alegreya is 92.0% of Georgia's width upright and 79.5% in italic; its ascent
   is 1016 and descent 345 per 1000. Without Georgia, the stack falls back to Times New Roman, then any serif. */
@font-face {
  font-family: "Alegreya Fallback"; font-style: normal;
  src: local("Georgia");
  size-adjust: 92%; ascent-override: 110.4%; descent-override: 37.5%; line-gap-override: 0%;
}
@font-face {
  font-family: "Alegreya Fallback"; font-style: italic;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 79.5%; ascent-override: 127.8%; descent-override: 43.4%; line-gap-override: 0%;
}
/* Ysabeau Office, the Kinsu wordmark's typeface, for the Kinsu page's text: the same file the Kinsu
   master was built from (biblioteko_ops/biblioteko/brand/marks/source/fonts/ysabeau-office/, from
   github.com/google/fonts, SIL Open Font License, see fonts/OFL-ysabeau-office.txt). One variable
   file per style covers every weight; the italic (Heather approved the download, 2026-11-30;
   checked against GitHub's own size and checksum) sets the Kinsu page's set-apart lines. */
@font-face {
  font-family: "Ysabeau Office"; font-style: normal; font-weight: 1 1000; font-display: swap;
  src: url("fonts/ysabeau-office.ttf") format("truetype");
}
@font-face {
  font-family: "Ysabeau Office"; font-style: italic; font-weight: 1 1000; font-display: swap;
  src: url("fonts/ysabeau-office-italic.ttf") format("truetype");
}

:root {
  --space: #03050B;    /* the sky's emptiest dark */
  --ink: #13233F;      /* navy cloth, the reversed lockup's ground */
  --paper: #FFFFFF;    /* reversed letters and disc; headings */
  --text: #E3E7EE;     /* body text, 12.6:1 on ink */
  --muted: #A3AEC2;    /* labels and grammar, 7.0:1 on ink */
  --rule: #30405B;     /* the reversed leaf colour; decorative only */
  --gold: #F3B539;     /* the reversed doorway's brightest gold, 8.6:1 on ink */

  --wordmark: min(44rem, 80vw);
  --serif: "Alegreya", "Alegreya Fallback", Georgia, "Times New Roman", serif;
}

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

html {
  /* Stands in for the sky without JavaScript or WebGL: soft clouds of the deep palette. */
  background:
    radial-gradient(42% 50% at 18% 22%, rgba(47, 15, 73, 0.55), rgba(47, 15, 73, 0) 100%),
    radial-gradient(46% 55% at 85% 78%, rgba(4, 45, 52, 0.6), rgba(4, 45, 52, 0) 100%),
    radial-gradient(36% 40% at 70% 25%, rgba(15, 27, 79, 0.6), rgba(15, 27, 79, 0) 100%),
    var(--space);
  background-attachment: fixed;
  color: var(--text);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection { background: #C58816; color: var(--ink); }

/* ---------------------------------------------------------------------------
   The sky (js/sky.js): two canvases fixed behind everything.
   --------------------------------------------------------------------------- */

.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.sky.is-on { opacity: 1; }
/* The nebula is opaque, so it must sit below the stars. */
.sky-nebula { z-index: -2; }
.sky-stars { z-index: -1; }

/* Text sits on moving clouds, so it carries a faint halo of the dark behind it. Invisible on
   empty sky; it keeps letters clear where a cloud is brightest. */
.gloss, .about, .credo, .kinsu-page, .foot { text-shadow: 0 0 0.9em rgba(3, 5, 11, 0.75), 0 0 0.25em rgba(3, 5, 11, 0.6); }

/* ---------------------------------------------------------------------------
   The menu.
   --------------------------------------------------------------------------- */

.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.75rem) 1.6rem;
  background: linear-gradient(rgba(3, 5, 11, 0.78), rgba(3, 5, 11, 0));
  transition: opacity 0.9s ease 0.5s;
}

.home {
  display: block;
  border-radius: 50%;
  transition: opacity 0.4s ease;
}
.home img { display: block; width: 28px; height: 28px; }
/* On the splash the wordmark is already the home mark. */
.site-head.on-splash .home { opacity: 0; pointer-events: none; }

.site-head ul {
  display: flex;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-head nav a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px;
  transition: color 0.2s ease, background-size 0.3s ease;
}
.site-head nav a:hover { color: var(--paper); background-size: 100% 1px; }
.site-head nav a[aria-current="page"] { color: var(--paper); }

/* ---------------------------------------------------------------------------
   The intro (js/splash.js, js/splash3d.js). The inline script in <head> sets
   these classes before the first paint; the intro removes them in turn.
   --------------------------------------------------------------------------- */

.headword img { transition: opacity 1s ease; }
.intro-mark .headword img { opacity: 0; }

.gloss .lang, .gloss .senses li { transition: opacity 0.9s ease, translate 0.9s ease; }
.gloss .senses li:nth-child(1) { transition-delay: 0.25s; }
.gloss .senses li:nth-child(2) { transition-delay: 0.5s; }

.intro-text .gloss .lang,
.intro-text .gloss .senses li,
.intro-text .to-about { opacity: 0; translate: 0 8px; }
.intro-text .site-head { opacity: 0; }

/* The 3D intro (js/splash3d.js): black space over the whole window, faded away to the sky as the
   wordmark lands; the lockup laid over it in the headword's exact place, until the headword itself
   takes over. Both are removed once the intro ends. */
/* Black space from the first paint, until the intro fades to the sky (or is skipped or abandoned). */
.intro-black body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 19;
  background: #03050B;
  pointer-events: none;
}
.splash-3d {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.splash-lockup {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 21;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Shown only while the intro plays (added and removed by js/splash.js). */
.skip-intro {
  position: fixed;
  right: clamp(1.25rem, 4vw, 2.75rem);
  bottom: 2rem;
  z-index: 22;
  padding: 0.5rem 0.25rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}
.skip-intro:hover { color: var(--paper); }
.skip-intro:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 2px; }

/* ---------------------------------------------------------------------------
   The splash: the wordmark as the headword, the dictionary entry beneath it.
   --------------------------------------------------------------------------- */

.entry {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 5rem 1.5rem 7rem;
}

.entry-body { width: var(--wordmark); }

.headword {
  position: relative;
  margin: 0;
  line-height: 0;
}

/* The trademark sign beside the wordmark (an unregistered mark, Heather 2026-12-03), at the top of the
   letters; it fades in with the entry after the intro. */
.headword .tm {
  position: absolute;
  left: 100%;
  top: 4%;
  margin-left: 0.2em;
  font-size: clamp(0.875rem, 0.6rem + 1.1vw, 1.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--paper);
  transition: opacity 0.9s ease;
}
.intro-text .headword .tm { opacity: 0; }

.headword img {
  display: block;
  width: 100%;
  height: auto;
}

/* The lockup's artboard starts a few units left of the B's stem; this lines the
   entry up with the letter rather than the artboard (30 of 4701 units). */
.gloss {
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
  padding-left: calc(var(--wordmark) * 0.0064);
  font-size: clamp(1.0625rem, 0.9rem + 0.7vw, 1.375rem);
  line-height: 1.5;
}

.gloss p { margin: 0; }

.lang {
  font-style: italic;
  color: var(--muted);
}

.senses {
  list-style: none;
  margin: 0.9em 0 0;
  padding: 0;
  counter-reset: sense;
}

.senses li {
  counter-increment: sense;
  position: relative;
  padding-left: 1.6em;
  color: var(--paper);
}

.senses li + li { margin-top: 0.2em; }

.senses li::before {
  content: counter(sense) ".";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.senses i { color: var(--muted); }

.to-about {
  position: absolute;
  left: 50%;
  bottom: 2.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: opacity 0.9s ease 1s, translate 0.9s ease 1s, color 0.2s ease;
}

.to-about::after {
  content: "";
  width: 1px;
  height: 2.5rem;
  background: var(--rule);
  transition: background-color 0.2s ease;
}

.to-about:hover { color: var(--gold); }
.to-about:hover::after { background: var(--gold); }

/* Short screens (a phone on its side): let the link sit under the entry. */
@media (max-height: 520px) {
  .entry { padding-bottom: 2rem; }
  .to-about { position: static; transform: none; margin-top: 2rem; }
  .entry { place-content: center; justify-items: center; }
}

/* ---------------------------------------------------------------------------
   About (Heather's About text, 2026-11-29; it replaced the credo here).
   --------------------------------------------------------------------------- */

.about {
  max-width: 38rem;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 9rem) 1.5rem 4rem;
}

.about h2,
.kinsu-text h2 {
  margin: 0.45em 0 1.1em;
  color: var(--paper);
  font-weight: 500;
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.375rem);
  line-height: 1.22;
  text-wrap: balance;
}

.about p,
.kinsu-text p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

/* The closing line, set apart. Alegreya's italic is set tight, and at this size its letters
   crowd; a little tracking opens them (Heather, 2026-11-29). */
.about .closing,
.kinsu-text .closing {
  margin: 2.6em 0 0;
  color: var(--paper);
  font-size: clamp(1.3125rem, 1.15rem + 0.7vw, 1.625rem);
  font-style: italic;
  letter-spacing: 0.035em;
  word-spacing: 0.06em;
  line-height: 1.3;
}

.about .closing::before,
.kinsu-text .closing::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  margin-bottom: 1.1em;
  background: var(--rule);
}

/* The credo's styles, kept for when its sections find a new home (for example the Kinsu page). */
.credo {
  max-width: 38rem;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 9rem) 1.5rem 4rem;
}

.kicker {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.credo h2,
.credo h3,
.credo h4 {
  color: var(--paper);
  font-weight: 500;
  text-wrap: balance;
}

.credo h2 {
  margin: 0.35em 0 0;
  font-size: clamp(2.125rem, 1.6rem + 2vw, 2.875rem);
  line-height: 1.12;
}

.credo h3 {
  margin: 2.4em 0 0.6em;
  font-size: clamp(1.3125rem, 1.15rem + 0.7vw, 1.625rem);
  line-height: 1.3;
}

.credo h2 + h3 { margin-top: 1.8em; }

.credo p {
  margin: 0 0 1em;
  text-wrap: pretty;
  hyphens: manual;
}

.credo em { font-style: italic; }

.disciplines h3 { margin-bottom: 0; }

.discipline-list {
  margin-top: 1.1em;
  padding-left: clamp(1.25rem, 4vw, 2rem);
  border-left: 1px solid var(--rule);
}

.discipline-list h4 {
  margin: 1.6em 0 0.3em;
  font-size: 1.125em;
  font-style: italic;
  line-height: 1.4;
}

.discipline-list h4:first-child { margin-top: 0; }
.discipline-list p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Kinsu
   --------------------------------------------------------------------------- */

.kinsu-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 7rem 1.5rem 4rem;
}

.kinsu-body { width: min(38rem, 100%); }

.kinsu-mark {
  width: min(30rem, 70vw);
  margin: 0 auto;
  line-height: 0;
}

.kinsu-mark img { display: block; width: 100%; height: auto; }
.kinsu-mark { position: relative; }
/* The trademark sign beside the Kinsu wordmark, at the top of its capitals (as on the home page). */
.kinsu-mark .tm {
  position: absolute;
  left: 100%;
  top: 2%;
  margin-left: 0.25em;
  font-size: clamp(0.875rem, 0.6rem + 1.1vw, 1.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--paper);
}

/* Heather's Kinsu text (2026-11-30): set like the About page (its rules above take .kinsu-text
   too), in Ysabeau Office, the wordmark's typeface. A line set apart in the middle of the text
   leaves the same room below it as above. The set-apart lines use Ysabeau Office's own italic; the
   browser is never left to slant the upright letters itself. */
.kinsu-text {
  margin-top: clamp(3.5rem, 9vh, 5.5rem);
  font-family: "Ysabeau Office", system-ui, sans-serif;
  font-synthesis: none;
}
.kinsu-text .closing:not(:last-child) { margin-bottom: 2.6em; }
/* The heading opens with the Kinsu icon (master v1, full drawing, reversed) at the height of the
   letters, and "The Kinsu Workforce" stands on its own line (Heather, 2026-11-30). */
.kinsu-text .lead-line { display: block; }
.kinsu-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.3em;
  vertical-align: -0.24em;
}
/* The tagline closes the Kintsugi paragraphs as one of them: the same size, in bold. */
.kinsu-text .tagline { font-weight: 700; }
.nowrap { white-space: nowrap; } /* a hyphenated word kept whole ("multi-agent") */

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */

.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 3rem 1.5rem 3.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}

.foot p { margin: 0; }
/* The photo credit the Queen butterfly's licence asks for (CC BY 4.0). */
.foot .credit {
  max-width: 34rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-align: center;
}
.foot .credit a { text-decoration-color: rgba(163, 174, 194, 0.45); text-underline-offset: 0.15em; }
.foot .credit a:hover { color: var(--paper); }

.foot-mark {
  display: block;
  width: 28px;
  height: 28px;
}
