/* blog.chrisquek.my - one blog, in the hub's look (spec v2.2).
   Same tokens as the hub's styles.css. Light and dark come from data-theme on <html>.
   No inline styles anywhere (strict Content-Security-Policy). */

/* ---------- Fonts (self-hosted, SIL Open Font Licence 1.1) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Tokens (the hub's, exactly) ---------- */
:root {
  color-scheme: light;
  --bg: #FFFFFF; --band: #EAF4FC; --dot: #B8D3EC; --card: #FFFFFF;
  --ink: #0F2238; --mut: #4A5E75; --line: #D5E1EC; --accent: #0369A1; --chip: #EFF5FA;
  --err: #B3261E; --good: #0F6E3F; --warn: #8A5A00;
  --strip: #0F2238; --stripink: #E8F0FA; --on-accent: #FFFFFF;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1626; --band: #0F2340; --dot: #1F3A5E; --card: #0E1C32;
  --ink: #E8F0FA; --mut: #9DB0C7; --line: #223452; --accent: #7CC4F5; --chip: #13233D;
  --err: #FF8A7A; --good: #5FD39A; --warn: #FBBF24;
  --strip: #050C17; --stripink: #E8F0FA; --on-accent: #0A1626;
}
/* names used by the sign-in page and the admin strip until their own restyle (R3) */
:root, html[data-theme="dark"] {
  --card-solid: var(--card); --head: var(--ink); --text: var(--ink); --muted: var(--mut);
  --font-head: var(--font-body); --font-label: var(--font-mono); --shadow: none;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: 10px 14px; border-radius: 6px; z-index: 20; }
.ico { flex: none; display: block; }
.mono { font-family: var(--font-mono); }

/* ---------- Admin strip (admin only, above the header; darkest navy of the palette) ---------- */
.admin-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  padding: 0 24px; padding-top: env(safe-area-inset-top, 0px);
  background: var(--strip); color: var(--stripink);
}
.admin-tag { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 0.9375rem; }
.admin-tag svg { flex: none; display: block; }
.admin-links { display: inline-flex; align-items: center; margin-right: -8px; }
.admin-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin-left: 8px;
  color: var(--stripink); font-size: 0.9375rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.admin-link:hover { text-decoration-thickness: 2px; }
.admin-strip a:focus-visible { outline: 3px solid #9CC3FF; outline-offset: -3px; }

/* ---------- Header ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 10px 24px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.admin-strip + .top { padding-top: 10px; }
.brand {
  display: flex; align-items: center; gap: 12px; margin-right: auto;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em;
}
.mark, .logo, .logo-pro {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--accent);
  font-family: var(--font-mono); font-weight: 500; font-size: 0.9375rem;
}
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-size: 0.9375rem; font-weight: 600;
}
.nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
.hubl {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--mut); text-decoration: none;
}
.hubl:hover { color: var(--accent); }
.btn-sq {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); cursor: pointer;
}
.btn-sq:hover, .btn-in:hover { border-color: var(--accent); }
.toggle .ico-sun { display: none; }
html[data-theme="dark"] .toggle .ico-moon { display: none; }
html[data-theme="dark"] .toggle .ico-sun { display: block; }
/* Sign in (a link) and Sign out (a button in a POST form) look the same */
.account-form { margin: 0; display: flex; }
.btn-in {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink);
  font: inherit; font-size: 0.9375rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.account svg { flex: none; display: block; }

/* ---------- Banner (home page) ---------- */
.hero {
  padding: 3.25rem 24px 2.5rem; border-bottom: 1px solid var(--line);
  background: radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 20px 20px, var(--band);
}
.hero-in { max-width: 62rem; margin: 0 auto; }
.eyebrow { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--accent); margin: 0 0 0.6rem; }
.hero h1 { font-size: 3rem; line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
.hero .role { margin-top: 0.75rem; color: var(--mut); font-size: 1.125rem; max-width: 36rem; }

/* ---------- Layout: main column and side column ---------- */
.wrap { max-width: 62rem; margin: 0 auto; padding: 2.5rem 24px 2rem; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.main-col { min-width: 0; }
.side { min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 62rem) {
  .cols { grid-template-columns: minmax(0, 1fr) 20rem; }
  .cols.one { grid-template-columns: minmax(0, 46rem); }
  .cols.full { grid-template-columns: minmax(0, 1fr); }
}

.sec-head { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 1.1rem; }
.num { font-family: var(--font-mono); font-size: 0.875rem; font-weight: 500; color: var(--accent); }
.sec-head h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.page-title { font-size: 2rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 1.25rem; }
.lab { font-family: var(--font-mono); font-size: 0.75rem; color: var(--mut); margin: 0 0 0.45rem; }
.meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--mut); margin: 0 0 0.7rem; }

/* ---------- Search box, chips ---------- */
.browse { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.side .browse { margin-bottom: 0; }
.search {
  position: relative; display: flex; align-items: center; min-height: 44px;
  border: 1px solid var(--mut); border-radius: 6px; background: var(--bg);
}
.search input {
  flex: 1 1 auto; min-width: 0; min-height: 42px; padding: 0 0 0 12px; border: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 0.9375rem;
}
.search input::placeholder { color: var(--mut); opacity: 1; }
.search input:focus-visible { outline: none; }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.search-go {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 42px; padding: 0;
  border: 0; background: transparent; color: var(--mut); cursor: pointer;
}
.search-go:hover { color: var(--accent); }

/* Suggestions dropdown (search.js) */
.suggest {
  position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
}
.suggest[hidden] { display: none; }
.suggest li {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px 6px 12px;
  border-left: 3px solid transparent; border-radius: 4px; color: var(--ink); cursor: pointer; line-height: 1.3;
}
.suggest li:hover { background: var(--chip); }
.suggest li[aria-selected="true"] { background: var(--chip); border-left-color: var(--accent); font-weight: 600; }
.suggest-kind { flex: none; min-width: 3.2em; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mut); }
.suggest-text { min-width: 0; overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chips li, .chips a {
  display: inline-block; max-width: 100%; padding: 0.125rem 0.5rem; border-radius: 4px;
  background: var(--chip); color: var(--ink); font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.6; text-decoration: none;
}
.chips li { padding: 0; background: none; }
.chips a:hover { text-decoration: underline; }
.chips .n { color: var(--mut); margin-left: 4px; }
.chips.big { gap: 0.5rem; }
.chips.big a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); font-family: var(--font-body); font-size: 0.875rem; font-weight: 600;
}
.chips.big .n { font-family: var(--font-mono); font-size: 0.75rem; }
.chips a { position: relative; }
.chips:not(.big) a::after { content: ""; position: absolute; inset: -9px -2px; } /* bigger touch area, same look */

/* ---------- Cards and badges ---------- */
.cards { display: flex; flex-direction: column; gap: 1rem; }
.card { display: flex; flex-direction: column; padding: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; min-width: 0; transition: border-color 0.15s ease; }
.cards > .card:hover, .card.panel-card:hover { border-color: var(--accent); }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem 0.75rem; margin-bottom: 0.4rem; }
.card-head h2, .card-head h3 { flex: 1 1 12rem; min-width: 0; font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.card-head a:not(.badge) { color: var(--ink); text-decoration: none; }
.card-head a:not(.badge):hover { text-decoration: underline; }
.desc { color: var(--mut); font-size: 0.95rem; line-height: 1.65; margin: 0 0 0.9rem; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 0.5rem; border: 1px solid var(--accent); border-radius: 4px;
  color: var(--accent); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; line-height: 1.6; white-space: nowrap; text-decoration: none;
}
a.badge:hover { text-decoration: underline; }
.badge.mut { border-color: var(--mut); color: var(--mut); }
.cards.tight { gap: 0.6rem; }
.cards.tight .card { padding: 0.9rem 1rem; }
.cards.tight .card a { font-weight: 600; color: var(--ink); text-decoration: none; }
.cards.tight .card a:hover { text-decoration: underline; }
.cards.tight .meta { margin: 0.25rem 0 0; }

/* ---------- 404 page: the full-width picture (one of seven, picked by quotes.js) ---------- */
.quip-art { margin: 0; width: 100%; aspect-ratio: 1600 / 1066; background: var(--chip); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quip-art img { display: block; width: 100%; height: auto; }

/* ---------- A post ---------- */
.post { max-width: 42rem; }
.crumb { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--mut); margin: 0 0 0.9rem; overflow-wrap: anywhere; }
.crumb a { color: var(--mut); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.badges:empty { display: none; }
.post h1 { font-size: 2.5rem; line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; overflow-wrap: anywhere; }
.post .meta { margin: 0.75rem 0 1.25rem; font-size: 0.78rem; }
.edit-row { margin: 0 0 1.75rem; }
.post-body img.post-img { display: block; max-width: 100%; height: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: 6px; background: var(--chip); }
.preview-note { max-width: 42rem; margin: 0 0 1.5rem; padding: 0.75rem 1rem; background: var(--chip); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; color: var(--ink); font-size: 0.9375rem; line-height: 1.5; }
.tags-lab { margin-top: 2rem; }
.post-body { font-size: 1.0625rem; line-height: 1.75; overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1rem; }
.post-body h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 2rem 0 0.75rem; }
.post-body h3 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; margin: 1.6rem 0 0.6rem; }
.post-body h4, .post-body h5, .post-body h6 { font-size: 1rem; font-weight: 700; margin: 1.4rem 0 0.5rem; }
.post-body ul, .post-body ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: 0.4rem; }
.post-body li > ul, .post-body li > ol { margin: 0.4rem 0 0; }
.post-body a { text-underline-offset: 3px; }
.post-body img { max-width: 100%; height: auto; border-radius: 6px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.post-body blockquote { margin: 1.25rem 0; padding: 0 0 0 1rem; border-left: 3px solid var(--accent); color: var(--mut); }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body code { font-family: var(--font-mono); font-size: 0.875em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--chip); }
.post-body pre { margin: 0 0 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--chip); overflow-x: auto; font-size: 0.875rem; line-height: 1.6; }
.post-body pre code { padding: 0; background: none; font-size: inherit; }
.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.9375rem; }
.post-body th, .post-body td { padding: 0.5rem 0.75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-body th { background: var(--chip); font-weight: 600; }

/* ---------- Page footer ---------- */
.foot {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--mut);
  font-family: var(--font-mono); font-size: 0.8125rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
}
.foot a { color: var(--mut); }

/* ---------- Live cards (side column on the home page) ---------- */
.dash-sub { margin: 0 0 1.5rem; max-width: 40rem; color: var(--mut); font-size: 1rem; line-height: 1.6; }
/* Cards flow down one column and then the next (two on a wide screen, one on a phone), so short cards leave no gaps. */
.dash-grid { column-width: 22rem; column-gap: 1rem; }
.dash-grid > .panel-card { break-inside: avoid; margin-bottom: 1rem; }
.right { gap: 1rem; }
.right > .lab { margin: 0; }
.panel-card h2 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; margin: 0 0 0.4rem; }
.panel-note { margin: 0; color: var(--ink); font-size: 0.95rem; }
.soon {
  display: inline-block; margin-right: 6px; padding: 0 0.5rem; border: 1px solid var(--mut); border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--mut);
}
.panel-sub { margin: 0 0 0.5rem; color: var(--mut); font-size: 0.9rem; }
.as-at { margin: 0.7rem 0 0; color: var(--mut); font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.5; }
.as-at a { color: var(--accent); }

/* weather */
.wx-list, .g-list, .st-list { list-style: none; margin: 0; padding: 0; }
.wx-row {
  display: grid; grid-template-columns: 4.2rem 24px minmax(0, 1fr) auto; grid-template-areas: "day icon cond temp";
  align-items: center; column-gap: 10px; min-height: 44px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 0.92rem;
}
.wx-row:first-child { border-top: 0; }
.wx-day { grid-area: day; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--mut); }
.wx-icon { grid-area: icon; display: block; color: var(--accent); }
.wx-cond { grid-area: cond; line-height: 1.3; overflow-wrap: break-word; min-width: 0; }
.wx-temp { grid-area: temp; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.8125rem; white-space: nowrap; text-align: right; }
.wx-lo { margin-left: 6px; color: var(--mut); }

/* at a glance, ringgit */
.g-head { margin: 1rem 0 0.25rem; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--mut); }
.panel-card .g-head:first-of-type { margin-top: 0; }
.g-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; min-height: 40px; padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.g-row:first-child { border-top: 0; }
.g-val { font-family: var(--font-mono); font-size: 0.875rem; font-variant-numeric: tabular-nums; text-align: right; }
.g-unit { color: var(--mut); font-size: 0.85em; }
.g-note { flex: 1 0 100%; color: var(--mut); font-size: 0.75rem; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.g-arrow { vertical-align: -2px; margin-right: 4px; }

/* site status: words and shapes, never colour alone */
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0.4rem 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.st-row:first-child { border-top: 0; }
.st-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 96px; min-height: 28px;
  border: 1px solid currentColor; border-radius: 999px; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
}
.st-icon { flex: none; }
.st-up { color: var(--good); }
.st-error { color: var(--warn); }
.st-down { color: var(--err); }

/* open-weight models */
.md-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.6rem; }
.md-tile { border: 1px solid var(--line); border-radius: 6px; background: var(--chip); min-width: 0; }
.md-link, .md-off { display: flex; flex-direction: column; gap: 2px; min-height: 44px; height: 100%; padding: 0.6rem 0.7rem; border-radius: 6px; }
.md-link { color: inherit; text-decoration: none; }
.md-link:hover { background: var(--card); }
.md-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.md-tile.md-off { padding: 0.6rem 0.7rem; }
.md-family { font-weight: 700; }
.md-name { font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.3; overflow-wrap: anywhere; color: var(--ink); }
.md-date { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--mut); }
.md-new {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 0.4rem; border: 1px solid var(--accent); border-radius: 4px;
  color: var(--accent); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
}
.md-hex { width: 10px; height: 10px; flex: none; }

/* page views (own counter), bars and the (i) note */
.pv-total, .gh-total { margin: 0; color: var(--mut); font-size: 0.8125rem; }
.pv-num, .gh-num { display: block; margin: 0 0 0.1rem; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-chart { display: block; width: 100%; height: 56px; margin-top: 0.6rem; }
.pv-bar { fill: color-mix(in srgb, var(--accent) 55%, transparent); }
.pv-today { fill: var(--accent); }
.pv-days { margin: 2px 0 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pv-days li { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pv-n { order: -1; font-family: var(--font-mono); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.pv-d { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--mut); }
.info { margin-top: 6px; }
.info summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; border-radius: 6px; }
.info summary::-webkit-details-marker { display: none; }
.info-i {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none;
  border: 1.5px solid var(--accent); border-radius: 50%; color: var(--accent);
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; line-height: 1;
}
.info-label { color: var(--accent); font-size: 0.875rem; text-decoration: underline; }
.info-text { margin: 2px 0 8px; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--chip); color: var(--ink); font-size: 0.82rem; line-height: 1.5; }

/* GitHub contributions grid, 16 weeks x 7 days */
.gh-sub { margin: 0.1rem 0 0.8rem; color: var(--mut); font-size: 0.8125rem; }
.gh-grid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 3px; align-items: start; }
.gh-cell { display: block; aspect-ratio: 1; min-width: 0; border-radius: 2px; border: 1px solid var(--line); background: var(--chip); }
.gh-none { border-color: transparent; background: transparent; }
.gh-l1 { background: color-mix(in srgb, var(--accent) 28%, var(--chip)); border-color: transparent; }
.gh-l2 { background: color-mix(in srgb, var(--accent) 52%, var(--chip)); border-color: transparent; }
.gh-l3 { background: color-mix(in srgb, var(--accent) 76%, var(--chip)); border-color: transparent; }
.gh-l4 { background: var(--accent); border-color: transparent; }
.gh-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 8px 0 0; color: var(--mut); font-family: var(--font-mono); font-size: 0.75rem; }
.gh-legend .gh-cell { width: 12px; height: 12px; aspect-ratio: auto; }

/* ---------- Motion: only a border-colour change, and none when the visitor asks for less ---------- */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Phone ---------- */
@media (max-width: 40rem) {
  .admin-strip { padding-left: 16px; padding-right: 16px; }
  .top { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); gap: 8px 12px; }
  .admin-strip + .top { padding-top: 10px; }
  .brand { flex: 1 1 auto; order: 1; margin-right: 0; min-width: 0; }
  .brand-name { overflow-wrap: anywhere; }
  .btn-sq { order: 2; }
  .account-form, .account { order: 3; }
  .account span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .account { width: 44px; padding: 0; justify-content: center; }
  .nav { order: 5; }
  .hubl { order: 6; margin-left: auto; }
  .hero { padding: 2.25rem 16px 1.75rem; }
  .hero h1 { font-size: 2.25rem; }
  .wrap { padding: 1.75rem 16px 1.5rem; }
  .cols { gap: 2rem; }
  .post h1 { font-size: 2rem; }
  .page-title { font-size: 1.625rem; }
  .chips.big { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chips.big li { flex: none; }
}

/* ---------- Sign-in page (restyled in R3; until then it reads the tokens above) ---------- */
.signin {
  --input-line: #6B7280;
  --err-bg: color-mix(in srgb, var(--err) 8%, transparent);
  min-height: 100vh; min-height: 100svh; max-width: 480px; margin: 0 auto;
  padding: 28px 20px; padding-top: calc(28px + env(safe-area-inset-top, 0px)); padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
html[data-theme="dark"] .signin { --input-line: #66748A; }
.signin-brand { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.signin-brand .brand-name { font-size: 1.2rem; font-weight: 700; line-height: 1.25; color: var(--ink); }
.tagline { color: var(--mut); font-size: 0.875rem; font-family: var(--font-mono); }
.signin-card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 24px 22px 8px; }
.signin-card h1 { margin: 0; font-size: 1.875rem; font-weight: 700; line-height: 1.2; color: var(--ink); }
.signin-card p { margin: 12px 0 0; font-size: 1rem; line-height: 1.6; }
.signin-card form { margin: 0; }

/* The box and the label are one 56 px row. The real checkbox is hidden but stays focusable. */
.admin-toggle {
  margin-top: 20px; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  font-size: 1.0625rem; font-weight: 600; color: var(--ink); cursor: pointer;
}
.admin-toggle .box {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border: 2px solid var(--mut); border-radius: 4px; background: var(--card); color: transparent;
}
.admin-toggle .box svg { display: block; }
.admin-check:checked + .admin-toggle { border-color: var(--accent); }
.admin-check:checked + .admin-toggle .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.admin-check:focus-visible + .admin-toggle { outline: 3px solid var(--accent); outline-offset: 2px; }
.signin-card .signin-hint { margin: 10px 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--mut); }
.admin-check:checked ~ .tick-hint { display: none; }
.key-panel { display: none; margin-top: 18px; }
.admin-check:checked ~ .key-panel { display: block; }
.key-label { display: block; font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.key-panel input[type="password"] {
  margin-top: 8px; width: 100%; min-height: 52px; padding: 0 14px;
  background: var(--card); color: var(--ink); border: 1px solid var(--input-line); border-radius: 6px;
  font: 400 1rem var(--font-mono);
}
.signin-alert {
  margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  background: var(--err-bg); border: 1px solid var(--err); border-radius: 6px;
  font-size: 0.9375rem; line-height: 1.5; color: var(--ink);
}
.signin-alert svg { flex: none; margin-top: 1px; color: var(--err); }
.signin-go {
  margin-top: 16px; width: 100%; min-height: 54px; border: 0; border-radius: 6px;
  background: var(--accent); color: var(--on-accent); font: 600 1.0625rem var(--font-body); cursor: pointer;
}
.signin-go:hover { filter: brightness(1.08); }
.signin-back { margin-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.signin-back a { min-height: 52px; display: flex; align-items: center; font-size: 1rem; font-weight: 600; }
@media (max-width: 380px) {
  .signin { padding-left: 14px; padding-right: 14px; }
  .signin-card { padding: 20px 16px 6px; }
}
