/* ==========================================================================
   Vintage Jewelry — design C «Пробирная книга» / «Проба / The assay ledger»

   Ported from the chosen mock-up (design/c/style.css, read only) to the real
   site: the fonts are self-hosted (static/fonts), chips, the view switch and
   the order are plain links (the site works without JavaScript), and a sold
   lot stays in the ledger crossed out, without a price (section 19).

   Design system in one screen
   ---------------------------
   Idea     The shop is kept like a jeweller's stock ledger. Every piece is a
            numbered lot. Three voices, three faces:
            · the form — numbers, labels, prices, stamps — is "printed" in a
              monospace (IBM Plex Mono);
            · sentences on the form are set in its sibling serif (IBM Plex
              Serif): light for section titles, regular for prose;
            · everything a person writes by hand — the claim, the names of
              pieces, the values in a passport, the owner's own words — is
              Old Standard TT Italic.
   Colour   Cool paper ground, pure-white card stock (tags, tickets, cards,
            the passport), ink black, and ONE accent — verdigris, the colour
            old copper and bronze turn — in three strengths (wash / fill /
            deep).
   Shapes   Borrowed from hallmark cartouches, and a shape means one thing:
            oval seal = the shop's own stamp on a passport · chamfered
            octagon = the piece is in Russia · pill = in Dubai · string tag
            = the lot number · dater rectangle = the day of entry. Nothing
            says a piece is the only one: the shop may have two alike.
   Name     «Vintage Jewelry» is struck as a maker's mark: two lines of
            capitals in a cartouche. Both words have seven letters, so in the
            monospace they stack letter under letter (see .mark).
   Photos   White cut-outs, 4:5, multiplied into the paper, so they float
            without frames. NOTHING may intersect the central 78% box of a
            cut-out: tags hang above the photo, in a band kept for them.
   Layout   Left-aligned, ledger-like. Rules only where a ledger has them.
   Motion   One signature moment per screen: the tag swings on its string
            (opening), the specimen card follows the reading line («Опись»),
            the loupe (piece page). Nothing else moves.
   ========================================================================== */

/* ---------- 0. Faces and tokens ------------------------------------------- */

/* The three voices, self-hosted (static/fonts, SIL Open Font License; the
   licence texts lie next to the files): Old Standard TT Italic 400, IBM Plex
   Serif 300 / 400, IBM Plex Mono 300 / 400 / 500 - Cyrillic, Latin and Latin
   Extended (₽ is there). A browser fetches a file only when the page has a
   character of its range. «≈» is in none of those ranges: its glyph comes
   from IBM Plex Mono itself, in a file of its own. The file names carry the
   font's version, so a new version gets a new address (they are cached for a
   year); base.html preloads the faces of the first screen at these same URLs. */
@font-face {
  font-family: "Old Standard TT";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/old-standard-tt-v22-400italic-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Old Standard TT";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/old-standard-tt-v22-400italic-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: "Old Standard TT";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/old-standard-tt-v22-400italic-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: "IBM Plex Serif";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/ibm-plex-serif-v20-300-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/ibm-plex-serif-v20-300-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: "IBM Plex Serif";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/ibm-plex-serif-v20-300-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: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-serif-v20-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-serif-v20-400-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: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-serif-v20-400-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-300-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-300-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-300-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-400-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-400-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-400-approx.woff2") format("woff2");
  unicode-range: U+2248;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-500-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-500-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-500-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-v23-500-approx.woff2") format("woff2");
  unicode-range: U+2248;
}

/* Metric-matched local fallbacks: the text keeps its width while the web
   fonts load, so the swap does not shove the layout around. */
@font-face {
  font-family: "Ledger hand fallback";
  font-style: italic;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 94.6%;
}

@font-face {
  font-family: "Ledger text fallback";
  src: local("Georgia");
  size-adjust: 106%;
}

@font-face {
  font-family: "Ledger mono fallback";
  src: local("Consolas");
  size-adjust: 109.1%;
}

:root {
  color-scheme: light;

  /* Colour */
  --paper: #eef2f0;                 /* cool paper-white ground */
  --sheet: #ffffff;                 /* card stock: tags, tickets, cards, passport */
  --ink: #0f1513;                   /* ink black, slightly green */
  --ink-soft: #55605d;              /* secondary text — 5.6:1 on paper */
  --ink-faint: #909a97;             /* leaders, perforations — never body text */
  --rule: rgb(15 21 19 / 0.16);     /* hairline */
  --rule-strong: rgb(15 21 19 / 0.4); /* outline of a control */
  --verdigris: #6db6a4;             /* verdigris: fills (ink text on it is 7:1) */
  --verdigris-deep: #0c6557;        /* verdigris for text and stamp outlines — 6:1 */
  --verdigris-wash: #d8e8e2;        /* a breath of verdigris: the active row */

  /* Type families */
  --hand: "Old Standard TT", "Ledger hand fallback", Georgia, "Times New Roman", serif;
  --text: "IBM Plex Serif", "Ledger text fallback", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "Ledger mono fallback", ui-monospace, "SF Mono", SFMono-Regular,
    Menlo, Consolas, "Liberation Mono", monospace;

  /* Type scale */
  --fs-micro: 0.6875rem;                                    /* 11 stamps, column heads */
  --fs-label: 0.75rem;                                      /* 12 mono labels */
  --fs-data: 0.875rem;                                      /* 14 mono data */
  --fs-body: 1.0625rem;                                     /* 17 prose */
  --fs-lead: clamp(1.125rem, 1.03rem + 0.42vw, 1.375rem);
  --fs-title: clamp(1.1875rem, 1.1rem + 0.38vw, 1.4375rem); /* name of a piece in a tile */
  --fs-h3: clamp(1.375rem, 1.24rem + 0.6vw, 1.75rem);
  --fs-h2: clamp(2.25rem, 1.62rem + 2.7vw, 4rem);
  --fs-claim: clamp(2.5rem, 13.2vw, 6.5rem);                /* «с историей» in the opening (one line, also in English at 320px) */
  --fs-lot: clamp(3.5rem, 2.5rem + 4.4vw, 6rem);            /* the big lot number */

  /* Space */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;
  --s9: 6rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --page: 85rem;
  --section: clamp(4rem, 2.6rem + 6.5vw, 8.5rem);

  --header-h: 3.5rem;
  --stick: 0px;                     /* height of whatever is pinned above a sticky block */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- 1. Base ------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s4);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-body) / 1.5 var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
  color: var(--ink-soft);
  font: 400 var(--fs-label) / 1.4 var(--mono);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
figure,
dl,
dd,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--verdigris-deep);
  outline-offset: 3px;
}

::selection {
  background: var(--verdigris);
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.mono {
  font-family: var(--mono);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

/* The paper the photos are multiplied into. It sits on one large, opaque
   ground — never on the photo's own box: a box with its own background and
   isolation shows a light hairline wherever its edge falls between pixels. */
main {
  background: var(--paper);
}

.section {
  margin-top: var(--section);
  scroll-margin-top: var(--s5);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s1) var(--s4);
}

.skip {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 200;
  padding: 0.875rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font: 500 var(--fs-label) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-120%);
}

.skip:focus {
  transform: none;
}

/* ---------- 2. Type helpers ---------------------------------------------- */

.eyebrow {
  font: 400 var(--fs-micro) / 1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.h2 {
  font: 300 var(--fs-h2) / 1 var(--text);
  letter-spacing: -0.028em;
  overflow-wrap: normal;
  text-wrap: balance;
}

.note {
  font: 400 var(--fs-label) / 1.55 var(--mono);
  color: var(--ink-soft);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.75rem;
  font: 500 var(--fs-label) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
  white-space: nowrap;
}

.icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link .icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.3s var(--ease);
}

/* ---------- 3. Marks: cartouche, stamps, tags, the lot number, the seal ---- */

/* A chamfered outline that works on any background: straight edges are a
   border, the four diagonals are hairline gradients, the corners are clipped.
   Drawn on ::before so the host keeps its focus ring. */
.cartouche {
  --cut: 5px;
  --line: 1px;
  position: relative;
  isolation: isolate;
}

.cartouche::before {
  --_d: calc(var(--cut) * 0.7071 + var(--line));
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: var(--line) solid currentColor;
  background:
    linear-gradient(135deg, currentColor var(--_d), transparent 0) top left,
    linear-gradient(225deg, currentColor var(--_d), transparent 0) top right,
    linear-gradient(315deg, currentColor var(--_d), transparent 0) bottom right,
    linear-gradient(45deg, currentColor var(--_d), transparent 0) bottom left;
  background-color: var(--fill, transparent);
  background-origin: border-box;
  background-repeat: no-repeat;
  background-size: 50% 50%;
  clip-path: polygon(
    var(--cut) 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut)),
    0 var(--cut)
  );
  pointer-events: none;
}

/* Wordmark as a maker's mark: plain letters in a cartouche, struck in two
   lines the way a two-line punch is cut. «Vintage» and «Jewelry» have seven
   letters each, so in the monospace they stack letter under letter into one
   block — no tracking tricks, and the block is no wider than a short one-line
   name would be. The markup says "Vintage Jewelry"; the capitals belong to
   the punch (text-transform). Each word is its own line (.mark__word), so
   the break is never left to chance. The cartouche is 44px tall — as tall
   as the other controls in the header, and a touch target in its own right. */
.mark {
  --track: 0.14em;
  --pad: 0.625rem;
  display: inline-flex;
  flex: none;
  flex-direction: column;
  justify-content: center;
  height: 2.75rem;
  /* the tracking that trails each line is given back on the left */
  padding: 0 var(--pad) 0 calc(var(--pad) + var(--track));
  font: 500 0.8125rem / 1.154 var(--mono);
  letter-spacing: var(--track);
  text-transform: uppercase;
  white-space: nowrap;
}

.mark__word {
  display: block;
}

/* the same lockup, larger: the footer */
.mark--lg {
  --cut: 8px;
  --pad: 1rem;
  height: 4.25rem;
  font-size: 1.25rem;
}

/* Stamps. The SHAPE carries the meaning. */
.stamp {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 1.375rem;
  padding: 0 0.45rem 0 calc(0.45rem + 0.1em);
  color: var(--verdigris-deep);
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stamp--ru {
  --cut: 4px;
}

.stamp--ae {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding-inline: calc(0.55rem + 0.1em) 0.55rem;
}

/* Dater: the day a lot was entered in the ledger */
.dater {
  display: inline-grid;
  flex: none;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem 0.35rem;
  border: 1px solid currentColor;
  box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3px currentColor;
  color: var(--verdigris-deep);
  font: 500 var(--fs-label) / 1 var(--mono);
  white-space: nowrap;
  transform: rotate(-4deg);
}

.dater__label {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Lot tag: a small card on a string, hanging from a pin.
   .tag is the swinging wrapper (pin + string), .tag__card is the paper. */
.tag {
  --tilt: -3deg;
  --lift: translateY(0);
  position: absolute;
  z-index: 2;
  display: block;
  padding-top: 1.15em;
  font-size: 0.75rem;
  filter: drop-shadow(0 1px 1px rgb(15 21 19 / 0.22));
  transform: var(--lift) rotate(var(--tilt));
  transform-origin: 50% 0.2em;
  pointer-events: none;
}

.tag::after {
  /* pin head + string, drawn over the card so the string runs into the hole */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.5em;
  height: 1.75em;
  margin-left: -0.25em;
  background:
    radial-gradient(circle at 50% 0.25em, var(--ink) 0.2em, transparent 0.24em),
    linear-gradient(var(--ink), var(--ink)) 50% 0.25em / 1px calc(100% - 0.25em) no-repeat;
}

.tag__card {
  position: relative;
  display: grid;
  justify-items: center;
  min-width: 3.3em;
  padding: 1.25em 0.5em 0.45em;
  background: var(--sheet);
  clip-path: polygon(0.7em 0, calc(100% - 0.7em) 0, 100% 0.7em, 100% 100%, 0 100%, 0 0.7em);
  line-height: 1.15;
}

.tag__card::before {
  /* punched hole */
  content: "";
  position: absolute;
  top: 0.38em;
  left: 50%;
  width: 0.46em;
  height: 0.46em;
  margin-left: -0.23em;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgb(15 21 19 / 0.28);
}

.tag__sign {
  font: italic 400 1.1em / 1 var(--hand);
  color: var(--ink-soft);
}

.tag__num {
  font: 500 1em / 1.25 var(--mono);
  letter-spacing: 0.03em;
}

@keyframes tag-swing {
  0% { transform: var(--lift) rotate(var(--tilt)); }
  22% { transform: var(--lift) rotate(calc(var(--tilt) + 9deg)); }
  48% { transform: var(--lift) rotate(calc(var(--tilt) - 5deg)); }
  72% { transform: var(--lift) rotate(calc(var(--tilt) + 2.5deg)); }
  100% { transform: var(--lift) rotate(var(--tilt)); }
}

.tag.is-swinging {
  animation: tag-swing 1.3s var(--ease) both;
}

/* The big lot number: a hand-written "№" next to stamped digits. */
.lotmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.14em;
  font: 300 var(--fs-lot) / 0.86 var(--mono);
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.lotmark__sign {
  font: italic 400 0.62em / 1 var(--hand);
  letter-spacing: 0;
}

/* The shop's seal: one inline-SVG symbol (text on arcs), so it holds together
   at any width. «ОПИСЬ УКРАШЕНИЙ» runs over the top, the shop's name under the
   bottom; the passport strikes the lot number in the middle. Struck slightly
   askew, the ink a little uneven. */
.seal {
  flex: none;
  width: clamp(6.5rem, 30vw, 8rem);
  aspect-ratio: 160 / 108;
  overflow: visible;
  color: var(--verdigris-deep);
  fill: currentColor;
  transform: rotate(-8deg);
  filter: url(#ink);
}

/* Both legends are short: set wide, each fills its arc, and the small
   capitals keep apart at seal size. Written in capitals in the SVG itself:
   text-transform is not dependable on SVG text. */
.seal__arc {
  font: 500 7.4px / 1 var(--mono);
  letter-spacing: 0.2em;
}

/* the lot number in the middle: a hand-written "№" before stamped digits, like .lotmark */
.seal__no {
  font: 400 21px / 1 var(--mono);
  letter-spacing: -0.03em;
}

.seal__sign {
  font: italic 400 17px / 1 var(--hand);
  letter-spacing: 0;
}

/* where no lot is named (the 410 page): the shop's monogram, by hand */
.seal__mono {
  font: italic 400 25px / 1 var(--hand);
  letter-spacing: 0.04em;
}

/* ---------- 4. Buttons, chips, switches ---------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1px solid var(--ink);
  font: 500 var(--fs-label) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.btn--primary {
  background: var(--verdigris);
}

.btn--sm {
  min-height: 2.75rem;
  padding-inline: 0.8rem;
}

.btn:active {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 359.98px) {
  /* very narrow phones: the icon is enough */
  .btn__extra {
    display: none;
  }
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.5em;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--rule-strong);
  font: 400 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.chip__n {
  color: rgb(15 21 19 / 0.7);
  letter-spacing: 0;
}

.chip[aria-current="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.chip[aria-current="true"] .chip__n {
  color: inherit;
  opacity: 0.75;
}

/* Location chips wear the shape of their stamp. */
.chip--ru {
  --cut: 6px;
  border-color: transparent;
  color: var(--verdigris-deep);
}

.chip--ae {
  padding-inline: 0.875rem;
  border-color: currentColor;
  border-radius: 999px;
  color: var(--verdigris-deep);
}

.chip--ru[aria-current="true"] {
  --fill: var(--verdigris-deep);
  border-color: transparent;
  background: none;
  color: var(--sheet);
}

.chip--ru[aria-current="true"]::before {
  color: var(--verdigris-deep);
}

.chip--ae[aria-current="true"] {
  border-color: var(--verdigris-deep);
  background: var(--verdigris-deep);
  color: var(--sheet);
}

.switch {
  display: inline-flex;
  border: 1px solid var(--ink);
}

.switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.75rem;
  padding: 0 0.7rem;
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}

.switch__btn .icon {
  width: 1rem;
  height: 1rem;
}

/* The pressed state follows the root attribute, which the inline script in
   <head> sets before the first paint: a shared «Опись» link never flashes. */
[data-view="grid"] .switch__btn[data-view-btn="grid"],
[data-view="ledger"] .switch__btn[data-view-btn="ledger"] {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 349.98px) {
  /* next to the title only the icons fit */
  .switch__btn {
    padding-inline: 0.875rem;
  }

  .switch__btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

/* ---------- 5. Header ---------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--header-h);
}

/* Phones: one row. The section links live in the page (opening and footer). */
.site-nav {
  display: none;
}

.site-nav a,
.site-header__back,
.hero__index a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  font: 400 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-header__back {
  padding-inline: var(--s1);
  font-weight: 500;
}

.site-header__back .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: var(--s1);
  margin-left: auto;
}

.lang {
  display: inline-flex;
  align-items: center;
  font: 400 var(--fs-label) / 1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* the other language is a link; the current one is plain text, underlined */
.lang a,
.lang__now {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
}

.lang [aria-current="true"] {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

@media (max-width: 767.98px) {
  /* on a piece's page the header gives its place to the way back to the
     catalog: the buy bar is always on screen there (and a sold piece has
     nothing to write about) */
  .site-header__back ~ .site-header__tools .site-header__write {
    display: none;
  }
}

@media (min-width: 768px) {
  :root {
    --header-h: 4rem;
  }

  .site-header__inner {
    gap: var(--s4);
  }

  .site-nav {
    display: flex;
    gap: clamp(0.75rem, -1.2rem + 3.6vw, 1.75rem);
    margin-left: var(--s2);
  }

  .site-nav a {
    font-size: var(--fs-label);
  }

  .site-header__back {
    display: none;
  }

  .site-header__tools {
    gap: var(--s3);
  }
}

@media (min-width: 768px) and (min-height: 500px) {
  /* the header is pinned only when the screen is tall enough to spare it */
  :root {
    --stick: var(--header-h);
  }

  html {
    scroll-padding-top: calc(var(--header-h) + var(--s4));
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .section {
    scroll-margin-top: calc(var(--header-h) + var(--s5));
  }
}

/* ---------- 6. Opening: the claim and one tagged specimen ----------------- */

.hero {
  display: grid;
  padding-top: 0.875rem;
}

.hero__title {
  margin-top: 0.375rem;
  font: italic 400 var(--fs-claim) / 0.95 var(--hand);
  letter-spacing: -0.02em;
}

.hero__kicker {
  display: block;
  padding-bottom: 0.1em;
  font-size: 0.52em;
  line-height: 1.1;
  letter-spacing: -0.012em;
}

/* The headline is one phrase in two hands: «Винтажные украшения» small,
   «с историей» large, each on a line of its own (also in English at 320px). */
.hero__claim {
  display: block;
  white-space: nowrap;
}

/* Featured lot. Per photo the bot writes four numbers (parts of the 4:5 frame):
   --ar   the trimmed box: the empty bands above and below a landscape piece
          are cut away, a portrait piece keeps 0.8
   --top  where the piece begins (the tag stops just above it)
   --ax / --ay   the point the string is tied to: the top of the piece on its
          centre line */
.feature {
  --L: clamp(4.5rem, 21vw, 6rem);    /* size of the digits on the tag */
  --s: 1.12;                         /* the frame is shown 12% larger than the box */
  --ar: 0.8;
  --top: 0.1;
  --ax: 0.5;
  --ay: 0.1;
  --clear: 0.75rem;                  /* air between the tag and the piece */
  --rest: 20.5rem;                   /* header + headline + tag + entry: what else must fit on the first screen */
  --hmax: max(16rem, calc(100vh - var(--rest)));
  --box: min(100%, calc(var(--hmax) * var(--ar)));
  /* how far below the box's upper edge the piece begins */
  --head: calc(var(--box) * (1.25 * var(--s) * (var(--top) - 0.5) + 0.5 / var(--ar)));
  position: relative;
  display: block;
  margin: var(--s2) calc(-1 * var(--gutter)) 0;
  /* room for the tag above the photo: its height, less what it may overlap */
  padding-top: calc(var(--L) * 1.24 + var(--clear) + 0.5rem - var(--head));
  overflow: hidden;                  /* the frame is wider than the box */
}

@supports (height: 100svh) {
  .feature {
    --hmax: max(16rem, calc(100svh - var(--rest)));
  }
}

@media (min-width: 600px) {
  .feature {
    --rest: 28.5rem;
  }
}

.feature__photo {
  position: relative;
  display: block;
  width: var(--box);
  aspect-ratio: var(--ar);
  margin-inline: auto;
}

.feature__frame::before,
.lot__photo::before,
.entry__photo::before {
  /* the plate waiting for its photo: four crop marks, gone once it arrives */
  --m: 0.625rem;
  content: "";
  position: absolute;
  inset: 10% 11% 12%;
  background:
    linear-gradient(var(--ink-faint), var(--ink-faint)) top left / var(--m) 1px,
    linear-gradient(var(--ink-faint), var(--ink-faint)) top left / 1px var(--m),
    linear-gradient(var(--ink-faint), var(--ink-faint)) top right / var(--m) 1px,
    linear-gradient(var(--ink-faint), var(--ink-faint)) top right / 1px var(--m),
    linear-gradient(var(--ink-faint), var(--ink-faint)) bottom left / var(--m) 1px,
    linear-gradient(var(--ink-faint), var(--ink-faint)) bottom left / 1px var(--m),
    linear-gradient(var(--ink-faint), var(--ink-faint)) bottom right / var(--m) 1px,
    linear-gradient(var(--ink-faint), var(--ink-faint)) bottom right / 1px var(--m);
  background-repeat: no-repeat;
  pointer-events: none;
}

.feature__frame::before {
  /* around the piece itself, wherever it sits in the frame */
  inset: calc(var(--top) * 100% - 3%) 9%;
}

.is-loaded::before {
  opacity: 0;
}

/* Fallback plate. A photo that failed the cut-out check (its border is not
   pure white) must not be multiplied into the paper: the bot adds .is-plate
   and the photo lies on a white sheet, the crop marks staying on it. */
.is-plate {
  background: var(--sheet);
}

.is-plate img {
  mix-blend-mode: normal;
}

.is-plate.is-loaded::before {
  z-index: 1;
  inset: 0.375rem;
  opacity: 1;
}

/* The 4:5 frame, centred on the box. Inside it percentages are parts of the
   photo, which is how the tag and the string find the piece. No transform,
   opacity or z-index on the way up to <main>: any of them would cut the photo
   off from the paper it multiplies into. */
.feature__frame {
  position: absolute;
  top: calc((1 - 1.25 * var(--s) * var(--ar)) * 50%);
  left: calc((1 - var(--s)) * 50%);
  width: calc(var(--s) * 100%);
  aspect-ratio: 4 / 5;
}

.feature__frame img {
  /* how much of the frame lies outside the box, above/below and left/right */
  --cut-y: calc((1 - 1 / (1.25 * var(--s) * var(--ar))) * 50%);
  --cut-x: calc((1 - 1 / var(--s)) * 50%);
  --feather: 3.5%;
  width: 100%;
  height: 100%;
  object-fit: contain;               /* a photo that is not 4:5 is never stretched (it keeps the default numbers) */
  mix-blend-mode: multiply;
  /* Only the part inside the box is painted, and its edges are feathered:
     a hard cut would show wherever it crosses the faint halo of the shadow. */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent var(--cut-y), #000 calc(var(--cut-y) + var(--feather)), #000 calc(100% - var(--cut-y) - var(--feather)), transparent calc(100% - var(--cut-y))),
    linear-gradient(to right, transparent var(--cut-x), #000 calc(var(--cut-x) + var(--feather)), #000 calc(100% - var(--cut-x) - var(--feather)), transparent calc(100% - var(--cut-x)));
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent var(--cut-y), #000 calc(var(--cut-y) + var(--feather)), #000 calc(100% - var(--cut-y) - var(--feather)), transparent calc(100% - var(--cut-y))),
    linear-gradient(to right, transparent var(--cut-x), #000 calc(var(--cut-x) + var(--feather)), #000 calc(100% - var(--cut-x) - var(--feather)), transparent calc(100% - var(--cut-x)));
  mask-composite: intersect;
}

/* Tag + string: one group that turns about the knot, like the real thing */
.tie {
  --hole: calc(var(--L) * 0.19);          /* from the tag's lower edge to the eyelet */
  --shift: calc(var(--L) * -0.26);        /* the eyelet sits a little left of the knot */
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: rotate(-2deg);
  transform-origin: calc(var(--ax) * 100%) calc(var(--ay) * 100%);
  pointer-events: none;
}

.tie__string {
  position: absolute;
  top: calc(var(--top) * 100% - var(--clear) - var(--hole));
  bottom: calc((1 - var(--ay)) * 100%);
  left: calc(var(--ax) * 100% + var(--shift));
  width: calc(-1 * var(--shift));
}

.tie__string svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
}

.tie__knot {
  position: absolute;
  top: calc(var(--ay) * 100%);
  left: calc(var(--ax) * 100%);
  width: 0.4375rem;
  height: 0.4375rem;
  margin: -0.21875rem 0 0 -0.21875rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.bigtag {
  position: absolute;
  bottom: calc((1 - var(--top)) * 100% + var(--clear));
  left: calc(var(--ax) * 100% + var(--shift));
  /* three digits fit the card exactly; lot 1000 and later widen it around the same centre */
  min-width: 2.96em;
  padding-inline: 0.1em;
  font-size: var(--L);
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 1px rgb(15 21 19 / 0.2)) drop-shadow(0 0.5rem 0.875rem rgb(15 21 19 / 0.07));
}

.bigtag__card {
  position: relative;
  display: flex;
  justify-content: center;
  height: 1.24em;
  padding-top: 0.17em;
  background: var(--sheet);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.2em), calc(100% - 0.2em) 100%, 0.2em 100%, 0 calc(100% - 0.2em));
}

.bigtag__card::after {
  /* eyelet */
  content: "";
  position: absolute;
  bottom: 0.135em;
  left: 50%;
  width: 0.11em;
  height: 0.11em;
  margin-left: -0.055em;
  border-radius: 50%;
  background: var(--paper);
  box-shadow:
    inset 0 0 0 1px rgb(15 21 19 / 0.35),
    0 0 0 0.03em var(--sheet),
    0 0 0 calc(0.03em + 1px) rgb(15 21 19 / 0.22);
}

.bigtag .lotmark {
  font-size: 1em;
}

@keyframes tie-swing {
  0% { transform: rotate(-2deg); }
  24% { transform: rotate(2.4deg); }
  50% { transform: rotate(-3.6deg); }
  76% { transform: rotate(-1deg); }
  100% { transform: rotate(-2deg); }
}

.tie.is-swinging {
  animation: tie-swing 1.9s var(--ease) both;
}

.feature__entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.125rem var(--s4);
  margin-inline: var(--gutter);
  padding-top: var(--s2);
  border-top: 1px solid var(--ink);
}

.feature__label {
  grid-column: 1 / -1;
}

.feature__name {
  font: italic 400 var(--fs-h3) / 1.1 var(--hand);
}

.feature__cost {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font: 500 var(--fs-data) / 1 var(--mono);
  white-space: nowrap;
}

.feature__cost .icon {
  transition: transform 0.3s var(--ease);
}

.hero__foot {
  margin-top: var(--s5);
}

.hero__lead {
  max-width: 31rem;
  font-size: var(--fs-lead);
  line-height: 1.42;
  text-wrap: pretty;
}

/* phones: the section links of the header, moved into the page */
.hero__index {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s5);
  margin-top: var(--s3);
}

.hero__index a {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
}

@media (min-width: 768px) {
  .hero__index {
    display: none;
  }
}

@media (min-width: 900px) {
  :root {
    --fs-claim: clamp(3.5rem, 7.1vw, 6.5rem);
  }

  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    column-gap: var(--s5);
    padding-top: clamp(2rem, 4vw, 3.5rem);
  }

  .hero__head {
    grid-column: 1 / span 6;
    grid-row: 1;
  }

  .hero__foot {
    grid-column: 1 / span 5;
    grid-row: 2;
    align-self: end;
    padding-bottom: var(--s1);
  }

  .feature {
    --L: clamp(5rem, min(8.2vw, 14vh), 7.5rem);
    --clear: 1.125rem;
    --rest: 24.5rem;
    --hmax: max(20rem, calc(100vh - var(--rest)));
    grid-column: 7 / -1;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .feature__entry {
    margin-inline: 0;
    padding-top: var(--s3);
  }
}

@supports (height: 100svh) {
  @media (min-width: 900px) {
    .feature {
      --hmax: max(20rem, calc(100svh - var(--rest)));
    }
  }
}

/* ---------- 7. New entries: specimen cards that stay put ------------------ */

/* «Новые записи»: the newest lots on sale under the opening (the featured one
   is not repeated). The mock-up's sideways strip cut the next card off at the
   edge of a phone; the owner wants every entry whole and still, so this is a
   grid at every width: two by two on a phone and up to 1023px, four in a row
   from 1024px. The cards of a row share their inner rows (number and date,
   photo, name, note, price), so names and prices line up. */
.entries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
  margin-top: var(--s5);
}

/* «Раньше всех — в Telegram-канале ↗»: fits a 320px phone on one line; a
   longer wording wraps rather than widen the page */
.fresh__channel {
  white-space: normal;
}

.entry {
  display: grid;
  min-width: 0;
}

.entry__link {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.625rem;
  border: 1px solid var(--ink);
  background: var(--sheet);
}

.entry__head {
  position: relative;
  z-index: 1;                        /* the dater is struck over the plate's edge */
  display: flex;
  flex-wrap: wrap;                   /* the narrowest phones: the stamp goes under the number */
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.375rem 0.125rem;
  padding-top: 0.125rem;
}

/* A phone's card is about 160px wide: a smaller number and a smaller stamp,
   still «ЗАПИСАНО» over the day; side by side from a 360px screen */
.entry .lotmark {
  font-size: 1.3125rem;
}

.entry .dater {
  gap: 0.1875rem;
  padding: 0.3rem 0.25rem 0.25rem;
  font-size: 0.6875rem;
}

.entry .dater__label {
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
}

.entry__photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  margin-top: var(--s2);
}

.entry__photo img,
.lot__photo img,
.specimen__photo img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* the name may take three or four lines on a phone: never cut short */
.entry__title {
  margin-top: var(--s1);
  font: italic 400 1.0625rem / 1.15 var(--hand);
  text-wrap: balance;
}

.entry__note,
.lot__note,
.specimen__note {
  color: var(--ink-soft);
  font: 400 var(--fs-label) / 1.45 var(--mono);
}

/* phones: the start of her description would take five lines of a card this
   narrow; the piece's page has all of it */
.entry__note {
  display: none;
  margin-top: var(--s2);
}

/* phones: the price, the «≈» price under it, then where the piece is */
.entry__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  margin-top: auto;
  padding-top: var(--s3);
}

/* Classes of its own, not .lot__*: the ledger view restyles every .lot__cost
   and .lot__price on the page, and these cards keep their look in both views. */
.entry__cost {
  display: grid;
  gap: 0.125rem;
  font-family: var(--mono);
  line-height: 1.3;
}

@supports (grid-template-rows: subgrid) {
  .entry,
  .entry__link {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  /* each part keeps its row, also where a card has no note */
  .entry__head { grid-row: 1; }
  .entry__photo { grid-row: 2; }
  .entry__title { grid-row: 3; }
  .entry__note { grid-row: 4; }

  .entry__foot {
    grid-row: 5;
    align-self: end;
  }
}

@media (min-width: 600px) {
  /* the mock-up's specimen card */
  .entries {
    gap: var(--s5);
    margin-top: var(--s6);
  }

  .entry__link {
    padding: var(--s4);
  }

  .entry__head {
    gap: var(--s2) var(--s3);
    padding-right: 0.25rem;
  }

  .entry .lotmark {
    font-size: 2.5rem;
  }

  .entry .dater {
    gap: 0.25rem;
    padding: 0.4rem 0.5rem 0.35rem;
    font-size: var(--fs-label);
  }

  .entry .dater__label {
    font-size: 0.625rem;
    letter-spacing: 0.14em;
  }

  .entry__photo {
    margin-top: var(--s1);
  }

  .entry__title {
    font-size: var(--fs-h3);
    line-height: 1.1;
  }

  /* the start of her description, at most three lines (the name above is never cut) */
  .entry__note {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .entry__foot {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2) var(--s3);
    padding-top: var(--s4);
  }

  .entry__cost {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.7em;
  }
}

@media (min-width: 1024px) {
  .entries {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) and (max-width: 1279.98px) {
  /* four cards of about 220px: a smaller number, the phone's stamp and a
     smaller name, so the number and the stamp still share a line */
  .entry .lotmark {
    font-size: 2rem;
  }

  .entry .dater {
    gap: 0.1875rem;
    padding: 0.3rem 0.3125rem 0.25rem;
    font-size: 0.6875rem;
  }

  .entry .dater__label {
    font-size: 0.5625rem;
    letter-spacing: 0.1em;
  }

  .entry__title {
    font-size: 1.3125rem;
  }
}

/* ---------- 8. Catalog: head, filters ------------------------------------ */

/* Phones: two rows — title + view switch, then where + count.
   From 900px the rows dissolve into one line: title · count · where · switch. */
.catalog__head {
  display: grid;
  gap: var(--s3);
}

.catalog__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.where {
  display: flex;
  flex: none;
  gap: 0.375rem;
}

.catalog__count {
  min-width: 0;
  font: 400 var(--fs-micro) / 1.45 var(--mono);
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.catalog__count b {
  color: var(--ink);
  font-weight: 500;
}

.catalog__count-label {
  display: none;
}

/* Category chips: one row that stays in reach while the tiles scroll (in
   «Опись» the specimen card takes the pinned place instead). The chips
   scroll sideways under both edges of the screen. */
.filterbar {
  position: sticky;
  top: var(--stick);
  z-index: 20;
  display: flex;
  align-items: center;
  margin: var(--s2) calc(-1 * var(--gutter)) 0;
  padding: var(--s2) var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.filterbar__chips {
  display: flex;
  flex: 1 1 auto;
  gap: 0.375rem;
  min-width: 0;
  margin: calc(-1 * var(--s2)) calc(-1 * var(--gutter));
  padding: var(--s2) var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.filterbar__chips::-webkit-scrollbar {
  display: none;
}

[data-view="ledger"] .filterbar {
  position: static;
}

/* The order, in words and always on screen: «Сначала: новые · дешёвые ·
   дорогие». The owner asked for "cheapest first and the other way round" and
   did not find the icon-only menu this replaces, so all three choices show at
   once, from 320px, in a switch like the view's: the current one is filled.
   Its own row, right above the lots; plain links, no script needed. */
.order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
  margin-top: var(--s4);
}

.order__label {
  color: var(--ink-soft);
  font: 400 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.order__opts {
  display: inline-flex;
  border: 1px solid var(--ink);
}

.order__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 0.7rem;
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.order__opt + .order__opt {
  border-left: 1px solid var(--rule-strong);
}

.order__opt[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 359.98px) {
  /* the narrowest phones: the location chips and the count share one row */
  .chip {
    padding-inline: 0.6rem;
  }

  /* …and the order keeps all three choices on one line */
  .order__opt {
    padding-inline: 0.5rem;
  }
}

.catalog__body {
  margin-top: var(--s5);
}

.catalog__empty {
  padding: var(--s7) 0;
  font-size: var(--fs-lead);
}

.catalog__empty .link {
  margin-top: var(--s3);
}

/* «Показать ещё»: the next step of the ledger. A plain link to the same list,
   longer, that lands on the first lot it adds; site.js adds them in place. */
.catalog__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3) var(--s5);
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: 1px dashed var(--ink);
}

.catalog__more .btn {
  min-width: min(100%, 16rem);
}

.catalog__more.is-busy .btn {
  cursor: progress;
  opacity: 0.6;
}

@media (min-width: 768px) {
  .chip {
    padding-inline: 0.875rem;
    font-size: var(--fs-label);
  }

  .chip__n {
    font-size: var(--fs-micro);
  }

  .switch__btn,
  .order__opt {
    padding-inline: 0.875rem;
    font-size: var(--fs-label);
  }

  .order__label {
    font-size: var(--fs-label);
  }

  .filterbar {
    margin-top: var(--s3);
  }

  .catalog__body {
    margin-top: var(--s6);
  }
}

@media (min-width: 900px) {
  .catalog__head {
    display: flex;
    align-items: flex-end;
    gap: var(--s4);
  }

  .catalog__row {
    display: contents;
  }

  .catalog__head .h2 {
    order: 1;
  }

  .catalog__count {
    order: 2;
    flex: 1 1 auto;
    padding-bottom: 0.7rem;
    text-align: left;
  }

  .where {
    order: 3;
  }

  .catalog__head .switch {
    order: 4;
  }

  .catalog__count-label {
    display: inline;
  }
}

/* ---------- 9. Lots: the tile («Витрина») view is the default ------------- */

.lots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5) var(--s3);
}

.lot {
  --band: 3rem;                      /* the band above the photo: tag left, stamp right */
}

.lot__link {
  position: relative;
  display: block;
  padding-top: var(--band);
}

.lot__photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
}

.lot__photo img {
  mix-blend-mode: multiply;
  transition: transform 0.7s var(--ease);
}

/* The tag hangs in the band and ends inside the photo's own empty margin:
   6% of the tile's width is 4.8% of the photo's height, the margin is 10%. */
.lot .tag {
  --lift: translateY(-100%);
  top: var(--band);
  left: 0;
  margin-top: 6%;
  font-size: 0.6875rem;
}

.lot:nth-child(4n + 2) .tag { --tilt: 2.5deg; }
.lot:nth-child(4n + 3) .tag { --tilt: -1.5deg; }
.lot:nth-child(4n) .tag { --tilt: 4deg; }

.lot:nth-child(even) .tag.is-swinging {
  animation-delay: 0.14s;
}

.lot__loc {
  position: absolute;
  top: calc((var(--band) - 1.375rem) / 2);
  right: 0;
}

.lot__title {
  margin-top: var(--s2);
  font: italic 400 var(--fs-title) / 1.14 var(--hand);
  text-wrap: balance;
}

.lot__note,
.lot__cat {
  display: none;
}

.lot__cost {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.7em;
  margin-top: 0.375rem;
  font-family: var(--mono);
  line-height: 1.3;
}

.lot__price,
.entry__price {
  font-size: var(--fs-data);
  font-weight: 500;
  white-space: nowrap;
}

.lot__approx,
.entry__approx {
  color: var(--ink-soft);
  font-size: var(--fs-label);
  white-space: nowrap;
}

/* Tiles in one row share their inner rows (photo / name / price),
   so prices line up even when names wrap differently. */
@supports (grid-template-rows: subgrid) {
  .lot,
  .lot__link {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .lot__cost {
    align-self: start;
  }
}

.lot__link:active .lot__photo img {
  transform: scale(0.985);
}

/* Hover states, pointer devices only. Keep this block ABOVE the ledger
   section: the ledger resets the tag (all: unset) and must win the cascade. */
@media (hover: hover) {
  .lot__link:hover .lot__title,
  .entry__link:hover .entry__title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
  }

  .lot__link:hover .lot__photo img {
    transform: scale(1.035);
  }

  .lot__link:hover .tag {
    animation: tag-swing 1.3s var(--ease) both;
  }

  .feature:hover .tie {
    animation: tie-swing 1.9s var(--ease) both;
  }

  .feature:hover .feature__cost .icon,
  .link:hover .icon {
    transform: translateX(0.2rem);
  }

  .btn:hover,
  .chip:hover,
  .switch__btn:hover,
  .order__opt:hover,
  .viewer__btn:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
  }

  .chip:hover .chip__n {
    color: inherit;
  }

  .chip--ru:hover {
    --fill: var(--verdigris-deep);
    border-color: transparent;
    background: none;
    color: var(--sheet);
  }

  .chip--ru:hover::before {
    color: var(--verdigris-deep);
  }

  .chip--ae:hover {
    border-color: var(--verdigris-deep);
    background: var(--verdigris-deep);
    color: var(--sheet);
  }

  .site-nav a:hover,
  .site-header__back:hover,
  .hero__index a:hover,
  .lang a:hover,
  .link:hover,
  .item__sold-link:hover,
  .gallery__zoom:hover {
    color: var(--verdigris-deep);
  }

  .site-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.35em;
  }

  /* the wordmark is two stacked lines: an underline would run between them */
  .site-footer .mark:hover {
    text-decoration: none;
  }
}

@media (min-width: 600px) {
  .lots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s6) var(--s5);
  }

  .lot {
    --band: 3.125rem;
  }

  .lot .tag {
    font-size: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .lots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: var(--s7);
  }

  .lot {
    --band: 3.5rem;
  }

  .lot .tag {
    font-size: 0.875rem;
  }
}

/* ---------- 10. Lots: the ledger («Опись») view ---------------------------- */

.specimen,
.ledger-head {
  display: none;
}

[data-view="ledger"] .lots {
  display: block;
  border-top: 1px solid var(--ink);
}

[data-view="ledger"] .lot {
  display: block;
  border-bottom: 1px solid var(--rule);
}

[data-view="ledger"] .lot__link {
  display: grid;
  grid-row: auto;
  grid-template-rows: none;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  grid-template-areas:
    "no title price"
    "no loc approx";
  align-items: center;
  gap: 0.3rem var(--s3);
  min-height: 4.25rem;
  padding: 0.75rem var(--s2);
  transition: background-color 0.15s;
}

[data-view="ledger"] .lot__photo {
  display: none;
}

/* the tag becomes a plain number in the first column */
[data-view="ledger"] .lot .tag,
[data-view="ledger"] .lot .tag__card,
[data-view="ledger"] .lot .tag__sign,
[data-view="ledger"] .lot .tag__num {
  all: unset;
}

[data-view="ledger"] .lot .tag::after,
[data-view="ledger"] .lot .tag__card::before {
  content: none;
}

[data-view="ledger"] .lot .tag {
  grid-area: no;
  align-self: start;
  padding-top: 0.2rem;
  font: 500 var(--fs-data) / 1.2 var(--mono);
}

[data-view="ledger"] .lot .tag__sign {
  display: none;
}

[data-view="ledger"] .lot__title {
  grid-area: title;
  margin: 0;
  font-size: 1.1875rem;
  text-wrap: pretty;
}

[data-view="ledger"] .lot__loc {
  position: relative;
  top: auto;
  right: auto;
  grid-area: loc;
  justify-self: start;
}

[data-view="ledger"] .lot__cost {
  display: contents;
}

[data-view="ledger"] .lot__price {
  grid-area: price;
  justify-self: end;
}

[data-view="ledger"] .lot__approx {
  grid-area: approx;
  justify-self: end;
}

[data-view="ledger"] .lot__link:hover .lot__title {
  text-decoration: none;
}

[data-view="ledger"] .lot__link:active {
  background: var(--verdigris-wash);
}

[data-view="ledger"] .lot.is-active {
  background: var(--verdigris-wash);
  box-shadow: inset 3px 0 0 var(--verdigris-deep);
}

/* Specimen card: the photo that follows the active row.
   Phones — pinned above the list, photo first; the active row is always the
   first one under it (the rows snap to the card's lower edge, the notch
   points at the row). Wider — a card beside the list. */
[data-view="ledger"] .specimen {
  --card-h: 11rem;
  position: sticky;
  top: var(--stick);
  z-index: 10;
  display: block;
  margin-inline: calc(-1 * var(--gutter));
  padding: var(--s2) var(--gutter) 0.625rem;
  background: var(--paper);
}

.specimen__card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "photo head"
    "photo note"
    "photo foot";
  column-gap: var(--s3);
  height: var(--card-h);
  padding: var(--s3);
  border: 1px solid var(--ink);
  background: var(--sheet);
}

.specimen__card::after {
  /* the notch that points at the active row */
  content: "";
  position: absolute;
  bottom: -0.3125rem;
  left: 1.25rem;
  width: 0.5625rem;
  height: 0.5625rem;
  border: solid var(--ink);
  border-width: 0 1px 1px 0;
  background: var(--sheet);
  transform: rotate(45deg);
}

.specimen__link {
  display: contents;
}

/* Pinned card: the plate is 14:15, so `cover` trims 7% above and below —
   inside the empty margin every cut-out has — and the piece shows larger. */
.specimen__photo {
  position: relative;
  grid-area: photo;
  height: 100%;
  min-height: 0;
  aspect-ratio: 14 / 15;
}

.specimen__photo img {
  object-fit: cover;
}

/* while the next photo decodes, the old one steps back: a name never sits
   beside another piece's picture */
.specimen__photo.is-swapping img {
  opacity: 0.16;
}

.specimen__head {
  position: relative;
  z-index: 1;
  grid-area: head;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s2);
}

.specimen .lotmark {
  font-size: 2.75rem;
}

/* where the active row stands in the list: "3 / 24" */
.specimen__pos {
  padding-top: 0.125rem;
  color: var(--ink-soft);
  font: 400 var(--fs-micro) / 1.2 var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.specimen__dater,
.specimen__title,
.specimen__cost,
.specimen__foot .stamp {
  display: none;
}

.specimen__note {
  grid-area: note;
  display: -webkit-box;
  align-self: start;
  margin-top: var(--s2);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.specimen__foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.specimen__open {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
  text-transform: uppercase;
}

.specimen__open .icon {
  width: 1rem;
  height: 1rem;
}

.specimen__tg {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--ink);
  background: var(--verdigris);
}

@media (max-width: 699.98px) {
  /* the rows click into place under the pinned card */
  [data-view="ledger"] {
    scroll-padding-top: 0;
    scroll-snap-type: y proximity;
  }

  [data-view="ledger"] .lot {
    scroll-margin-top: calc(var(--stick) + 0.5rem + 11rem + 0.625rem);
    scroll-snap-align: start;
  }
}

@media (min-width: 700px) {
  [data-view="ledger"] .catalog__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    align-items: start;
    gap: var(--s6);
  }

  [data-view="ledger"] .specimen {
    order: 2;
    top: calc(var(--stick) + var(--s5));
    margin: 0;
    padding: 0;
    background: none;
  }

  .specimen__card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(5rem, 1fr) auto auto auto auto;
    grid-template-areas:
      "head"
      "photo"
      "title"
      "note"
      "cost"
      "foot";
    height: auto;
    max-height: calc(100vh - var(--stick) - 3rem);
    padding: var(--s4);
  }

  .specimen__card::after {
    content: none;
  }

  /* The plate wants to be 4:5 (the strut below), but on a short screen its
     row gives way first, so the number, the name and the price are never
     the part that is cut off. */
  .specimen__photo {
    height: auto;
    aspect-ratio: auto;
    margin-block: var(--s1);
    overflow: hidden;
  }

  .specimen__photo::after {
    content: "";
    display: block;
    padding-top: 125%;
  }

  .specimen__photo img {
    position: absolute;
    inset: 0;
    object-fit: contain;
  }

  /* beside the list the card is a full specimen: it carries the date stamp */
  .specimen__pos {
    display: none;
  }

  .specimen__dater {
    display: inline-grid;
    margin: 0.125rem 0.125rem 0 0;
  }

  .specimen__title {
    display: -webkit-box;
    grid-area: title;
    min-height: 2.24em;
    overflow: hidden;
    font: italic 400 1.25rem / 1.12 var(--hand);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .specimen__note {
    min-height: 2.9em;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .specimen__cost {
    grid-area: cost;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.7em;
    margin-top: var(--s2);
    font-family: var(--mono);
  }

  .specimen__foot {
    margin-top: var(--s3);
    padding-top: var(--s3);
    border-top: 1px solid var(--rule);
  }

  .specimen__foot .stamp {
    display: inline-flex;
    margin-right: auto;
  }
}

@media (min-width: 700px) and (max-height: 519.98px) {
  /* a phone on its side: the row already names the piece, the card keeps
     its height for the photo */
  .specimen__title,
  .specimen__note {
    display: none;
  }

  .specimen__card {
    padding: var(--s3);
  }
}

@media (max-width: 359.98px) {
  /* beside the pinned card's photo only the lot number fits; the row itself shows where it is */
  .specimen .lotmark {
    font-size: 2.25rem;
  }

  .specimen__pos {
    display: none;
  }
}

@media (min-width: 900px) {
  [data-view="ledger"] .catalog__body {
    grid-template-columns: minmax(0, 1fr) clamp(17rem, 27vw, 23rem);
    gap: clamp(1.5rem, 4vw, 4rem);
  }

  .specimen .lotmark {
    font-size: 3.25rem;
  }

  .specimen__title {
    font-size: var(--fs-h3);
  }

  .specimen__card {
    padding: var(--s5);
  }

  /* column heads from here on: the list is wide enough to be a real ledger */
  [data-view="ledger"] .ledger-head,
  [data-view="ledger"] .lot__link {
    grid-template-columns: 3.25rem minmax(0, 1fr) 5.5rem 7rem;
    column-gap: var(--s4);
  }

  [data-view="ledger"] .ledger-head {
    display: grid;
    padding: 0 var(--s2) var(--s2);
    color: var(--ink-soft);
    font: 400 var(--fs-micro) / 1 var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .ledger-head__cat,
  .ledger-head__approx {
    display: none;
  }

  .ledger-head__price,
  .ledger-head__approx {
    text-align: right;
  }

  [data-view="ledger"] .lot__link {
    grid-template-areas:
      "no title loc price"
      "no note loc approx";
    row-gap: 0.2rem;
    min-height: 4.5rem;
  }

  [data-view="ledger"] .lot .tag {
    padding-top: 0.3rem;
  }

  [data-view="ledger"] .lot__title {
    align-self: end;
    font-size: 1.3125rem;
  }

  [data-view="ledger"] .lot__note {
    grid-area: note;
    display: block;
    align-self: start;
  }

  [data-view="ledger"] .lot__price {
    align-self: end;
  }

  [data-view="ledger"] .lot__approx {
    align-self: start;
  }
}

@media (min-width: 1100px) {
  /* the category column comes back; the card gives it the room */
  [data-view="ledger"] .catalog__body {
    grid-template-columns: minmax(0, 1fr) clamp(18rem, 24vw, 23rem);
  }

  [data-view="ledger"] .ledger-head,
  [data-view="ledger"] .lot__link {
    grid-template-columns: 3.5rem minmax(0, 1fr) 9.5rem 5.5rem 7rem;
  }

  [data-view="ledger"] .lot__link {
    grid-template-areas:
      "no title cat loc price"
      "no note cat loc approx";
  }

  .ledger-head__cat {
    display: block;
  }

  [data-view="ledger"] .lot__cat {
    grid-area: cat;
    display: block;
    color: var(--ink-soft);
    font: 400 var(--fs-label) / 1.3 var(--mono);
  }
}

@media (min-width: 1320px) {
  [data-view="ledger"] .ledger-head,
  [data-view="ledger"] .lot__link {
    grid-template-columns: 3.75rem minmax(0, 1fr) 9.5rem 5.5rem 6.5rem 6.75rem;
  }

  [data-view="ledger"] .lot__link {
    grid-template-areas:
      "no title cat loc price approx"
      "no note cat loc price approx";
  }

  .ledger-head__approx {
    display: block;
  }

  [data-view="ledger"] .lot__price,
  [data-view="ledger"] .lot__approx {
    align-self: center;
  }
}

/* ---------- 11. How to buy: a three-part ticket --------------------------- */

.split {
  display: grid;
  gap: var(--s6);
}

.split__intro {
  max-width: 26rem;
  margin-top: var(--s4);
  font-size: var(--fs-lead);
  line-height: 1.42;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--s5);
  }

  .split__head {
    grid-column: 1 / span 4;
  }

  .split__body {
    grid-column: 5 / -1;
  }
}

.ticket {
  display: grid;
  border: 1px solid var(--ink);
  background: var(--sheet);
}

.ticket__stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--s5);
}

.ticket__step {
  color: var(--verdigris-deep);
  font: 500 var(--fs-micro) / 1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ticket__stub h3 {
  margin-top: var(--s3);
  font: 400 var(--fs-h3) / 1.12 var(--text);
  letter-spacing: -0.015em;
}

.ticket__stub p + p,
.ticket__stub h3 + p {
  margin-top: var(--s3);
}

.ticket__stub .ticket__action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s5);
  min-height: 2.75rem;
  margin-top: auto;
  padding-top: var(--s3);
}

/* perforation + two punched notches between stubs */
.ticket__stub + .ticket__stub {
  border-top: 1px dashed var(--ink);
}

.ticket__stub + .ticket__stub::before,
.ticket__stub + .ticket__stub::after {
  content: "";
  position: absolute;
  top: -0.5625rem;
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.ticket__stub + .ticket__stub::before {
  left: calc(-0.5625rem - 1px);
  clip-path: inset(-1px -1px -1px 50%);
}

.ticket__stub + .ticket__stub::after {
  right: calc(-0.5625rem - 1px);
  clip-path: inset(-1px 50% -1px -1px);
}

/* Delivery and payment: where the header link lands */
.terms {
  margin-top: var(--s6);
  scroll-margin-top: var(--s5);
}

.terms__title,
.key__title {
  font: 500 var(--fs-label) / 1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.facts {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--ink);
}

.facts dt {
  font: 500 var(--fs-micro) / 1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.facts dd {
  margin-top: var(--s1);
}

/* on the site the facts are her own delivery text, a paragraph a column */
.facts p {
  white-space: pre-line;
}

.terms__more {
  margin-top: var(--s3);
}

@media (min-width: 768px) {
  .ticket {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ticket__stub + .ticket__stub {
    border-top: 0;
    border-left: 1px dashed var(--ink);
  }

  .ticket__stub + .ticket__stub::before,
  .ticket__stub + .ticket__stub::after {
    top: auto;
    right: auto;
    left: calc(-0.5625rem - 0.5px);
  }

  .ticket__stub + .ticket__stub::before {
    top: calc(-0.5625rem - 1px);
    clip-path: inset(50% -1px -1px -1px);
  }

  .ticket__stub + .ticket__stub::after {
    bottom: calc(-0.5625rem - 1px);
    clip-path: inset(-1px -1px 50% -1px);
  }

  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s5);
  }
}

@media (min-width: 768px) and (min-height: 500px) {
  .terms {
    scroll-margin-top: calc(var(--header-h) + var(--s5));
  }
}

/* ---------- 12. About + the key to the marks ------------------------------ */

/* her own words: the hand */
.about__text {
  max-width: 46rem;
  font: italic 400 clamp(1.375rem, 1.14rem + 1.05vw, 2.125rem) / 1.28 var(--hand);
  text-wrap: pretty;
}

.about__sign {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s5);
  margin-top: var(--s5);
}

.key {
  display: grid;
  gap: var(--s5);
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--ink);
}

.key__list {
  display: grid;
  gap: var(--s5);
}

.key__item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  gap: var(--s4);
}

.key__mark {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  min-height: 3.5rem;
}

.key__mark .tag {
  --tilt: -4deg;
  position: relative;
}

.key__price {
  font-family: var(--mono);
  line-height: 1.3;
}

.key__price b {
  display: block;
  font-size: var(--fs-data);
  font-weight: 500;
}

.key__price span {
  color: var(--ink-soft);
  font-size: var(--fs-label);
}

.key__item p {
  font-size: 1rem;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .key__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s6) var(--s5);
  }
}

@media (min-width: 1024px) {
  .key {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--s5);
  }

  .key__title {
    grid-column: 1 / span 4;
  }

  .key__list {
    grid-column: 5 / -1;
    /* four marks: the lot number, where the piece is, the two prices, the sold stamp */
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .key__item {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: var(--s3);
  }

  .key__mark {
    min-height: 5.5rem;
  }

  .key__mark .tag {
    font-size: 1rem;
  }

  .key__mark .stamp {
    height: 1.875rem;
    padding-inline: calc(0.7rem + 0.1em) 0.7rem;
    font-size: 0.8125rem;
  }

  .key__price b {
    font-size: 1.125rem;
  }

  .key__price span {
    font-size: var(--fs-data);
  }
}

/* ---------- 13. Footer ---------------------------------------------------- */

.site-footer {
  margin-top: var(--section);
  padding-block: var(--s8) var(--s5);
  background: var(--verdigris);
}

.site-footer :focus-visible {
  outline-color: var(--ink);
}

.site-footer__top {
  display: grid;
  gap: var(--s7);
}

.site-footer__line {
  max-width: 24rem;
  margin-top: var(--s5);
  font: italic 400 var(--fs-h3) / 1.15 var(--hand);
}

.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s6) var(--s4);
}

.site-footer h2 {
  font: 500 var(--fs-micro) / 1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-footer li a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.75rem;
  font: 400 var(--fs-data) / 1 var(--mono);
  white-space: nowrap;
}

.site-footer li .icon {
  width: 1rem;
  height: 1rem;
}

.site-footer .lang {
  margin-left: -0.875rem;
  color: var(--ink);
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  margin-top: var(--s8);
  padding-top: var(--s4);
  border-top: 1px solid var(--ink);
  font: 400 var(--fs-label) / 1.4 var(--mono);
  letter-spacing: 0.04em;
}

@media (max-width: 359.98px) {
  /* "Telegram channel ↗" does not fit half of the narrowest phone */
  .site-footer__cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 700px) {
  /* the brand takes the full width, the four columns one row under it */
  .site-footer__cols {
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    gap: var(--s5);
  }
}

@media (min-width: 1100px) {
  .site-footer__top {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--s5);
  }

  .site-footer__brand {
    grid-column: 1 / span 4;
  }

  .site-footer__cols {
    grid-column: 6 / -1;
  }
}

/* ---------- 14. Piece page ------------------------------------------------ */

/* phones: the way back sits in the header, so this row appears from 768px */
.crumbs {
  display: none;
}

.crumbs .link {
  text-decoration: none;
}

.crumbs__where {
  font: 400 var(--fs-label) / 1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.item {
  display: grid;
  gap: var(--s3);
  padding-top: var(--s2);
}

/* Gallery: scroll-snap track + ticks (phones) / thumbnails (wider) */
.gallery {
  min-width: 0;
}

.gallery__track {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery__track::-webkit-scrollbar {
  display: none;
}

/* Every slide is the same 4:5 plate; on a phone it is never taller than half
   the screen, so the number, the name and the price stay above the buy bar. */
.gallery__slide {
  position: relative;
  flex: 0 0 90%;
  aspect-ratio: 4 / 5;
  max-height: 50vh;
  max-height: 50svh;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: zoom-in;
}

.gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* a landscape piece (the bot's flag) may lose the empty bands above and below
   it when the plate is cut short */
.gallery__slide.is-wide img {
  object-fit: cover;
}

/* the optional video is one more slide; its thumb gets a play mark */
.gallery__slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink);
}

.gallery__thumb--video::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 0.4rem solid transparent;
  border-left: 0.65rem solid var(--ink);
  transform: translate(-25%, -50%);
}

/* crop marks give every plate an edge without boxing the photo in */
.gallery__slide::after {
  --m: 0.875rem;
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) top left / var(--m) 1px,
    linear-gradient(var(--ink), var(--ink)) top left / 1px var(--m),
    linear-gradient(var(--ink), var(--ink)) top right / var(--m) 1px,
    linear-gradient(var(--ink), var(--ink)) top right / 1px var(--m),
    linear-gradient(var(--ink), var(--ink)) bottom left / var(--m) 1px,
    linear-gradient(var(--ink), var(--ink)) bottom left / 1px var(--m),
    linear-gradient(var(--ink), var(--ink)) bottom right / var(--m) 1px,
    linear-gradient(var(--ink), var(--ink)) bottom right / 1px var(--m);
  background-repeat: no-repeat;
  pointer-events: none;
}

.gallery__cap {
  position: absolute;
  bottom: 0.875rem;
  left: 0.75rem;
  z-index: 1;
  font: 400 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* «Лупа»: opens the full-screen viewer; press and hold the photo (or move the
   mouse over it) for the loupe itself */
.gallery__zoom {
  position: absolute;
  right: 0.25rem;
  bottom: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  padding-inline: 0.5rem;
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery__zoom .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.gallery__thumbs {
  /* on phones the ticks sit on the same row as the lot number below */
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin-top: var(--s3);
  margin-bottom: calc(-2.75rem - var(--s3));
}

.gallery__thumb {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 2.75rem;
}

.gallery__thumb::before {
  /* on phones a thumb is a tick */
  content: "";
  position: absolute;
  top: 50%;
  right: 0.25rem;
  left: 0.25rem;
  height: 2px;
  background: var(--ink-faint);
  transition: background-color 0.2s;
}

.gallery__thumb[aria-current="true"]::before {
  background: var(--ink);
}

.gallery__thumb span {
  display: none;
}

@media (min-width: 768px) {
  .crumbs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    padding-block: var(--s1);
  }

  .item {
    padding-top: 0;
  }

  .gallery__thumbs {
    z-index: auto;                   /* no layer of its own: the thumbs multiply into the paper too */
    justify-content: flex-start;
    gap: var(--s2);
    margin-top: var(--s3);
    margin-bottom: 0;
  }

  /* thumbnails float on the paper like every other photo; the current one is
     marked with the same tick the phone uses */
  .gallery__thumb {
    width: 4.5rem;
    height: auto;
    padding-bottom: 0.5rem;
  }

  .gallery__thumb::before {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    background: transparent;
  }

  .gallery__thumb span {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
  }

  .gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
  }
}

/* The piece: number, name, price, where it is */
.item__info {
  min-width: 0;
}

.item__title {
  margin-top: 0.625rem;
  font: italic 400 clamp(2.125rem, 1.6rem + 2.3vw, 3.5rem) / 1.02 var(--hand);
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.item__deal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s3);
  margin-top: var(--s3);
}

/* The price, and the «≈» price on the same line after it: the row is the
   price alone (a piece has its price and her description, nothing more) */
.item__cost {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.75rem;
  font-family: var(--mono);
}

.item__price {
  font-size: clamp(1.625rem, 1.42rem + 0.9vw, 2.125rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.item__approx {
  color: var(--ink-soft);
  font-size: var(--fs-data);
  white-space: nowrap;
}

.item__where {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  font: 400 var(--fs-label) / 1.45 var(--mono);
}

/* her description: blank lines part paragraphs, single line breaks stay */
.item__text p {
  white-space: pre-line;
}

.item__text p + p {
  margin-top: 0.75em;
}

.item__text {
  max-width: 34rem;
  margin-top: var(--s5);
  font-size: 1.125rem;
  line-height: 1.5;
}

/* Buy bar: fixed to the bottom on phones — lot, price, Telegram, WhatsApp —
   and in the flow from 768px */
.buybar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--gutter) calc(var(--s2) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ink);
  background: var(--sheet);
}

.buybar__lot {
  display: grid;
  gap: 0.3rem;
  margin-right: auto;
  font-family: var(--mono);
  line-height: 1;
  white-space: nowrap;
}

.buybar__no {
  color: var(--ink-soft);
  font-size: var(--fs-micro);
  letter-spacing: 0.04em;
}

.buybar__price {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.buybar .btn {
  padding-inline: 1rem;
}

.buybar .btn--wa {
  width: 3rem;
  padding: 0;
}

.has-buybar {
  /* room for the fixed bar so it never covers the end of the page */
  padding-bottom: calc(4rem + 1px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767.98px) {
  .btn--wa .btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (max-width: 409.98px) {
  /* next to the price only the messenger's name fits */
  .buybar .btn__extra {
    display: none;
  }
}

.item__help {
  margin-top: var(--s5);
}

.copy {
  margin-top: var(--s2);
}

.copy.is-done {
  color: var(--verdigris-deep);
  text-decoration: none;
}

.copy .icon--done,
.copy.is-done .icon--link {
  display: none;
}

.copy.is-done .icon--done {
  display: block;
}

/* Where the clipboard is out of reach — an in-app browser, a locked preview
   frame — app.js sets the link itself under the control, already selected
   (the selection wears the verdigris of ::selection). One tap selects it again. */
.copy__url {
  max-width: 34rem;
  margin-top: var(--s1);
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  font: 400 var(--fs-label) / 1.45 var(--mono);
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}

@media (min-width: 768px) {
  .item {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--s5);
    align-items: start;
    row-gap: var(--s5);
  }

  .gallery {
    grid-column: 1 / span 7;
  }

  .gallery__track {
    gap: 0;
    margin: 0;
    padding: 0;
    scroll-padding: 0;
  }

  .gallery__slide {
    flex-basis: 100%;
    max-height: calc(100vh - var(--stick) - 9rem);
  }

  .item__info {
    grid-column: 8 / -1;
  }

  .item__title {
    margin-top: var(--s4);
  }

  .item__deal {
    margin-top: var(--s4);
  }

  .buybar {
    position: static;
    z-index: auto;
    flex-wrap: wrap;
    margin-top: var(--s6);
    padding: 0;
    border: 0;
    background: none;
  }

  .buybar__lot {
    display: none;
  }

  .buybar .btn,
  .buybar .btn--wa {
    flex: 1 1 0;
    width: auto;
    min-height: 3.5rem;
    padding-inline: 1rem;
  }

  .buybar .btn--primary {
    flex-grow: 1.7;
  }

  .has-buybar {
    padding-bottom: 0;
  }

  .item__help {
    margin-top: var(--s4);
  }
}

@media (min-width: 1024px) {
  /* thumbnails move to a rail on the left; the gallery stays in view
     while the description and the passport scroll past */
  .gallery {
    grid-row: 1 / span 2;
    position: sticky;
    top: calc(var(--stick) + var(--s5));
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: var(--s4);
    align-items: start;
    /* a pinned block is its own layer: it needs its own paper under the
       photos, a little wider than the plates so no edge shows */
    margin: -2px;
    padding: 2px;
    background: var(--paper);
  }

  .gallery__track {
    grid-column: 2;
    grid-row: 1;
  }

  .gallery__slide {
    max-height: calc(100vh - var(--stick) - 5.5rem);
  }

  .gallery__thumbs {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    margin: 0;
  }

  /* a piece with one photo has no rail: the plate takes the whole column */
  .gallery--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery--single .gallery__track {
    grid-column: 1;
  }

  .item__info {
    grid-row: 1;
    padding-left: clamp(0rem, -4rem + 7vw, 3.5rem);
  }
}

/* ---------- 15. The passport: one sheet per lot --------------------------- */

.passport {
  position: relative;
  min-width: 0;                      /* a grid item: never wider than the page column */
  margin-top: var(--s5);
  padding: clamp(1.375rem, 0.9rem + 2.2vw, 2.5rem);
  border: 1px solid var(--ink);
  background: var(--sheet);
}

.passport::before {
  /* inner frame */
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.passport__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;           /* the sheet number stands level with the name */
  justify-content: space-between;
  gap: var(--s1) var(--s3);
}

.passport__kicker,
.passport__label {
  font: 500 var(--fs-micro) / 1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* The letterhead: the name, and under it what the sheet belongs to. Both
   lines have fifteen characters, so in the monospace they set flush left and
   right — at any width, with nothing left to wrap. */
.passport__issuer span {
  display: block;
  white-space: nowrap;
}

.passport__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s4);
}

.passport__title {
  font: 300 clamp(1.875rem, 1.5rem + 1.7vw, 2.75rem) / 1.02 var(--text);
  letter-spacing: -0.028em;
}

/* The document's photo, the shop's seal with the lot number struck across its corner */
.passport__id {
  position: relative;
  flex: none;
  width: clamp(5.5rem, 27vw, 7rem);
  margin: 0 0.125rem 1.375rem 0;
}

.passport__photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
}

.passport__photo::after {
  --m: 0.4375rem;
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) top left / var(--m) 1px,
    linear-gradient(var(--ink), var(--ink)) top left / 1px var(--m),
    linear-gradient(var(--ink), var(--ink)) top right / var(--m) 1px,
    linear-gradient(var(--ink), var(--ink)) top right / 1px var(--m),
    linear-gradient(var(--ink), var(--ink)) bottom right / var(--m) 1px,
    linear-gradient(var(--ink), var(--ink)) bottom right / 1px var(--m);
  background-repeat: no-repeat;
}

.passport__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.passport .seal {
  position: absolute;
  right: 31%;
  bottom: -1.5rem;
  width: clamp(5.75rem, 27vw, 6.75rem);
}

@media (max-width: 374.98px) {
  /* Narrow phones: the photo and the seal follow the width of the screen
     (27vw), so the title follows it too. Otherwise its long word runs under
     the seal and, on the narrowest screens, pushes the sheet wider than the
     page. */
  .passport__title {
    font-size: max(1.625rem, 8vw);
  }
}

@media (max-width: 339.98px) {
  /* …and where the photo stops shrinking, the seal moves a touch onto it,
     clear of the title's last letter */
  .passport .seal {
    right: 17%;
  }
}

/* printed label ........ hand-written value, starting at a tab stop */
.specs {
  display: grid;
  gap: 0.8rem;
  margin-top: var(--s5);
}

.spec {
  display: grid;
  grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.6rem;
}

.spec dt {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font: 400 var(--fs-micro) / 1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.spec dt::after {
  content: "";
  flex: 1;
  border-bottom: 1px dotted var(--ink-faint);
}

.spec dd {
  font: italic 400 1.1875rem / 1.2 var(--hand);
  text-wrap: pretty;
}

/* date of entry and the owner's hand */
.passport__sign {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  margin-top: var(--s5);
}

.passport__date {
  display: grid;
  gap: 0.25rem;
  font: 500 var(--fs-data) / 1 var(--mono);
}

.passport__date span,
.passport__hand span {
  color: var(--ink-soft);
  font: 400 var(--fs-micro) / 1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.passport__hand {
  display: grid;
  justify-items: end;
  text-align: right;
}

.passport__hand span {
  letter-spacing: 0.06em;
}

.signature {
  width: 8.5rem;
  height: auto;
  margin-bottom: -0.125rem;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.passport__foot {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--ink);
}

.passport__share {
  margin-top: var(--s1);
}

@media (min-width: 768px) {
  .passport {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  /* beside the photo, under the description */
  .passport {
    grid-column: 8 / -1;
    grid-row: 2;
    margin-top: var(--s2);
    margin-left: clamp(0rem, -4rem + 7vw, 3.5rem);
  }
}

/* ---------- 16. The loupe and the full-screen viewer ----------------------- */

/* A jeweller's loupe with a verdigris rim: follows the mouse over a photo,
   or the finger after a press-and-hold. Positioned by app.js. */
.loupe {
  --d: 10.5rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: var(--d);
  height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border: 3px solid var(--verdigris);
  border-radius: 50%;
  background-color: var(--sheet);
  background-repeat: no-repeat;
  box-shadow:
    0 0 0 1px var(--ink),
    inset 0 0 0 1px rgb(15 21 19 / 0.55),
    inset 0 0.5rem 1.25rem rgb(15 21 19 / 0.06),
    0 0.875rem 2rem rgb(15 21 19 / 0.28);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  will-change: transform;
}

.loupe.is-on {
  opacity: 1;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--paper);
}

.viewer__bar,
.viewer__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s2) var(--gutter);
}

.viewer__bar {
  padding-top: calc(var(--s2) + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--rule);
}

.viewer__foot {
  padding-bottom: calc(var(--s2) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
}

.viewer__title {
  display: flex;
  gap: var(--s3);
  font: 500 var(--fs-data) / 1 var(--mono);
}

.viewer__title span + span {
  color: var(--ink-soft);
  font-weight: 400;
}

.viewer__tools {
  display: flex;
  gap: var(--s2);
}

.viewer__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.625rem;
  border: 1px solid var(--ink);
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}

.viewer__btn:disabled {
  border-color: var(--rule);
  color: var(--ink-faint);
  cursor: default;
}

.viewer__btn .icon {
  width: 1.125rem;
  height: 1.125rem;
}

/* The stage scrolls natively once the photo is larger than the screen;
   app.js only changes the photo's width (pinch, double tap, buttons). */
.viewer__stage {
  display: flex;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  cursor: zoom-in;
}

.viewer.is-zoomed .viewer__stage {
  cursor: grab;
}

.viewer__canvas {
  flex: none;
  aspect-ratio: 4 / 5;
  margin: auto;
}

.viewer__canvas img {
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

.viewer__hint {
  text-align: center;
}

.viewer__hint-mouse {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .viewer__hint-touch {
    display: none;
  }

  .viewer__hint-mouse {
    display: inline;
  }
}

@media (max-width: 479.98px) {
  .viewer__btn--close span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

/* ---------- 17. More pieces ----------------------------------------------- */

.lots--four {
  margin-top: var(--s5);
}

@media (min-width: 600px) and (max-width: 1023.98px) {
  /* four pieces read better as 2 × 2 than as 3 + 1 */
  .lots--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- 19. Sold lots: crossed out in the ledger ----------------------- */

/* The owner's rule: a sold piece stays on the site as a lot, struck through
   and without a price. Sold lots come after every lot on sale. The stamp gets
   a shape of its own - a double-ruled rectangle, set askew like a rubber
   stamp - and it is ink, not verdigris: it is the ledger's last word. */
.stamp--sold {
  border: 1px solid currentColor;
  outline: 1px solid currentColor;
  outline-offset: 2px;
  color: var(--ink);
  transform: rotate(-3deg);
}

/* in the tile's band it stands where the location stamp would */
.lot .stamp--sold {
  right: 0.25rem;
}

.lot__title s,
.item__title s,
.specimen__title s {
  text-decoration-line: line-through;
  text-decoration-thickness: max(1px, 0.055em);
  text-decoration-color: var(--ink);
}

.is-sold .lot__title {
  color: var(--ink-soft);
}

/* the photo steps back; white still multiplies into nothing */
.is-sold .lot__photo img {
  opacity: 0.55;
}

/* where the sold lots begin: a ruled line across the list */
.lots__break {
  grid-column: 1 / -1;
  padding-top: var(--s2);
  border-top: 1px solid var(--ink);
}

[data-view="ledger"] .lots__break {
  padding: var(--s6) var(--s2) var(--s2);
  border-top: 0;
  border-bottom: 1px solid var(--ink);
}

/* the piece's own page: the stamp in place of the price, and one line instead of the buy bar */
.item__deal .stamp--sold {
  height: 2.125rem;
  padding-inline: calc(0.85rem + 0.1em) 0.85rem;
  font-size: 0.9375rem;
  transform: rotate(-4deg);
}

.item__sold {
  max-width: 34rem;
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--ink);
  font-size: var(--fs-lead);
  line-height: 1.42;
  text-wrap: pretty;
}

.item__sold-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.passport__dates {
  display: grid;
  gap: var(--s3);
}

.specimen__foot .stamp:empty,
.specimen__photo img[hidden] {
  display: none;
}

/* ---------- 20. Notices (404, 410, 500) and the text pages ----------------- */

.notice {
  padding-top: clamp(2.5rem, 1.5rem + 5vw, 6rem);
}

.notice__code {
  font: 300 var(--fs-lot) / 0.86 var(--mono);
  letter-spacing: -0.045em;
}

.notice .seal {
  width: clamp(7rem, 30vw, 9.5rem);
}

.notice__title {
  max-width: 20ch;
  margin-top: var(--s5);
  font: 300 var(--fs-h2) / 1 var(--text);
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.notice__text {
  max-width: 31rem;
  margin-top: var(--s4);
  font-size: var(--fs-lead);
  line-height: 1.42;
}

.notice__action {
  margin-top: var(--s4);
}

.page {
  padding-top: clamp(1.5rem, 0.5rem + 4vw, 3.5rem);
}

.page__text {
  max-width: 40rem;
  font-size: var(--fs-lead);
  line-height: 1.5;
}

.page__text.about__text {
  max-width: 46rem;
  font-size: clamp(1.375rem, 1.14rem + 1.05vw, 2.125rem);
  line-height: 1.28;
}

.page__text p {
  white-space: pre-line;
}

.page__text p + p {
  margin-top: 0.9em;
}

.page__back {
  margin-top: var(--s5);
}

/* ---------- 21. Motion preferences (last, so that it wins) ------------------ */

/* Links inside the page jump: no smooth scrolling across a catalog this long */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
