:root {
  color-scheme: dark;
  --bg: #080c11;
  --bg-elevated: #0d131b;
  --surface: rgba(17, 24, 34, 0.88);
  --surface-strong: #151e29;
  --border: rgba(148, 163, 184, 0.16);
  --border-active: rgba(94, 234, 212, 0.52);
  --text: #e8eef5;
  --text-soft: #b4c0ce;
  --muted: #8290a2;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-blue: #7dd3fc;
  --code-bg: #070a0f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --font-sans: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text-soft);
  background:
    radial-gradient(circle at 78% -10%, rgba(45, 212, 191, 0.11), transparent 30rem),
    radial-gradient(circle at 32% 105%, rgba(56, 189, 248, 0.08), transparent 34rem),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.72;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: -0.025em;
}

a {
  color: var(--accent-blue);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

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

.wrapper {
  width: 100%;
  max-width: none;
}

.sidebar {
  width: 280px;
  padding: 34px 24px 26px;
  color: var(--text-soft);
  background: rgba(10, 15, 22, 0.9);
  border-right: 1px solid var(--border);
  box-shadow: 18px 0 55px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.about {
  margin: 0;
}

.about .cover-author-image {
  width: 112px;
  height: 112px;
  margin-bottom: 20px;
  padding: 3px;
  background: linear-gradient(145deg, var(--accent), var(--accent-blue));
  box-shadow: 0 0 0 7px rgba(94, 234, 212, 0.06), 0 18px 44px rgba(0, 0, 0, 0.35);
}

.about img {
  border: 3px solid var(--bg-elevated);
  filter: saturate(0.82) contrast(1.05);
}

.about img:hover {
  transform: scale3d(1.03, 1.03, 1);
}

.about .author-name {
  margin-bottom: 17px;
  padding-bottom: 17px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.about .author-name::after {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
}

.about .author-subtitle {
  margin: -5px 0 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.about p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sidebar-profile-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-profile-link i {
  color: var(--accent);
  transition: transform 180ms ease;
}

.sidebar-profile-link:hover i {
  transform: translateX(4px);
}

.content-box {
  gap: 20px;
  padding: 36px 36px 36px 316px;
}

.contact .contact-title {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.contact .contact-title::before,
.contact .contact-title::after {
  height: 1px;
  background: var(--border);
}

.contact ul li {
  vertical-align: middle;
}

.contact ul li a {
  display: inline-flex;
  width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 17px;
  line-height: 1;
}

.contact ul li a .fa {
  display: block;
  line-height: 1;
}

.contact ul li a:hover {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 9px 25px rgba(45, 212, 191, 0.22);
  transform: translateY(-3px);
}

footer .copyright {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.site-nav {
  display: flex;
  margin: 18px 0 24px;
  gap: 4px;
  justify-content: center;
}

.site-nav a {
  padding: 7px 7px;
  color: var(--muted);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  background: rgba(94, 234, 212, 0.07);
}

.sidebar-cta {
  margin: 0 0 22px;
  padding: 15px;
  background: linear-gradient(145deg, rgba(94, 234, 212, 0.07), rgba(56, 189, 248, 0.035));
  border: 1px solid rgba(94, 234, 212, 0.18);
  border-radius: 13px;
}

.sidebar-cta>span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-cta p {
  margin: 7px 0 11px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.sidebar-cta a {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-cta a i {
  color: var(--accent);
  transition: transform 180ms ease;
}

.sidebar-cta a:hover i {
  transform: translateX(4px);
}

.not-found-shell {
  width: 100%;
  max-width: 920px;
  margin: auto;
}

.not-found-header {
  max-width: 680px;
  margin-bottom: 30px;
}

.not-found-meta {
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.not-found-header h1 {
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.not-found-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

.not-found-terminal {
  margin-top: 0;
}

.not-found-terminal .terminal-body {
  padding: 24px 28px;
}

.not-found-actions {
  display: flex;
  margin-top: 24px;
  gap: 10px;
  flex-wrap: wrap;
}

.static-page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.static-page-header {
  max-width: 850px;
  margin: 0 0 42px;
  text-align: left;
}

.static-page-header .page-title {
  margin: 7px 0 14px;
}

.page-kicker,
.cta-eyebrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-lead {
  max-width: 760px;
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(17px, 2.1vw, 22px);
  line-height: 1.55;
}

.static-page-content {
  color: var(--text-soft);
}

.profile-summary {
  max-width: 810px;
  font-size: 17px;
}

.profile-summary strong {
  color: var(--text);
}

.profile-section {
  margin-top: 56px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.focus-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
}

.focus-card:hover {
  background: rgba(94, 234, 212, 0.035);
  border-color: rgba(94, 234, 212, 0.3);
  transform: translateY(-3px);
}

.focus-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.07);
  border: 1px solid rgba(94, 234, 212, 0.16);
  border-radius: 10px;
}

.focus-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.focus-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.research-terminal {
  overflow: hidden;
  background: #060a0e;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.3);
}

.terminal-bar {
  display: flex;
  min-height: 42px;
  padding: 0 15px;
  gap: 7px;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
}

.terminal-bar span {
  width: 8px;
  height: 8px;
  background: #334155;
  border-radius: 50%;
}

.terminal-bar span:first-child {
  background: #fb7185;
}

.terminal-bar span:nth-child(2) {
  background: #fbbf24;
}

.terminal-bar span:nth-child(3) {
  background: #34d399;
}

.terminal-bar strong {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

.terminal-body {
  padding: 20px 22px;
  overflow-x: auto;
}

.terminal-body p {
  margin: 5px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: nowrap;
}

.terminal-key {
  color: var(--accent-blue);
}

.terminal-value {
  color: #a7f3d0;
}

.profile-cta {
  display: flex;
  margin-top: 56px;
  padding: clamp(24px, 4vw, 38px);
  gap: 30px;
  align-items: flex-end;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.075), rgba(56, 189, 248, 0.04));
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 16px;
}

.profile-cta .cta-eyebrow {
  display: block;
  margin-bottom: 2px;
}

.profile-cta h2 {
  max-width: 670px;
  margin: 2px 0 8px;
  font-size: clamp(21px, 3vw, 30px);
}

.profile-cta p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.cta-actions {
  display: flex;
  gap: 9px;
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 16px;
  gap: 9px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.button-primary {
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.button-primary:hover {
  color: var(--bg);
  background: #99f6e4;
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}

.button-secondary:hover {
  color: var(--accent);
  border-color: rgba(94, 234, 212, 0.35);
}

.static-page-content>h2 {
  margin-top: 42px;
  padding-top: 6px;
  font-size: 21px;
}

.static-page-content>blockquote:last-child {
  margin-top: 44px;
  font-size: 13px;
}

.post,
.article-page {
  color: var(--text-soft);
  background: linear-gradient(145deg, rgba(21, 30, 41, 0.93), rgba(13, 19, 27, 0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.post {
  position: relative;
  width: 100%;
  min-height: 13rem;
  margin: 0;
  border-radius: 18px;
  isolation: isolate;
}

.post::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  box-shadow: inset 0 0 0 1px var(--border-active);
  transition: opacity 220ms ease;
}

.post:hover {
  border-color: rgba(94, 234, 212, 0.28);
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.42);
  transform: translateY(-4px);
}

.post:hover::after {
  opacity: 1;
}

.post .post-thumbnail {
  width: 34%;
  min-height: 13rem;
  filter: saturate(0.78) contrast(1.08) brightness(0.82);
  transition: filter 260ms ease, transform 450ms ease;
}

.post:hover .post-thumbnail {
  filter: saturate(1) contrast(1.05) brightness(0.94);
  transform: scale(1.015);
}

.post .post-content {
  display: flex;
  width: 66%;
  padding: 26px 30px;
  flex-direction: column;
  justify-content: center;
}

.post .post-content .post-title {
  margin-bottom: 12px;
  line-height: 1.2;
}

.post .post-content .post-title a {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(23px, 2.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.post .post-content .post-title a:hover {
  color: var(--accent);
}

.post .post-content p {
  color: var(--text-soft);
  font-size: 15px;
}

.post .post-content .post-date,
.post .post-content .post-words,
.header-page .page-date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.article-page {
  overflow: visible;
  border-radius: 18px;
}

.article-page .page-cover-image {
  border-radius: 18px 18px 0 0;
}

.wrap-content {
  padding: clamp(24px, 5vw, 64px);
}

.header-page {
  margin: 8px 0 32px;
}

.header-page .page-title {
  color: var(--text);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 750;
  letter-spacing: -0.045em;
}

.page-cover-image {
  max-height: 560px;
  background: var(--surface-strong);
}

.page-cover-image .page-image {
  filter: saturate(0.86) contrast(1.05) brightness(0.85);
}

.wrap-content p,
.wrap-content li {
  color: var(--text-soft);
}

/* Keep regular post images readable without filling the whole article. */
.wrap-content > p > img {
  display: block;
  width: auto;
  max-width: min(100%, 720px);
  max-height: 72vh;
  margin: 2rem auto;
  object-fit: contain;
}

.wrap-content figure.ring-diagram {
  display: flex;
  width: 100%;
  margin: 2rem 0;
  padding: 0;
  justify-content: center;
}

.wrap-content figure.ring-diagram img {
  display: block;
  width: min(100%, 400px);
  height: auto;
  margin: 0;
}

.wrap-content h2,
.wrap-content h3 {
  margin-top: 1.8em;
  line-height: 1.3;
}

.wrap-content h2 {
  font-size: 1.5em;
}

.wrap-content h3 {
  font-size: 1.25em;
}

.wrap-content .profile-cta h2 {
  margin: 2px 0 8px;
}

blockquote {
  margin: 1.8rem 0;
  padding: 1rem 1.4rem;
  color: var(--text-soft);
  background: rgba(94, 234, 212, 0.045);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
}

blockquote.security-solution-note {
  position: relative;
  padding: 2.4rem 1.4rem 1.15rem;
  color: #cbd5e1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.11), rgba(125, 211, 252, 0.045));
  border: 1px solid rgba(129, 140, 248, 0.24);
  border-left: 3px solid #818cf8;
  border-radius: 0 10px 10px 0;
}

blockquote.security-solution-note::before {
  content: "DEFENSIVE NOTE";
  position: absolute;
  top: 0.85rem;
  left: 1.4rem;
  color: #a5b4fc;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
}

blockquote.security-solution-note a {
  color: #7dd3fc;
}

blockquote.security-solution-note a:hover {
  color: #a5b4fc;
}

code,
kbd,
samp {
  color: #a7f3d0;
  font-family: var(--font-mono);
}

:not(pre)>code {
  padding: 0.12em 0.38em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}

pre {
  color: #d8e4ee;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

pre code {
  color: inherit;
}

/* Editor-style code cards */
.code-card {
  margin: 2rem 0;
  overflow: hidden;
  background: #080c12;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);
}

.code-card__header {
  display: flex;
  min-height: 42px;
  padding: 0 14px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  background: #101720;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}

.code-card__lights {
  display: inline-flex;
  gap: 6px;
}

.code-card__lights i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5f57;
}

.code-card__lights i:nth-child(2) {
  background: #febc2e;
}

.code-card__lights i:nth-child(3) {
  background: #28c840;
}

.code-card__filename {
  color: #c7d2df;
}

.code-card__language {
  margin-left: auto;
  padding: 2px 8px;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.18);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.code-card__copy {
  display: inline-flex;
  min-height: 28px;
  padding: 4px 9px;
  gap: 6px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.code-card__copy:hover,
.code-card__copy.copied {
  color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.35);
}

.code-card__copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.code-card__copy .fa {
  font-size: 11px;
}

.code-card .code-type {
  color: #7dd3fc;
  font-weight: 600;
}

.syntax-preview {
  margin-top: 0.8rem;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.syntax-preview .code-card__header {
  min-height: 46px;
  background: rgba(255, 255, 255, 0.035);
}

.syntax-preview .code-card__filename {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.syntax-preview pre,
.syntax-preview pre.highlight,
.syntax-preview .syntax-preview__code {
  padding: 1.1rem 1.4rem;
  color: #e8eef5;
  background: #080c12;
  font-weight: 500;
}

.syntax-preview__code code {
  color: inherit;
}

.syntax-preview__type {
  color: #67e8f9;
  font-weight: 700;
}

.syntax-preview__function {
  color: #82aaff;
  font-weight: 700;
}

.syntax-preview__annotation {
  color: #f8fafc;
  font-weight: 700;
}

.code-card .highlighter-rouge,
.code-card .highlight,
.code-card pre,
.code-card pre.highlight {
  margin: 0;
  background: #080c12;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.code-card .highlighter-rouge {
  padding: 0;
}

.code-card pre,
.code-card pre.highlight {
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  color: #d8e4ee;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 4;
}

.code-card pre code {
  color: inherit;
  white-space: inherit;
}

/* Rouge syntax colors tuned for the dark theme */
.code-card .highlight .c,
.code-card .highlight .cm,
.code-card .highlight .c1,
.code-card .highlight .cs {
  color: #637083;
  font-style: italic;
}

.code-card .highlight .k,
.code-card .highlight .kc,
.code-card .highlight .kd,
.code-card .highlight .kn,
.code-card .highlight .kp,
.code-card .highlight .kr,
.code-card .highlight .kt {
  color: #c792ea;
}

.code-card .highlight .o,
.code-card .highlight .ow {
  color: #89ddff;
}

.code-card .highlight .m,
.code-card .highlight .mf,
.code-card .highlight .mh,
.code-card .highlight .mi,
.code-card .highlight .mo,
.code-card .highlight .il {
  color: #f78c6c;
}

.code-card .highlight .s,
.code-card .highlight .s1,
.code-card .highlight .s2,
.code-card .highlight .sb,
.code-card .highlight .sc,
.code-card .highlight .sd,
.code-card .highlight .se,
.code-card .highlight .sh,
.code-card .highlight .si,
.code-card .highlight .sx,
.code-card .highlight .sr {
  color: #c3e88d;
}

.code-card .highlight .na,
.code-card .highlight .nf {
  color: #82aaff;
}

.code-card .highlight .nb,
.code-card .highlight .nt {
  color: #f07178;
}

.code-card .highlight .nc,
.code-card .highlight .no {
  color: #ffcb6b;
}

.code-card .highlight .nv,
.code-card .highlight .vc,
.code-card .highlight .vg,
.code-card .highlight .vi {
  color: #d8e4ee;
}

.code-card .highlight .err {
  color: #ff5370;
  background: transparent;
}

@media (max-width: 640px) {

  .code-card pre,
  .code-card pre.highlight {
    padding: 1rem;
    font-size: 12px;
  }
}

table {
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

table td,
table.blueTable th {
  border-color: var(--border);
  padding: 10px 12px;
}

table tr:nth-child(even) {
  background: rgba(255, 255, 255, .025);
}

table thead,
table tfoot {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--border);
}

.page-footer {
  border-color: var(--border);
}

.page-footer .page-share {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-footer .page-share a,
.page-footer .page-share button,
.page-footer .page-tag a {
  display: inline-flex;
  min-height: 34px;
  margin: 0;
  padding: 5px 10px;
  gap: 7px;
  align-items: center;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.045);
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
}

.page-footer .page-share button {
  appearance: none;
  cursor: pointer;
}

.page-footer .page-share a:hover,
.page-footer .page-share button:hover,
.page-footer .page-share button.copied,
.page-footer .page-tag a:hover {
  color: var(--bg);
  background: var(--accent);
  text-decoration: none;
}

.page-footer .page-share button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a.older-posts,
a.newer-posts {
  color: var(--accent);
  font-family: var(--font-mono);
}

::selection {
  color: var(--bg);
  background: var(--accent);
}

::-webkit-scrollbar {
  width: 11px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #263342;
  border: 3px solid var(--bg);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-strong);
}

@media only screen and (min-width: 769px) and (max-height: 760px) {
  .sidebar {
    padding-top: 22px;
    padding-bottom: 18px;
  }

  .about .cover-author-image {
    width: 84px;
    height: 84px;
    margin-bottom: 12px;
  }

  .about .author-name {
    margin-bottom: 13px;
    padding-bottom: 13px;
  }

  .about .author-subtitle {
    margin-bottom: 9px;
  }

  .sidebar-bio {
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.45;
  }

  .site-nav {
    margin: 12px 0 16px;
  }

  .sidebar-cta {
    display: none;
  }
}

@media only screen and (max-width: 992px) {
  .post {
    width: 100%;
    margin: 0;
    flex-direction: row;
  }

  .post .post-thumbnail {
    width: 38%;
  }

  .post .post-content {
    width: 62%;
  }
}

@media only screen and (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    padding: 28px 20px 18px;
    background: rgba(10, 15, 22, 0.94);
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .about {
    margin: 0 auto 20px;
  }

  .content-box {
    gap: 16px;
    padding: 20px 14px 30px;
  }
}

@media only screen and (max-width: 580px) {
  .post {
    width: 100%;
    margin: 0;
    flex-direction: column;
  }

  .post .post-thumbnail {
    width: 100%;
    min-height: 13rem;
  }

  .post .post-content {
    width: 100%;
    padding: 22px;
  }

  .article-page {
    border-radius: 12px;
  }

  .article-page .page-cover-image {
    border-radius: 12px 12px 0 0;
  }

  .focus-grid {
    grid-template-columns: 1fr;
  }

  .profile-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .cta-actions {
    flex-wrap: wrap;
  }

  .button {
    flex: 1 1 auto;
  }

  .not-found-terminal .terminal-body {
    padding: 20px;
  }

  .not-found-actions {
    flex-direction: column;
  }

  .not-found-actions .button {
    width: 100%;
  }

  .terminal-body p {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Article reading-layout refinements */
.article-page {
  width: min(100%, 1320px);
  margin-inline: auto;
}

.page-cover-image {
  height: clamp(240px, 26vw, 320px);
  max-height: none;
}

.page-cover-image figure,
.page-cover-image .page-image {
  width: 100%;
  height: 100%;
}

.page-cover-image .page-image {
  object-fit: cover;
}

.wrap-content {
  --prose-width: 760px;
  --wide-width: 960px;
  padding: clamp(24px, 3.5vw, 48px);
}

.header-page {
  max-width: var(--prose-width);
  margin: 0 auto 30px;
  text-align: left;
}

.header-page .page-title {
  margin: 8px 0 16px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
}

.article-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-page .page-lead {
  max-width: none;
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.6;
}

.article-body > :where(p, h2, h3, h4, h5, h6, ul, ol, blockquote) {
  max-width: var(--prose-width);
  margin-inline: auto;
}

.article-body > p {
  margin-top: 0;
  margin-bottom: 1.35em;
}

.article-body > h2 {
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  font-size: clamp(24px, 2.2vw, 30px);
}

.article-body > h3 {
  margin-top: 2em;
  margin-bottom: 0.65em;
  font-size: clamp(19px, 1.8vw, 23px);
}

.article-body > :where(.code-card, figure, table, pre, .highlighter-rouge) {
  width: min(100%, var(--wide-width));
  margin-right: auto;
  margin-left: auto;
}

.article-body > p > img {
  display: block;
  width: auto;
  max-width: min(100%, 760px);
  max-height: 72vh;
  margin: 2rem auto;
  object-fit: contain;
}

.article-body > p > img.token-screenshot {
  width: min(100%, 480px);
  max-width: 480px;
  height: auto;
}

.article-body figure.ring-diagram img {
  width: min(100%, 500px);
}

.article-rail {
  max-width: var(--prose-width);
  margin: 0 auto 30px;
}

.article-rail__desktop {
  display: none;
}

.article-toc {
  max-width: none;
  margin: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.article-toc__toggle {
  display: flex;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.article-toc__toggle i {
  color: var(--accent);
  transition: transform 180ms ease;
}

.article-toc__toggle[aria-expanded="false"] i {
  transform: rotate(180deg);
}

.article-toc__list {
  margin: 0;
  padding: 0 20px 16px 38px;
}

.article-toc__list[hidden] {
  display: none;
}

.article-toc__list li {
  margin: 5px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.article-toc__list li.toc-level-3 {
  margin-left: 18px;
  font-size: 11px;
}

.article-toc__list a {
  color: var(--text-soft);
  text-decoration: none;
}

.article-toc__list a:hover,
.article-toc__list a.active {
  color: var(--accent);
}

.rail-panel {
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.article-rail__desktop .rail-panel {
  margin-top: 8px;
  padding: 12px 14px;
}

.article-rail .rail-panel__title {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.rail-progress {
  position: relative;
  padding-bottom: 15px !important;
}

.rail-progress__track {
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.rail-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
  border-radius: inherit;
}

.rail-progress__value {
  position: absolute;
  right: 14px;
  top: 11px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
}

.article-code-index__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: code-sample;
}

.article-code-index__list li {
  counter-increment: code-sample;
}

.article-code-index__list a {
  display: grid;
  padding: 5px 0;
  grid-template-columns: 24px minmax(0, 1fr);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  text-decoration: none;
}

.article-code-index__list a::before {
  content: counter(code-sample, decimal-leading-zero);
  color: var(--muted);
}

.article-code-index__list a:hover {
  color: var(--accent);
}

.rail-topics__list,
.rail-share__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rail-topics__list a,
.rail-share__actions a,
.rail-share__actions button {
  display: inline-flex;
  min-height: 28px;
  margin: 0;
  padding: 5px 8px;
  gap: 6px;
  align-items: center;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.045);
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  text-decoration: none;
}

.rail-share__actions button {
  appearance: none;
  cursor: pointer;
}

.rail-topics__list a:hover,
.rail-share__actions a:hover,
.rail-share__actions button:hover,
.rail-share__actions button.copied {
  color: var(--bg);
  background: var(--accent);
}

.research-note {
  max-width: var(--prose-width);
  margin: 1.25rem auto;
  padding: 18px 20px;
  background: rgba(125, 211, 252, 0.035);
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 10px 10px 0;
}

.research-note--mitigation {
  background: rgba(94, 234, 212, 0.035);
  border-color: rgba(94, 234, 212, 0.2);
  border-left-color: var(--accent);
}

.research-note > strong:first-child {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-note ul {
  margin: 0;
  padding-left: 1.2rem;
}

.research-note li {
  margin: 0.4rem 0;
  font-size: 14px;
}

.back-to-top:not([hidden]) {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.back-to-top:hover {
  background: #99f6e4;
}

.post .post-content .post-title a {
  font-size: clamp(22px, 2.1vw, 30px);
}

.post .post-content p {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.content-box > .post {
  max-width: 1200px;
  margin-inline: auto;
}

@media only screen and (min-width: 1400px) {
  .article-page:not(.static-page) .wrap-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    grid-template-areas:
      "header rail"
      "body rail"
      "footer footer"
      "comments comments";
    column-gap: 48px;
    align-items: start;
  }

  .article-page:not(.static-page) .header-page {
    width: min(100%, var(--prose-width));
    margin-right: auto;
    margin-left: 0;
    grid-area: header;
  }

  .article-body {
    min-width: 0;
    grid-area: body;
  }

  .article-body > :where(p, h2, h3, h4, h5, h6, ul, ol, blockquote) {
    margin-right: auto;
    margin-left: 0;
  }

  .article-body > :where(.code-card, figure, table, pre, .highlighter-rouge) {
    width: 100%;
    max-width: var(--wide-width);
    margin-right: 0;
    margin-left: 0;
  }

  .article-rail {
    position: sticky;
    top: 24px;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: visible;
    grid-area: rail;
    align-self: start;
  }

  .article-rail__desktop {
    display: block;
  }

  .article-toc {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .research-note {
    margin-right: auto;
    margin-left: 0;
  }

  .page-footer {
    display: none;
    grid-area: footer;
  }

  .comment-area {
    grid-area: comments;
  }
}

@media only screen and (max-width: 768px) {
  .sidebar {
    padding: 12px 16px;
  }

  .sidebar header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
  }

  .about {
    display: grid;
    margin: 0;
    grid-template-columns: 56px minmax(0, 1fr);
    text-align: left;
  }

  .about .cover-author-image {
    width: 56px;
    height: 56px;
    margin: 0 10px 0 0;
    grid-row: 1 / 3;
  }

  .about img {
    width: 100%;
    height: 100%;
    margin: 0;
  }

  .about .author-name {
    margin: 7px 0 0;
    padding: 0;
    font-size: 12px;
    align-self: end;
  }

  .about .author-name::after,
  .about p,
  .sidebar-profile-link,
  .sidebar footer {
    display: none;
  }

  .about .author-subtitle {
    margin: 2px 0 7px;
    font-size: 9px;
    align-self: start;
  }

  .site-nav {
    margin: 0;
    gap: 2px;
    flex: 0 0 auto;
  }

  .site-nav a {
    padding: 6px 5px;
    font-size: 9px;
  }

  .header-page {
    margin-bottom: 30px;
  }

  .article-rail {
    margin-bottom: 34px;
  }
}

@media only screen and (max-width: 480px) {
  .sidebar header {
    flex-wrap: wrap;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .page-cover-image {
    height: 210px;
  }

  .wrap-content {
    padding: 24px;
  }

  .header-page .page-title {
    font-size: 34px;
  }

  .article-meta {
    font-size: 10px;
  }

  .article-toc__list li.toc-level-3 {
    margin-left: 8px;
  }
}

/* Notables / published research */
.static-page .static-page-header {
  width: 100%;
  max-width: 850px;
  margin: 0 0 42px;
  text-align: left;
}

.notables-overview {
  display: flex;
  margin-bottom: 28px;
  padding: 0 0 28px;
  gap: 40px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.notables-overview__copy {
  max-width: 690px;
}

.notables-eyebrow,
.notable-record__type,
.notable-record__vendor,
.notable-vector > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.notables-overview h2 {
  margin: 6px 0 9px;
  color: var(--text);
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.15;
}

.notables-overview p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.notables-counter {
  display: flex;
  min-width: 130px;
  flex-direction: column;
  align-items: flex-end;
}

.notables-counter strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.notables-counter span {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.notables-list {
  display: grid;
  gap: 20px;
}

.notable-record {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: 220px minmax(0, 1fr);
  background: linear-gradient(145deg, rgba(17, 24, 34, 0.94), rgba(9, 14, 21, 0.98));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.3);
}

.notable-record::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue), transparent 78%);
}

.notable-record__identity {
  position: relative;
  display: flex;
  padding: 28px 24px;
  flex-direction: column;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    rgba(5, 9, 14, 0.72);
  background-size: 24px 24px;
  border-right: 1px solid var(--border);
}

.notable-record__identity > strong {
  margin: 12px 0 20px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.3vw, 27px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.notable-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  gap: 7px;
  align-items: center;
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notable-status i {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

.notable-record__identity time {
  margin-top: auto;
  padding-top: 38px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.notable-record__content {
  padding: clamp(26px, 4vw, 42px);
}

.notable-record__header {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
}

.notable-record__vendor {
  color: var(--accent-blue);
}

.notable-record__header h2 {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--text);
  font-size: clamp(23px, 3vw, 34px);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.severity-badge {
  display: grid;
  min-width: 86px;
  padding: 9px 10px;
  grid-template-columns: 1fr auto;
  align-items: end;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 10px;
}

.severity-badge span {
  grid-column: 1 / -1;
  color: #fcd34d;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.severity-badge strong {
  color: #fde68a;
  font-family: var(--font-mono);
  font-size: 25px;
  line-height: 1;
}

.severity-badge small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.notable-record__summary {
  max-width: 750px;
  margin: 24px 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.72;
}

.notable-facts {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.notable-facts > div {
  min-width: 0;
  padding: 13px 15px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.notable-facts dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.notable-facts dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notable-vector {
  display: flex;
  margin-top: 18px;
  gap: 12px;
  align-items: center;
}

.notable-vector code {
  min-width: 0;
  padding: 6px 8px;
  overflow-x: auto;
  color: #a7f3d0;
  background: #06090e;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
}

.notable-record__actions {
  display: flex;
  margin-top: 28px;
  gap: 9px;
  flex-wrap: wrap;
}

.notable-record__actions .button-secondary span {
  color: var(--muted);
}

.notables-footnote {
  display: flex;
  margin-top: 22px;
  padding: 19px 21px;
  gap: 14px;
  align-items: flex-start;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.014);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.notables-footnote > i {
  margin-top: 2px;
  color: var(--accent);
}

.notables-footnote strong {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notables-footnote p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

@media only screen and (max-width: 760px) {
  .notables-overview {
    gap: 24px;
    align-items: flex-start;
  }

  .notables-counter strong {
    font-size: 38px;
  }

  .notable-record {
    grid-template-columns: 1fr;
  }

  .notable-record__identity {
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .notable-record__identity > strong {
    margin-bottom: 13px;
  }

  .notable-record__identity time {
    margin-top: 14px;
    padding-top: 0;
  }

}

@media only screen and (max-width: 520px) {
  .notables-overview {
    flex-direction: column;
  }

  .notables-counter {
    align-items: flex-start;
  }

  .notable-record__header {
    flex-direction: column;
  }

  .severity-badge {
    min-width: 96px;
  }

  .notable-facts {
    grid-template-columns: 1fr;
  }

  .notable-vector {
    align-items: flex-start;
    flex-direction: column;
  }

  .notable-vector code {
    width: 100%;
  }

  .notable-record__actions {
    flex-direction: column;
  }

  .notable-record__actions .button {
    width: 100%;
  }
}

/* Consistent article thumbnails and full-size image viewer */
.image-viewer__trigger {
  position: relative;
  display: flex;
  width: min(100%, 760px);
  height: 380px;
  margin: 2rem auto;
  padding: 12px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text);
  background: rgba(7, 10, 15, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: zoom-in;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.image-viewer__trigger--compact {
  width: min(100%, 480px);
  height: 360px;
}

.image-viewer__trigger--diagram {
  width: min(100%, 520px);
  height: 380px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.image-viewer__trigger--wide {
  height: 260px;
}

.image-viewer__trigger--ultrawide {
  height: 130px;
}

.image-viewer__trigger::after {
  content: "View full size";
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  color: var(--bg);
  background: rgba(94, 234, 212, 0.92);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.image-viewer__trigger:hover::after,
.image-viewer__trigger:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.image-viewer__trigger:hover {
  border-color: rgba(94, 234, 212, 0.38);
}

.image-viewer__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.image-viewer__trigger img,
.article-body > p > .image-viewer__trigger img,
.article-body figure .image-viewer__trigger img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
}

body.image-lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  width: min(96vw, 1600px);
  max-width: none;
  height: min(94vh, 1000px);
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--text-soft);
  background: #070b10;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.image-lightbox[open] {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 46px;
}

.image-lightbox::backdrop {
  background: rgba(2, 5, 9, 0.88);
  backdrop-filter: blur(7px);
}

.image-lightbox__toolbar {
  display: flex;
  padding: 0 14px 0 18px;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: #0d141d;
  border-bottom: 1px solid var(--border);
}

.image-lightbox__counter {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.image-lightbox__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.image-lightbox__actions button {
  display: inline-flex;
  min-height: 32px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-decoration: none;
  cursor: pointer;
}

.image-lightbox__actions button:hover {
  color: var(--accent);
  border-color: rgba(94, 234, 212, 0.35);
}

.image-lightbox__close {
  width: 34px;
  padding: 0 !important;
  font-size: 22px !important;
}

.image-lightbox__stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  overflow: auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #05080c;
  background-size: 24px 24px;
}

.image-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(94vh - 138px);
  margin: auto;
  object-fit: contain;
  grid-column: 2;
}

.image-lightbox__image.is-actual-size {
  max-width: none;
  max-height: none;
  margin: 0;
  align-self: start;
  justify-self: start;
}

.image-lightbox__previous,
.image-lightbox__next {
  position: sticky;
  display: inline-flex;
  width: 42px;
  height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  background: rgba(13, 20, 29, 0.88);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__previous {
  left: 0;
  grid-column: 1;
}

.image-lightbox__next {
  right: 0;
  grid-column: 3;
}

.image-lightbox__previous:hover,
.image-lightbox__next:hover {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.image-lightbox__caption {
  padding: 0 18px;
  overflow: hidden;
  color: var(--muted);
  background: #0d141d;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 46px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media only screen and (max-width: 768px) {
  .image-viewer__trigger,
  .image-viewer__trigger--compact,
  .image-viewer__trigger--diagram {
    width: 100%;
    height: min(72vw, 340px);
    padding: 8px;
  }

  .image-viewer__trigger::after {
    opacity: 1;
    transform: none;
  }

  .image-lightbox {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .image-lightbox[open] {
    grid-template-rows: 50px minmax(0, 1fr) 42px;
  }

  .image-lightbox__stage {
    padding: 10px;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 5px;
  }

  .image-lightbox__previous,
  .image-lightbox__next {
    width: 34px;
    height: 34px;
    font-size: 24px;
  }

  .image-lightbox__image {
    max-height: calc(100dvh - 112px);
  }

  .image-lightbox__caption {
    padding: 0 10px;
    font-size: 10px;
    line-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}