/* ==========================================================================
   mirakbar.tech — Warm Editorial Daylight Design System
   Deliberately architectural, daylight-first, warm paper & terracotta ink.
   ========================================================================== */

:root {
  --bg: #f6f2ea;
  --bg-elevated: #ffffff;
  --bg-muted: #ece6da;
  --bg-soft-accent: #f9ebe4;
  --bg-soft-jade: #e4f1ec;

  --ink: #171614;
  --ink-secondary: #4e4b45;
  --ink-muted: #767067;

  --accent: #c44d29;
  --accent-hover: #a13a1b;
  --jade: #166551;
  --amber: #b4690e;

  --border: #dcd5c7;
  --border-strong: #b9af9c;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(23, 22, 20, 0.04);
  --shadow-md: 0 10px 28px rgba(23, 22, 20, 0.06);
  --max-width: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(to right, rgba(23, 22, 20, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(23, 22, 20, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

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

button,
input {
  font-family: inherit;
}

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

.mono {
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 68px;
  background: rgba(246, 242, 234, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.primary-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-secondary);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-index {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.btn-index:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.mobile-menu-btn {
  display: none;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 12px 24px 18px;
}

.mobile-drawer.is-open {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-drawer a {
  padding: 8px 0;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 56px 0 42px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 36px;
  align-items: stretch;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-soft-accent);
  border: 1px solid rgba(196, 77, 41, 0.25);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jade);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.1vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 18px 0 18px;
  font-weight: 700;
}

.hero h1 .underline-accent {
  position: relative;
  display: inline-block;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--ink-secondary);
  max-width: 60ch;
  margin: 0 0 26px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #2b2926;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: rgba(196, 77, 41, 0.4);
}

.btn-accent:hover {
  background: var(--bg-soft-accent);
  border-color: var(--accent);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

/* Hero Right Panel — Geometric Span Card */
.hero-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-secondary);
}

.hero-canvas-wrap {
  position: relative;
  height: 230px;
  background: #fbf9f5;
  border-bottom: 1px solid var(--border);
}

#heroVectorCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-overlay-controls {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.canvas-pills {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.pill-btn {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.pill-btn.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.hero-dossier-rows {
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.dossier-item {
  display: flex;
  flex-direction: column;
}

.dossier-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.dossier-val {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

/* Bottom 4-col Meta Strip */
.meta-strip {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
}

.meta-cell {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
}

.meta-cell:last-child {
  border-right: none;
}

.meta-cell-k {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}

.meta-cell-v {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---------------- Section Layout ---------------- */
.section {
  padding: 68px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0;
}

.section-desc {
  max-width: 46ch;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  margin: 0;
}

/* ---------------- Cards & Grids ---------------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.two-col {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
}

.four-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

.badge-accent {
  background: var(--bg-soft-accent);
  color: var(--accent);
  border-color: rgba(196, 77, 41, 0.25);
}

.badge-jade {
  background: var(--bg-soft-jade);
  color: var(--jade);
  border-color: rgba(22, 101, 81, 0.25);
}

/* Profile Ledger Table */
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ledger tr {
  border-bottom: 1px solid var(--border);
}

.ledger tr:last-child {
  border-bottom: none;
}

.ledger th {
  text-align: left;
  padding: 11px 8px 11px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  width: 38%;
  vertical-align: top;
}

.ledger td {
  padding: 11px 0;
  font-weight: 500;
  color: var(--ink);
}

/* Language Pills */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.lang-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.lang-box strong {
  display: block;
  font-size: 0.9rem;
}

.lang-box span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* ---------------- Interactive Matrix Sandbox Widget ---------------- */
.lab-showcase {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.sandbox-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fbf9f5;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sandbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#matrixPlaygroundCanvas {
  width: 100%;
  height: 260px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
}

.matrix-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.matrix-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.matrix-field label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.matrix-field input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 6px;
}

.telemetry-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.telemetry-box span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--ink-muted);
}

.telemetry-box strong {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink);
}

/* Lab Grid Cards */
.lab-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.lab-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.lab-card h3 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  margin: 0 0 6px;
}

.lab-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--ink-secondary);
}

.lab-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 600;
}

/* ---------------- Learning Tabs & Credit Bars ---------------- */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tab-btn {
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.credit-row {
  margin-bottom: 14px;
}

.credit-row:last-child {
  margin-bottom: 0;
}

.credit-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 5px;
}

.credit-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
  border: 1px solid var(--border);
}

.credit-fill {
  height: 100%;
  border-radius: 999px;
}

/* Phase Accordion / Selector */
.phase-selector {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.phase-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phase-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.14s ease;
}

.phase-btn strong {
  display: block;
  font-size: 0.86rem;
  color: var(--ink);
}

.phase-btn span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.phase-btn.is-active {
  background: var(--bg-soft-accent);
  border-color: var(--accent);
}

.phase-detail {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.module-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.module-list li {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.87rem;
}

.module-list li strong {
  display: block;
  color: var(--ink);
}

.module-list li span {
  color: var(--ink-secondary);
  font-size: 0.82rem;
}

/* Mini Projects Filter Table */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.project-chip {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.83rem;
}

.project-chip .num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
}

/* ---------------- Interests ---------------- */
.interest-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 8px 0 8px;
}

.interest-card p {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  margin: 0 0 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
}

/* ---------------- Notes & Contact ---------------- */
.note-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.note-item:last-child {
  border-bottom: none;
}

.note-item:hover h4 {
  color: var(--accent);
}

.note-item > span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.note-item h4 {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-size: 1rem;
  transition: color 0.14s ease;
}

.note-item p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 10px;
}

.contact-row:last-child {
  margin-bottom: 0;
}

.contact-meta span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.contact-meta strong {
  font-size: 0.9rem;
}

.copy-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--ink);
}

/* ---------------- Footer ---------------- */
.site-footer {
  padding: 28px 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.footer-links {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

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

/* ---------------- Command Palette Modal (⌘K) ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(23, 22, 20, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 16px 24px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  width: 100%;
  max-width: 660px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(23, 22, 20, 0.2);
  overflow: hidden;
}

.modal-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.96rem;
  background: transparent;
  color: var(--ink);
}

.modal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.modal-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.modal-item:hover,
.modal-item.is-selected {
  background: var(--bg-soft-accent);
}

.modal-item strong {
  display: block;
  font-size: 0.9rem;
}

.modal-item span {
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 70;
  padding: 10px 16px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------- Subpage Styles (Notes & Labs) ---------------- */
.page-hero {
  padding: 46px 0 32px;
  border-bottom: 1px solid var(--border);
}

.article-prose {
  max-width: 760px;
  padding: 44px 0 68px;
}

.article-prose h2 {
  font-family: var(--font-display);
  margin-top: 34px;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.article-prose p,
.article-prose li {
  color: var(--ink-secondary);
  font-size: 1rem;
}

.article-prose pre {
  background: #1d1c1a;
  color: #f6f2ea;
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .hero-grid,
  .two-col,
  .lab-showcase,
  .phase-selector {
    grid-template-columns: 1fr;
  }

  .meta-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-cell:nth-child(2) {
    border-right: none;
  }

  .meta-cell:nth-child(1),
  .meta-cell:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .three-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .primary-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .four-col,
  .three-col,
  .project-grid,
  .meta-strip {
    grid-template-columns: 1fr;
  }

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

  .meta-cell:last-child {
    border-bottom: none;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 0 16px;
  }

  .brand-sub {
    display: none;
  }

  .btn-index .kbd {
    display: none;
  }

  .btn-index {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 33px;
    height: 33px;
  }
}
