/* Blog styles. Tokens and chrome mirror the homepage (index.html). */
:root {
  --ink: #0F1420;
  --ink-2: #161D2C;
  --ink-3: #1F2839;
  --line: #2B3549;
  --bone: #ECE6DA;
  --muted: #9AA3B5;
  --brass: #D4B07A;
  --brass-deep: #A9844D;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --step-4: clamp(2.3rem, 1.5rem + 3.6vw, 4rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 1180px;
  --measure: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--brass); color: var(--ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 20, 32, .86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-family: var(--display); font-weight: 600; }
.brand img { width: 40px; height: 40px; }
.brand span { line-height: 1.15; }
.nav { display: flex; align-items: center; gap: 1.75rem; font-family: var(--display); font-size: .95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--bone); }
@media (max-width: 820px) {
  .nav { gap: 1rem; }
  .nav a:not(.nav-blog) { display: none; }
}

/* Shared */
.eyebrow, .card p.eyebrow, .blog-hero p.eyebrow, .post-list li:first-child .card p.eyebrow { font-family: var(--display); font-weight: 600; font-size: var(--step--1); color: var(--brass); letter-spacing: .02em; margin: 0 0 1rem; line-height: 1.4; }
.card p.eyebrow, .post-list li:first-child .card p.eyebrow { margin-bottom: .6rem; }
.meta { font-family: var(--display); font-size: var(--step--1); color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.meta span + span::before { content: "·"; margin-right: .9rem; color: var(--line); }
.crumbs { font-family: var(--display); font-size: var(--step--1); color: var(--muted); margin: 0 0 2rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--bone); }
.crumbs span { margin: 0 .5rem; color: var(--line); }

/* Blog index */
.blog-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem); position: relative; }
.blog-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(50rem 26rem at 85% 0%, rgba(212,176,122,.10), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 56px;
  opacity: .5;
  mask-image: linear-gradient(to bottom, #000 20%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 95%);
}
.blog-hero .wrap { position: relative; }
.blog-hero h1 { font-size: var(--step-4); max-width: 18ch; margin-bottom: 1.25rem; }
.blog-hero p { font-size: var(--step-1); color: #D3CDC1; line-height: 1.5; max-width: 40ch; margin: 0; }

.posts { padding: 1rem 0 clamp(4rem, 8vw, 6rem); }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 1.75rem; }
.post-list li:first-child { grid-column: 1 / -1; }
.card { display: flex; flex-direction: column; gap: 1.1rem; text-decoration: none; height: 100%; }
.card .thumb { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--ink-3); border: 1px solid var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card .card-title { font-size: var(--step-1); letter-spacing: -0.015em; line-height: 1.2; }
.card:hover .card-title { color: var(--brass); }
.card p { color: #CFC9BD; margin: 0; font-size: 1rem; }
.post-list li:first-child .card { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.post-list li:first-child .card .card-title { font-size: var(--step-3); line-height: 1.08; margin-bottom: .9rem; }
.post-list li:first-child .card p { font-size: var(--step-1); line-height: 1.5; margin-bottom: 1.25rem; }
@media (max-width: 960px) {
  .post-list { grid-template-columns: 1fr 1fr; }
  .post-list li:first-child .card { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .post-list { grid-template-columns: 1fr; } }
.empty { border: 1px dashed var(--line); border-radius: 18px; padding: clamp(2rem, 5vw, 3.5rem); max-width: 46rem; }
.empty h2 { font-size: var(--step-2); margin-bottom: .75rem; }
.empty p { color: #CFC9BD; margin: 0 0 1.5rem; }

/* Article */
.article-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.article-head .wrap, .article-body, .article-foot { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.article-head h1 { font-size: var(--step-4); margin-bottom: 1.25rem; }
.article-head .standfirst { font-size: var(--step-1); line-height: 1.5; color: #D3CDC1; margin: 0 0 1.75rem; }
.article-hero { margin: 0 auto clamp(2.5rem, 5vw, 3.5rem); max-width: calc(64rem + 2 * var(--gutter)); }
.article-hero img { width: 100%; border-radius: 18px; border: 1px solid var(--line); aspect-ratio: 16 / 9; object-fit: cover; }
.article-hero figcaption, .article-body figcaption { font-family: var(--display); font-size: var(--step--1); color: var(--muted); margin-top: .75rem; }

.toc { border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.5rem; margin: 0 0 2.5rem; background: var(--ink-2); }
.toc strong { font-family: var(--display); font-weight: 600; display: block; margin-bottom: .5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; font-family: var(--display); font-size: .98rem; }
.toc li { padding: .2rem 0; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--bone); }

.prose { font-size: 1.125rem; line-height: 1.72; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: var(--step-2); margin-top: 2.4em; scroll-margin-top: 90px; }
.prose h3 { font-size: var(--step-1); letter-spacing: -0.01em; margin-top: 1.9em; scroll-margin-top: 90px; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose a { color: var(--brass); text-underline-offset: 3px; }
.prose a:hover { color: #E3C595; }
.prose strong { color: #F5F0E6; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--brass); }
.prose blockquote { margin: 1.8em 0; padding: .2rem 0 .2rem 1.4rem; border-left: 2px solid var(--brass); font-style: italic; color: #D3CDC1; font-size: var(--step-1); line-height: 1.5; }
.prose figure { margin: 2.2em 0; }
.prose figure img { border-radius: 14px; border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose code { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace; font-variant-ligatures: none; font-size: .86em; background: var(--ink-3); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: #0A0E17; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; overflow-x: auto; line-height: 1.55; font-size: .95rem; }
.prose pre code { background: none; padding: 0; border-radius: 0; font-size: .88em; color: #DCD6CA; }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--display); font-weight: 600; color: var(--muted); }
.prose .callout { background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.5rem; }

.author { display: flex; gap: 1rem; align-items: center; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); font-family: var(--display); }
.author img { width: 48px; height: 48px; border-radius: 50%; background: var(--ink-3); border: 1px solid var(--line); padding: 6px; }
.author b { display: block; font-weight: 600; }
.author span { color: var(--muted); font-size: var(--step--1); }

.related { padding: clamp(3.5rem, 7vw, 5rem) 0; margin-top: clamp(3rem, 6vw, 4.5rem); background: var(--ink-2); border-top: 1px solid var(--line); }
.related h2 { font-size: var(--step-2); margin-bottom: 2rem; }
.related .post-list li:first-child { grid-column: auto; }
.related .post-list li:first-child .card { display: flex; }
.related .post-list li:first-child .card .card-title { font-size: var(--step-1); line-height: 1.2; margin: 0; }
.related .post-list li:first-child .card p { font-size: 1rem; margin: 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-family: var(--display); font-size: .95rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem 2rem; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--bone); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
