/* =========================================================================
   THE AGENT MUSEUM — Design System
   agentmuseum.org

   A grand-museum visual language: warm alabaster galleries, editorial serif
   display, letter-spaced wall labels, antique-bronze accents, verdigris for
   the "authenticated" state. Built to feel like a real cultural institution —
   quiet, confident, generous with space, fast and accessible.

   Influences in spirit: the Met, the Rijksmuseum, the Getty, Tate, the British
   Museum — editorial typography, full-bleed objects, restrained palette.
   ========================================================================= */

/* --------------------------------------------------- Typefaces (self-hosted)
   Variable woff2, Latin subset, served from our own origin — no third-party
   CDN, no tracking, ~127KB total. One file per family carries every weight. */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/assets/fonts/cormorant-garamond.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic; font-weight: 300 700; font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-italic.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/assets/fonts/eb-garamond.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("/assets/fonts/eb-garamond-italic.woff2") format("woff2");
}

/* ------------------------------------------------------------------ Tokens */
:root {
  /* Palette — the gallery */
  --paper:        #f6f2e9; /* warm alabaster — the wall */
  --paper-deep:   #efe9da; /* a recessed panel */
  --paper-rich:   #11100d; /* a darkened room (footer, lightbox) */
  --ink:          #1c1a15; /* warm near-black — primary text */
  --ink-soft:     #423d33; /* secondary text */
  --stone:        #837c6c; /* captions, metadata */
  --stone-light:  #a7a08e;
  --line:         #ddd5c2; /* hairline rules */
  --line-soft:    #e8e1d0;

  /* Accents */
  --bronze:       #9a6a2b; /* antique gold — seals, rules, links */
  --bronze-deep:  #6e4a1c;
  --bronze-tint:  #efe3cb;
  --verdigris:    #2c5f57; /* authenticated / verified — bronze patina */
  --verdigris-tint:#dfeae5;
  --oxblood:      #7a2e25; /* caution / unverified */
  --oxblood-tint: #f0ddd7;

  /* Type */
  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body:    "EB Garamond", Georgia, "Times New Roman", serif;
  --font-label:   ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Scale (fluid) */
  --t-hero:   clamp(3.4rem, 8.5vw, 7.5rem);
  --t-d1:     clamp(2.6rem, 5.5vw, 4.75rem);
  --t-d2:     clamp(2rem, 3.6vw, 3.1rem);
  --t-h1:     clamp(1.9rem, 3vw, 2.6rem);
  --t-h2:     clamp(1.5rem, 2.2vw, 1.95rem);
  --t-h3:     1.34rem;
  --t-body:   1.175rem;
  --t-small:  0.95rem;
  --t-label:  0.74rem;
  --lh-body:  1.72;
  --lh-tight: 1.12;

  /* Space */
  --s-1: 0.5rem; --s-2: 1rem; --s-3: 1.5rem; --s-4: 2rem;
  --s-5: 3rem;  --s-6: 4.5rem; --s-7: 7rem;  --s-8: 10rem;

  /* Layout */
  --measure: 38rem;      /* reading measure */
  --wide: 78rem;         /* full content width */
  --gutter: clamp(1.25rem, 5vw, 4rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-feature-settings: "liga" 1, "kern" 1, "onum" 1; /* oldstyle figures */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, picture { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
h1, h2, h3, h4 { font-weight: 500; line-height: var(--lh-tight); margin: 0 0 0.5em; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }
::selection { background: var(--bronze-tint); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }

/* ------------------------------------------------------------- Typography */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.005em; }
.serif   { font-family: var(--font-body); }
.label {
  font-family: var(--font-label);
  font-size: var(--t-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--stone);
}
.eyebrow { /* the line above a heading */
  font-family: var(--font-label);
  font-size: var(--t-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze-deep);
  font-weight: 600;
  margin: 0 0 var(--s-2);
}
.lede { font-size: 1.36rem; line-height: 1.6; color: var(--ink-soft); }
.muted { color: var(--stone); }
.measure { max-width: var(--measure); }
.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em; line-height: 0.78; float: left;
  padding: 0.06em 0.1em 0 0; color: var(--bronze-deep); font-weight: 500;
}

/* ----------------------------------------------------------------- Layout */
.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-read { max-width: calc(var(--measure) + 8rem); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s-7); }
.section--tight { padding-block: var(--s-6); }
.rule { border-top: 1px solid var(--line); }
.grid { display: grid; gap: var(--s-4); }
@media (min-width: 48rem) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------------------------------------- Top / nav */
.topstrip {
  background: var(--paper-rich); color: #d8cfb8;
  font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; text-align: center; padding: 0.55rem 1rem;
}
.topstrip a { color: var(--bronze); text-decoration: none; }

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.masthead__bar {
  max-width: var(--wide); margin-inline: auto; padding: 0.9rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
}
.wordmark { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.wordmark__seal { width: 38px; height: 38px; flex: none; }
.wordmark__txt { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; letter-spacing: 0.02em; }
.wordmark__txt small { display: block; font-family: var(--font-label); font-size: 0.55rem; letter-spacing: 0.34em; color: var(--stone); margin-top: 3px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); }
.nav a {
  font-family: var(--font-label); font-size: 0.82rem; letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
  padding: 0.3rem 0; border-bottom: 1.5px solid transparent; transition: border-color .25s var(--ease), color .25s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-color: var(--bronze); }
.nav__search { color: var(--stone); }
@media (max-width: 60rem) { .nav { display: none; } }
.nav-toggle { display: none; }
@media (max-width: 60rem) {
  .nav-toggle { display: inline-flex; font-family: var(--font-label); font-size: .8rem; letter-spacing:.12em; text-transform: uppercase; background: none; border: 0; color: var(--ink); cursor: pointer; }
}

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-label); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 600; text-decoration: none;
  padding: 0.85rem 1.6rem; border: 1px solid var(--ink); color: var(--ink);
  background: transparent; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--bronze { border-color: var(--bronze-deep); color: var(--bronze-deep); }
.btn--bronze:hover { background: var(--bronze-deep); color: var(--paper); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--bronze-deep); border-color: var(--bronze-deep); }
.link-arrow { font-family: var(--font-label); font-size: .8rem; letter-spacing:.1em; text-transform: uppercase; text-decoration: none; color: var(--bronze-deep); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.link-arrow:hover { border-color: var(--bronze); }

/* ----------------------------------------------------------------- Hero */
.hero { padding-block: clamp(3rem, 9vh, 7rem) clamp(2rem, 6vh, 4rem); }
.hero__eyebrow { text-align: center; }
.hero__title { font-family: var(--font-display); font-weight: 400; font-size: var(--t-hero); text-align: center; letter-spacing: 0.01em; margin: 0.2em 0 0.3em; }
.hero__sub { max-width: 40rem; margin: 0 auto; text-align: center; font-size: 1.4rem; line-height: 1.55; color: var(--ink-soft); }
.hero__actions { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; margin-top: var(--s-4); }

/* ----------------------------------------------- Featured object (split) */
.featured { display: grid; gap: var(--s-5); align-items: center; }
@media (min-width: 56rem) { .featured { grid-template-columns: 1.1fr 0.9fr; } }
.plate { /* an object on the wall */
  position: relative; background: var(--paper-deep);
  border: 1px solid var(--line); aspect-ratio: 4 / 3; overflow: hidden;
}
.plate img { width: 100%; height: 100%; object-fit: cover; }
.plate--frame { padding: clamp(0.8rem, 2vw, 1.4rem); background: #fff; box-shadow: 0 1px 0 var(--line), 0 30px 60px -40px rgba(20,18,12,.45); }
.plate--frame > * { border: 1px solid var(--line); }

/* ---------------------------------------------------------- Object label */
/* The museum wall label — the signature component. */
.objlabel { border-top: 2px solid var(--ink); padding-top: var(--s-2); max-width: 30rem; }
.objlabel__title { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.15; margin: 0 0 0.15em; }
.objlabel__attr { font-style: italic; color: var(--ink-soft); margin: 0 0 var(--s-2); }
.objlabel dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.1rem; margin: var(--s-2) 0 0; }
.objlabel dt { font-family: var(--font-label); font-size: var(--t-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); align-self: baseline; }
.objlabel dd { margin: 0; font-size: var(--t-small); }
.accession { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* ------------------------------------------------------------ Collection */
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; group: card; }
.card__plate { background: var(--paper-deep); border: 1px solid var(--line); aspect-ratio: 1/1; overflow: hidden; position: relative; }
.card__plate img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card__plate img { transform: scale(1.035); }
.card__cat { position: absolute; top: 0.75rem; left: 0.75rem; background: var(--paper); padding: 0.25rem 0.6rem; }
.card__title { font-family: var(--font-display); font-size: 1.34rem; line-height: 1.18; margin: var(--s-2) 0 0.15em; }
.card__meta { font-family: var(--font-label); font-size: var(--t-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); }
.card:hover .card__title { color: var(--bronze-deep); }

/* --------------------------------------------------- Section headings */
.sechead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.sechead h2 { font-family: var(--font-display); font-size: var(--t-d2); margin: 0; }

/* --------------------------------------------------------- Verification */
/* The "Authenticate" seal + result — the trust centerpiece. */
.seal { width: 96px; height: 96px; }
.verify {
  border: 1px solid var(--line); background: var(--paper-deep);
  padding: clamp(1.4rem, 3vw, 2.4rem); display: grid; gap: var(--s-3);
}
.verify__head { display: flex; align-items: center; gap: var(--s-3); }
.verify__status { font-family: var(--font-label); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.verify__checks { display: grid; gap: 0.65rem; margin: 0; padding: 0; list-style: none; }
.verify__checks li { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.6rem; align-items: start; font-size: var(--t-small); }
.tick { color: var(--verdigris); font-weight: 700; }
.is-verified { color: var(--verdigris); }
.is-unverified { color: var(--oxblood); }
.badge {
  display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-label);
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  padding: 0.3rem 0.7rem; border: 1px solid currentColor; border-radius: 2rem;
}
.badge--verified { color: var(--verdigris); background: var(--verdigris-tint); border-color: transparent; }
.badge--bronze { color: var(--bronze-deep); background: var(--bronze-tint); border-color: transparent; }

/* ------------------------------------------------------------- Timeline */
.timeline { position: relative; margin: var(--s-5) 0; }
.timeline::before { content: ""; position: absolute; left: 7.5rem; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-item { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--s-4); padding: var(--s-3) 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: calc(7.5rem - 4px); top: 1.8rem; width: 9px; height: 9px; background: var(--bronze); border-radius: 50%; box-shadow: 0 0 0 4px var(--paper); }
.tl-date { font-family: var(--font-label); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--stone); text-align: right; padding-top: 1.5rem; }
.tl-body h3 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 0.2em; }
@media (max-width: 40rem) {
  .timeline::before { left: 5px; }
  .tl-item { grid-template-columns: 1fr; gap: 0.3rem; padding-left: 1.6rem; }
  .tl-item::before { left: 1px; top: 0.5rem; }
  .tl-date { text-align: left; padding-top: 0; }
}

/* --------------------------------------------------------------- Footer */
.colophon { background: var(--paper-rich); color: #cfc6ae; padding-block: var(--s-6) var(--s-4); margin-top: var(--s-7); }
.colophon a { color: #e7dcc0; text-decoration: none; border-bottom: 1px solid #4a4233; }
.colophon a:hover { border-color: var(--bronze); }
.colophon__grid { display: grid; gap: var(--s-4); }
@media (min-width: 48rem) { .colophon__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.colophon h4 { font-family: var(--font-label); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--stone-light); margin: 0 0 var(--s-2); }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin: 0.35rem 0; font-size: 0.98rem; }
.colophon__fine { margin-top: var(--s-5); padding-top: var(--s-3); border-top: 1px solid #312b20; display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); }

/* --------------------------------------------------------------- Utility */
.center { text-align: center; }
.flow > * + * { margin-top: var(--s-3); }
.pill-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hairline { height: 1px; background: var(--line); border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------ Flash + forms */
.flash { padding: 0.9rem 1.2rem; border-left: 3px solid var(--bronze); background: var(--paper-deep); font-size: var(--t-small); }
.flash--success { border-color: var(--verdigris); background: var(--verdigris-tint); }
.flash--error { border-color: var(--oxblood); background: var(--oxblood-tint); }
.field { display: block; margin-bottom: var(--s-3); }
.field > label { display: block; font-family: var(--font-label); font-size: var(--t-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.4rem; }
.field > label .req { color: var(--oxblood); }
.field input[type=text], .field input[type=date], .field select, .field textarea {
  width: 100%; font-family: var(--font-body); font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); padding: 0.7rem 0.85rem;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--bronze); outline-offset: 1px; border-color: var(--bronze); }
.field .hint { font-size: 0.85rem; color: var(--stone); margin-top: 0.3rem; }
.review { border: 1px solid var(--line); background: var(--paper-deep); padding: var(--s-3); margin-bottom: var(--s-3); }
.review pre { background: #fff; border: 1px solid var(--line); padding: 0.8rem; overflow: auto; max-height: 14rem; font-size: 0.82rem; }

/* ----------------------------------------------------------- Priority rows */
.first-row { display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 1.5rem; align-items: baseline;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.first-row:hover .first-row__title .display { color: var(--bronze-deep); }
.first-row__date { text-align: left; color: var(--stone); }
.first-row__anchor { white-space: nowrap; }
@media (max-width: 40rem) {
  .first-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .first-row__anchor { justify-self: start; }
}
