:root {
  /* the page is re-inked per piece; these are the resting values */
  --ink: #16202e;
  --glow: #e9c766;
  --paper: #efe9da;
  --paper-dim: rgba(239, 233, 218, 0.62);
  --paper-faint: rgba(239, 233, 218, 0.16);
  --sol: #e9b949;
  --celeste: #8ec3ea;
  --display: 'Bodoni Moda', 'Bodoni 72', Didot, serif;
  --text: 'Archivo', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.55 var(--text);
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 4px;
  border-radius: 2px;
}

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

/* paper grain + vignette over everything, never interactive */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(120% 90% at 65% 45%, transparent 35%, rgba(0, 0, 0, 0.45) 100%);
}

.rosette svg { width: 100%; height: 100%; overflow: visible; }
/* the rosette is engraved by a sweeping lathe: a conic mask opens with --draw (0 → 1), intersected with a
   soft radial fade. Animating the mask instead of each stroke keeps the SVG static and cheap to paint. */
.rosette {
  --sweep: calc(var(--draw, 1) * 372deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%), conic-gradient(from -90deg, #000 calc(var(--sweep) - 12deg), transparent var(--sweep));
  mask-image: radial-gradient(closest-side, #000 72%, transparent 100%), conic-gradient(from -90deg, #000 calc(var(--sweep) - 12deg), transparent var(--sweep));
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.rosette path {
  fill: none;
  stroke: var(--glow);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  opacity: calc(var(--o) * 0.42);
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark sup { font-family: var(--text); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; margin-left: 2px; color: var(--glow); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--paper-faint);
  background: transparent;
  color: var(--paper);
  font: 500 14px/1 var(--text);
  font-variation-settings: 'wdth' 106;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.btn:hover { border-color: var(--glow); }
.btn.solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.solid:hover { background: var(--glow); border-color: var(--glow); }
.btn small { font-weight: 400; opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* page to page: the engraved numeral travels between the collection and the piece */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 0.75s; animation-timing-function: cubic-bezier(0.2, 0.7, 0.15, 1); }
::view-transition-old(root) { animation: 0.35s ease-in both salir; }
::view-transition-new(root) { animation: 0.6s 0.1s ease-out both entrar; }
@keyframes salir { to { opacity: 0; } }
@keyframes entrar { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
