/* TopRomanFacts site styles.
   Colour tokens first (light is the default; dark applies only when the visitor
   chooses it with the toggle in the header), then layout, then components. */

:root {
  --paper: #f1eee8;
  --surface: #faf8f4;
  --sunk: #e6e2da;
  --ink: #1a1c1c;
  --ink-2: #3d413f;
  --muted: #676c69;
  --rule: #d8d3ca;
  --rule-2: #b9b5ab;
  --accent: #a8281c;
  --accent-ink: #8c2016;
  --accent-soft: #f3ddd8;
  --bronze: #8a5326;
  --bronze-ink: #6b3f1b;
  --bronze-soft: #efe1d2;
  --patina: #2e7263;
  --on-accent: #ffffff;
  --shadow: 0 1px 0 rgba(20, 24, 22, 0.05), 0 12px 28px -20px rgba(20, 24, 22, 0.5);
  --radius: 12px;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}


:root[data-theme="dark"] {
  --paper: #121413;
  --surface: #1a1d1c;
  --sunk: #0c0e0d;
  --ink: #e8e6e0;
  --ink-2: #c2c0b8;
  --muted: #949a95;
  --rule: #2c302e;
  --rule-2: #3f4441;
  --accent: #e5826f;
  --accent-ink: #f0a190;
  --accent-soft: #33201b;
  --bronze: #cd9058;
  --bronze-ink: #e0ad79;
  --bronze-soft: #2e2117;
  --patina: #5ab29c;
  --on-accent: #16100e;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 14px 32px -22px #000;
  color-scheme: dark;
}

/* ---- base ---------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.wrap { width: min(100% - 2rem, 1080px); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, 720px); margin-inline: auto; }
@media (min-width: 640px) { .wrap, .wrap-narrow { width: min(100% - 3rem, 1080px); } .wrap-narrow { max-width: 720px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6em;
}
.eyebrow a { color: inherit; }

/* ---- header -------------------------------------------------------------------------- */

.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head__inner { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; padding: 0.9rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand__mark { width: 40px; height: 40px; border-radius: 50%; }
.brand__name { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; margin-left: auto; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.98rem; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-2); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.theme-toggle { background: none; border: 1px solid var(--rule-2); border-radius: 999px; width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.theme-toggle:hover { color: var(--ink); background: var(--sunk); }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }
@media (max-width: 560px) {
  .site-head__inner { padding: 0.75rem 0; }
  .site-nav { order: 3; width: 100%; margin-left: 0; gap: 0.25rem 1rem; }
  .theme-toggle { margin-left: auto; }
}

/* ---- hero ---------------------------------------------------------------------------- */

.hero { position: relative; isolation: isolate; color: #f5f2ec; background: #1b1a17; min-height: min(78vh, 640px); display: flex; align-items: flex-end; overflow: hidden; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 35% 45%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 10, 9, 0.15) 0%, rgba(10, 10, 9, 0.35) 45%, rgba(10, 10, 9, 0.86) 100%),
    linear-gradient(90deg, rgba(10, 10, 9, 0.45) 0%, rgba(10, 10, 9, 0) 60%);
}
.hero__inner { padding: 5rem 0 2.75rem; max-width: 1080px; }
.hero__mark { width: 96px; height: 96px; margin-bottom: 1rem; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 6px 18px rgba(0, 0, 0, 0.45); }
.hero__title { font-size: clamp(2.6rem, 1.8rem + 4vw, 4.4rem); color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.hero__tag { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem); color: #e9e2d5; margin: 0.35rem 0 0.9rem; }
.hero__lede { max-width: 42rem; font-size: 1.05rem; color: #dcd6cb; margin-bottom: 1.5rem; }
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; color: #fff; }
@media (max-width: 640px) { .hero { min-height: 70vh; } .hero__inner { padding-top: 3.5rem; } .hero__mark { width: 72px; height: 72px; } }

/* ---- buttons, tags, links ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.1rem; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; line-height: 1.2; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-ink); color: var(--on-accent); }
.btn--ghost { border-color: var(--rule-2); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--sunk); }
.textlink { font-weight: 500; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.02em;
  padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--bronze-soft); color: var(--bronze-ink);
  text-decoration: none; border: 1px solid transparent; line-height: 1.5;
}
.tag:hover { border-color: var(--bronze); color: var(--bronze-ink); }
.tag.is-current { background: var(--bronze); color: var(--surface); }
.tag__count { opacity: 0.7; }
.tagbar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.75rem; }

/* ---- sections and grids -------------------------------------------------------------- */

.section { padding: 3rem 0 0.5rem; }
.section:last-child { padding-bottom: 3.5rem; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section__title { margin-bottom: 1rem; }
.section__head .section__title { margin-bottom: 0; }
.section__more { font-weight: 500; white-space: nowrap; }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem 1.5rem; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.plist { display: grid; gap: 1.25rem; }

/* video card and click-to-play embed */
.vcard__title { font-size: 1.05rem; margin: 0.8rem 0 0.3rem; font-family: var(--sans); font-weight: 600; line-height: 1.35; }
.vcard__title a { color: var(--ink); text-decoration: none; }
.vcard__title a:hover { color: var(--accent-ink); text-decoration: underline; }
.vcard .eyebrow { margin: 0; }

.yt { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0e0e0e; box-shadow: var(--shadow); }
.yt__link { display: block; width: 100%; height: 100%; }
.yt__thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.yt__link:hover .yt__thumb { transform: scale(1.03); }
/* play button drawn in CSS so each card stays small */
.yt__play { position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px; border-radius: 12px; background: #c4241d; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); transition: background 0.15s, transform 0.15s; }
.yt__play::after { content: ""; position: absolute; left: 25px; top: 12px; border-left: 18px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.yt__link:hover .yt__play, .yt__link:focus-visible .yt__play { background: #f00; transform: scale(1.06); }
.yt__dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.78); color: #fff; font-family: var(--mono); font-size: 0.74rem; font-variant-numeric: tabular-nums; line-height: 1.4; }
.yt__thumb.is-missing { visibility: hidden; }
.vcard[hidden] { display: none; }

/* filter bar and "show more" on the Videos page */
.vfilter { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--rule-2); border-radius: 9px; overflow: hidden; }
.vfilter button { background: var(--surface); border: 0; border-right: 1px solid var(--rule-2); padding: 0.45rem 0.9rem; font-size: 0.9rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.vfilter button:last-child { border-right: 0; }
.vfilter button:hover { color: var(--ink); }
.vfilter button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.vfilter__n { opacity: 0.75; font-family: var(--mono); font-size: 0.78rem; margin-left: 0.2rem; }
.vmore { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; margin: 1.75rem 0 0.5rem; text-align: center; }
.vmore p { margin: 0; font-size: 0.9rem; }
.yt__play svg { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt__title { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 2rem 1rem 0.8rem; color: #fff; font-weight: 500; font-size: 0.95rem; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75)); pointer-events: none; }
.prose .yt { margin: 1.75rem 0; }

/* post card */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sunk); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; }
.card__body .eyebrow { margin-bottom: 0.1rem; }
.card__title { font-size: 1.3rem; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent-ink); text-decoration: underline; }
.card__desc { color: var(--ink-2); margin: 0; }
.card__tags { margin: 0.35rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.plist .card { flex-direction: row; }
.plist .card__media { flex: 0 0 34%; aspect-ratio: auto; min-height: 100%; }
.plist .card__body { flex: 1 1 auto; }
@media (max-width: 640px) { .plist .card { flex-direction: column; } .plist .card__media { flex-basis: auto; aspect-ratio: 16 / 9; min-height: 0; } }

/* feature band (LRBC Online) */
.feature { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 3rem; }
.feature__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; padding: 3rem 0; }
.feature__text h2 { margin-bottom: 0.75rem; }
.feature__text p:last-child { margin: 1.25rem 0 0; }
.feature__media { margin: 0; }
.feature__media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.feature__media figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
@media (max-width: 760px) { .feature__inner { grid-template-columns: 1fr; gap: 1.75rem; padding: 2.25rem 0; } }

/* coin tools list */
.tools { display: grid; gap: 1.25rem; max-width: 820px; }
.tool { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 1.25rem; align-items: start; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.5rem; }
.tool__icon img { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 1px var(--rule); }
.tool__title { font-size: 1.5rem; margin-bottom: 0.5rem; }
.tool__title a { color: var(--ink); text-decoration: none; }
.tool__title a:hover { color: var(--accent-ink); text-decoration: underline; }
.tool__body p { margin: 0 0 0.75rem; }
.tool__note { color: var(--muted); font-size: 0.92rem; }
.tool__cta { margin: 1rem 0 0 !important; }
@media (max-width: 480px) { .tool { grid-template-columns: 1fr; } .tool__icon img { width: 56px; height: 56px; } }
.feature__actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }

/* about teaser */
.about-teaser { display: grid; grid-template-columns: 160px 1fr; gap: 2rem; align-items: start; padding-bottom: 3.5rem; }
.about-teaser__photo { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.about-teaser p:last-child { margin: 0; }
@media (max-width: 640px) { .about-teaser { grid-template-columns: 1fr; } .about-teaser__photo { width: 120px; height: 120px; } }

/* ---- generic pages ------------------------------------------------------------------- */

.page { padding: 3rem 0 4rem; }
.page__head { margin-bottom: 2rem; max-width: 46rem; }
.page__head h1 { margin-bottom: 0.6rem; }
.page__lede { font-size: 1.15rem; color: var(--ink-2); font-family: var(--serif); }
.page--center { text-align: center; }
.page--center .page__head { margin-inline: auto; }
.page__columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.page--portrait .page__columns { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.page__portrait { margin: 0; }
.page__portrait img { border-radius: var(--radius); box-shadow: var(--shadow); }
.page__portrait figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
@media (max-width: 800px) {
  .page--portrait .page__columns { grid-template-columns: 1fr; }
  .page__portrait { order: -1; max-width: 260px; }
}

/* ---- blog post ----------------------------------------------------------------------- */

.post { padding: 3rem 0 4rem; }
.post__head { margin-bottom: 1.75rem; }
.post__title { margin-bottom: 0.75rem; }
.post__desc { font-family: var(--serif); font-size: 1.2rem; color: var(--ink-2); }
.post__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0; }
.post__cover { margin: 0 auto 2rem; max-width: 900px; }
.post__cover img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.post__cover figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
.post__foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.byline { color: var(--muted); font-size: 0.95rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.pager__link { display: flex; flex-direction: column; gap: 0.2rem; text-decoration: none; color: var(--ink); padding: 0.9rem 1rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.pager__link:hover { border-color: var(--rule-2); color: var(--accent-ink); }
.pager__link .eyebrow { margin: 0; }
.pager__link--next { text-align: right; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager__link--next { text-align: left; } }

/* ---- prose (rendered Markdown) ------------------------------------------------------- */

.prose { font-size: 1.06rem; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2rem 0 0.8rem; font-size: 1.6rem; }
.prose h3 { margin: 1.8rem 0 0.6rem; font-size: 1.25rem; }
.prose h4 { margin: 1.5rem 0 0.5rem; font-size: 1.05rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.35em; }
.prose li > p { margin-bottom: 0.5em; }
.prose blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--bronze); color: var(--ink-2); font-family: var(--serif); font-size: 1.1em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose figure { margin: 1.75rem 0; }
.prose figure img { width: 100%; border-radius: 10px; box-shadow: var(--shadow); }
.prose figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--sunk); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { background: var(--sunk); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.88rem; line-height: 1.55; margin: 1.5rem 0; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose .table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--rule); border-radius: 8px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
.prose tr:last-child td { border-bottom: 0; }
.prose td[align="right"], .prose th[align="right"] { text-align: right; }
.prose sup { line-height: 0; }
.prose abbr[title] { text-decoration: underline dotted; }

/* ---- footer -------------------------------------------------------------------------- */

.site-foot { border-top: 1px solid var(--rule); background: var(--surface); margin-top: 2rem; font-size: 0.95rem; }
.site-foot__inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; padding: 2.5rem 0 1.5rem; }
.site-foot__brand p { color: var(--muted); margin: 0.75rem 0 0; }
.site-foot__nav, .site-foot__social { display: flex; flex-direction: column; gap: 0.5rem; }
.site-foot__nav a, .site-foot__social a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.site-foot__nav a:hover, .site-foot__social a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-foot__legal { padding: 1rem 0 2rem; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--rule); }
.site-foot__legal p { margin: 0; }
@media (max-width: 640px) { .site-foot__inner { grid-template-columns: 1fr; gap: 1.5rem; } }
