/* ============================================================
   MBuTT3178 — Cobalt Technical Studio Design System
   PFP Gradient: #D7E6FD -> #A0C3FB -> #4689FA -> #1A70F7
   Lettering Ink: #000520
   ============================================================ */

:root,
:root[data-theme="dark"] {
  --pfp-ice: #d7e6fd;
  --pfp-sky: #a0c3fb;
  --pfp-mid: #7cabf9;
  --pfp-azure: #4689fa;
  --pfp-cobalt: #1a70f7;
  --pfp-ink: #000520;

  --bg: #040714;
  --bg-surface: #0a1126;
  --bg-elev: #0f1936;
  --bg-glass: rgba(10, 17, 38, 0.72);
  --bg-glass-hover: rgba(18, 30, 66, 0.86);

  --border: rgba(160, 195, 251, 0.14);
  --border-strong: rgba(70, 137, 250, 0.42);
  --grid-dot: rgba(160, 195, 251, 0.11);

  --accent: #4689fa;
  --accent-strong: #1a70f7;
  --accent-soft: rgba(70, 137, 250, 0.14);
  --accent-grad: linear-gradient(135deg, #d7e6fd 0%, #7cabf9 45%, #1a70f7 100%);
  --accent-btn-grad: linear-gradient(135deg, #4689fa 0%, #1a70f7 100%);
  --accent-ink: #ffffff;

  --text: #eef5ff;
  --muted: #93add6;
  --faint: #5b74a1;

  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --shadow-sm: 0 4px 16px rgba(0, 5, 32, 0.45);
  --shadow-md: 0 18px 46px rgba(0, 5, 32, 0.62);
  --shadow-glow: 0 0 0 1px rgba(70, 137, 250, 0.28), 0 16px 40px rgba(26, 112, 247, 0.2);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max-w: 1160px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  --bg: #eef4ff;
  --bg-surface: #ffffff;
  --bg-elev: #f7faff;
  --bg-glass: rgba(255, 255, 255, 0.76);
  --bg-glass-hover: rgba(255, 255, 255, 0.94);

  --border: rgba(26, 112, 247, 0.16);
  --border-strong: rgba(26, 112, 247, 0.44);
  --grid-dot: rgba(26, 112, 247, 0.13);

  --accent: #1a70f7;
  --accent-strong: #1155cc;
  --accent-soft: rgba(26, 112, 247, 0.11);
  --accent-grad: linear-gradient(135deg, #000520 0%, #1a70f7 60%, #4689fa 100%);
  --accent-btn-grad: linear-gradient(135deg, #1a70f7 0%, #4689fa 100%);
  --accent-ink: #ffffff;

  --text: #000520;
  --muted: #354b75;
  --faint: #677ea8;

  --success: #059669;
  --warn: #d97706;
  --danger: #dc2626;

  --shadow-sm: 0 4px 14px rgba(0, 5, 32, 0.06);
  --shadow-md: 0 16px 40px rgba(26, 112, 247, 0.11);
  --shadow-glow: 0 0 0 1px rgba(26, 112, 247, 0.25), 0 14px 36px rgba(26, 112, 247, 0.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

.skip-link {
  position: fixed;
  top: -100px; left: 16px;
  z-index: 1200;
  background: var(--accent-strong);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 14px; }

.bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-aurora {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 50% at 85% -5%, rgba(26, 112, 247, 0.22) 0%, transparent 62%),
    radial-gradient(ellipse 55% 45% at 10% 10%, rgba(215, 230, 253, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 50% 105%, rgba(70, 137, 250, 0.12) 0%, transparent 60%);
  transition: opacity 0.3s ease;
}

:root[data-theme="light"] .bg-aurora {
  background:
    linear-gradient(180deg, rgba(215, 230, 253, 0.85) 0%, rgba(238, 244, 255, 0.35) 38%, transparent 72%),
    radial-gradient(ellipse 65% 45% at 92% 0%, rgba(70, 137, 250, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 5% 95%, rgba(160, 195, 251, 0.28) 0%, transparent 60%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 65%, transparent 100%);
}

#app { position: relative; z-index: 1; }

.top-shell { position: sticky; top: 0; z-index: 100; padding: 14px 20px 0; }

.top-rail {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 62px;
  padding: 0 12px 0 10px;
  border-radius: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-cluster {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  transition: background 0.2s ease;
  min-width: 0;
}
.brand-cluster:hover { background: var(--accent-soft); }

.brand-avatar-ring {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  padding: 2px;
  background: linear-gradient(180deg, var(--pfp-ice), var(--pfp-cobalt));
  flex-shrink: 0;
  display: block;
}
.brand-avatar { width: 100%; height: 100%; border-radius: 9px; object-fit: cover; display: block; }
.brand-text-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand-crumb {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.rail-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.rail-btn-primary { background: var(--accent-btn-grad); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(26, 112, 247, 0.28); }
.rail-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(26, 112, 247, 0.38); }
.rail-btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.rail-btn-ghost:hover { background: var(--accent-soft); border-color: var(--border-strong); }

.theme-switch {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 11px;
  padding: 3px;
  height: 38px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s ease;
}
.theme-switch:hover { border-color: var(--border-strong); }
.theme-switch-track { position: relative; display: grid; grid-template-columns: 30px 30px; align-items: center; height: 30px; }
.theme-opt { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: color 0.25s ease; }
.theme-switch-thumb {
  position: absolute;
  top: 0; left: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent-btn-grad);
  box-shadow: 0 3px 10px rgba(26, 112, 247, 0.34);
  transition: transform 0.28s var(--ease);
  z-index: 1;
}
:root[data-theme="dark"] .theme-switch-thumb { transform: translateX(30px); }
:root[data-theme="dark"] .theme-opt-dark { color: #ffffff; }
:root[data-theme="light"] .theme-switch-thumb { transform: translateX(0); }
:root[data-theme="light"] .theme-opt-light { color: #ffffff; }

.page { display: none; }
.page.active { display: block; animation: fadeLift 0.35s var(--ease) both; }
@keyframes fadeLift {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#page-home, .detail-shell { max-width: var(--max-w); margin: 0 auto; padding: 36px 20px 72px; }

.hero-bento { display: grid; grid-template-columns: 1.45fr 0.95fr; gap: 20px; align-items: stretch; }
.hero-copy-panel {
  position: relative;
  padding: 36px 38px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.hero-copy-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pfp-ice), var(--pfp-azure), var(--pfp-cobalt));
  opacity: 0.85;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero-heading { font-family: var(--font-display); display: flex; flex-direction: column; gap: 4px; letter-spacing: -0.04em; line-height: 1.02; }
.hero-word-main {
  font-size: clamp(2.4rem, 5.2vw, 3.85rem);
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-word-sub { font-size: clamp(1.35rem, 2.7vw, 2.05rem); font-weight: 600; color: var(--text); letter-spacing: -0.03em; }
.hero-lead { margin-top: 18px; max-width: 52ch; font-size: 0.96rem; line-height: 1.7; color: var(--muted); }
.hero-inline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.action-pill-primary { background: var(--accent-btn-grad); color: var(--accent-ink); box-shadow: 0 8px 22px rgba(26, 112, 247, 0.28); }
.action-pill-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(26, 112, 247, 0.38); }
.action-pill-secondary { background: var(--bg-elev); border-color: var(--border); color: var(--text); }
.action-pill-secondary:hover { border-color: var(--border-strong); background: var(--bg-glass-hover); }

.identity-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}
.identity-top { display: flex; align-items: center; gap: 16px; }
.identity-pfp-frame {
  width: 72px; height: 72px;
  border-radius: 18px;
  padding: 3px;
  background: linear-gradient(180deg, var(--pfp-ice) 0%, var(--pfp-sky) 45%, var(--pfp-cobalt) 100%);
  box-shadow: 0 10px 26px rgba(26, 112, 247, 0.28);
  flex-shrink: 0;
}
.identity-pfp { width: 100%; height: 100%; border-radius: 15px; object-fit: cover; display: block; }
.identity-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.identity-tag { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em; color: var(--accent); }
.identity-handle { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.identity-status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--muted); }
.status-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2); }

.telemetry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.telemetry-cell {
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.telemetry-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; color: var(--faint); }
.telemetry-value { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.telemetry-value-sm { font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; padding-top: 4px; }

.pfp-spectrum { display: flex; align-items: center; gap: 12px; }
.spectrum-bar { flex: 1; height: 6px; border-radius: 100px; background: linear-gradient(90deg, #d7e6fd 0%, #a0c3fb 35%, #4689fa 70%, #1a70f7 100%); }
.spectrum-code { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--faint); white-space: nowrap; }

.activity-banner {
  margin-top: 20px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.activity-banner[hidden] { display: none; }
.activity-banner:hover { border-color: var(--border-strong); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.activity-badge { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; color: var(--accent-ink); background: var(--accent-btn-grad); padding: 4px 9px; border-radius: 6px; }
.activity-name { font-family: var(--font-display); font-weight: 700; font-size: 0.96rem; }
.activity-ver { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.activity-date { margin-left: auto; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-arrow { color: var(--accent); display: inline-flex; transition: transform 0.2s var(--ease); }
.activity-banner:hover .activity-arrow { transform: translateX(3px); }

.catalog-section { margin-top: 34px; }
.command-bar {
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.command-left { flex: 1 1 240px; min-width: 200px; }
.command-right { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.search-field { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 13px; color: var(--faint); pointer-events: none; }
.search-input {
  width: 100%; height: 40px;
  padding: 0 36px 0 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-kbd { position: absolute; right: 11px; font-family: var(--font-mono); font-size: 0.66rem; color: var(--faint); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; pointer-events: none; }
.search-input:focus + .search-kbd { opacity: 0; }

.category-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-pill {
  height: 36px; padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.cat-pill:hover { color: var(--text); border-color: var(--border-strong); background: var(--accent-soft); }
.cat-pill.active { background: var(--accent-btn-grad); border-color: transparent; color: #ffffff; }

.view-switcher { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border); }
.view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--accent-soft); color: var(--accent); }

.catalog-meta-row { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 16px; }
.catalog-heading { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.catalog-count-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--faint); }

.catalog-sections { display: flex; flex-direction: column; gap: 34px; }
.catalog-group { display: flex; flex-direction: column; gap: 16px; }
.catalog-group-head { display: flex; align-items: center; gap: 12px; }
.catalog-group-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.catalog-group-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.catalog-group-title::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 3px;
  background: var(--accent-btn-grad);
  box-shadow: 0 0 10px rgba(26, 112, 247, 0.45);
}
.catalog-group-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 340px)); gap: 18px; }
.projects-grid.view-list { grid-template-columns: 1fr; gap: 10px; }

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.28s var(--ease), border-color 0.25s ease, box-shadow 0.28s ease;
  animation: fadeLift 0.45s var(--ease) both;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-glow); }

.card-visual { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.card-visual img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.55s var(--ease); }
.project-card:hover .card-visual img { transform: scale(1.04); }
.card-visual-bar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 2; }
.card-index-num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(0, 5, 32, 0.72);
  color: var(--pfp-ice);
  border: 1px solid rgba(160, 195, 251, 0.25);
  backdrop-filter: blur(8px);
}

.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.22; }
.card-category { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); white-space: nowrap; padding-top: 3px; }
.card-desc { font-size: 0.87rem; line-height: 1.62; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stack-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.stack-chip { font-family: var(--font-mono); font-size: 0.64rem; padding: 4px 8px; border-radius: 6px; background: var(--bg-elev); border: 1px solid var(--border); color: var(--muted); }
.card-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-foot-meta { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.card-stars { color: var(--accent); font-weight: 600; }
.card-inspect { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; color: var(--accent); transition: transform 0.2s var(--ease); }
.project-card:hover .card-inspect { transform: translateX(3px); }

.project-card.list-row { flex-direction: row; align-items: center; padding: 14px 18px; gap: 16px; }
.row-idx { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; color: var(--faint); width: 28px; flex-shrink: 0; }
.row-thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; background: var(--bg-elev); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-main { flex: 1; min-width: 0; }
.row-main .card-title { font-size: 1.04rem; margin-bottom: 3px; }
.row-main .card-desc { -webkit-line-clamp: 1; font-size: 0.84rem; }
.row-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.status-chip { font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 9px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.status-chip.active, .status-chip.stable { color: var(--success); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.12); }
.status-chip.beta { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.12); }
.status-chip.wip, .status-chip.alpha { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.12); }
.status-chip.archived { color: var(--muted); border-color: var(--border-strong); background: var(--bg-elev); }

.empty-blueprint {
  grid-column: 1 / -1;
  position: relative;
  padding: 58px 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.empty-badge { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border); padding: 5px 12px; border-radius: 7px; margin-bottom: 16px; }
.empty-title { font-family: var(--font-display); font-size: clamp(1.35rem, 2.8vw, 1.75rem); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 10px; }
.empty-desc { max-width: 48ch; font-size: 0.9rem; line-height: 1.7; color: var(--muted); }

.detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.back-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text);
  font-family: var(--font-body); font-size: 0.84rem; font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}
.back-pill:hover { border-color: var(--border-strong); transform: translateX(-2px); }
.detail-slug-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

.detail-bento { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; margin-bottom: 36px; }
.detail-banner-card { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--bg-surface); aspect-ratio: 16 / 9; }
.detail-banner-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-spec-card { padding: 28px; border-radius: var(--radius-lg); background: var(--bg-surface); border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.detail-title { font-family: var(--font-display); font-size: clamp(1.7rem, 3.2vw, 2.35rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; margin: 10px 0 12px; }
.detail-desc { font-size: 0.92rem; line-height: 1.7; color: var(--muted); }
.detail-kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kv-item { display: flex; flex-direction: column; gap: 3px; }
.kv-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; }
.kv-val { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: var(--text); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.releases-section { margin-top: 12px; }
.releases-heading { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; }
.rel-group { margin-bottom: 28px; }
.rel-group-head { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.rel-group-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.rel-list { display: flex; flex-direction: column; gap: 10px; }
.rel-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-radius: var(--radius-sm); background: var(--bg-surface); border: 1px solid var(--border); transition: border-color 0.2s ease, transform 0.2s var(--ease); }
.rel-row:hover { border-color: var(--border-strong); transform: translateX(3px); }
.rel-name { font-family: var(--font-display); font-weight: 700; font-size: 0.96rem; }
.rel-meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.rel-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.site-footer { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; font-size: 0.8rem; color: var(--faint); }
.footer-left { display: inline-flex; align-items: center; gap: 10px; }
.footer-brand { font-family: var(--font-display); font-weight: 700; color: var(--text); }
.footer-year { font-family: var(--font-mono); font-size: 0.72rem; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 500; transition: color 0.18s ease; }
.footer-links a:hover { color: var(--accent); }

.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0, 5, 32, 0.65); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 20px; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-sheet { width: 100%; max-width: 780px; max-height: 85vh; overflow-y: auto; border-radius: var(--radius-lg); background: var(--bg-surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); padding: 26px 30px 30px; animation: fadeLift 0.25s var(--ease); }
.modal-sheet-sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color 0.2s ease, color 0.2s ease; }
.modal-close:hover { border-color: var(--accent); color: var(--text); }

.md-prose { line-height: 1.72; font-size: 0.93rem; }
.md-prose h1, .md-prose h2, .md-prose h3 { font-family: var(--font-display); color: var(--text); margin: 1.4em 0 0.55em; letter-spacing: -0.02em; }
.md-prose h1 { margin-top: 0; font-size: 1.65rem; }
.md-prose h2 { font-size: 1.25rem; }
.md-prose p { margin-bottom: 0.95em; color: var(--muted); }
.md-prose ul, .md-prose ol { padding-left: 22px; margin-bottom: 1em; color: var(--muted); }
.md-prose li { margin-bottom: 0.35em; }
.md-prose a { color: var(--accent); text-decoration: underline; }
.md-prose code { font-family: var(--font-mono); font-size: 0.84em; background: var(--bg-elev); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; color: var(--text); }
.md-prose pre { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin-bottom: 1em; }
.md-prose pre code { border: 0; padding: 0; background: none; }

.links-copy { font-size: 0.88rem; line-height: 1.65; color: var(--muted); margin-bottom: 18px; }
.links-stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Device Filter Row (auto-shown when 2+ devices) ---------- */
.device-filter-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.device-filter-bar[hidden] { display: none; }
.device-filter-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--faint);
}

/* ---------- Detail Safety Callout Strip ---------- */
.safety-callout {
  margin: 0 0 28px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.34);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
:root[data-theme="light"] .safety-callout {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.32);
}
.safety-icon {
  color: var(--warn);
  flex-shrink: 0;
  margin-top: 2px;
}
.safety-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.safety-target {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warn);
}
.safety-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}
.safety-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- SHA-256 Checksum & Copy Buttons ---------- */
.rel-hash-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 5px 8px 5px 10px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  max-width: 100%;
}
.rel-hash-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  flex-shrink: 0;
}
.rel-hash-val {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.copy-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.copy-chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-chip-btn.copied {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
}

/* Code Block Copy Wrapper inside Markdown Modals */
.code-block-wrap {
  position: relative;
  margin-bottom: 1em;
}
.code-block-wrap pre {
  margin-bottom: 0;
  padding-right: 78px;
}
.code-copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
}

/* ---------- Screenshots Gallery & Lightbox ---------- */
.gallery-section {
  margin: 0 0 32px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.gallery-thumb {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
  padding: 0;
  cursor: pointer;
  aspect-ratio: 16 / 10;
  transition: transform 0.22s var(--ease), border-color 0.2s ease;
}
.gallery-thumb:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lightbox-wrap {
  position: relative;
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 96px);
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}
.lightbox-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--pfp-ice);
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
}
.lightbox-nav {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lightbox-nav[hidden] { display: none; }
.lightbox-nav:hover { border-color: var(--accent); color: var(--accent); }

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

@media (max-width: 920px) {
  .hero-bento, .detail-bento { grid-template-columns: 1fr; }
  .hero-copy-panel { padding: 28px 24px; }
  .brand-crumb { display: none; }
}

@media (max-width: 640px) {
  .top-shell { padding: 10px 12px 0; }
  .top-rail { height: 56px; padding: 0 8px; }
  .rail-btn span { display: none; }
  .rail-btn { padding: 0 11px; }
  #page-home, .detail-shell { padding: 22px 12px 56px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.list-row { flex-wrap: wrap; }
  .row-thumb { width: 76px; }
  .rel-row { flex-direction: column; align-items: flex-start; }
  .rel-right { width: 100%; flex-wrap: wrap; }
  .modal-sheet { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
