/* Roman Rise Blog — public styles.
   Tokens mirror romanrise.com (Instrument Serif + Inter, ivory / ink / burgundy). */

/* Metric-matched fallback so text doesn't jump when the web fonts load (CLS). */
@font-face { font-family: "Instrument Serif Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 92%; ascent-override: 96%; }
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; }

:root {
  --background: oklch(95.5% .013 90);
  --foreground: oklch(18% 0 0);
  --ink: oklch(18% 0 0);
  --ivory: oklch(95.5% .013 90);
  --primary: oklch(35% .155 18);
  --primary-foreground: oklch(95.5% .013 90);
  --burgundy: oklch(22% .085 16);
  --muted: oklch(92% .01 88);
  --muted-foreground: oklch(46% .012 40);
  --border: oklch(84% .012 88);
  --card: oklch(97.5% .008 90);
  --body-text: oklch(28% .006 40);
  --font-display: "Instrument Serif", "Instrument Serif Fallback", Georgia, serif;
  --font-sans: Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
.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; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, figure { margin: 0; }
h2.section-label { font-family: var(--font-sans); }
::selection { background: var(--primary); color: var(--primary-foreground); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.site-container { width: min(100% - 2.5rem, 84rem); margin-inline: auto; }
.eyebrow { letter-spacing: .22em; text-transform: uppercase; font-size: .75rem; font-weight: 600; line-height: 1.4; }
.text-primary { color: var(--primary); }
.muted { color: var(--muted-foreground); }
.accent { font-style: italic; color: var(--primary); }
.accent-light { font-style: italic; color: var(--ivory); opacity: .75; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--ivory); padding: .75rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

.rule-link { position: relative; }
.rule-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--primary); transition: width .35s var(--ease);
}
.rule-link:hover::after, .rule-link:focus-visible::after { width: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .75rem; width: fit-content;
  border: 1px solid transparent; padding: 1rem 1.75rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  transition: background-color .3s, border-color .3s, color .3s;
}
.btn svg { transition: transform .3s; }
.btn:hover svg { transform: translateX(4px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--ivory); }
.btn-light { background: var(--ivory); border-color: var(--ivory); color: var(--ink); }
.btn-light:hover { background: var(--primary); border-color: var(--primary); color: var(--ivory); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in oklch, var(--background) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .3s; border-bottom: 1px solid transparent; }
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; height: 6rem; }
.header-logo { display: block; min-width: 0; }
/* Sized by width with the logo's exact ratio (1377×253), so it can never be cropped. */
.header-logo img { width: min(15rem, 60vw); height: auto; aspect-ratio: 1377 / 253; object-fit: contain; object-position: left center; }
.header-nav { display: none; align-items: center; gap: 2.25rem; }
.header-nav a:not(.btn) { font-size: .78rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: color-mix(in oklch, var(--foreground) 70%, transparent); transition: color .3s; }
.header-nav a:not(.btn):hover, .header-nav a.is-active { color: var(--primary); }
.menu-toggle { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; }
.menu-toggle path { transition: transform .3s var(--ease), opacity .2s; transform-origin: center; }
.menu-toggle[aria-expanded="true"] .l1 { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .l2 { opacity: 0; }
.menu-toggle[aria-expanded="true"] .l3 { transform: translateY(-6px) rotate(-45deg); }
.mobile-menu { border-top: 1px solid var(--border); background: var(--background); }
.mobile-menu nav { display: flex; flex-direction: column; padding: 1.5rem 0 2rem; }
.mobile-menu a:not(.btn) { font-family: var(--font-display); font-size: 2rem; line-height: 1.25; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.mobile-menu a.is-active { color: var(--primary); font-style: italic; }
.mobile-menu .btn { margin-top: 1.5rem; }
@media (min-width: 1024px) {
  .header-nav { display: flex; }
  .menu-toggle, .mobile-menu { display: none !important; }
}

/* Hero */
.blog-hero { padding: clamp(3rem, 8vw, 7rem) 0 clamp(2rem, 5vw, 3.5rem); }
.display-title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em;
  font-size: clamp(2.9rem, 8vw, 7.5rem); line-height: .95; margin-top: 1.75rem; max-width: 16ch;
  text-wrap: balance;
}
.lead { margin-top: 2rem; max-width: 38rem; font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.7; color: var(--muted-foreground); }
.blog-hero .btn { margin-top: 2rem; }

/* Category filter */
.category-nav { display: flex; flex-wrap: wrap; gap: .5rem 2rem; padding: 1.25rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.category-nav a { font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-foreground); padding: .35rem 0; transition: color .3s; }
.category-nav a:hover { color: var(--foreground); }
.category-nav a.is-active { color: var(--primary); }
.category-nav sup { font-size: .75rem; vertical-align: baseline; opacity: .55; letter-spacing: 0; margin-left: .15rem; opacity: .7; }

/* Featured */
.featured { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.featured-post { display: grid; gap: 2rem; align-items: center; }
/* Covers are stored at 1200:630, so every frame uses that ratio: nothing gets cropped. */
.featured-media { display: block; overflow: hidden; background: var(--muted); aspect-ratio: 1200 / 630; }
.featured-media img, .card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.featured-post:hover .featured-media img, .card:hover .card-media img { transform: scale(1.035); }
.featured-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 4.4vw, 4rem); line-height: 1; margin: 1.25rem 0 0; text-wrap: balance; }
.featured-title a { transition: color .3s; }
.featured-title a:hover { color: var(--primary); }
.featured-excerpt { margin: 1.5rem 0 2rem; color: var(--muted-foreground); font-size: 1.05rem; line-height: 1.75; max-width: 34rem; }
@media (min-width: 900px) {
  .featured-post { grid-template-columns: 7fr 5fr; gap: clamp(2.5rem, 5vw, 5rem); }
}

/* Cards */
.post-grid-wrap { padding: clamp(1rem, 3vw, 2rem) 0 clamp(3rem, 7vw, 6rem); }
.featured + .post-grid-wrap { border-top: 1px solid var(--border); padding-top: clamp(2.5rem, 5vw, 4rem); }
.section-label { color: var(--muted-foreground); margin-bottom: 2rem; }
.post-grid { display: grid; gap: 3.5rem 2rem; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4rem 2.5rem; } }
.card { display: flex; flex-direction: column; }
.card-media { display: block; overflow: hidden; background: var(--muted); aspect-ratio: 1200 / 630; }
.card-fallback {
  display: grid; place-items: center; width: 100%; height: 100%; padding: 1.5rem; text-align: center;
  background: var(--ink); color: var(--ivory); font-family: var(--font-display); font-style: italic; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1;
}
.card-fallback--large { font-size: clamp(2.4rem, 5vw, 4rem); }
.card-body { padding-top: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; gap: .5rem; color: var(--muted-foreground); }
.card-meta a { position: relative; z-index: 1; }
.card-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.65rem, 2.3vw, 2.05rem); line-height: 1.05; margin-top: 1rem; text-wrap: balance; }
.card-title a { transition: color .3s; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { margin-top: .9rem; color: var(--muted-foreground); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-link { margin-top: 1.25rem; width: fit-content; font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }

/* Empty / pagination */
.empty-state { padding: clamp(3rem, 8vw, 6rem) 0; border-bottom: 1px solid var(--border); }
.empty-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; margin: 1rem 0; }
.empty-state .btn { margin-top: 1.5rem; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 2rem 0 4rem; border-top: 1px solid var(--border); font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.pagination > :last-child { justify-self: end; text-align: right; }
.page-numbers { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; letter-spacing: 0; }
.page-numbers a, .page-numbers span { display: grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .5rem; border: 1px solid transparent; }
.page-numbers a:hover { border-color: var(--border); }
.page-numbers [aria-current] { background: var(--ink); color: var(--ivory); }
@media (max-width: 560px) { .pagination { grid-template-columns: 1fr 1fr; } .page-numbers { grid-column: 1 / -1; grid-row: 1; justify-content: center; } }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; font-family: var(--font-display); font-size: 1.6rem; }

/* Article */
.article-header { padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(2rem, 4vw, 3rem); max-width: 60rem; }
.breadcrumb { color: var(--muted-foreground); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem .6rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.breadcrumb li + li::before { content: "/"; opacity: .6; }
.breadcrumb [aria-current] { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blog-hero .breadcrumb + .display-title { margin-top: 1.5rem; }
.hero-count { margin-top: 1.75rem; color: var(--muted-foreground); }
.author-hero { display: grid; gap: 1.75rem; align-items: start; margin-top: 1.75rem; }
.author-hero .display-title { margin-top: 0; }
.display-title--author { font-size: clamp(2.8rem, 7vw, 6rem); }
.author-role { margin-top: 1rem; }
.author-photo { width: 140px; height: 140px; object-fit: cover; filter: grayscale(.15); }
@media (min-width: 768px) { .author-hero { grid-template-columns: 200px 1fr; gap: 3rem; } .author-photo { width: 200px; height: 200px; } }
.article-title { font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em; font-size: clamp(2.6rem, 6.2vw, 5.6rem); line-height: .98; margin-top: 1.75rem; text-wrap: balance; }
.article-lead { margin-top: 1.75rem; font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.65; color: var(--muted-foreground); max-width: 44rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted-foreground); }
.article-meta strong { color: var(--foreground); font-weight: 500; }
.article-meta { align-items: center; }
.byline { display: inline-flex; align-items: center; gap: .65rem; }
.byline:hover strong { color: var(--primary); }
.byline-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.author-box { display: flex; gap: 1rem; align-items: center; width: 100%; padding-bottom: 1.75rem; margin-bottom: .25rem; border-bottom: 1px solid var(--border); }
.author-box-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.author-box .eyebrow { color: var(--muted-foreground); }
.author-box-name { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; margin-top: .3rem; }
.author-box-name a:hover { color: var(--primary); }
.author-box-role { font-size: .85rem; color: var(--muted-foreground); margin-top: .2rem; }
.article-footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; width: 100%; }
.article-cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }

.prose { width: min(100% - 2.5rem, 44rem); margin-inline: auto; padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; color: var(--body-text); font-size: 1.125rem; line-height: 1.8; overflow-wrap: break-word; }
.prose a { overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.4em; }
.prose h2 { font-family: var(--font-display); font-weight: 400; color: var(--foreground); font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1.08; margin-top: 2.2em; letter-spacing: -.005em; }
.prose h3 { font-family: var(--font-sans); font-weight: 600; color: var(--foreground); font-size: 1.25rem; line-height: 1.35; margin-top: 2em; }
.prose h4 { font-weight: 600; color: var(--foreground); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; margin-top: 2em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .9em; }
.prose a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s; }
.prose a:hover { color: var(--ink); }
.prose strong { color: var(--foreground); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--primary); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: .25em 0 .25em 1.5em; border-left: 2px solid var(--primary); font-family: var(--font-display); font-style: italic; font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.3; color: var(--foreground); }
.prose blockquote p + p { margin-top: .6em; }
.prose figure { margin-top: 2.2em; margin-bottom: 2.2em; }
.prose figure img, .prose > p > img { width: 100%; }
.prose figcaption { margin-top: .75rem; font-size: .85rem; color: var(--muted-foreground); line-height: 1.5; }
.prose figure.embed, .prose figure.video { position: relative; aspect-ratio: 16 / 9; background: var(--burgundy); overflow: hidden; }
.prose figure.embed iframe, .prose figure.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none !important; color: var(--ivory) !important;
  background: radial-gradient(120% 120% at 20% 0%, color-mix(in oklch, var(--primary) 70%, transparent), var(--burgundy) 60%, var(--ink)); }
.video-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), opacity .3s; }
.video-facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .55), rgb(0 0 0 / .1)); }
.video-play { position: relative; z-index: 1; width: 4.75rem; height: 4.75rem; border-radius: 50%; background: var(--ivory); transition: transform .3s var(--ease), background-color .3s; }
.video-play::before { content: ""; position: absolute; left: 53%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: .75rem 0 .75rem 1.2rem; border-color: transparent transparent transparent var(--primary); }
.video-label { position: absolute; z-index: 1; left: 1.25rem; bottom: 1rem; font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.video-facade:hover .video-play, .video-facade:focus-visible .video-play { transform: scale(1.08); }
.video-facade:hover img { transform: scale(1.03); }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 3em 0; }
.prose pre { background: var(--ink); color: var(--ivory); padding: 1.25rem 1.5rem; overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.prose :not(pre) > code { background: var(--muted); padding: .1em .35em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--foreground); }

.article-footer { width: min(100% - 2.5rem, 44rem); margin: 0 auto; padding: 2rem 0 clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; }
.share { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.share .eyebrow { color: var(--muted-foreground); }
.share button { font: inherit; text-transform: inherit; letter-spacing: inherit; }
.back-link { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }

.related { padding: clamp(3rem, 7vw, 5rem) 0 clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--border); }
.related-head { margin-bottom: 3rem; }
.related-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 4.5vw, 3.8rem); line-height: 1; margin-top: 1.25rem; }

/* CTA band */
.cta-band { background: var(--burgundy); color: var(--ivory); padding: clamp(4rem, 9vw, 7rem) 0; }
.cta-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 2.5rem; }
.cta-eyebrow { color: color-mix(in oklch, var(--ivory) 55%, transparent); }
.cta-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.6rem, 6.5vw, 6rem); line-height: .95; margin-top: 1.5rem; max-width: 14ch; }

/* Footer */
.site-footer { background: var(--ink); color: var(--ivory); padding: 5rem 0 2.5rem; }
.footer-grid { display: grid; gap: 3rem; padding-bottom: 3.5rem; border-bottom: 1px solid color-mix(in oklch, var(--ivory) 15%, transparent); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-logo { width: min(19rem, 75vw); height: auto; aspect-ratio: 1385 / 255; object-fit: contain; object-position: left center; }
.footer-tag { margin-top: 1.25rem; font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; color: color-mix(in oklch, var(--ivory) 50%, transparent); }
.footer-links { display: flex; flex-direction: column; gap: .75rem; font-size: .875rem; }
.footer-links a { width: fit-content; color: color-mix(in oklch, var(--ivory) 65%, transparent); transition: color .3s; word-break: break-all; }
.footer-links a:hover { color: var(--ivory); }
.footer-copy { padding-top: 2rem; font-size: .75rem; color: color-mix(in oklch, var(--ivory) 40%, transparent); }

/* Preview bar */
.preview-bar { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding: .7rem 1.25rem; background: var(--primary); color: var(--ivory); font-size: .8rem; }
.preview-bar a { text-decoration: underline; text-underline-offset: 3px; }
.preview-bar + .site-header { top: 2.6rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
