/* ══════════════════════════════════════════════════════
   demo.css
   Blog-style design demo — monochrome + terminal aesthetic
   Dark / light mode via [data-theme] on <html>
   ══════════════════════════════════════════════════════ */

/* ── Design tokens ── */
:root {
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: Consolas, Monaco, 'Courier New', monospace;

  /* Dark (default) */
  --bg:           #161616;
  --bg-surface:   #1a1a1a;
  --bg-sidebar:   #181818;
  --bg-hover:     rgba(255, 255, 255, 0.03);
  --border:       #2c2c2c;
  --border-mid:   #3d3d3d;
  --text:         #c9d1d9;
  --text-dim:     #a0aab4;
  --text-faint:   #8a97a5;
  --accent:       #39d353;
  --accent-dim:   rgba(57, 211, 83, 0.12);
  --critical:     #f85149;
  --high:         #e3b341;
  --medium:       #58a6ff;
}

[data-theme="light"] {
  --bg:           #f0f0eb;
  --bg-surface:   #fafaf7;
  --bg-sidebar:   #ebebe6;
  --bg-hover:     rgba(0, 0, 0, 0.03);
  --border:       #c8c8c2;
  --border-mid:   #b0b0aa;
  --text:         #1a1a1a;
  --text-dim:     #3a3a3a;
  --text-faint:   #7a7a7a;
  --accent:       #1a7f37;
  --accent-dim:   rgba(26, 127, 55, 0.08);
  --critical:     #d1242f;
  --high:         #9a6700;
  --medium:       #0969da;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

body:not(.is-home) p,
body:not(.is-home) li {
  font-family: var(--sans);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ── Site frame ── */
.site-frame {
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 2.5rem);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* ══════════════════════
   PALETTE SWATCHES
   ══════════════════════ */
.palette-swatches {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.4rem;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: var(--sw);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.15s, border-color 0.15s;
}

.swatch:hover {
  transform: scale(1.3);
}

.swatch.active {
  border-color: var(--text);
  transform: scale(1.25);
}

/* ══════════════════════
   TOPBAR
   ══════════════════════ */
.topbar {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-surface);
  transition: background 0.2s ease;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.25rem;
}

.topbar-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.tl {
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color 0.15s;
  position: relative;
}

.tl:hover {
  color: var(--text);
}

.tl.active {
  color: var(--accent);
  font-weight: 500;
}

/* Green dot prefix on active link */
.tl.active::before {
  content: none;
}

.topbar-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--text);
}

/* ══════════════════════
   CONTENT GRID
   ══════════════════════ */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 230px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.content-grid:not(:has(.sidebar)) {
  grid-template-columns: 1fr;
}
.content-grid::-webkit-scrollbar {
  width: 5px;
}
.content-grid::-webkit-scrollbar-track {
  background: transparent;
}
.content-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.content-grid::-webkit-scrollbar-thumb:hover {
  opacity: 0.75;
}

/* ── Posts column ── */
.posts-col {
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow: visible;
}
.content-grid:not(:has(.sidebar)) .posts-col {
  border-right: none;
}
.exp-posts-col {
  overflow-y: auto;
  min-height: 0;
}
#page-experience {
  overflow-y: hidden;
}
#page-experience .exp-posts-col {
  overflow-y: auto;
}
.exp-posts-col::-webkit-scrollbar {
  width: 5px;
}
.exp-posts-col::-webkit-scrollbar-track {
  background: transparent;
}
.exp-posts-col::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.exp-posts-col::-webkit-scrollbar-thumb:hover {
  opacity: 0.75;
}

/* ── Sidebar ── */
.sidebar {
  padding: 1.5rem;
  background: var(--bg-sidebar);
  overflow-y: auto;
  transition: background 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  opacity: 0.75;
}

/* ── Section label ── */
.col-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

/* ══════════════════════
   POST ROWS
   ══════════════════════ */
.post-row {
  display: flex;
  gap: 1.2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.post-row:first-of-type {
  padding-top: 0;
}

.post-row:hover {
  background: var(--bg-hover);
}

/* Date block */
.post-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 52px;
  padding-top: 3px;
  user-select: none;
}

.pd-day {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.03em;
}

.pd-mon {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Post content */
.post-body {
  flex: 1;
  min-width: 0;
}

.post-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.post-title a {
  color: var(--accent);
  transition: opacity 0.15s;
}

.post-title a:hover {
  opacity: 0.72;
}

.post-excerpt {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 0.65rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Shared badge + severity (same as main site pattern) */
.badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  padding: 0.15rem 0.4rem;
}

.severity {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
}

.severity.critical { color: var(--critical); border: 1px solid var(--critical); }
.severity.high     { color: var(--high);     border: 1px solid var(--high);     }
.severity.medium   { color: var(--medium);   border: 1px solid var(--medium);   }

.post-prog {
  font-size: 0.6rem;
  color: var(--text-faint);
  margin-left: auto;
}

/* ══════════════════════
   PAGINATION (sidebar block)
   ══════════════════════ */
.pg-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}

.pg-btn {
  font-family: var(--mono);
  font-size: 0.65rem;
  background: none;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  cursor: pointer;
  min-width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}

.pg-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.pg-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.pg-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ══════════════════════
   SIDEBAR BLOCKS
   ══════════════════════ */
.sb-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sb-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sb-text {
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.sb-name {
  color: var(--text);
  font-weight: 600;
}

/* Terminal prompt line in sidebar */
.sb-prompt {
  font-size: 0.68rem;
  color: var(--text-faint);
}

.prompt-char {
  color: var(--accent);
  margin-right: 0.3em;
  font-weight: 600;
}

.prompt-ans {
  color: var(--text-faint);
  font-style: italic;
}

/* Experience */
.sb-exp {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.sb-exp-dot {
  color: var(--accent);
  flex-shrink: 0;
  font-size: 0.75rem;
  margin-top: 2px;
}

.sb-exp-date {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.sb-exp-role {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Badge Preview */
#badge-preview-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 162px;
  padding: 1rem;
  background: var(--bg-dim);
  border-radius: 8px;
  transition: all 0.3s ease;
}

#badge-preview-img {
  max-width: 100%;
  max-height: 100%;
  width: 144px;
  height: 144px;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

#badge-preview-text {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-faint);
  margin: 0;
}

.sb-exp-role a {
  color: var(--accent);
  transition: opacity 0.15s;
}

.sb-exp-role a:hover {
  opacity: 0.75;
}

/* About intro row: name+quote left, photo right */
.about-intro {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 0;
}

.about-intro-text {
  flex: 1;
  min-width: 0;
}

/* Profile picture placeholder */
.profile-pic-placeholder {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  border: 1px dashed var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.profile-pic {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
}

.profile-pic-label {
  font-size: 0.6rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Cert badges */
.cert-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cert-tag {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  padding: 0.2rem 0.45rem;
  cursor: default;
  transition: border-color 0.15s, color 0.15s;
}

.cert-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ══════════════════════
   CERT ROW EXPAND (inline badge preview)
   ══════════════════════ */
.cert-expand-row td {
  padding: 0 !important;
  border-bottom: none;
}

.cert-expand-row.active td {
  border-bottom: 1px solid var(--border);
}

.cert-expand-inner {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.cert-expand-row.active .cert-expand-inner {
  max-height: 240px;
}

.cert-expand-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
}

.cert-expand-row.active .cert-expand-content {
  padding: 1.1rem 0.75rem;
}

.cert-expand-img {
  max-height: 190px;
  max-width: 100%;
  object-fit: contain;
}

/* Stats grid */
.sb-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.stat-box {
  border: 1px solid var(--border);
  padding: 0.65rem 0.4rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 0.55rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ══════════════════════
   FOOTER
   ══════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 0.7rem 1.25rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--text-dim);
  transition: color 0.15s;
}

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

.f-sep {
  color: var(--border-mid);
}

/* ══════════════════════
   ABOUT PAGE
   ══════════════════════ */
.about-name {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.name-swap {
  position: relative;
  display: inline-block;
  cursor: default;
}

.name-real,
.name-handle {
  display: inline-block;
  transition: opacity 0.2s ease;
}

.name-handle {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  opacity: 0;
  white-space: nowrap;
}

.name-swap:hover .name-real  { opacity: 0; }
.name-swap:hover .name-handle { opacity: 1; }

.about-accent {
  color: var(--accent);
}

.about-quote {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--accent);
  line-height: 1.6;
  margin-bottom: 1.4rem;
  opacity: 0.9;
}

.about-bio {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 0.75rem;
  max-width: 54ch;
}

/* Terminal block */
.about-terminal {
  font-family: var(--mono);
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
  margin: 1.5rem 0 2rem;
  background: var(--bg);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.about-terminal p {
  font-size: 0.7rem;
  line-height: 2;
}

.t-dim {
  color: var(--text-faint);
  margin-right: 0.5rem;
}

.t-light {
  color: var(--text);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor-blink {
  color: var(--accent);
  animation: blink 1.1s step-start infinite;
}

/* About sections */
.about-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.about-section:last-child {
  border-bottom: none;
}

.about-contact-line {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.about-contact-line a {
  color: var(--accent);
  transition: opacity 0.15s;
}

.about-contact-line a:hover {
  opacity: 0.72;
}

.contact-sep {
  color: var(--text-faint);
}

/* Experience list */
.about-exp-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-exp-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.about-exp-dot {
  color: var(--accent);
  flex-shrink: 0;
  font-size: 0.75rem;
  margin-top: 2px;
}

.about-exp-body {
  flex: 1;
}

.about-exp-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.about-exp-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.about-exp-date {
  color: var(--text-faint);
  margin-left: 0.5rem;
}

.about-exp-desc {
  font-size: 0.68rem;
  color: var(--text-faint);
  line-height: 1.65;
}

/* Sidebar links block */
.about-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.about-link {
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: color 0.15s;
}

.about-link:hover {
  color: var(--accent);
}

/* ══════════════════════
   EXPERIENCE / EDUCATION ROWS
   ══════════════════════ */
.exp-row {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.exp-row:last-child { border-bottom: none; }
.exp-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.exp-meta {
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.exp-date {
  color: var(--accent);
  font-weight: 500;
}
.exp-list {
  margin: 0;
  padding-left: 1.2rem;
  list-style: none;
}
.exp-list li {
  font-size: 0.7rem;
  color: var(--text-faint);
  line-height: 1.65;
  margin-bottom: 0.25rem;
  position: relative;
}
.exp-list li::before {
  content: '▸';
  color: var(--accent);
  position: absolute;
  left: -1rem;
  font-size: 0.65rem;
  top: 0.1rem;
}

/* ══════════════════════
   LAB PLATFORM CARDS
   ══════════════════════ */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding-top: 0.5rem;
}
.platform-card {
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.platform-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.platform-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.platform-card-url {
  font-size: 0.8rem;
  color: var(--accent);
}
.platform-card-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* ══════════════════════
   CERT ROW LIST
   ══════════════════════ */
.cert-section-heading {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.25rem 0 0.5rem;
}

/* ══════════════════════
   CERT TABS + TABLE
   ══════════════════════ */
.cert-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  margin-top: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cert-tabs::-webkit-scrollbar {
  display: none;
}

.cert-tab {
  font-family: var(--mono);
  font-size: 0.68rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0.5rem 1rem 0.45rem;
  margin-bottom: -1px;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.cert-tab:hover {
  color: var(--text-dim);
}

.cert-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cert-panel {
  display: none;
}

.cert-panel.active {
  display: block;
}

/* Custom scrollbar for WebKit browsers */
.cert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.cert-table thead tr {
  border-bottom: 1px solid var(--border-mid);
}

.cert-table th {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 0.75rem 0.55rem 0;
  text-align: left;
  white-space: nowrap;
}

.cert-table td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: middle;
}

.cert-table tbody tr:last-child td {
  border-bottom: none;
}

.cert-table tbody tr:hover td {
  background: var(--bg-hover);
}

.cert-table td:first-child {
  white-space: nowrap;
  color: var(--text-faint);
  font-size: 0.68rem;
  width: 72px;
}

.cert-code {
  white-space: nowrap;
  color: var(--accent);
  font-weight: 600;
  width: 62px;
}

.cert-table td:nth-child(3) a {
  color: var(--accent);
  transition: color 0.15s;
}

.cert-table td:nth-child(3) a:hover {
  opacity: 0.75;
}

.cert-table td:last-child {
  color: var(--text);
  font-size: 0.68rem;
  white-space: nowrap;
}


/* ══════════════════════
   CERT DIFFICULTY + FORMAT BADGES
   (hardcoded hex — intentionally NOT using theme vars,
   so these stay consistent regardless of swatch/theme)
   ══════════════════════ */
.cert-meta {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: 0.6rem;
  vertical-align: middle;
}

.diff-badge,
.format-badge {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border: 1px solid;
  white-space: nowrap;
  line-height: 1.6;
}

/* ── Difficulty ramp: calm → hardcore ──
   Beginner = muted slate (low stakes)
   Intermediate = blue (steady, building)
   Advanced = amber/orange (hotter)
   Expert = red (hardcore) */
.diff-beginner {
  color: #8a97a5;
  border-color: #4a5561;
  background: rgba(138, 151, 165, 0.08);
}
.diff-intermediate {
  color: #5b9dff;
  border-color: #5b9dff;
  background: rgba(91, 157, 255, 0.08);
}
.diff-advanced {
  color: #f0a63a;
  border-color: #f0a63a;
  background: rgba(240, 166, 58, 0.1);
}
.diff-expert {
  color: #ff5c5c;
  border-color: #ff5c5c;
  background: rgba(255, 92, 92, 0.12);
  font-weight: 700;
}

/* ── Format: practical vs MCQ ──
   Practical = filled solid, vivid cyan — signals "this is the
   one that matters," matches how you've talked about these
   certs all along.
   MCQ = flat grey outline, deliberately quiet/recessive. */
.format-practical {
  color: #0a1414;
  border-color: #2dd4c4;
  background: #2dd4c4;
  font-weight: 700;
}
.format-mcq {
  color: #6b7480;
  border-color: #6b7480;
  background: transparent;
}

/* Light theme overrides — same logic, adjusted for contrast on a light bg */
[data-theme="light"] .diff-beginner     { color: #5a6472; border-color: #9aa4b0; background: rgba(90, 100, 114, 0.06); }
[data-theme="light"] .diff-intermediate { color: #1d6fe0; border-color: #1d6fe0; background: rgba(29, 111, 224, 0.07); }
[data-theme="light"] .diff-advanced     { color: #b5750f; border-color: #b5750f; background: rgba(181, 117, 15, 0.08); }
[data-theme="light"] .diff-expert       { color: #d13c3c; border-color: #d13c3c; background: rgba(209, 60, 60, 0.1); }
[data-theme="light"] .format-practical  { color: #ffffff; border-color: #0f9c8c; background: #0f9c8c; }
[data-theme="light"] .format-mcq        { color: #7a8390; border-color: #7a8390; }


/* ══════════════════════
   DEFAULT TABLE
   ══════════════════════ */
.default-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  font-family: var(--mono);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.default-table thead tr {
  border-bottom: 1px solid var(--border-mid);
}

.default-table th {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 0.75rem 0.55rem 0;
  text-align: left;
  white-space: nowrap;
}

.default-table td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}

.default-table tbody tr:last-child td {
  border-bottom: none;
}

.default-table tbody tr:hover td {
  background: var(--bg-hover);
}

.default-table p code,
.default-table li code,
.default-table td code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.05rem 0.35rem;
  font-size: 0.74rem;
  color: var(--accent);
}

table.default-table td li,
table.default-table td ul {
  font-family: var(--mono);
  font-size: inherit;
  color: inherit;
}


/* ══════════════════════
   CHAPTERS LIST (2-column)
   ══════════════════════ */
.writeup-body ol.chapters-list {
  column-count: 2;
  column-gap: 2.5rem;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.writeup-body ol.chapters-list li {
  break-inside: avoid;      /* prevents an item splitting across columns */
  margin-bottom: 0.45rem;
}

.writeup-body ol.chapters-list li a {
  color: var(--text-dim);
  transition: color 0.15s;
}

.writeup-body ol.chapters-list li a:hover {
  color: var(--accent);
}

/* keep single column on small screens */
@media (max-width: 680px) {
  .writeup-body ol.chapters-list {
    column-count: 1;
  }
}

/* offset scroll target so headings don't hide under the sticky topbar */
.writeup-body h2 {
  scroll-margin-top: 5.5rem;
}


/* ══════════════════════
   WRITEUP TYPOGRAPHY — READABILITY PASS
   ══════════════════════ */

/* Give h4 subsection headers their own identity: heavier weight,
   tracking, and a rule underneath so they read as structural anchors
   rather than "bold pink text" indistinguishable from inline emphasis */
.writeup-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin-top: 1.85rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Inline lead-in bold phrases inside bullets/paragraphs no longer use
   accent — they use the primary text color instead. This frees accent
   pink to mean exactly one thing: "this is a heading." */
.writeup-body li strong,
.writeup-body p strong {
  color: var(--text);
  font-weight: 700;
}

/* Fix the undefined --text-secondary reference + loosen line-height
   for long-form lead paragraphs */
.writeup-body .lead {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 1rem !important;
}

.writeup-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.9rem;
}

/* Give bullets room to breathe */
.writeup-body ul,
.writeup-body ol {
  padding-left: 1.4rem;
  margin-bottom: 1.1rem;
}
.writeup-body li {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.55rem;
}

/* Demote nested sub-bullets one visual step so depth is obvious at a
   glance (e.g. Fetch/Decode/Execute under a parent bullet) */
.writeup-body li ul,
.writeup-body li ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.writeup-body li ul li,
.writeup-body li ol li {
  font-size: 0.85rem;
  color: var(--text-faint);
}
.writeup-body li ul li strong,
.writeup-body li ol li strong {
  color: var(--text-dim);
}

/* Constrain the READING measure — wider than strict typographic
   ideal (68ch) since this sits in a spacious dark-mode layout,
   but still meaningfully narrower than full container width */
.writeup-body p,
.writeup-body li {
  max-width: 85ch;
  font-size: 1rem;
  line-height: 1.75;
}

.writeup-body .lead {
  max-width: 88ch;
  font-size: 1rem;
  line-height: 1.8;
}

/* Bold lead-ins inside bullets need to actually pop against the
   surrounding text, not just be slightly heavier — bump size a touch
   and use a brighter/warmer tone than --text so it reads as a label */
.writeup-body li strong {
  color: #f0f0f0;
  font-weight: 500;
  font-size: 1.02em;
}

[data-theme="light"] .writeup-body li strong {
  color: #0a0a0a;
}

/* Explicit "new chapter" pause */
.writeup-body h2 {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.writeup-body h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}


.writeup-toc {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}
.writeup-toc nav ul {
  list-style: none;
  padding-left: 0;
}
.writeup-toc nav a {
  display: block;
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 0.35rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  transition: color 0.15s, border-color 0.15s;
}
.writeup-toc nav a:hover { color: var(--text-dim); }
.writeup-toc nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.note-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: minmax(0, 1fr);   /* NEW — caps the row to note-layout's own height */
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.note-layout::-webkit-scrollbar { width: 5px; }
.note-layout::-webkit-scrollbar-track { background: transparent; }
.note-layout::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.note-layout::-webkit-scrollbar-thumb:hover { opacity: 0.75; }

.note-layout .writeup-body {
  order: 1;
  min-width: 0;
  max-width: 900px;
  width: 100%;
  flex: none;
  min-height: auto;
  overflow-y: visible;
  overflow-x: visible;
  margin: 0;
}

.note-toc {
  order: 2;
  min-width: 0;
  width: 260px;
  align-self: start;
  position: sticky;
  top: 0;
  max-height: 100%;   /* CHANGED from 100vh — now resolves against the capped row height */
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.note-toc::-webkit-scrollbar { width: 5px; }
.note-toc::-webkit-scrollbar-track { background: transparent; }
.note-toc::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.note-toc::-webkit-scrollbar-thumb:hover { opacity: 0.75; }
.note-toc nav ul { list-style: none; padding-left: 0; }
.note-toc nav li { margin-bottom: 0.35rem; }
.note-toc nav a {
  display: block;
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 0.35rem 0 0.35rem 0.6rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.note-toc nav a:hover { color: var(--text-dim); }
.note-toc nav a.active { color: var(--accent); border-left-color: var(--accent); }

/* subsections (nested <ul>) only reveal themselves for the chapter currently being read */
.note-toc nav ul ul {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.note-toc nav li.open > ul {
  max-height: 1000px;
  opacity: 1;
}
.note-toc nav ul ul li { margin-bottom: 0.15rem; }
.note-toc nav ul ul a { font-size: 0.68rem; padding-left: 1.4rem; }

/* Flip sides: add class="note-layout toc-left" */
.note-layout.toc-left {
  grid-template-columns: 260px minmax(0, 1fr);
}
.note-layout.toc-left .writeup-body { order: 2; }
.note-layout.toc-left .note-toc { order: 1; }

@media (max-width: 680px) {
  .note-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;   /* NEW */
    overflow-y: visible;
  }
  .note-toc {
    position: static;
    max-height: none;
    border-right: none;
    align-self: auto;
  }
}

/* ══════════════════════
   KNOWLEDGE NOTES TYPOGRAPHY
   Scoped to content/knowledge/** only (layouts/knowledge/single.html
   adds .knowledge-body alongside .writeup-body) — h3 subsections here
   were rendering smaller than h4 sub-headers under the shared
   .writeup-body rules; these overrides restore a correct h2 > h3 > h4
   size hierarchy without touching other sections (CVEs, writeups, etc).
   ══════════════════════ */
.knowledge-body.knowledge-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.2rem 0 0.9rem;
  letter-spacing: 0.01em;
}
.knowledge-body.knowledge-body h4 {
  font-size: 1.05rem;
}
.knowledge-body.knowledge-body .lead {
  font-size: 1rem;
  line-height: 1.8;
}

/* ══════════════════════
   PRIMITIVES TABS + TABLE
   ══════════════════════ */
.primitives-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  margin-top: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.primitives-tabs::-webkit-scrollbar {
  display: none;
}

.primitives-tab {
  font-family: var(--mono);
  font-size: 0.68rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0.5rem 1rem 0.45rem;
  margin-bottom: -1px;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.primitives-tab:hover {
  color: var(--text-dim);
}

.primitives-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.primitives-panel {
  display: none;
}

.primitives-panel.active {
  display: block;
  overflow-x: hidden;
}

.primitives-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.primitives-table thead tr {
  border-bottom: 1px solid var(--border-mid);
}

.primitives-table th {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 0.75rem 0.55rem 0;
  text-align: left;
  white-space: nowrap;
}

.primitives-table td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}

.primitives-table tbody tr:last-child td {
  border-bottom: none;
}

.primitives-table tbody tr:hover td {
  background: var(--bg-hover);
}

.primitives-table td:first-child {
  white-space: nowrap;
  color: var(--text-faint);
  font-size: 0.68rem;
  width: 110px;
}

.primitives-table td:nth-child(2) {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 500;
  width: 180px;
}

.primitives-table td:nth-child(2) code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.72rem;
  color: var(--accent);
}

.primitives-table td:nth-child(3) {
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1.5;
}

.primitives-table td:nth-child(3) code {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 500;
}

.primitives-table td:nth-child(3) a {
  color: var(--accent);
  transition: color 0.15s;
}

.primitives-table td:nth-child(3) a:hover {
  opacity: 0.75;
}

.primitives-panel h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.primitives-panel p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.primitives-panel blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 0.75rem;
  margin: 1rem 0;
  background: var(--bg-hover);
  padding: 0.75rem;
  border-radius: 2px;
}

.primitives-panel blockquote p {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}

.primitives-panel blockquote strong {
  color: var(--accent);
  font-weight: 600;
}

.primitives-panel pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 0.6rem;
  overflow-x: auto;
  margin: 0.5rem 0 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--accent);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.primitives-panel pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.7rem;
}

.primitives-panel pre::-webkit-scrollbar {
  height: 5px;
}

.primitives-panel pre::-webkit-scrollbar-track {
  background: transparent;
}

.primitives-panel pre::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.primitives-panel pre::-webkit-scrollbar-thumb:hover {
  opacity: 0.75;
}

/* ══════════════════════
   WRITEUP PAGE (standalone)
   ══════════════════════ */
.writeup-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 2rem;
  width: 100%;
  box-sizing: border-box;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.5;
}
.writeup-body::-webkit-scrollbar {
  width: 5px;
}
.writeup-body::-webkit-scrollbar-track {
  background: transparent;
}
.writeup-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.writeup-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  opacity: 0.75;
}
.writeup-body p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 0.3rem;
}

.writeup-body .answer-text {
  overflow-wrap: break-word;
  word-break: break-all;
}

.writeup-body h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.6rem;
}
.writeup-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.writeup-body ul, .writeup-body ol {
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}
.writeup-body li {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.3rem;
}
.writeup-body .lead {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem !important;
}
.writeup-body img {
  width: calc(95% + 4rem) !important;
  max-width: calc(95% + 4rem) !important;
  margin-left: !important;
  height: auto !important;
  display: block;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.writeup-body .writeup-logo {
  width: auto !important;
  max-width: none !important;
  height: 72px !important;
  flex-shrink: 0;
  border: none !important;
  margin-left: 0 !important;
  margin-bottom: 0 !important;
}
.writeup-body pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 0.8rem;
  overflow-x: auto;
  margin: 0.5rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.4;
  color: #e6e6e6;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.writeup-body pre::-webkit-scrollbar {
  height: 5px;
}
.writeup-body pre::-webkit-scrollbar-track {
  background: transparent;
}
.writeup-body pre::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.writeup-body pre::-webkit-scrollbar-thumb:hover {
  opacity: 0.75;
}
.writeup-body code {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.4;
  color: #e6e6e6;
}
[data-theme="light"] .writeup-body pre {
  background: #ebebeb;
  color: #1a1a1a;
}
[data-theme="light"] .writeup-body code {
  color: #1a1a1a;
}
.writeup-body p code,
.writeup-body li code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.05rem 0.35rem;
  font-size: 0.74rem;
  color: var(--accent);
}
.writeup-body strong {
  font-weight: 600;
  color: var(--accent);
}
.writeup-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.writeup-body a {
  color: var(--accent);
  transition: opacity 0.15s;
}
.writeup-body a:hover { opacity: 0.75; }
.writeup-footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 1rem;
}
.mb-2 { margin-bottom: 0.3rem; }
.mb-3 { margin-bottom: 0.6rem; }
.mb-4 { margin-bottom: 0.8rem; }

/* ── Sign-off block (See you in the next … / @aaronamran / date) ── */
.writeup-body section.text-center {
  margin-top: 1.25rem !important;
  margin-bottom: 1.25rem !important;
}
.writeup-body section.text-center p {
  font-size: 0.78rem;
  margin-bottom: 0.2rem !important;
  line-height: 1.4;
  color: var(--text-dim);
}
.writeup-body section.text-center p:first-child {
  font-size: 0.82rem;
  font-style: italic;
  font-size: 0.82rem !important; /* override inline 1.125rem */
}
.writeup-body section.text-center p [id="nextHackLink"],
.writeup-body section.text-center p a {
  font-style: normal;
}
.writeup-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.writeup-header-text { flex: 1; }
.writeup-org {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}
.writeup-date {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.writeup-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0.4rem 0 0.2rem;
}
.back-link {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }

/* ══════════════════════
   "YOU'RE ALL CAUGHT UP" MODAL
   ══════════════════════ */
.cu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  align-items: center;
  justify-content: center;
}
.cu-overlay.active {
  display: flex;
}
.cu-box {
  font-family: var(--mono);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  width: min(480px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cu-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.cu-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cu-img-wrap {
  text-align: center;
  margin-bottom: 0.25rem;
}
.cu-img-wrap img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}
.cu-body p {
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}
.cu-regards {
  font-size: 0.72rem !important;
  color: var(--text-faint) !important;
}
.cu-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.cu-btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  background: none;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.cu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ══════════════════════
   HAMBURGER TOGGLE
   (injected by scripts.js; hidden on desktop)
   ══════════════════════ */
#navToggle {
  display: none;
}

/* ══════════════════════
   RESPONSIVE
   ══════════════════════ */
@media (max-width: 680px) {
  body {
    padding: 0;
    height: auto;
    overflow: auto;
  }

  .site-frame {
    border-left: none;
    border-right: none;
    overflow: visible;
    max-height: none;
  }

  .posts-col {
    overflow: visible;
  }

  .sidebar {
    overflow: visible;
  }

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

  .posts-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .pd-day {
    font-size: 1.8rem;
  }
  
  .platform-grid {
    grid-template-columns: 1fr;
  }

  /* ── Mobile topbar: hamburger layout ── */
  #navToggle {
    display: flex;
    order: 1;
  }

  .topbar-inner {
    flex-wrap: wrap;
    align-items: center;
    padding: 0.55rem 1rem;
  }

  .topbar-actions {
    order: 2;
    margin-left: auto;
  }

  .topbar-links {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 0 0.35rem;
    border-top: 1px solid var(--border);
  }

  .topbar-inner.nav-open .topbar-links {
    display: flex;
  }

  /* ── Responsive images in writeup pages ── */
  .writeup-body img:not(.writeup-logo) {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* ── Cert table: fully exit table layout ── */
  .cert-table,
  .cert-table thead,
  .cert-table tbody {
    display: block;
    width: 100%;
  }

  .cert-table thead {
    display: none;
  }

  .cert-table tbody tr[data-cert] {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.5rem;
    row-gap: 0.35rem;
    width: 100%;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
  }

  .cert-table tbody tr[data-cert] td {
    display: block;
    padding: 0 !important;
    border-bottom: none !important;
    white-space: normal !important;
    width: auto;
  }

  /* Unwrap the title cell so its children (link + badges)
     become independent flex items we can reorder freely */
  .cert-table tbody tr[data-cert] td:nth-child(3) {
    display: contents;
  }

  /* ── Row 1: title, full width on its own line ── */
  .cert-table tbody tr[data-cert] td:nth-child(3) > a {
    order: 1;
    flex: 1 0 100%;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  /* forced line break after title */
  .cert-table tbody tr[data-cert]::before {
    content: "";
    order: 2;
    flex-basis: 100%;
  }

  /* ── Row 2: badges + date together ── */
  .cert-meta {
    order: 3;
    margin-left: 0;
  }

  .cert-table tbody tr[data-cert] td:nth-child(1) {
    order: 4;
    font-size: 0.68rem;
    color: var(--text-faint);
  }

  /* forced line break before code/issuer */
  .cert-table tbody tr[data-cert]::after {
    content: "";
    order: 5;
    flex-basis: 100%;
  }

  /* ── Row 3: code + issuer together ── */
  .cert-table tbody tr[data-cert] .cert-code {
    order: 6;
    width: auto;
    font-size: 0.68rem;
  }

  .cert-table tbody tr[data-cert] td:nth-child(4) {
    order: 7;
    font-size: 0.68rem;
    color: var(--text-dim);
  }

  .cert-table tbody tr[data-cert] td:nth-child(4)::before {
    content: "·";
    margin-right: 0.4rem;
    color: var(--text-faint);
  }

  /* Expand row stays full-width, unaffected by the flex rules above */
  .cert-expand-row,
  .cert-expand-row td {
    display: block;
    width: 100% !important;
  }
}
