/* Security Console theme. Dark first; light "daylight" mode via toggle or OS setting.
   Layout: one centred column, sticky console header, sections as terminal panels. */
:root {
  --bg: #0B0F14; --panel: #121922; --panel2: #18212C; --line: #223040;
  --ink: #D5E1EA; --strong: #FFFFFF; --muted: #8394A3;
  --accent: #5FD4E8; --warn: #F5B547; --ok: #3DDC97; --bad: #FF7A6B;
  --glow: rgba(95, 212, 232, .22);
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F3F6F8; --panel: #FFFFFF; --panel2: #E7EDF2; --line: #D3DCE4;
    --ink: #1B2733; --strong: #0B0F14; --muted: #586979;
    --accent: #0B7A90; --warn: #9A5B00; --ok: #17834F; --bad: #B83A2B;
    --glow: rgba(11, 122, 144, .15); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F3F6F8; --panel: #FFFFFF; --panel2: #E7EDF2; --line: #D3DCE4;
  --ink: #1B2733; --strong: #0B0F14; --muted: #586979;
  --accent: #0B7A90; --warn: #9A5B00; --ok: #17834F; --bad: #B83A2B;
  --glow: rgba(11, 122, 144, .15); color-scheme: light;
}
/* Colour of the week: accent only */
:root[data-palette="matrix"] { --accent: #3DDC97; --glow: rgba(61, 220, 151, .2); }
:root[data-palette="amber"]  { --accent: #F5B547; --glow: rgba(245, 181, 71, .2); }
:root[data-palette="violet"] { --accent: #B49CFF; --glow: rgba(180, 156, 255, .22); }
:root[data-palette="coral"]  { --accent: #FF8A7A; --glow: rgba(255, 138, 122, .2); }
@media (prefers-color-scheme: light) {
  :root[data-palette="matrix"]:not([data-theme="dark"]) { --accent: #17834F; }
  :root[data-palette="amber"]:not([data-theme="dark"])  { --accent: #9A5B00; }
  :root[data-palette="violet"]:not([data-theme="dark"]) { --accent: #5B44C4; }
  :root[data-palette="coral"]:not([data-theme="dark"])  { --accent: #B83A2B; }
}
:root[data-palette="matrix"][data-theme="light"] { --accent: #17834F; }
:root[data-palette="amber"][data-theme="light"]  { --accent: #9A5B00; }
:root[data-palette="violet"][data-theme="light"] { --accent: #5B44C4; }
:root[data-palette="coral"][data-theme="light"]  { --accent: #B83A2B; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1.02rem; line-height: 1.65;
  padding-inline: 16px; padding-block: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 28px 28px;
  transition: background-color .4s ease, color .4s ease;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--accent); color: var(--bg); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding-block: 24px 64px; display: grid; gap: 72px; }

/* Console header */
.consolebar {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px;
  font-family: var(--mono); font-size: .82rem;
}
.prompt { color: var(--ink); text-decoration: none; white-space: nowrap; }
.prompt b { color: var(--accent); font-weight: 500; }
.prompt i { color: var(--muted); font-style: normal; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav a::before { content: "/"; color: var(--muted); }
.bar-right { display: flex; align-items: center; gap: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--warn); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); position: relative; display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 1.8s ease-out infinite; }
  @keyframes ping { from { transform: scale(1); opacity: .6; } to { transform: scale(2.8); opacity: 0; } }
}
.icon-btn { font: 500 .78rem var(--mono); color: var(--ink); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Hero */
.hero { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 24px; }
@media (max-width: 820px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; justify-items: start; } }
.avatar { width: 100%; max-width: 280px; aspect-ratio: 1; border-radius: 50%; padding: 6px; border: 2px solid var(--accent); box-shadow: 0 0 40px var(--glow); }
@media (max-width: 820px) { .avatar { max-width: 200px; } }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.hero-text { display: grid; gap: 16px; min-width: 0; }
.comment { font-family: var(--mono); font-size: .82rem; color: var(--muted); }
h1 { font-family: var(--sans); font-weight: 700; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: -.02em; margin: 0; color: var(--strong); text-wrap: balance; }
.cmd { font-family: var(--mono); font-size: clamp(1.15rem, 2.6vw, 1.6rem); margin: 0; color: var(--ink); }
.cmd .gt { color: var(--muted); }
.cmd .str { color: var(--warn); }
.cursor { display: inline-block; width: .55em; height: 1.05em; background: var(--accent); vertical-align: -.15em; margin-left: 2px; }
@media (prefers-reduced-motion: no-preference) { .cursor { animation: blink 1.1s steps(1) infinite; } @keyframes blink { 50% { opacity: 0; } } }
.lead { font-size: 1.2rem; line-height: 1.6; margin: 0; max-width: 58ch; color: var(--ink); }
.lead strong { color: var(--strong); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--mono); font-size: .8rem; background: var(--panel); border: 1px solid var(--line); color: var(--ok); padding: 5px 10px; border-radius: 5px; text-decoration: none; }
a.chip:hover { border-color: var(--ok); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono); font-size: .82rem; color: var(--muted); align-items: center; }
.email { color: var(--ink); user-select: all; }
.toast { font-family: var(--mono); font-size: .78rem; color: var(--accent); min-height: 1.2em; }

/* Section heads */
section { display: grid; gap: 22px; min-width: 0; }
.sh { display: grid; gap: 6px; }
.sh .cmdline { font-family: var(--mono); font-size: .82rem; color: var(--muted); }
.sh .cmdline b { color: var(--accent); font-weight: 500; }
h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.1rem); line-height: 1.15; margin: 0; color: var(--strong); text-wrap: balance; }
h3 { font-family: var(--sans); font-weight: 700; font-size: 1.1rem; margin: 0; color: var(--strong); }
p { margin: 0; }
.prose { max-width: 66ch; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.panel-head { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.panel-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
.panel-head span { margin-left: 8px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 18px 20px; display: grid; gap: 4px; }
.stat .k { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.stat b { font-family: var(--mono); font-size: 2.6rem; line-height: 1.05; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { font-size: .86rem; color: var(--ink); }

/* now.log */
.log { padding: 16px 20px; font-family: var(--mono); font-size: .92rem; line-height: 1.9; display: grid; gap: 2px; }
.log .row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .log .row { grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 8px; } }
.tag-build { color: var(--ok); } .tag-explore { color: var(--accent); } .tag-write { color: var(--warn); }
.log .row span:last-child { font-family: var(--sans); color: var(--ink); line-height: 1.6; padding-top: 2px; }

/* Approach */
.focus { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; }
@media (max-width: 640px) { .focus { grid-template-columns: minmax(0, 1fr); } }
.focus li { padding-left: 26px; position: relative; }
.focus li::before { content: "✓"; position: absolute; left: 0; top: 0; font-family: var(--mono); color: var(--ok); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--mono); font-size: .78rem; padding: 4px 10px; border-radius: 5px; background: var(--panel2); color: var(--ink); }

/* Career as a commit log */
.gitlog { list-style: none; margin: 0; padding: 18px 20px 18px 20px; display: grid; gap: 26px; position: relative; --p: 1; }
.gitlog::before, .gitlog::after { content: ""; position: absolute; left: 151px; top: 26px; bottom: 26px; width: 2px; }
.gitlog::before { background: var(--line); }
.gitlog::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--p)); }
.gitlog li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 36px; position: relative; }
.gitlog li::before { content: ""; position: absolute; left: 126px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 2px var(--accent); z-index: 1; }
.gitlog .when { font-family: var(--mono); font-size: .8rem; color: var(--warn); padding-top: 2px; font-variant-numeric: tabular-nums; }
.gitlog .org { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-top: 2px; }
.gitlog p { margin-top: 8px; font-size: .96rem; }
@media (max-width: 600px) {
  .gitlog { padding-left: 38px; }
  .gitlog::before, .gitlog::after { left: 19px; }
  .gitlog li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .gitlog li::before { left: -25px; }
}

/* Cards */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 680px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.card { padding: 22px; display: grid; gap: 8px; align-content: start; }
.card .k { font-family: var(--mono); font-size: .74rem; color: var(--warn); letter-spacing: .06em; }
.card p { font-size: .96rem; }
a.card { color: inherit; text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s; }
a.card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 30px var(--glow); }
@media (prefers-reduced-motion: no-preference) { a.card:hover { transform: translateY(-2px); } }
.big-title { font-size: 1.45rem; line-height: 1.25; }
.go { font-family: var(--mono); font-size: .84rem; color: var(--accent); }

/* Certifications */
.certs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 680px) { .certs { grid-template-columns: minmax(0, 1fr); } }
.cert { padding: 20px; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; align-items: center; }
.badge-link { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 14px; background: #EEF3F6; transition: transform .2s; }
@media (prefers-reduced-motion: no-preference) { .badge-link:hover { transform: scale(1.05); } }
.badge { width: 70px; height: 70px; object-fit: contain; display: block; }
.cert b { font-family: var(--mono); font-size: 1.15rem; color: var(--strong); display: block; }
.cert span { font-size: .84rem; color: var(--muted); line-height: 1.4; display: block; }
.cert .ok { font-family: var(--mono); font-size: .74rem; color: var(--ok); margin-top: 4px; }

/* Footer */
.foot { display: grid; gap: 14px; }
.disclaimer { font-size: .86rem; color: var(--muted); }
.signoff { font-family: var(--mono); font-size: .76rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.palette { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.palette button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Motion */
.reveal { transition: opacity .7s ease, transform .7s ease; }
.reveal.pending { opacity: .25; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal.pending { opacity: 1; transform: none; transition: none; } }
.scrollbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.scrollbar span { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent); transform-origin: left; transform: scaleX(0); }
.rot { display: inline-block; }
.rot.out { animation: wordout .3s ease-in forwards; }
.rot.in { animation: wordin .35s ease-out; }
@keyframes wordout { to { opacity: 0; transform: translateY(-.3em); } }
@keyframes wordin { from { opacity: 0; transform: translateY(.3em); } to { opacity: 1; transform: none; } }

/* Article page */
.article-page .col { max-width: 720px; margin: 0 auto; padding-block: 24px 72px; display: grid; gap: 30px; }
.article-page .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: .82rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.article-page .top .home { color: var(--ink); text-decoration: none; }
.article-page .eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.article-page .standfirst { font-size: 1.3rem; line-height: 1.5; color: var(--muted); margin: 0; }
.article-page .byline { display: flex; align-items: center; gap: 14px; }
.article-page .byline img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.article-page .who { font-weight: 700; color: var(--strong); line-height: 1.3; }
.article-page .meta { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.article-page article { display: grid; gap: 20px; font-size: 1.06rem; line-height: 1.78; }
.article-page article h2 { margin-top: 18px; font-size: 1.55rem; }
.article-page article h2::before { content: "## "; font-family: var(--mono); color: var(--accent); font-size: .8em; }
.article-page article h3 { margin-top: 4px; }
.article-page article ul, .article-page article ol { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.article-page article strong { color: var(--strong); }
.article-page .pull { margin: 6px 0; padding: 22px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 1.25rem; line-height: 1.45; font-weight: 500; color: var(--strong); }
.article-page .pull span { color: var(--accent); }
.article-page .end { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; display: grid; gap: 8px; font-size: .95rem; }
.article-page .end strong { font-size: 1.1rem; color: var(--strong); }

/* Quick check page */
.tool-page .wrap { gap: 32px; }
.tool-page .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: .82rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.tool-page .top .home { color: var(--ink); text-decoration: none; }
.tool-page .eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.tool-page .intro { color: var(--muted); max-width: 60ch; margin: 0; font-size: 1.05rem; }
.tool-page .layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
@media (max-width: 860px) { .tool-page .layout { grid-template-columns: minmax(0, 1fr); } }
.tool-page ol.qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tool-page .q { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.tool-page .q fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
.tool-page .q legend { font-weight: 600; padding: 0; color: var(--strong); }
.tool-page .qn { font-family: var(--mono); font-size: .74rem; color: var(--warn); font-weight: 400; }
.tool-page .seg { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-page .seg label { position: relative; }
.tool-page .seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tool-page .seg span { display: inline-block; padding: 7px 16px; border-radius: 6px; font-family: var(--mono); font-size: .84rem; background: var(--panel2); border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: background .2s, color .2s; }
.tool-page .seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.tool-page .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-page .score { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 24px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: grid; gap: 14px; }
@media (max-width: 860px) { .tool-page .score { position: static; } }
.tool-page .dial { width: 150px; height: 150px; justify-self: center; }
.tool-page .dial circle { fill: none; stroke-width: 12; }
.tool-page .dial .track { stroke: var(--line); }
.tool-page .dial .bar { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s ease, stroke .4s; }
.tool-page .dial text { fill: var(--strong); font-family: var(--mono); font-weight: 700; font-size: 34px; }
.tool-page .dial .of { fill: var(--muted); font-weight: 400; font-size: 11px; }
.tool-page .band { text-align: center; font-weight: 700; font-size: 1.25rem; color: var(--strong); }
.tool-page .band small { display: block; font-family: var(--mono); font-size: .72rem; font-weight: 400; color: var(--muted); }
.tool-page .progress { font-family: var(--mono); font-size: .76rem; color: var(--muted); text-align: center; }
.tool-page .tips { display: grid; gap: 10px; }
.tool-page .tips ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.tool-page .btn { font: 500 .82rem var(--mono); color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 6px; padding: 6px 14px; cursor: pointer; justify-self: center; }
.tool-page .btn:hover { background: var(--accent); color: var(--bg); }
.tool-page .note { font-size: .84rem; color: var(--muted); }
:root { --good: var(--ok); --mid: var(--warn); --low: var(--bad); }
@media (max-width: 640px) { .consolebar { position: static; } html { scroll-padding-top: 12px; } }
