/* The shared look of every page, following the Tarot Sparrow design: paper, ink and type.
   Change colours and fonts here and every page follows. */
:root {
  --bg: #eee4cc;          /* aged paper */
  --panel: #f1ead9;       /* the cream of the question box */
  --ink: #4a4238;         /* body text */
  --brand: #7b7366;       /* the taupe of the logo lettering */
  --muted: #665e52;       /* small labels */
  --soft: #c5bda6;        /* the question box's waiting text */
  --line: #b4ac9f;        /* thin rules */
  --accent: #a35f52;      /* the salmon of the card back, deepened a little so it reads as text */
  --gold: #bd9520;
  --card-cream: #f9f4e8;  /* what the white paper of the old card scans becomes */
  /* The design's typeface is Bookman JF Pro, loaded from the Adobe Fonts web project.
     Besley, a close free relative, is the fallback if that fails to load. */
  --book: "bookman-jf-pro", "Besley", "Bookman Old Style", "URW Bookman", Georgia, serif;
}
* { box-sizing: border-box; }
/* No rubber-band bounce when scrolling past the top or bottom of the page. */
html, body { overscroll-behavior: none; }
/* Nothing may make the page wider than the screen: the card turning in 3D and the sparrows
   flying off it reach past the right edge for a moment, and phones let you scroll out to them. */
html { overflow-x: hidden; }
body {
  margin: 0;
  background-color: var(--bg);
  /* Banknote-style paper: a soft grain, tiny spots and a few threads. Made by tools/make-paper.mjs. */
  background-image: url("/assets/paper.svg?v=2");
  color: var(--ink);
  font-family: var(--book);
  line-height: 1.5;
  overflow-x: clip;
}
main {
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 16px 24px;
  text-align: center;
}
h1 { font-size: 30px; line-height: 1.3; margin: 0; font-weight: normal; letter-spacing: 0.02em; }
.date { color: var(--muted); margin: 4px 0 20px; font-size: 15px; line-height: 22px; font-style: italic; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The one button shape: a soft cream pill, like the question box. Links can wear it too. */
.draw {
  display: inline-block;
  font-family: var(--book);
  font-size: 15px;
  line-height: 22px;
  letter-spacing: 0.1em;
  padding: 13px 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 239, 224, 0.72);
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.draw:hover { background: #f5efe0; }
.draw:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.keywords { color: var(--accent); font-size: 14px; letter-spacing: 0.1em; margin: 0 0 16px; }
.meaning { margin: 0 0 18px; font-size: 17px; line-height: 1.6; text-align: left; }
/* The large first letter that opens a passage in an old book. */
.meaning::first-letter {
  float: left;
  font-size: 3.1em;
  line-height: 0.84;
  padding: 4px 6px 0 0;
  color: var(--accent);
}
.dinkus { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 14px; color: var(--gold); clear: both; }
.dinkus::before, .dinkus::after { content: ""; width: 56px; border-top: 1px solid var(--line); opacity: 0.7; }
.dinkus svg { width: 12px; height: 12px; }
.tomorrow { color: var(--muted); font-size: 15px; font-style: italic; margin: 0; }
[hidden] { display: none !important; }
/* The seal at the top of the page: a circle that hangs off the top edge, the sparrow, and the
   name around the rim. Every measurement comes from the design and is counted in --u, which is
   one pixel on a wide screen and shrinks in step with a narrow one. */
.seal {
  --u: min(1px, calc((100vw - 24px) / 442));
  position: relative;
  height: calc(247 * var(--u));
  margin-bottom: 41px;
  /* The seal is only for looking at. Without this its round frame would sit over the
     question box and swallow the clicks meant for it. */
  pointer-events: none;
}
.seal > * { position: absolute; margin: 0; }
/* The circle and the name set around its rim. The name is real lettering, not a picture. */
.seal-name {
  left: 50%; top: calc(-195.5 * var(--u));
  width: calc(442.5 * var(--u)); height: calc(442.5 * var(--u));
  margin-left: calc(-221.25 * var(--u));
  font-size: inherit; font-weight: normal;
}
.seal-name svg { display: block; width: 100%; height: 100%; overflow: visible; }
.seal-name text { font-family: var(--book); font-size: 30px; letter-spacing: 8px; fill: var(--brand); }
.seal-name .tick { fill: var(--brand); }
/* The small trademark sign, raised beside the last letter of the name. */
.seal-name .tm { font-size: 13px; letter-spacing: 0; }
.seal-bird {
  left: calc(50% - 96.5 * var(--u)); top: calc(-40 * var(--u));
  width: calc(165 * var(--u)); height: auto;
}
.seal-words {
  left: calc(50% - 115 * var(--u)); top: calc(73.5 * var(--u));
  font-size: calc(14 * var(--u)); line-height: calc(17 * var(--u)); letter-spacing: 0.02em;
  color: var(--brand); text-align: left; white-space: nowrap;
}
.seal-words span { display: block; }
.seal-words span:nth-child(2) { padding-left: calc(4 * var(--u)); }
.seal-words span:nth-child(3) { padding-left: calc(14.5 * var(--u)); }
.seal-date {
  left: calc(50% + 60 * var(--u)); top: calc(95.5 * var(--u));
  font-size: calc(12 * var(--u)); line-height: 1; letter-spacing: 0.32em;
  color: var(--accent); white-space: nowrap;   /* the site's salmon, so today's date stands out from the taupe */
}
/* The two thin rules above and below the date, staggered as in the design. */
.seal-date::before, .seal-date::after {
  content: ""; position: absolute; width: calc(63 * var(--u)); height: 1px; background: var(--line);
}
.seal-date::before { left: calc(9 * var(--u)); top: calc(-15.5 * var(--u)); }
.seal-date::after { left: calc(-21.5 * var(--u)); top: calc(25 * var(--u)); }
/* On a phone the seal is smaller; its small words and the date keep their size. */
@media (max-width: 520px) {
  .seal { --u: calc((100vw - 24px) / 600); margin-bottom: 34px; }
  .seal-name text { font-size: 27px; letter-spacing: 7px; }
  .seal-words { font-size: 10px; line-height: 12px; margin-left: -8px; }
  .seal-date { font-size: 8.5px; }
}

/* Words for search engines and screen readers that aren't shown on the page. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* The footer at the bottom of every page: a thin rule, then what the site is and the
   link to every card, all centred, with a small line underneath. */
.site-foot {
  margin-top: 24px;
  padding: 36px 16px 28px;
  border-top: 1px solid rgba(180, 172, 159, 0.6);
  color: var(--brand);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  position: relative;
}
.site-foot-inner { max-width: 440px; margin: 0 auto; }
.site-foot p { margin: 0 0 8px; }
.site-foot-perks { font-style: italic; letter-spacing: 0.04em; color: var(--accent); }
/* The sparrow to press, centred; the words about the site open beneath it. */
.site-foot-about summary { list-style: none; cursor: pointer; display: inline-block; padding: 4px 8px; border-radius: 8px; }
.site-foot-about summary::-webkit-details-marker { display: none; }
.site-foot-about summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* The sparrow from the logo, small: press it to read about the site. The words stay folded
   away until then. It hops a little on hover. */
.foot-bird { display: block; width: 46px; height: auto; opacity: 0.85; transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease; }
.site-foot-about summary:hover .foot-bird { transform: translateY(-3px) rotate(-4deg); opacity: 1; }
.site-foot-about[open] .foot-bird { opacity: 1; }
/* Belt and braces: the words never show until the sparrow is pressed, in any browser. */
.site-foot-about:not([open]) .foot-more { display: none; }
.foot-more { padding-top: 10px; }
.site-foot-links { margin-top: 16px; }
.site-foot-links a { color: var(--brand); letter-spacing: 0.08em; text-decoration: none; }
.site-foot-links a:hover { color: var(--ink); }
/* "YOUR COLLECTION" in small capitals curving over the count, like a stamp: the number large
   in salmon, "/78" a size smaller in the taupe. */
.foot-collection { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.foot-collection svg { display: block; width: 116px; height: 23px; overflow: visible; margin-bottom: -2px; }
/* The curve runs well past both ends of the words, so no browser or font width can push a letter off it. */
.foot-collection text { font-family: var(--book); font-size: 10px; letter-spacing: 1.6px; fill: var(--brand); }
.foot-collection .tally { font-size: 15px; letter-spacing: 0.02em; color: var(--brand); }
.foot-collection b { font-weight: normal; font-size: 24px; color: var(--accent); }
.foot-collection:hover text { fill: var(--ink); }
.site-foot-small {
  max-width: 600px; margin: 24px auto 0 !important; padding-top: 16px;
  border-top: 1px solid rgba(180, 172, 159, 0.35);
  font-size: 12px; letter-spacing: 0.04em; color: var(--muted);
}
/* The card credit on its own line beneath the copyright, a size smaller. */
.site-foot-credit { display: block; margin-top: 2px; font-size: 10.5px; opacity: 0.85; }

/* Card pages and the contents page. */
.crumbs { margin: 0 0 20px; font-size: 13px; letter-spacing: 0.12em; color: var(--muted); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.plate { margin: 0 0 14px; }
.plate { position: relative; }
/* The card picture, shown exactly as the image file is, with no blending. */
.plate .face {
  display: block; margin: 0 auto;
  width: 220px; height: 382px;
  border-radius: 6px; border: 1px solid rgba(180, 172, 159, 0.6);
  background: var(--card-cream); overflow: hidden; isolation: isolate;
  box-shadow: 0 4px 14px rgba(34, 28, 20, 0.22);
}
.plate img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A card with its own PNG: no cream panel, edge or boxed shadow, so whatever was erased shows
   the page. The shadow follows the picture's own shape instead. */
/* Contain, not cover, so a PNG a little taller or shorter than the frame is never cropped. */
.plate .face.cutout img { object-fit: contain; }
.plate .face.cutout {
  background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible;
  filter: drop-shadow(0px 3px 1px rgba(34, 28, 20, .7));
}
.plate figcaption { margin-top: 10px; font-size: 14px; font-style: italic; color: var(--muted); }
.page h2 {
  clear: both;
  font-size: 14px; font-weight: normal; letter-spacing: 0.12em;
  color: var(--muted); margin: 24px 0 8px;
}
.page .meaning { margin-bottom: 12px; }
.text { font-size: 17px; line-height: 1.6; text-align: left; margin: 0 0 12px; }
.page .dinkus { margin: 26px 0 20px; }

/* Previous and next card, at the foot of a card page. */
.turn {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
  margin-top: 30px; padding-top: 16px; border-top: 1px solid rgba(180, 172, 159, 0.6); font-size: 16px;
}
.turn a { text-decoration: none; }
.turn a:hover { text-decoration: underline; }
.turn span { display: block; font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.turn .prev { text-align: left; }
.turn .next { text-align: right; }
.turn .all { grid-column: 1 / -1; }

/* The contents page: the cards listed like the contents of a book. */
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; text-align: left; font-size: 16px; }
.toc li { display: flex; align-items: baseline; padding: 3px 0; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .no { flex: 0 0 3.2em; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.toc .date { margin: -4px 0 10px; }
/* On a phone the numbered list gets one column, so long names are not broken in two. */
@media (max-width: 520px) {
  h1 { font-size: 24px; }
  main { padding-top: 28px; }
  .meaning, .text { font-size: 16px; line-height: 1.55; }
  .plate .face { width: 190px; height: 330px; }
  .toc.majors ul { columns: 1; }
  .toc ul { font-size: 15px; }
  .site-foot { font-size: 13px; padding: 28px 20px 22px; }
  .site-foot-small { font-size: 11px; }
}
