/* Interchange theme — blog and markdown pages on interchangestudio.com.
   Tokens, header, buttons and footer deliberately mirror the homepage
   (wranglers/interchange/src/home.html.tpl) so the whole site reads as one.
   Keep the two in sync when changing colours. */
:root {
  --ground: #F1F3F5; --surface: #FAFBFC; --ink: #0F1B2D; --muted: #55627A; --line: #D3D9E1; --edge: #8793A6;
  --red: #D9262C; --on-red: #FFFFFF; --blue: #1F4FBF; --on-blue: #FFFFFF;
  --display: 'Schibsted Grotesk', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0C131F; --surface: #131C2B; --ink: #E9EEF6; --muted: #9AA7BD; --line: #243148; --edge: #4A5B78;
    --red: #F2545B; --on-red: #0C131F; --blue: #6C8FFF; --on-blue: #0C131F; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--display); font-size: 1.0625rem; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 1120px; margin-inline: auto; }
h1, h2, h3 { font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; margin: 0; color: var(--ink); }
a { color: var(--ink); text-underline-offset: 3px; }

/* Header: same markup and look as the homepage */
.ic-header { position: sticky; top: 0; z-index: 20; margin-inline: -16px; padding-inline: 16px;
  background: color-mix(in srgb, var(--ground) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.ic-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand span { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.ic-header nav { display: flex; align-items: center; gap: 22px; }
.ic-header nav a.link { text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.ic-header nav a.link:hover { text-decoration: underline; text-underline-offset: 6px; }
@media (max-width: 760px) { .ic-header nav a.link { display: none; } }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; font: 700 1rem/1.2 var(--display);
  border: 2px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; border-radius: 10px;
  transition: transform .15s ease, background-color .2s ease; }
.btn:hover { background: var(--ink); color: var(--ground); transform: translateY(-2px); }
.btn-primary { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }

/* Article body */
main { max-width: 44rem; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 0 clamp(48px, 8vw, 96px); }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; letter-spacing: -0.03em; }
h2 { font-size: 1.55rem; margin: 2.6rem 0 0.8rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
main p, main li { color: var(--ink); }
main a { color: var(--blue); }
main a:hover { color: var(--red); }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; overflow-x: auto; font-size: 0.9rem; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; }
pre code { background: none; padding: 0; }
blockquote { margin: 1.5rem 0; padding: 0.2rem 1.1rem; border-left: 4px solid var(--red); color: var(--muted); }
.post-meta { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.5rem; }
.post-list { list-style: none; padding: 0; margin: 2rem 0; }
.post-list li { padding: 1.3rem 0; border-top: 1px solid var(--line); }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list a { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.post-list a:hover { color: var(--red); }
.post-list time { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.post-excerpt { margin: 0.5rem 0 0; color: var(--muted); font-size: 1rem; }
main img { max-width: 100%; height: auto; border-radius: 8px; }
figure.img-figure { margin: 1.8rem 0; }
figure.img-figure figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.lang-switch { max-width: 1120px; margin: 0 auto; padding: 0 0 0.6rem; font-size: 0.8rem; }
.lang-switch a { color: var(--muted); }

/* Footer: same as the homepage */
.site-footer { border-top: 1px solid var(--line); padding-block: 36px 48px; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn:hover { transform: none; } }
