:root {
  --ink: #132025;
  --muted: #52646b;
  --line: #d8e1e2;
  --paper: #f7faf9;
  --white: #ffffff;
  --accent: #8f1f2d;
  --code-bg: #101820;
  --code-ink: #e6edf0;
  --shadow: 0 18px 44px rgba(19, 32, 37, .12);
  --page-max: 820px;
  --header-max: 1400px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

.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: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; margin: 1.2em 0; border: 1px solid var(--line); border-radius: 4px; }
figure { margin: 1.2em 0; }
figure img { margin: 0; }
figure figcaption { margin-top: .5em; color: var(--muted); font-size: 13px; }
.post-body iframe { width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; }
.wrap { width: min(var(--page-max), calc(100% - 40px)); margin: 0 auto; }
.wrap-wide { width: min(var(--header-max), calc(100% - 48px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 250, 249, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--accent);
  border-radius: 7px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 15px; font-weight: 700; }
.nav-links a { color: var(--ink); text-decoration: none; }
.nav-links a.button { color: var(--white); }
.nav-links a.button.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--accent);
}
.nav-toggle span:not(.sr-only) { width: 18px; height: 2px; border-radius: 99px; background: currentColor; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}
.button.secondary { background: var(--white); color: var(--accent); }

.archive-notice {
  background: rgba(143, 31, 45, .07);
  border-bottom: 1px solid rgba(143, 31, 45, .2);
  font-size: 14px;
}
.archive-notice[hidden] { display: none; }
.archive-notice-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.archive-notice p { margin: 0; color: var(--ink); }
.archive-notice a { color: var(--accent); text-decoration: underline; font-weight: 700; }
.archive-notice-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.archive-notice-close:hover { background: rgba(143, 31, 45, .12); }

main.wrap { padding: 40px 0 60px; }

h1 { font-size: 1.9rem; margin: 0 0 .3em; }
h2 { font-size: 1.4rem; margin-top: 1.6em; }
h3 { font-size: 1.15rem; }

.eyebrow, .fineprint { color: var(--muted); font-size: 14px; }
.eyebrow { margin: 0 0 .4em; }

.post-list { list-style: none; padding: 0; margin: 1.5em 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.post-list a { color: var(--ink); font-weight: 600; }
.post-list-date { color: var(--muted); white-space: nowrap; font-size: 14px; }

.post-tags { margin-top: 2.5em; padding-top: 1em; border-top: 1px solid var(--line); }
.tag-pill { color: var(--accent); }

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92em;
}
p code, li code { background: var(--line); padding: .1em .35em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; color: inherit; }

table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }

.site-footer {
  padding: 36px 0;
  background: #10191d;
  color: #d4dee0;
  font-size: 14px;
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-grid a { color: #d4eee9; }
.footer-blurb { display: block; margin-top: 4px; }
.footer-abn { display: block; margin-top: 10px; }
.footer-credential { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #d4dee0; }
.footer-credential-badge { width: 36px; height: 36px; flex-shrink: 0; margin: 0; border: 0; }
.footer-legal { color: #9fb3b6; font-size: 12px; line-height: 1.4; margin-top: 10px; }
.footer-legal a { color: #9fb3b6; }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner strong { display: block; margin-bottom: 4px; }
.cookie-banner p { margin: 0; color: var(--muted); font-size: 14px; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-link { color: var(--accent); font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.cookie-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .nav { padding: 12px 0; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-links {
    display: none;
    order: 3;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 2px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 7px;
    background: var(--white);
    border: 1px solid var(--line);
  }
  .nav-links a.button { justify-content: center; background: var(--accent); border-color: var(--accent); }
  .nav-links a.button.secondary { background: var(--white); color: var(--accent); border-color: var(--accent); }
  .footer-grid { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .brand { max-width: calc(100% - 56px); }
  .cookie-banner { grid-template-columns: 1fr; align-items: stretch; }
  .cookie-actions .button { flex: 1 1 180px; }
  .archive-notice-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 0 12px; }
  .archive-notice-close { position: absolute; top: 6px; right: 0; }
  .archive-notice-inner { position: relative; padding-right: 36px; }
}
