/* Iris Moreau — Personal blog template
   Theme tokens: override these to recolour the whole site. Dark values are repeated below. */
:root {
  --brand: #b24a27;
  --accent: #2d4a43;
  --bg: #fbf8f3;
  --surface: #f3ede3;
  --surface-2: #ebe3d6;
  --text: #1c1b19;
  --muted: #5f5a52;
  --line: #e2d9cb;
  --code-bg: #1f2a37;
  --code-text: #e6edf3;
  --radius: 12px;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  --measure: 68ch;
  --container: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #f08a65;
  --accent: #8cc7b5;
  --bg: #141312;
  --surface: #1d1b19;
  --surface-2: #262320;
  --text: #ece7df;
  --muted: #aaa397;
  --line: #34302b;
  --code-bg: #0e1116;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #f08a65;
    --accent: #8cc7b5;
    --bg: #141312;
    --surface: #1d1b19;
    --surface-2: #262320;
    --text: #ece7df;
    --muted: #aaa397;
    --line: #34302b;
    --code-bg: #0e1116;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.125rem/1.7 var(--font-body); -webkit-font-smoothing: antialiased; transition: background-color .3s, color .3s; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.015em; text-wrap: balance; }
em { font-style: italic; }
h1 em { color: var(--brand); }
p { margin: 0 0 1em; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 8px; font-family: var(--font-ui); text-decoration: none; }
.skip-link:focus { top: 1rem; }
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
.container-wide { width: min(100% - 2.5rem, 1240px); margin-inline: auto; }
.eyebrow, .label { font: 600 .75rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: .85rem 1.4rem; background: var(--text); color: var(--bg); font: 600 .92rem var(--font-ui); cursor: pointer; text-decoration: none; transition: background .25s, transform .25s var(--ease); }
.btn:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
:root[data-theme="dark"] .btn:hover { color: #1a0f0a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:hover { color: #1a0f0a; } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 2rem; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font: 600 1.25rem var(--font-display); text-decoration: none; margin-right: auto; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--bg); font-style: italic; font-size: 1.2rem; line-height: 1; }
.nav-menu ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav-menu a { font: 500 .92rem var(--font-ui); text-decoration: none; color: var(--muted); transition: color .2s; }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { color: var(--text); }
.nav-actions { display: flex; gap: .3rem; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
html:not(.js) .theme-toggle { display: none; }
.nav-toggle { display: none; border: 0; }
.bars, .bars::before, .bars::after { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .3s var(--ease); }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Home */
.intro { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2rem, 4vw, 3rem); }
.intro h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); font-weight: 400; max-width: 18ch; }
.intro-lead { font-size: 1.25rem; color: var(--muted); max-width: 52ch; margin-top: 1.4rem; }
.featured { display: grid; grid-template-columns: 1.25fr 1fr; background: var(--surface); border-radius: calc(var(--radius) * 1.6); overflow: hidden; transition: box-shadow .4s var(--ease); }
.featured:hover { box-shadow: 0 30px 60px -35px rgba(28, 27, 25, .35); }
.featured-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.featured:hover .featured-media img { transform: scale(1.03); }
.featured-media { overflow: hidden; }
.featured-body { padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.featured h3 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin-bottom: 1rem; }
.featured h3 a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.featured h3 a:hover { background-size: 100% 1px; }
.featured-body > p { color: var(--muted); }
.byline { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; font-family: var(--font-ui); }
.byline img { border-radius: 50%; }
.byline div { display: flex; flex-direction: column; line-height: 1.35; }
.byline strong { font-size: .92rem; font-weight: 600; }
.byline span { font-size: .84rem; color: var(--muted); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(2rem, 6vw, 5rem); padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.list-head h2 { font-size: 1.8rem; }
.filter-status { margin: 0; font: 500 .85rem var(--font-ui); color: var(--muted); }
.filter-status button { font: inherit; color: var(--brand); background: none; border: 0; cursor: pointer; text-decoration: underline; padding: 0; margin-left: .3rem; }
.post-row { border-bottom: 1px solid var(--line); }
.post-row article { padding: 1.8rem 0; }
.post-link { display: block; text-decoration: none; }
.post-row-meta { display: flex; gap: .5rem; font: 500 .8rem var(--font-ui); color: var(--muted); margin-bottom: .5rem; }
.post-row h3 { font-size: 1.6rem; margin-bottom: .45rem; transition: color .2s; }
.post-link:hover h3 { color: var(--brand); }
.post-row p { color: var(--muted); margin: 0 0 .9rem; max-width: 60ch; }
.post-row[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li, .chips a { font: 500 .75rem var(--font-ui); color: var(--muted); background: var(--surface); padding: .22rem .65rem; border-radius: 999px; text-decoration: none; }
.chips a:hover { color: var(--text); background: var(--surface-2); }
.more-link { display: inline-block; margin-top: 2rem; font: 600 .92rem var(--font-ui); color: var(--brand); text-decoration: none; }
.more-link:hover { text-decoration: underline; }
.sidebar { display: grid; gap: 1.5rem; align-content: start; position: sticky; top: 90px; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.side-card h2 { font: 600 .78rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.topics { display: flex; flex-wrap: wrap; gap: .45rem; }
.topic { display: inline-flex; align-items: center; gap: .4rem; font: 500 .85rem var(--font-ui); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .75rem; transition: border-color .2s, background .2s; }
.topic span { color: var(--muted); font-size: .75rem; }
.topic:hover { border-color: var(--text); }
.topic[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.topic[aria-current="true"] span { color: inherit; opacity: .7; }
.popular { margin: 0; padding-left: 1.2rem; }
.popular li { margin-bottom: .7rem; line-height: 1.35; }
.popular li::marker { color: var(--brand); font-family: var(--font-ui); font-size: .85rem; }
.popular a { text-decoration: none; }
.popular a:hover { text-decoration: underline; }

.newsletter { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem 3rem; align-items: center; background: var(--accent); color: #f4efe6; border-radius: calc(var(--radius) * 1.6); padding: clamp(2rem, 5vw, 3.5rem); margin-bottom: clamp(3.5rem, 7vw, 5.5rem); }
:root[data-theme="dark"] .newsletter { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .newsletter { background: var(--surface); color: var(--text); border: 1px solid var(--line); } }
.newsletter h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: .8rem; }
.nl-copy p { margin: 0; opacity: .85; }
.nl-form { display: flex; flex-wrap: wrap; gap: .6rem; }
.nl-form input { flex: 1 1 220px; min-width: 0; font: 400 1rem var(--font-ui); padding: .85rem 1.1rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); color: inherit; }
.nl-form input::placeholder { color: inherit; opacity: .65; }
.nl-form input:focus { outline: 2px solid currentColor; outline-offset: 2px; }
.newsletter .btn { background: #f4efe6; color: #1c1b19; }
.newsletter .btn:hover { background: #fff; color: #1c1b19; }
:root[data-theme="dark"] .newsletter .btn { background: var(--brand); color: #1a0f0a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .newsletter .btn { background: var(--brand); color: #1a0f0a; } }
:root[data-theme="dark"] .nl-form input { border-color: var(--line); background: var(--bg); }
.nl-form .form-status { flex-basis: 100%; margin: 0; font: 500 .88rem var(--font-ui); }

/* Post */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--brand); transform-origin: 0 50%; transform: scaleX(0); }
html:not(.js) .progress { display: none; }
.post-header { padding-top: clamp(3rem, 7vw, 5rem); text-align: center; }
.post-header .chips { justify-content: center; margin-bottom: 1.5rem; }
.post-header h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 400; }
.dek { font-size: clamp(1.2rem, 2vw, 1.4rem); color: var(--muted); margin: 1.2rem auto 0; max-width: 40ch; font-style: italic; }
.post-header .byline { justify-content: center; margin-top: 1.8rem; text-align: left; }
.post-cover { margin-top: clamp(2rem, 5vw, 3.5rem); margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.post-cover img { border-radius: calc(var(--radius) * 1.4); width: 100%; }
.post-layout { display: grid; grid-template-columns: 220px minmax(0, var(--measure)) 220px; justify-content: center; gap: 3rem; }
.toc { position: sticky; top: 100px; align-self: start; font-family: var(--font-ui); }
.toc h2 { font: 600 .75rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .35rem 0 .35rem 1rem; margin-left: -1px; border-left: 2px solid transparent; font-size: .88rem; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--text); border-color: var(--brand); font-weight: 600; }

.prose { font-size: 1.2rem; line-height: 1.75; min-width: 0; }
.prose > * + * { margin-top: 1.25em; }
.prose p { margin-bottom: 0; }
.prose h2 + * { margin-top: .6em; }
.prose .lede { font-size: 1.35rem; line-height: 1.6; }
.prose .lede::first-letter { float: left; font-size: 3.6em; line-height: .85; padding: .08em .1em 0 0; color: var(--brand); font-weight: 500; }
.prose h2 { font-size: 1.85rem; margin-top: 2.2em; }
.prose a { color: var(--brand); }
.prose ul, .prose ol { padding-left: 1.3rem; margin-bottom: 0; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--brand); }
.prose code { font: 400 .82em var(--font-mono); background: var(--surface); border: 1px solid var(--line); padding: .1em .35em; border-radius: 5px; }
.code-block { margin: 1.6em 0 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); }
.code-block figcaption { display: flex; justify-content: space-between; align-items: center; font: 500 .78rem var(--font-ui); color: #9fb0c3; padding: .55rem 1rem; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.code-block pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; font: 400 .88rem/1.7 var(--font-mono); color: var(--code-text); tab-size: 2; }
.code-block code { font: inherit; background: none; border: 0; padding: 0; }
.copy-btn { font: 500 .75rem var(--font-ui); color: #cbd5e1; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px; padding: .2rem .6rem; cursor: pointer; }
.copy-btn:hover { background: rgba(255, 255, 255, .16); }
.tk-sel { color: #f3b562; } .tk-prop { color: #7fd1b9; } .tk-val { color: #f4a6c6; } .tk-com { color: #7d8b9b; font-style: italic; } .tk-at { color: #a5b4fc; }
.pullquote { margin: 2em -1rem; padding: 1.5rem 0; border-block: 2px solid var(--text); text-align: center; }
.pullquote p { font: italic 400 clamp(1.5rem, 3vw, 2rem)/1.3 var(--font-display); color: var(--text); }
blockquote { margin: 1.6em 0 0; padding: .2rem 0 .2rem 1.4rem; border-left: 3px solid var(--brand); font-style: italic; color: var(--muted); }
.prose-figure { margin: 2em 0 0; }
.prose-figure img { border-radius: var(--radius); width: 100%; }
.prose-figure figcaption { font: 400 .85rem/1.5 var(--font-ui); color: var(--muted); margin-top: .7rem; text-align: center; }
.callout { background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.3rem; font: 400 1rem/1.6 var(--font-ui); border-left: 4px solid var(--accent); }
.signoff { font-style: italic; color: var(--muted); }

.post-footer { margin-top: clamp(3rem, 6vw, 4.5rem); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; font: 500 .88rem var(--font-ui); padding-block: 1.2rem; border-block: 1px solid var(--line); }
.share span { color: var(--muted); margin-right: auto; }
.share a, .link-btn { color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.share a:hover, .link-btn:hover { color: var(--brand); }
.author-box { display: flex; gap: 1.4rem; align-items: flex-start; background: var(--surface); border-radius: calc(var(--radius) * 1.4); padding: 1.6rem; margin-top: 2.5rem; }
.author-box img { border-radius: 50%; flex-shrink: 0; }
.author-box .label { margin-bottom: .3rem; }
.author-box h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.author-box p:last-child { margin: 0; color: var(--muted); font-size: 1.05rem; }
.author-box a { color: var(--brand); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.post-nav a { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; text-decoration: none; transition: border-color .2s; }
.post-nav a:hover { border-color: var(--text); }
.post-nav .next { text-align: right; }
.post-nav small { display: block; font: 500 .8rem var(--font-ui); color: var(--muted); margin-bottom: .2rem; }
.post-nav span { font-size: 1.15rem; line-height: 1.3; }
.related { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.related h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.related-grid a { display: block; text-decoration: none; }
.related-grid img { border-radius: var(--radius); margin-bottom: .9rem; transition: transform .5s var(--ease); }
.related-grid a:hover img { transform: translateY(-3px); }
.r-meta { display: block; font: 500 .78rem var(--font-ui); color: var(--muted); margin-bottom: .3rem; }
.r-title { font: 500 1.3rem/1.25 var(--font-display); }
.related-grid a:hover .r-title { color: var(--brand); }

/* About */
.about { padding-block: clamp(3rem, 7vw, 5rem); }
.about-head { margin-bottom: 2.5rem; }
.about-avatar { border-radius: 50%; margin-bottom: 1.5rem; }
.about h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 400; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 3rem 0 0; border-top: 1px solid var(--line); padding-top: 1.5rem; font-family: var(--font-ui); }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: .2rem 0 0; font: 500 1.35rem var(--font-display); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-top: 3rem; font-family: var(--font-ui); font-size: .92rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; }
.footer-inner .logo { color: var(--text); margin-bottom: .8rem; }
.footer-inner p { max-width: 36ch; margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-self: center; }
.footer-links a, .footer-base a { text-decoration: none; }
.footer-links a:hover, .footer-base a:hover { color: var(--brand); }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px solid var(--line); padding-block: 1.4rem; font-size: .82rem; }
.footer-base p { margin: 0; }

/* Responsive */
@media (max-width: 1180px) {
  .post-layout { grid-template-columns: minmax(0, var(--measure)); }
  .toc { position: static; background: var(--surface); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
  .toc ol { border: 0; counter-reset: t; }
  .toc a { padding-left: 0; border: 0; }
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .featured, .newsletter { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .related-grid li:last-child { display: none; }
}
@media (max-width: 720px) {
  .nav-toggle { display: grid; }
  .nav-menu { position: absolute; top: 68px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem; display: none; }
  .nav-menu.open { display: block; }
  .nav-menu ul { flex-direction: column; gap: 0; }
  .nav-menu a { display: block; padding: .85rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); color: var(--text); }
  html:not(.js) .nav-menu { position: static; display: block; }
  html:not(.js) .nav { flex-wrap: wrap; height: auto; padding-block: .75rem; }
  .sidebar { grid-template-columns: 1fr; }
  .prose { font-size: 1.12rem; }
  .prose .lede { font-size: 1.22rem; }
  .pullquote { margin-inline: 0; }
  .post-nav, .related-grid { grid-template-columns: 1fr; }
  .related-grid li:last-child { display: block; }
  .post-nav .next { text-align: left; }
  .author-box { flex-direction: column; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .progress, .toc, .share, .post-nav, .related, .newsletter, .site-footer, .copy-btn { display: none !important; }
  body { background: #fff; color: #000; }
}
