/* CVI Newfoundland. Layout: one centred shell; photos sit on dark "stages" so bronze and silver read true. */
:root {
  --paper: #f4f4f1;
  --panel: #ffffff;
  --ink: #1d1f22;
  --muted: #5f6570;
  --rule: #dcdcd6;
  --bronze: #8a4b1f;
  --bronze-ink: #ffffff;
  --bronze-soft: #f2e6db;
  --new: #2f6b4f;
  --new-soft: #e1efe7;
  --stage: #101113;
  --focus: #b8661f;
  --display: "Spectral", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shell: 1180px;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151618; --panel: #1d1f22; --ink: #e8e6e1; --muted: #a2a7ae; --rule: #33363b;
    --bronze: #d49a68; --bronze-ink: #1a1308; --bronze-soft: #2c231b; --new: #8fd0ad; --new-soft: #1f3128;
    --stage: #0a0a0b; color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--body); }
img { max-width: 100%; height: auto; }
a { color: var(--bronze); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; }
h1 { font: 700 clamp(1.9rem, 4vw, 2.7rem)/1.12 var(--display); margin: .2em 0 .35em; }
h2 { font: 700 1.55rem/1.25 var(--display); margin: 2em 0 .6em; }
h3 { font: 600 1.05rem/1.3 var(--body); margin: 1.6em 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { font: 500 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bronze); margin: 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--panel); padding: 8px 12px; z-index: 50; }

.shell { max-width: var(--shell); margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 760px; }
main { padding-block: 8px 72px; }

/* Header */
.site-head { background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { font: 700 1.25rem/1 var(--display); color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--bronze); }
.head-nav { display: flex; align-items: center; gap: 22px; font-size: .95rem; }
.head-nav > a { color: var(--ink); text-decoration: none; }
.head-nav > a:hover { color: var(--bronze); }
.browse { position: relative; }
.browse summary { cursor: pointer; list-style: none; color: var(--ink); }
.browse summary::-webkit-details-marker { display: none; }
.browse summary::after { content: " ▾"; color: var(--muted); }
.browse-panel { position: absolute; right: 0; top: calc(100% + 14px); background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 18px; display: grid; grid-template-columns: repeat(6, minmax(92px, 1fr)); gap: 18px; width: min(820px, 92vw); }
.browse-denom { font-weight: 600; color: var(--ink); text-decoration: none; font-size: .9rem; }
.browse-col ul { list-style: none; margin: 8px 0 0; padding: 0; font: 500 .82rem/1.9 var(--mono); }
.soon { color: var(--muted); opacity: .55; }
@media (max-width: 760px) {
  .browse-panel { position: fixed; left: 12px; right: 12px; width: auto; top: 64px; grid-template-columns: repeat(3, 1fr); max-height: 75vh; overflow: auto; }
  .head-nav { gap: 14px; }
}

/* Footer */
.site-foot { border-top: 1px solid var(--rule); background: var(--panel); padding-block: 28px; font-size: .9rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.foot-row p { margin: 0; max-width: 62ch; }

/* Tags */
.type-tag { font: 500 .8rem/1 var(--mono); background: var(--bronze); color: var(--bronze-ink); padding: 4px 7px; border-radius: 3px; white-space: nowrap; display: inline-block; }
.new-tag { font: 600 .72rem/1 var(--body); letter-spacing: .04em; text-transform: uppercase; background: var(--new-soft); color: var(--new); padding: 4px 7px; border-radius: 3px; display: inline-block; }

/* Breadcrumbs */
.crumbs { font-size: .88rem; color: var(--muted); margin: 22px 0 6px; }
.crumbs a { color: var(--muted); }

/* Prose */
.prose p, .prose li { max-width: 68ch; }
.prose blockquote { margin: 1.4em 0; }
.table-wrap { overflow-x: auto; margin: 1em 0 1.4em; }
table { border-collapse: collapse; font-size: .92rem; min-width: 420px; }
th, td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; background: var(--bronze-soft); }

/* Photos */
.ph { display: block; position: relative; background: var(--stage); border-radius: 4px; overflow: hidden; line-height: 0; cursor: zoom-in; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.ph .markers, .stage .markers, .v-card-img .markers, .hero-img .markers { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.markers-off .markers { opacity: 0; }
.ph:hover img:first-child { opacity: .92; }
figure { margin: 0; }
figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; line-height: 1.35; }

/* Home */
.home-hero { background: var(--panel); border-bottom: 1px solid var(--rule); margin-top: -8px; }
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; padding-block: 48px; }
.hero-text h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
.hero-img { position: relative; }
.hero-img img:first-child { border-radius: var(--radius); display: block; width: 100%; }
.hero-img .markers { border-radius: var(--radius); }
.hero-img figcaption { margin-top: 10px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-block; background: var(--bronze); color: var(--bronze-ink); text-decoration: none; padding: 11px 18px; border-radius: var(--radius); font-weight: 600; font-size: .95rem; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
@media (max-width: 860px) { .hero-row { grid-template-columns: 1fr; padding-block: 32px; gap: 24px; } }

.denom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.denom-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; }
.denom-card h3 { font: 700 1.3rem/1.2 var(--display); margin: 0 0 4px; }
.denom-card h3 a { color: var(--ink); text-decoration: none; }
.year-chips { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font: 500 .82rem/1 var(--mono); padding: 7px 9px; border-radius: 4px; background: var(--bronze); color: var(--bronze-ink); text-decoration: none; }
.chip.off { background: transparent; color: var(--muted); border: 1px dashed var(--rule); }
.home-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.steps { padding-left: 1.2em; } .steps li { margin: .6em 0; }
.about-card { background: var(--bronze-soft); border-radius: var(--radius); padding: 22px 24px; margin-top: 2em; }
.about-card blockquote { font: italic 500 1.15rem/1.45 var(--display); margin: 0 0 14px; }
@media (max-width: 860px) { .home-split { grid-template-columns: 1fr; gap: 0; } }

/* Denomination */
.year-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.year-list a, .year-list .off { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); text-decoration: none; color: var(--ink); }
.year-list strong { font: 700 1.4rem/1.1 var(--display); }
.year-list span span, .year-list a span { font-size: .82rem; color: var(--bronze); }
.year-list .off { opacity: .6; } .year-list .off span { color: var(--muted); }

/* Year */
.y-sub, .v-sub { color: var(--muted); margin: 0; }
.specs { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 18px 0 0; }
.specs div { display: flex; flex-direction: column; }
.specs dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.specs dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.y-intro { margin-top: 18px; }
details.more summary { cursor: pointer; color: var(--bronze); font-weight: 500; margin: .4em 0 .8em; }
.group-head { font: 500 .85rem/1 var(--mono); color: var(--muted); letter-spacing: .06em; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.v-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.v-card { display: flex; flex-direction: column; height: 100%; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.v-card:hover { border-color: var(--bronze); transform: translateY(-1px); }
.v-card-img { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--stage); }
.v-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v-card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.v-card-title { font-size: .92rem; line-height: 1.4; }
.plate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.plate-grid .ph { aspect-ratio: 4 / 3; }

/* Variety */
.v-head { margin-bottom: 20px; }
.v-tags { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; }
.v-head h1 { font-size: clamp(1.45rem, 2.6vw, 2rem); max-width: 46ch; margin-top: .45em; }
.v-hero { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .v-hero { grid-template-columns: 1fr; } }
.stage { background: var(--stage); border-radius: var(--radius); overflow: hidden; }
.stage .ph { border-radius: 0; }
.stage .stage-img img:first-child { width: 100%; height: auto; object-fit: contain; }
.stage figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin: 0; color: #c9c6bf; background: #1a1b1e; font-size: .88rem; }
.stage.empty { min-height: 240px; display: grid; place-items: center; color: #c9c6bf; padding: 24px; text-align: center; }
.marker-toggle { font: 500 .8rem/1 var(--body); background: transparent; color: #f0ede6; border: 1px solid #55575c; border-radius: 4px; padding: 7px 10px; cursor: pointer; white-space: nowrap; }
.marker-toggle[aria-pressed="false"] { color: #9a9790; }
.v-coin { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.v-coin .ph { aspect-ratio: 1; background: #fff; border-radius: 4px; border: 1px solid var(--rule); }
.v-coin .ph img { object-fit: contain; }
.v-coin figcaption { text-align: center; }
.v-coin p { grid-column: 1 / -1; margin: 0; text-align: center; }
@media (max-width: 760px) { .v-coin { grid-template-columns: repeat(2, minmax(0, 160px)); justify-content: center; } }
.v-text { margin-top: 26px; font-size: 1.04rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.detail-grid .ph { aspect-ratio: 4 / 3; }
.folder { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); margin-bottom: 10px; }
.folder summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.folder summary::-webkit-details-marker { display: none; }
.folder summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.folder[open] summary::before { transform: rotate(90deg); }
.folder-name { font-weight: 600; flex: 1; }
.folder-meta { font-size: .85rem; color: var(--muted); }
.folder-peek { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 4px 14px 16px; }
.ref-grid .ph { aspect-ratio: 1; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; border-top: 1px solid var(--rule); margin-top: 48px; padding-top: 18px; }
.pager a { text-decoration: none; }
.pager .prev span, .pager .next span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pager .next { text-align: right; } .pager .up { font-size: .9rem; }
.pager .prev, .pager .next { font: 500 .95rem var(--mono); }

/* About / guide */
.dedication { font: italic 500 1.35rem/1.45 var(--display); border-left: 3px solid var(--bronze); padding-left: 20px; }
.dedication cite { display: block; font: 500 .8rem var(--body); color: var(--muted); margin-top: 8px; font-style: normal; }
.signature { font: italic 500 1.1rem var(--display); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
.glossary div { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 4px 0 0; color: var(--muted); max-width: 68ch; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8, 8, 9, .95); z-index: 100; display: grid; grid-template-columns: 60px 1fr 60px; align-items: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { grid-column: 2; display: flex; flex-direction: column; align-items: center; max-height: 100vh; padding-block: 20px; }
.lb-stage { position: relative; line-height: 0; }
.lb-stage img { max-width: calc(100vw - 140px); max-height: calc(100vh - 110px); object-fit: contain; }
.lb-stage .lb-markers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lightbox figcaption { color: #d8d5ce; font-size: .95rem; text-align: center; margin-top: 12px; }
.lightbox button { background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; padding: 10px; line-height: 1; }
.lb-close { position: absolute; top: 8px; right: 12px; }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
@media (max-width: 600px) { .lightbox { grid-template-columns: 40px 1fr 40px; } .lb-stage img { max-width: calc(100vw - 80px); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (max-width: 600px) {
  .brand { font-size: 1.1rem; }
  .head-nav { gap: 12px; font-size: .9rem; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ref-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .v-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .v-card-title { font-size: .82rem; }
  .plate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
