/* Ancient coins in the Lav look (2026-10-25). Tokens from /assets/tokens.css ([data-look="lav"]),
   header and footer from /assets/chrome.css, the turning coin from /assets/home/vendor/coin-turn.*.
   One idea: the 31 coins lie on the page's ground in date order, drawn at their real diameters on
   one scale (--mm, pixels per millimetre), and the one you press is picked up into the hand on the
   left, where it turns over. The spot it came from stays as a faint ring.
   Grid as on the homepage and Photography: 12 columns, 16 px gap, 56 px gutter, max 1440; under
   860 px one column on a 20 px gutter, with the hand as a short sticky row under the header. */

/* ── Base (same as the homepage) ── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; font-optical-sizing: auto; font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
[data-look="lav"] { color-scheme: light; --coin-shadow-c: rgba(22,26,22,.42); --gc-shadow: rgba(22,26,22,.34); }
[data-look="lav"][data-theme="dark"] { color-scheme: dark; --coin-shadow-c: rgba(0,0,0,.55); --gc-shadow: rgba(0,0,0,.58); }
body { margin: 0; min-width: 320px; min-height: 100svh; font-size: var(--t-body); line-height: var(--lh-body); letter-spacing: var(--tr-body); font-weight: 400; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
p, h1, h2 { margin: 0; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.t-title { font-size: var(--t-title); line-height: var(--lh-title); letter-spacing: var(--tr-title); font-weight: 300; }
.t-statement { font-size: var(--t-statement); line-height: var(--lh-statement); letter-spacing: var(--tr-statement); font-weight: 400; }
.t-body { font-size: var(--t-body); line-height: var(--lh-body); letter-spacing: var(--tr-body); font-weight: 400; }
.t-ui { font-size: var(--t-ui); line-height: var(--lh-ui); letter-spacing: 0; font-weight: 400; }
.t-caption { font-size: var(--t-caption); line-height: var(--lh-caption); letter-spacing: var(--tr-caption); font-weight: 400; }

.link { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.link:hover { text-decoration-thickness: 2px; }

.sec { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* The header's Coins link points at the homepage section; on this page it is the current one. */
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ── The page opens on one word and a short line, as Photography does. ── */
.intro { padding-top: 120px; }
.intro__title { margin-left: var(--tr-title); color: var(--ink); }
.intro__lead { margin-top: 40px; max-width: 31em; color: var(--muted); text-wrap: pretty; }

/* ── The tray: the hand on the left (sticky), the ground on the right. ── */
.coins-page { padding-bottom: 200px; }
.tray {
  --mm: 4.4px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; align-items: start;
  margin-top: 104px;
}

.hand { grid-column: 1 / span 4; position: sticky; top: 112px; display: flex; flex-direction: column; gap: 40px; }
.hand__coin { width: min(340px, 100%, calc(100svh - 440px)); min-width: 200px; }
.hand .coin-turn { --coin-size: 100%; --coin-shadow: var(--coin-shadow-c); --coin-shadow-blur: 18px; --coin-focus: var(--accent); }
.hand__label { display: flex; flex-direction: column; gap: 16px; max-width: 22em; }
.hand__name { color: var(--ink); text-wrap: pretty; }
.hand__meta { display: flex; flex-direction: column; color: var(--muted); }
.hand__more { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.hand__hint { color: var(--muted); }
/* a new coin settles into the hand */
.hand.is-new .hand__coin, .hand.is-new .hand__label { animation: hand-in .42s var(--ease) both; }
.hand.is-new .hand__label { animation-delay: .05s; }
@keyframes hand-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ground { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 72px; padding-top: 8px; }
.ground__h { display: flex; align-items: baseline; gap: 16px; padding-bottom: 14px; margin-bottom: 36px; border-bottom: 1px solid var(--hairline); color: var(--ink); }
.ground__years { margin-left: auto; color: var(--muted); }
.ground__coins { display: flex; flex-wrap: wrap; align-items: center; gap: 36px 30px; }

/* One coin on the ground: its box is its diameter on the page's scale, the photograph turned
   a little the way it was put down, with a short cast shadow. */
.gc { position: relative; flex: none; width: calc(var(--d) * var(--mm)); aspect-ratio: 1; border-radius: 50%; }
.gc img { width: 100%; height: 100%; object-fit: contain; transform: rotate(var(--r)); filter: drop-shadow(2px 4px 4px var(--gc-shadow)); transition: transform .3s var(--ease), opacity .25s var(--ease), filter .3s var(--ease); }
.gc::before { content: ""; position: absolute; inset: 3%; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--hairline); background: color-mix(in srgb, var(--ink) 3%, transparent); opacity: 0; transition: opacity .25s var(--ease); }
.gc:focus-visible { outline-offset: 5px; border-radius: 50%; }
@media (hover: hover) {
  .gc:hover img { transform: rotate(var(--r)) translateY(-3px); filter: drop-shadow(4px 9px 8px var(--gc-shadow)); }
}
/* picked up: the coin is in the hand, its place on the ground stays as a ring */
.gc[aria-checked="true"] img { opacity: 0; transform: rotate(var(--r)) scale(.96); }
.gc[aria-checked="true"]::before { opacity: 1; }

/* A scale bar under the ground, the same --mm as the coins. */
.scale { display: flex; align-items: center; gap: 12px; margin-top: -24px; color: var(--muted); }
.scale__bar { display: block; width: calc(10 * var(--mm)); height: 7px; border: 1px solid var(--muted); border-top: 0; }

/* the coin in the hand stays still unless pressed: its turn is tied to this fixed, full-height
   box, which never scrolls, so the scroll progress reads 0 */
.coin-still { position: fixed; left: 0; top: 0; width: 1px; height: 100vh; visibility: hidden; pointer-events: none; }

/* ── Narrower desktops ── */
@media (max-width: 1199px) {
  .tray { --mm: 3.7px; }
  .ground__coins { gap: 30px 24px; }
}
@media (max-width: 1023px) {
  .tray { --mm: 3.6px; }
  .hand { grid-column: 1 / span 5; }
  .ground { grid-column: 7 / span 6; }
}

/* ── Phones and narrow widths: the hand becomes a short row that stays under the header. ── */
@media (max-width: 860px) {
  .intro { padding-top: 88px; }
  .intro__lead { margin-top: 28px; max-width: 34em; }
  .coins-page { padding-bottom: 140px; }

  .tray { --mm: 2.9px; display: block; margin-top: 48px; }
  .hand {
    top: 56px; z-index: 5; flex-direction: row; align-items: center; gap: 20px;
    margin: 0 calc(-1 * var(--gutter)); padding: 14px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--hairline);
  }
  .hand__coin { flex: none; width: 116px; min-width: 0; }
  .hand .coin-turn { --coin-shadow-blur: 10px; }
  .hand__label { gap: 4px; min-width: 0; }
  .hand__name { font-size: var(--t-body); line-height: 1.3; letter-spacing: var(--tr-body); }
  .hand__meta, .hand__more { font-size: var(--t-caption); line-height: var(--lh-caption); letter-spacing: var(--tr-caption); }
  .hand__more { margin-top: 2px; gap: 0; }
  .hand__more .link { display: inline-block; padding: 13px 0; margin: -13px 0; text-underline-offset: 3px; }
  .hand__hint { display: none; }

  .ground { gap: 56px; padding-top: 40px; }
  .ground__h { margin-bottom: 28px; }
  .ground__coins { gap: 22px 18px; }
  .gc { min-width: 44px; }
  .scale { margin-top: -16px; }
}

@media (prefers-reduced-motion: reduce) {
  .gc img, .gc::before { transition: none; }
  .hand.is-new .hand__coin, .hand.is-new .hand__label { animation: none; }
}
