:root {
  --bg: #0a0b0d;
  --bg-soft: #101216;
  --panel: #14161b;
  --line: #232730;
  --line-bright: #2f3542;
  --text: #e9ebef;
  --muted: #8d94a3;
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, .12);
  --amber: #fbbf24;
  --radius: 12px;
  --max: 880px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 56px 56px fixed,
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 56px 56px fixed,
    radial-gradient(900px 500px at 15% -8%, rgba(74,222,128,.07), transparent 60%) fixed,
    var(--bg);
  color: var(--text);
  font: 16px/1.65 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace; }

/* ---------- nav ---------- */

nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10,11,13,.8);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
nav .brand { font-weight: 600; color: var(--text); }
nav .brand:hover { text-decoration: none; color: var(--accent); }
nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
nav ul a { color: var(--muted); font-size: .9rem; }
nav ul a:hover { color: var(--text); text-decoration: none; }
/* mobile nav handled in the responsive block below */

/* ---------- hero ---------- */

header { padding: 72px 0 48px; }

.id-row { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }

.avatar {
  width: 116px; height: 116px; flex: 0 0 116px;
  border-radius: 50%;
  object-fit: cover;
  /* Portrait source: bias the square crop upward so the face is centred,
     not the chest. */
  object-position: center 20%;
  background: var(--panel);
  padding: 3px;
  border: 1px solid var(--line-bright);
  box-shadow: 0 0 0 1px rgba(74,222,128,.25), 0 8px 28px rgba(0,0,0,.45);
}
@media (max-width: 520px) {
  .avatar { width: 92px; height: 92px; flex: 0 0 92px; }
}
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft);
}

h1 { margin: 0 0 4px; font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; letter-spacing: -.025em; }
.role { margin: 0; color: var(--accent); font-weight: 500; font-size: 1.02rem; }
.loc { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(74,222,128,.35);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px; padding: 4px 12px;
  font-size: .8rem; font-weight: 500;
  margin-bottom: 18px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.summary { margin: 0 0 26px; color: #c3c8d2; max-width: 66ch; }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.links a {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 15px; color: var(--text); font-size: .9rem;
  transition: border-color .18s, color .18s, transform .18s;
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4,1fr); } }

.stat {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 16px;
}
.stat b { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .8rem; }

/* ---------- sections ---------- */

section { padding: 52px 0; border-top: 1px solid var(--line); }

h2 {
  margin: 0 0 28px; font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 12px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- timeline ---------- */

.job {
  position: relative;
  padding: 0 0 30px 26px;
  border-left: 1px solid var(--line);
}
.job:last-child { padding-bottom: 0; border-left-color: transparent; }
.job::before {
  content: ""; position: absolute; left: -5px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-bright);
}
.job.now::before { border-color: var(--accent); background: var(--accent); }

.job h3 { margin: 0 0 2px; font-size: 1.02rem; font-weight: 600; }
.job .co { color: var(--accent); font-size: .92rem; }
.job .when { color: var(--muted); font-size: .82rem; margin: 2px 0 12px; }
.job ul { margin: 0; padding-left: 18px; color: #b8bec9; font-size: .93rem; }
.job li { margin-bottom: 7px; }
.job li::marker { color: var(--line-bright); }

/* ---------- skills ---------- */

.skills { display: grid; gap: 14px; }
@media (min-width: 640px) { .skills { grid-template-columns: 1fr 1fr; } }

.sk {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 18px;
  transition: border-color .18s;
}
.sk:hover { border-color: var(--line-bright); }
.sk h3 { margin: 0 0 10px; font-size: .92rem; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  border: 1px solid var(--line); border-radius: 5px;
  padding: 3px 9px; font-size: .76rem; color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- project ---------- */

.project {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 22px;
  transition: border-color .18s, transform .18s;
}
.project:hover { border-color: var(--line-bright); transform: translateY(-2px); }
.project h3 { margin: 0 0 8px; font-size: 1.05rem; }
.project p { margin: 0 0 16px; color: var(--muted); font-size: .93rem; }

/* ---------- certs ---------- */

.certs { display: grid; gap: 12px; }
@media (min-width: 640px) { .certs { grid-template-columns: 1fr 1fr; } }
.cert {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 15px 18px;
}
.cert .mark {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.cert b { display: block; font-size: .92rem; font-weight: 600; }
.cert span { color: var(--muted); font-size: .8rem; }

/* ---------- contact ---------- */

.contact-card {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(74,222,128,.06), transparent 55%), var(--panel);
  border-radius: var(--radius); padding: 30px;
}
.contact-card p { margin: 0 0 20px; color: var(--muted); max-width: 52ch; }

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 56px; color: var(--muted); font-size: .84rem;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
}

/* ---------- scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ================= additions: a11y, chat, cases, flow ================= */

.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;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--accent); color: #08080a; padding: 10px 16px;
  border-radius: 0 0 8px 0; font-weight: 600;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }

.links a.primary {
  background: var(--accent); color: #08080a; border-color: var(--accent); font-weight: 600;
}
.links a.primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #08080a; }

.lede { margin: -14px 0 24px; color: var(--muted); max-width: 62ch; font-size: .94rem; }
.note { margin: 14px 0 0; color: var(--muted); font-size: .86rem; }

/* ---------- chat ---------- */

.chat-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.chat-head b { display: block; font-size: .95rem; }
.chat-head span { color: var(--muted); font-size: .82rem; }

.mode-btn {
  flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--line-bright); background: transparent; color: var(--text);
  border-radius: 8px; padding: 7px 13px; font-size: .82rem; font-weight: 500;
  font-family: inherit; transition: border-color .18s, color .18s;
}
.mode-btn:hover { border-color: var(--accent); color: var(--accent); }
.mode-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.chat-log {
  padding: 18px; min-height: 190px; max-height: 420px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}

.msg { display: flex; }
.msg p {
  margin: 0; padding: 11px 14px; border-radius: 12px;
  font-size: .93rem; line-height: 1.6; max-width: 84%; white-space: pre-wrap;
}
.msg.bot p { background: var(--bg-soft); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.user { justify-content: flex-end; }
.msg.user p { background: var(--accent-soft); border: 1px solid rgba(74,222,128,.3); border-bottom-right-radius: 4px; }

.msg.thinking p { display: flex; gap: 5px; align-items: center; }
.msg.thinking span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: blink 1.3s ease-in-out infinite;
}
.msg.thinking span:nth-child(2) { animation-delay: .18s; }
.msg.thinking span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

.quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 14px; }
.quick button {
  cursor: pointer; font-family: inherit;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 13px; font-size: .8rem;
  transition: border-color .18s, color .18s;
}
.quick button:hover { border-color: var(--accent); color: var(--accent); }

.chat-form { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0; font-family: inherit; font-size: .92rem;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 10px 13px; outline: none;
}
.chat-form input::placeholder { color: var(--muted); }
.chat-form input:focus { border-color: var(--accent); }
.chat-form button {
  cursor: pointer; font-family: inherit; font-weight: 600; font-size: .9rem;
  border: 1px solid var(--accent); background: var(--accent); color: #08080a;
  border-radius: 8px; padding: 10px 20px; transition: opacity .18s;
}
.chat-form button:disabled { opacity: .45; cursor: default; }

/* ---------- case studies ---------- */

.case {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.case summary {
  cursor: pointer; list-style: none; padding: 16px 18px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  transition: background .18s;
}
.case summary::-webkit-details-marker { display: none; }
.case summary::after {
  content: "+"; margin-left: auto; color: var(--muted); font-size: 1.15rem; line-height: 1;
}
.case[open] summary::after { content: "\2212"; }
.case summary:hover { background: var(--bg-soft); }
.case-name { font-weight: 600; font-size: .98rem; }
.case-where { color: var(--accent); font-size: .82rem; }

.case-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.case-body h4 {
  margin: 16px 0 5px; font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}
.case-body p { margin: 0; color: #b8bec9; font-size: .93rem; }
.case-body .tags { margin-top: 15px; }

/* ---------- pipeline flow ---------- */

.flow-scroll { overflow-x: auto; padding-bottom: 6px; }

.flow {
  display: flex; align-items: stretch; gap: 0;
  list-style: none; margin: 0; padding: 0; min-width: max-content;
}
.flow li {
  position: relative; flex: 0 0 auto;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 9px; padding: 12px 16px; margin-right: 26px;
  min-width: 120px;
}
.flow li:last-child { margin-right: 0; }
.flow li::after {
  content: ""; position: absolute; right: -21px; top: 50%;
  width: 16px; height: 1px; background: var(--line-bright);
}
.flow li:last-child::after { display: none; }
.flow li b { display: block; font-size: .88rem; font-weight: 600; }
.flow li span { color: var(--muted); font-size: .76rem; }
.flow li:nth-child(3) { border-color: rgba(74,222,128,.35); }
.flow li:nth-child(3) b { color: var(--accent); }

@media (max-width: 620px) {
  .chat-log { max-height: 340px; }
  .msg p { max-width: 92%; }
  .chat-head { flex-direction: column; }
}

/* ================= floating AI assistant widget ================= */

.widget {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}

/* ---------- launcher ---------- */

.launcher {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; font-family: inherit; font-size: .89rem; font-weight: 600;
  color: #08080a; background: var(--accent);
  border: none; border-radius: 999px; padding: 12px 20px 12px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 0 1px rgba(74,222,128,.4);
  transition: transform .18s ease, box-shadow .18s ease, background .18s;
}
.launcher:hover { transform: translateY(-2px); background: var(--accent-dim); }
.launcher:active { transform: translateY(0); }

.launcher-ico { display: grid; place-items: center; width: 22px; height: 22px; }
.launcher-ico svg { grid-area: 1 / 1; width: 22px; height: 22px; transition: opacity .18s, transform .18s; }
.ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }

.widget.open .ico-bot { opacity: 0; transform: rotate(90deg) scale(.6); }
.widget.open .ico-close { opacity: 1; transform: none; }
.widget.open .launcher-label { display: none; }
.widget.open .launcher { padding: 13px; }

/* ---------- panel ---------- */

.chat-panel {
  width: min(390px, calc(100vw - 44px));
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform-origin: bottom right;
  animation: pop .22s cubic-bezier(.16,1,.3,1);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.chat-head {
  background: linear-gradient(160deg, rgba(74,222,128,.09), transparent 60%), var(--bg-soft);
}
.chat-id { display: flex; align-items: center; gap: 11px; }
.chat-id b { display: block; font-size: .92rem; line-height: 1.3; }
.chat-id span { color: var(--muted); font-size: .76rem; }

.bot-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(74,222,128,.3);
}
.bot-avatar svg { width: 19px; height: 19px; }

.chat-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.icon-btn {
  display: grid; place-items: center; cursor: pointer;
  width: 30px; height: 30px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); transition: color .18s, border-color .18s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-bright); }

.mode-btn { padding: 6px 11px; font-size: .77rem; }

.chat-log { min-height: 200px; max-height: min(46vh, 380px); }

.chat-form button {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: 0 0 40px; padding: 0; border-radius: 9px;
}
.chat-form button svg { width: 17px; height: 17px; }

.quick button { font-size: .77rem; padding: 5px 11px; }

/* ---------- mobile ---------- */

@media (max-width: 560px) {
  .widget { right: 14px; bottom: 14px; left: 14px; align-items: stretch; }
  .launcher { align-self: flex-end; }
  .chat-panel { width: 100%; }
  .chat-log { max-height: 52vh; }
  .chat-head { flex-direction: row; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-panel { animation: none; }
  .launcher:hover { transform: none; }
}

/* ================= contact + enquiry form ================= */

.contact-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .contact-grid { grid-template-columns: 0.85fr 1.15fr; align-items: start; } }

.contact-list { margin: 20px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .9rem; }
.contact-list dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; padding-top: 2px; }
.contact-list dd { margin: 0; }

.enquiry {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 24px;
}
.enquiry h3 { margin: 0 0 6px; font-size: 1.05rem; }
.form-lede { margin: 0 0 20px; color: var(--muted); font-size: .89rem; }

.row { display: grid; gap: 14px; }
@media (min-width: 520px) { .row { grid-template-columns: 1fr 1fr; } }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: .84rem; font-weight: 500; }
.field label span[aria-hidden] { color: var(--accent); }
.field .opt { color: var(--muted); font-weight: 400; font-size: .78rem; }

.field input, .field textarea {
  width: 100%; font-family: inherit; font-size: .92rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; outline: none;
  transition: border-color .16s;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .65; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field input.invalid, .field textarea.invalid { border-color: #f87171; }

.err { display: block; margin-top: 5px; color: #f87171; font-size: .78rem; min-height: 0; }
.err:empty { display: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.enquiry > button[type="submit"] {
  cursor: pointer; font-family: inherit; font-weight: 600; font-size: .92rem;
  background: var(--accent); color: #08080a; border: none;
  border-radius: 9px; padding: 12px 24px; transition: background .16s, opacity .16s;
}
.enquiry > button[type="submit"]:hover { background: var(--accent-dim); }
.enquiry > button[type="submit"]:disabled { opacity: .5; cursor: default; }

.form-status { margin: 14px 0 0; font-size: .88rem; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--accent); }
.form-status.bad { color: #f87171; }

.enquiry.sent .row, .enquiry.sent .field, .enquiry.sent > button, .enquiry.sent .form-lede { display: none; }
.enquiry.sent .form-status { font-size: .95rem; margin-top: 8px; }

/* ================= multi-page: nav, cards, posts, pager ================= */

nav ul a[aria-current="page"] { color: var(--accent); }

.nav-toggle {
  display: none; cursor: pointer; padding: 8px; margin: -8px -8px -8px 0;
  background: none; border: none;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px; margin: 4px 0;
  background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.page-head { padding: 64px 0 40px; }
.page-head h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 5vw, 2.5rem); letter-spacing: -.025em; }
.page-head .summary { margin: 0; }

h2.plain {
  font-size: 1.05rem; font-weight: 600; text-transform: none;
  letter-spacing: normal; color: var(--text); margin-bottom: 6px;
}
h2.plain::after { display: none; }

/* ---------- explore cards ---------- */

.cards { display: grid; gap: 12px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  display: block; padding: 20px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card b { display: block; margin-bottom: 5px; font-size: .98rem; }
.card span { color: var(--muted); font-size: .89rem; }

/* ---------- blog posts ---------- */

.posts { display: grid; gap: 14px; }

.post {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 22px;
  transition: border-color .18s;
}
.post:hover { border-color: var(--line-bright); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-where {
  font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(74,222,128,.3);
  background: var(--accent-soft); border-radius: 5px; padding: 2px 8px;
}
.post-meta time { color: var(--muted); font-size: .8rem; }
.post h3 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.4; }
.post h3 a { color: var(--text); }
.post h3 a:hover { color: var(--accent); text-decoration: none; }
.post p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }

/* ---------- pagination ---------- */

.pager {
  display: flex; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); padding: 28px 0 8px;
}
.pager a {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 18px;
  color: var(--text); font-size: .9rem; font-weight: 500;
  transition: border-color .18s, color .18s;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager .next { margin-left: auto; }

/* ================= responsive ================= */

@media (max-width: 720px) {
  nav .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; }
  .nav-toggle { display: block; }

  nav ul {
    display: none; flex-direction: column; align-items: flex-start;
    width: 100%; gap: 0; margin-top: 10px;
    border-top: 1px solid var(--line); padding-top: 6px;
  }
  nav ul.open { display: flex; }
  nav ul li { width: 100%; }
  nav ul a { display: block; padding: 11px 2px; font-size: .95rem; }

  .page-head { padding: 44px 0 32px; }
  section { padding: 40px 0; }
  .id-row { gap: 16px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 1.3rem; }
  .links a { flex: 1 1 auto; text-align: center; }
  .pager a { flex: 1; text-align: center; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 16px; }
  .enquiry { padding: 18px; }
  .post, .project, .card { padding: 16px; }
  .case summary { padding: 14px; }
  .case-body { padding: 0 14px 14px; }
}

/* Touch targets: keep interactive elements comfortably tappable. */
@media (hover: none) {
  .quick button { padding: 9px 14px; }
  .links a, .pager a { padding: 12px 18px; }
}

/* ================= client project case studies ================= */

.proj-head { margin-bottom: 14px; }
.proj-meta { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.proj-meta .client {
  color: var(--accent); font-weight: 600;
}

h3.sub {
  margin: 30px 0 8px; font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

/* ---------- tiered VPC diagram ---------- */

.tiers { display: grid; gap: 10px; min-width: 460px; }

.tier {
  position: relative;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 14px 16px;
}
.tier::after {
  content: ""; position: absolute; left: 50%; bottom: -10px;
  width: 1px; height: 10px; background: var(--line-bright);
}
.tier:last-child::after { display: none; }
.tier b { display: block; font-size: .82rem; margin-bottom: 9px; }
.tier.edge { border-color: rgba(74,222,128,.35); }
.tier.edge b { color: var(--accent); }
.tier.db { border-color: var(--line-bright); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span {
  border: 1px solid var(--line-bright); border-radius: 6px;
  padding: 4px 10px; font-size: .78rem; color: #b8bec9;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.side-note {
  margin-top: 16px; border-left: 2px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; padding: 14px 16px;
}
.side-note b { display: block; font-size: .88rem; margin-bottom: 5px; }
.side-note p { margin: 0; color: #b8bec9; font-size: .9rem; }

/* ---------- OU hierarchy diagram ---------- */

.ou-svg { width: 900px; height: auto; display: block; }
.ou-svg .box { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.ou-svg .box.root { fill: var(--accent-soft); stroke: rgba(74,222,128,.4); }
.ou-svg .box.ou { stroke: var(--line-bright); }
.ou-svg .box.prod { stroke: rgba(74,222,128,.4); }
.ou-svg .box.idp { fill: var(--bg-soft); stroke: var(--line-bright); }
.ou-svg .line { stroke: var(--line-bright); stroke-width: 1; fill: none; }
.ou-svg text { font-family: inherit; }
.ou-svg .t-title { fill: var(--accent); font-size: 14px; font-weight: 600; }
.ou-svg .t-sub { fill: var(--muted); font-size: 10.5px; }
.ou-svg .t-ou { fill: #e9ebef; font-size: 12.5px; font-weight: 600; }
.ou-svg .t-scp { fill: var(--muted); font-size: 10px; letter-spacing: .06em; }
.ou-svg .t-acct { fill: #e9ebef; font-size: 11.5px; }
.ou-svg .t-svc { fill: var(--muted); font-size: 9.5px; }

/* ---------- deliverables ---------- */

.deliverables { margin: 0; padding-left: 18px; color: #b8bec9; font-size: .93rem; }
.deliverables li { margin-bottom: 9px; }
.deliverables li b { color: var(--text); font-weight: 600; }
.deliverables li::marker { color: var(--line-bright); }

.contact-card h2.plain { margin-bottom: 8px; }

/* ================= fixes ================= */

/* The hidden attribute must win over any author display rule. Without this,
   .chat-panel{display:flex} and .quick{display:flex} silently override the
   browser default, so the panel rendered on load, the close button appeared
   to do nothing, and the quick chips stayed visible in interview mode. */
[hidden] { display: none !important; }

/* Chat header on phones: the subtitle wrapped to three lines and shoved the
   controls off-centre. The greeting in the log already makes the same point. */
@media (max-width: 560px) {
  .chat-id span { display: none; }
  .chat-id b { font-size: .95rem; }
  .chat-head { padding: 12px 14px; }
  .mode-btn { padding: 7px 10px; font-size: .75rem; }
}

/* ================= architecture diagram decks ================= */

.carousel { margin: 6px 0 4px; }

.carousel-stage {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 16px 4px;
}

.slide { margin: 0; animation: slide-in .32s ease both; }
@keyframes slide-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .slide { animation: none; } }

/* Wide diagrams scroll inside their own box — the page never scrolls sideways. */
.slide-art { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
svg.arch { display: block; width: 100%; min-width: 660px; height: auto; }

.slide figcaption {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding: 12px 2px 14px;
}
.slide figcaption b { display: block; font-size: .92rem; margin-bottom: 4px; }
.slide figcaption span { color: var(--muted); font-size: .88rem; line-height: 1.55; }

.carousel-bar { display: flex; align-items: center; gap: 10px; padding: 12px 2px 0; }

.c-nav {
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line-bright); border-radius: 9px;
  background: var(--panel); color: var(--text);
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.c-nav:hover { border-color: var(--accent); color: var(--accent); }
.c-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.c-dots { display: flex; gap: 7px; flex: 1; }
.c-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-bright); background: transparent;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.c-dot:hover { border-color: var(--accent); }
.c-dot.on { background: var(--accent); border-color: var(--accent); }
.c-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.c-count { color: var(--muted); font-size: .78rem; flex: none; font-variant-numeric: tabular-nums; }
.c-count b { color: var(--text); font-weight: 600; }

/* ---------- diagram primitives (inherit theme tokens) ---------- */

svg.arch text { font-family: inherit; }
.d-box { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.d-box.hi { fill: var(--accent-soft); stroke: rgba(74, 222, 128, .42); }
.d-box.edge { stroke: rgba(74, 222, 128, .42); }
.d-box.db { stroke: var(--line-bright); }
.d-cloud { fill: none; stroke: var(--line-bright); stroke-width: 1; stroke-dasharray: 5 5; }
.d-vpc { fill: none; stroke: var(--line-bright); stroke-width: 1; }
.d-az { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.d-line { stroke: var(--line-bright); stroke-width: 1; fill: none; }
.d-head { fill: var(--line-bright); }
.d-cap { fill: var(--accent); font-size: 12px; font-weight: 600; }
.d-vpc-t { fill: #b8bec9; font-size: 11px; font-weight: 600; }
.d-t { fill: #e9ebef; font-size: 11.5px; font-weight: 600; }
.d-s { fill: var(--muted); font-size: 9.5px; }

/* ---------- rule tables shown as diagram slides ---------- */

.rules { overflow-x: auto; }
.rules table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: .86rem; }
.rules th {
  text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--line-bright);
  color: var(--accent); font-size: .74rem;
  letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}
.rules td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: #b8bec9; vertical-align: top; }
.rules tr:last-child td { border-bottom: 0; }
.rules td b { color: var(--text); }
.rules-note { margin: 14px 2px 0; color: var(--muted); font-size: .86rem; line-height: 1.6; }

@media (max-width: 560px) {
  .carousel-stage { padding: 12px 12px 4px; }
  .c-count { display: none; }
}

/* ================= nav brand mark ================= */

nav .brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-img {
  width: 32px; height: 32px; flex: none;
  border-radius: 50%; object-fit: cover; object-position: center 22%;
  border: 1px solid var(--line-bright);
}
.brand-mono {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
}
nav .brand:hover .brand-img { border-color: var(--accent); }

@media (max-width: 380px) {
  nav .brand span { display: none; }
}

/* ================= services ================= */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.svc {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0 0 18px;
  overflow: hidden;
  transition: border-color .18s, transform .18s;
}
.svc:hover { border-color: var(--line-bright); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .svc:hover { transform: none; } }

.svc-head {
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px 10px;
}
.svc-art { display: block; width: 100%; height: auto; }

.svc h3 { margin: 16px 18px 8px; font-size: 1rem; line-height: 1.35; }
.svc > p { margin: 0 18px; color: var(--muted); font-size: .9rem; line-height: 1.6; }

.svc-list {
  margin: 14px 18px 0;
  padding-left: 20px;
  color: #b8bec9;
  font-size: .88rem;
}
.svc-list li { margin-bottom: 6px; padding-left: 2px; }
.svc-list li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }

.svc-more {
  margin: 16px 18px 0 18px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 16px;
  font-size: .87rem;
  font-weight: 500;
}
.svc-more span { display: inline-block; transition: transform .18s; }
.svc:hover .svc-more span { transform: translateX(3px); }

/* ---------- service illustration primitives ---------- */

.a-box { fill: var(--panel); stroke: var(--line-bright); stroke-width: 1; }
.a-box.on { fill: var(--accent-soft); stroke: rgba(74, 222, 128, .5); }
.a-fill { fill: var(--accent-soft); }
.a-cloud { fill: var(--accent-soft); stroke: none; }
.a-stroke { stroke: var(--line-bright); stroke-width: 1.5; fill: none; }
.a-stroke2 { stroke: rgba(74, 222, 128, .55); stroke-width: 1.5; fill: none; }
.a-dash { stroke: var(--line-bright); stroke-width: 1; fill: none; stroke-dasharray: 3 3; }
.a-axis { stroke: var(--line); stroke-width: 1; fill: none; }
.a-line { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.a-dot { fill: var(--accent); }
.a-alert { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .55; }
.a-tick { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.a-lock { fill: none; stroke: rgba(74, 222, 128, .7); stroke-width: 1.5; }
.a-head { fill: var(--line-bright); }
.a-t { fill: var(--accent); font-family: inherit; font-size: 10px; font-weight: 600; }
