/* ============================================================================
   Contraste · Joyerías de Andalucía
   Identity: "damasquinado" — 24k gold inlaid in blued steel (Córdoba/Toledo).
   Signature: the punzón (assay hallmark) carries the rank.
   Display Forum (engraved caps) · body Manrope · figures Space Mono.
   ========================================================================== */

:root {
  --steel-950: #14161b;
  --steel-925: #181b21;
  --steel-900: #1a1d24;
  --steel-850: #1f232b;
  --steel-800: #232730;
  --line: #343a45;
  --line-soft: #2a2f38;

  --oro: #c9a24a;
  --oro-lux: #e7c879;
  --oro-deep: #9c7a30;
  --granate: #9c3142;
  --granate-bright: #c5485a;

  --nacar: #ece6d8;
  --nacar-dim: #9aa0a8;
  --nacar-faint: #6c727b;

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .8);
  --shadow-sm: 0 12px 30px -18px rgba(0, 0, 0, .75);
  --wrap: 1200px;
  --gold-grad: linear-gradient(115deg, var(--oro-deep), var(--oro-lux) 42%, var(--oro) 70%, var(--oro-deep));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(201, 162, 74, .10), transparent 55%),
    radial-gradient(90% 60% at 0% 0%, rgba(156, 49, 66, .07), transparent 50%),
    var(--steel-950);
  color: var(--nacar);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

h1, h2, h3 { font-family: "Forum", "Cormorant Garamond", Georgia, serif; font-weight: 400; margin: 0; letter-spacing: .01em; }
a { color: inherit; text-decoration: none; }
.mono { font-family: "Space Mono", ui-monospace, monospace; }

/* ---- selection / focus --------------------------------------------------- */
::selection { background: rgba(201, 162, 74, .28); color: #fff; }
:focus-visible { outline: 2px solid var(--oro-lux); outline-offset: 3px; border-radius: 3px; }

/* ============================================================================
   PUNZÓN — the struck assay hallmark
   ========================================================================== */
.punzon { position: relative; display: inline-grid; place-items: center; flex: none; line-height: 1; }
.punzon--lg { width: 60px; height: 60px; }
.punzon--md { width: 46px; height: 46px; }
.punzon--sm { width: 34px; height: 34px; }
.punzon-frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.punzon-frame polygon { fill: rgba(201, 162, 74, .06); stroke: var(--oro); stroke-width: 1.4; }
.punzon-frame .punzon-inner { fill: none; stroke: rgba(231, 200, 121, .42); stroke-width: .8; }
.punzon-rank {
  position: relative; z-index: 1;
  font-family: "Space Mono", monospace; font-weight: 700;
  color: var(--oro-lux); letter-spacing: .04em;
}
.punzon--lg .punzon-rank { font-size: 20px; }
.punzon--md .punzon-rank { font-size: 15px; }
.punzon--sm .punzon-rank { font-size: 12px; }
.punzon-crown { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 22px; height: 9px; }
.punzon-crown path { fill: none; stroke: var(--oro); stroke-width: 1.3; stroke-linejoin: round; }

/* ============================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(20, 22, 27, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: .5ch; font-family: "Forum", serif; font-size: 1.32rem; letter-spacing: .14em; text-transform: uppercase; }
.brand .gem { color: var(--oro-lux); }
.brand .sub { font-family: "Space Mono", monospace; font-size: .58rem; letter-spacing: .34em; color: var(--nacar-dim); text-transform: uppercase; }
.header-nav { display: flex; gap: clamp(14px, 2.6vw, 30px); font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; }
.header-nav a { color: var(--nacar-dim); transition: color .25s; }
.header-nav a:hover { color: var(--oro-lux); }
@media (max-width: 680px) { .header-nav { display: none; } }

/* ============================================================================
   HERO
   ========================================================================== */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 116px) 0 clamp(40px, 6vw, 76px); }
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--oro) 18%, var(--oro-lux) 50%, var(--oro) 82%, transparent);
  opacity: .5;
}
.hero-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  font-family: "Space Mono", monospace; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--oro); margin: 0 0 22px; display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--oro); display: inline-block; }

.hero h1 {
  font-size: clamp(2.7rem, 7vw, 5.1rem); line-height: 1.02; letter-spacing: .005em;
  margin: 0 0 26px; color: #fff;
}
.hero h1 em {
  font-style: normal; position: relative; white-space: nowrap;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(1rem, 1.5vw, 1.16rem); color: var(--nacar-dim); max-width: 46ch; margin: 0 0 34px; }
.hero-sub strong { color: var(--nacar); font-weight: 600; }

.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 52px); }
.stat .num { font-family: "Forum", serif; font-size: clamp(1.9rem, 4vw, 2.7rem); color: var(--oro-lux); display: block; line-height: 1; }
.stat .lbl { font-family: "Space Mono", monospace; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--nacar-faint); }

/* --- hero medallion (the struck hallmark) --- */
.hero-mark { display: grid; place-items: center; position: relative; }
.hero-medallion { width: min(360px, 80%); height: auto; }
.hero-medallion .ring { fill: none; stroke: var(--oro); }
.hero-medallion .ring-faint { stroke: rgba(231, 200, 121, .35); }
.hero-medallion .fill-soft { fill: rgba(201, 162, 74, .05); }
.hero-medallion text { fill: var(--oro-lux); font-family: "Space Mono", monospace; }
.hero-medallion .crown { fill: none; stroke: var(--oro-lux); stroke-width: 2; stroke-linejoin: round; }
.hero-medallion .tick { stroke: var(--oro); stroke-width: 1.4; }

@keyframes strike {
  0% { transform: scale(1.12) rotate(-4deg); opacity: 0; }
  55% { transform: scale(.97) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.hero-mark .struck { transform-origin: center; animation: strike .9s cubic-bezier(.2, .9, .2, 1) both; }
.hero-mark .sheen {
  position: absolute; inset: 0; pointer-events: none; border-radius: 50%;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .5) 50%, transparent 62%);
  mix-blend-mode: screen; opacity: 0; animation: sweep 1.1s ease-out .55s both;
}
@keyframes sweep { 0% { opacity: 0; transform: translateX(-30%); } 35% { opacity: .9; } 100% { opacity: 0; transform: translateX(30%); } }
@media (prefers-reduced-motion: reduce) {
  .hero-mark .struck { animation: none; }
  .hero-mark .sheen { display: none; }
}
@media (max-width: 860px) { .hero-mark { order: -1; margin-bottom: 8px; } .hero-medallion { width: 200px; } }

/* ============================================================================
   FILTER BAR
   ========================================================================== */
.filterbar {
  position: sticky; top: 64px; z-index: 50;
  background: rgba(24, 27, 33, .94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line);
}
.filterbar-inner { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 16px 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-search { flex: 1 1 230px; min-width: 180px; }
.field label { font-family: "Space Mono", monospace; font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--nacar-faint); padding-left: 2px; }
.field input, .field select {
  appearance: none; -webkit-appearance: none;
  background: var(--steel-900); color: var(--nacar);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 10px 13px; font-family: inherit; font-size: .92rem; min-height: 44px;
  transition: border-color .2s, box-shadow .2s;
}
.field select { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c9a24a' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; cursor: pointer; }
.field input:focus, .field select:focus { border-color: var(--oro); box-shadow: 0 0 0 3px rgba(201, 162, 74, .14); outline: none; }
.field input::placeholder { color: var(--nacar-faint); }
.btn-reset {
  background: transparent; color: var(--oro); border: 1px solid var(--line);
  border-radius: 2px; padding: 10px 18px; min-height: 44px; cursor: pointer;
  font-family: "Space Mono", monospace; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  transition: border-color .2s, color .2s, background .2s;
}
.btn-reset:hover { border-color: var(--oro); background: rgba(201, 162, 74, .08); color: var(--oro-lux); }
@media (max-width: 620px) { .field { flex: 1 1 100%; } .btn-reset { flex: 1 1 100%; } }

/* ============================================================================
   BLOCKS
   ========================================================================== */
main { display: block; padding-bottom: 30px; }
.block { padding: clamp(46px, 7vw, 80px) 0 0; }
.block-head { max-width: 62ch; margin-bottom: clamp(26px, 4vw, 42px); }
.block-head .index {
  font-family: "Space Mono", monospace; font-size: .72rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--oro); display: inline-flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.block-head .index::before { content: ""; width: 26px; height: 1px; background: var(--oro); }
.block-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); color: #fff; line-height: 1.08; }
.block-head p { color: var(--nacar-dim); margin: 12px 0 0; font-size: 1.02rem; max-width: 56ch; }

/* ============================================================================
   PLATE (premium / featured card) — a "contrast plate"
   ========================================================================== */
.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.grid-premium { grid-template-columns: repeat(3, 1fr); }
.grid-featured { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-featured { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .grid-premium { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-featured { grid-template-columns: 1fr; } }

.plate {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--steel-850), var(--steel-900));
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .4s cubic-bezier(.2, .8, .2, 1), border-color .4s, box-shadow .4s;
}
/* thin inlaid gold inner frame */
.plate::before {
  content: ""; position: absolute; inset: 9px; border: 1px solid rgba(201, 162, 74, .22);
  border-radius: 2px; pointer-events: none; z-index: 3; transition: border-color .4s;
}
.plate:hover { transform: translateY(-5px); border-color: rgba(201, 162, 74, .5); box-shadow: var(--shadow); }
.plate:hover::before { border-color: rgba(231, 200, 121, .5); }
.plate--premium { background: linear-gradient(180deg, #20242d, var(--steel-900)); border-color: rgba(201, 162, 74, .34); }

.plate .punzon { position: absolute; top: 16px; left: 16px; z-index: 5; }
.plate .punzon-frame polygon { fill: rgba(20, 22, 27, .82); }

.plate-media { position: relative; aspect-ratio: 16 / 11; background: var(--steel-800); overflow: hidden; }
.plate-media .mono-init {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 0;
  font-family: "Forum", serif; font-size: 3.4rem; color: rgba(201, 162, 74, .26);
}
.plate-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
  filter: saturate(.78) contrast(1.04); transition: transform .6s ease, filter .4s;
}
.plate-media::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(20, 22, 27, .12) 30%, rgba(20, 22, 27, .78)); }
.plate:hover .plate-photo { transform: scale(1.05); filter: saturate(.95) contrast(1.05); }

.badge {
  position: absolute; top: 14px; right: 14px; z-index: 4;
  font-family: "Space Mono", monospace; font-size: .58rem; letter-spacing: .2em; text-transform: uppercase;
  color: #1a1209; background: var(--gold-grad); padding: 5px 11px; border-radius: 2px; font-weight: 700;
}
.badge--soft { background: none; color: var(--oro-lux); border: 1px solid rgba(201, 162, 74, .55); padding: 4px 10px; }
.open-now {
  position: absolute; left: 14px; bottom: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 6px;
  font-family: "Space Mono", monospace; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--nacar);
}
.open-now .dot { width: 7px; height: 7px; border-radius: 50%; background: #57b894; box-shadow: 0 0 8px rgba(87, 184, 148, .8); }
.open-now.closed { color: var(--nacar-faint); }
.open-now.closed .dot { background: var(--granate-bright); box-shadow: none; }

.plate-body { display: flex; flex-direction: column; flex: 1; padding: clamp(16px, 2vw, 22px); gap: 7px; }
.plate-seg { font-family: "Space Mono", monospace; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--oro); }
.plate-seg .seg-city { color: var(--nacar-faint); }
.plate-name { font-size: clamp(1.18rem, 1.9vw, 1.5rem); color: #fff; line-height: 1.12; margin: 1px 0 2px; }
.plate-rating { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--nacar); }
.plate-rating svg { width: 14px; height: 14px; color: var(--oro-lux); }
.plate-rating b { font-weight: 700; }
.plate-rating .rev { color: var(--nacar-faint); font-weight: 400; }
.plate-meta { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.m-row { display: flex; align-items: flex-start; gap: 9px; font-size: .85rem; color: var(--nacar-dim); }
.m-row svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--oro-deep); }

.plate-actions { margin-top: auto; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.act {
  display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; letter-spacing: .02em;
  padding: 8px 13px; border-radius: 2px; border: 1px solid var(--line); transition: all .25s; min-height: 38px;
}
.act svg { width: 15px; height: 15px; }
.act--primary { background: var(--gold-grad); color: #1a1209; border-color: transparent; font-weight: 600; }
.act--primary:hover { filter: brightness(1.08); }
.act--ghost { color: var(--nacar-dim); }
.act--ghost:hover { color: var(--oro-lux); border-color: rgba(201, 162, 74, .5); }

/* ============================================================================
   REGISTRY LIST
   ========================================================================== */
.list { border-top: 1px solid var(--line-soft); }
.row {
  display: grid; align-items: center; gap: clamp(10px, 1.8vw, 22px);
  grid-template-columns: 54px minmax(0, 1.7fr) minmax(96px, .8fr) minmax(0, 1.1fr) auto;
  padding: 15px 6px; border-bottom: 1px solid var(--line-soft); transition: background .25s;
}
.row:hover { background: rgba(201, 162, 74, .045); }
.row-punzon .punzon { width: 36px; height: 36px; }
.row-punzon .punzon-frame polygon { fill: rgba(201, 162, 74, .05); }
.row-thumb { position: relative; width: 54px; height: 54px; border-radius: 2px; overflow: hidden; background: var(--steel-800); border: 1px solid var(--line-soft); }
.row-thumb .mono-init { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Forum", serif; font-size: 1.4rem; color: rgba(201, 162, 74, .4); }
.row-thumb .plate-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); }
.row-name { font-family: "Forum", serif; font-size: 1.18rem; color: var(--nacar); line-height: 1.1; }
.row-seg { font-family: "Space Mono", monospace; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--nacar-faint); margin-top: 3px; }
.row-rating { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--nacar); white-space: nowrap; }
.row-rating svg { width: 13px; height: 13px; color: var(--oro-lux); }
.row-rating .rev { color: var(--nacar-faint); }
.row-loc { font-size: .82rem; color: var(--nacar-dim); }
.row-links { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 2px; color: var(--nacar-dim); transition: all .22s; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--oro-lux); border-color: rgba(201, 162, 74, .5); background: rgba(201, 162, 74, .07); }

@media (max-width: 860px) {
  .row { grid-template-columns: 48px minmax(0, 1fr) auto; row-gap: 8px; }
  .row-rating-wrap { grid-column: 2; }
  .row-loc { display: none; }
}
@media (max-width: 520px) {
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row-thumb { display: none; }
}

/* ============================================================================
   RESULTS (filtered view)
   ========================================================================== */
#results .grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { #results .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { #results .grid { grid-template-columns: 1fr; } }
.empty { text-align: center; color: var(--nacar-dim); padding: 50px 0; font-size: 1.05rem; }

/* ============================================================================
   FOOTER
   ========================================================================== */
.site-footer { margin-top: clamp(56px, 8vw, 90px); border-top: 1px solid var(--line); background: var(--steel-925); }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; padding: clamp(40px, 6vw, 64px) 0 26px; }
.foot-brand { font-family: "Forum", serif; font-size: 1.4rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 6px; }
.foot-brand .gem { color: var(--oro-lux); }
.foot-tag { color: var(--nacar-faint); font-size: .9rem; margin: 0; max-width: 40ch; }
.foot-provs { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-start; max-width: 460px; }
.foot-provs span { font-family: "Space Mono", monospace; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--nacar-dim); border: 1px solid var(--line-soft); padding: 5px 10px; border-radius: 2px; }
.foot-note { border-top: 1px solid var(--line-soft); padding: 22px 0 40px; color: var(--nacar-faint); font-size: .8rem; max-width: 92ch; }
.foot-note code { font-family: "Space Mono", monospace; color: var(--oro); font-size: .9em; }

/* ============================================================================
   REVEAL
   ========================================================================== */
.r { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.r.in { opacity: 1; transform: none; }
.grid .r:nth-child(2) { transition-delay: .07s; }
.grid .r:nth-child(3) { transition-delay: .14s; }
.grid .r:nth-child(4) { transition-delay: .21s; }
@media (prefers-reduced-motion: reduce) {
  .r { opacity: 1; transform: none; transition: none; }
  .plate, .plate-photo, .icon-btn, .act { transition: none; }
}
