:root {
  --dark-gunmetal: #1b222a;
  --bright-gray: #3c444f;
  --waterfall: #64c5fc;
  --neutral-light-blue: #8ca1b4;
  --shuttle-gray: #5e6670;

  --bg-deep: #13181e;
  --text-main: #f0f4f8;
  --danger: #ff5c6c;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--dark-gunmetal);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(100, 197, 252, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(140, 161, 180, 0.06) 0%, transparent 40%),
    linear-gradient(rgba(60, 68, 79, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 68, 79, 0.15) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(27, 34, 42, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bright-gray);
}

.nav-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 42px;
  height: 46px;
  transition: transform 0.25s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.06);
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--waterfall);
  font-weight: 600;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.nav-btn {
  background: transparent;
  color: var(--neutral-light-blue);
  border: 1px solid transparent;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(60, 68, 79, 0.45);
}

.nav-btn.active {
  color: var(--dark-gunmetal);
  background: var(--waterfall);
  border-color: var(--waterfall);
}

.vault-btn {
  border: 1px solid var(--bright-gray);
}

/* Main Layout */
.main-container {
  max-width: 1180px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
}

.tab-section {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-card {
  background: linear-gradient(145deg, rgba(60, 68, 79, 0.55), rgba(27, 34, 42, 0.9));
  border: 1px solid var(--bright-gray);
  border-radius: var(--radius);
  padding: 3rem 2.25rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--waterfall);
  background: rgba(100, 197, 252, 0.12);
  border: 1px solid rgba(100, 197, 252, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero-card h1 {
  font-size: 2.5rem;
  margin-bottom: 0.85rem;
}

.hero-lead {
  max-width: 680px;
  margin: 0 auto 1.75rem;
  color: var(--neutral-light-blue);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Typography & Helpers */
.accent { color: var(--waterfall); }
.muted { color: var(--neutral-light-blue); font-size: 0.9rem; }
.hidden { display: none !important; }

.section-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--bright-gray);
  padding-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
}

/* Grids & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 1.5rem;
}

.info-card, .edu-article, .portfolio-card, .meme-card, .contact-card-wrap {
  background: rgba(60, 68, 79, 0.32);
  border: 1px solid var(--bright-gray);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.info-card:hover, .portfolio-card:hover, .meme-card:hover, .contact-card-wrap:hover {
  border-color: var(--waterfall);
  transform: translateY(-2px);
}

.info-card h3, .edu-article h3 {
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.info-card p, .edu-article p {
  color: var(--neutral-light-blue);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Educational Articles */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.edu-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--waterfall);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.code-block {
  background: var(--bg-deep);
  border: 1px solid var(--shuttle-gray);
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
  font-family: "Fira Code", Consolas, monospace;
  font-size: 0.86rem;
  color: var(--waterfall);
  overflow-x: auto;
  margin: 0.85rem 0 0;
}

/* Portfolio & Meme Cards */
.card-img-wrap {
  width: 100%;
  height: 190px;
  background: var(--bg-deep);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--shuttle-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meme-card .card-img-wrap {
  height: 250px;
}

.meme-card .card-img-wrap img {
  object-fit: contain;
}

.card-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--waterfall);
  text-transform: uppercase;
}

.delete-btn {
  margin-top: 0.85rem;
  background: rgba(255, 92, 108, 0.15);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
}

/* Contact Cards */
.contact-card {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  text-decoration: none;
  color: var(--text-main);
}

.contact-icon {
  font-size: 2rem;
  background: rgba(100, 197, 252, 0.1);
  border: 1px solid rgba(100, 197, 252, 0.3);
  width: 58px;
  height: 58px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Buttons & Forms */
.btn {
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--waterfall);
  color: var(--dark-gunmetal);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bright-gray);
  color: var(--text-main);
  border-color: var(--shuttle-gray);
}

.btn-danger {
  background: rgba(255, 92, 108, 0.2);
  color: var(--danger);
  border-color: var(--danger);
}

.full-width { width: 100%; }

input, textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--shuttle-gray);
  color: var(--text-main);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--waterfall);
}

.admin-editor-panel {
  background: rgba(100, 197, 252, 0.07);
  border: 1px dashed var(--waterfall);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Vault Box */
.vault-box {
  max-width: 460px;
  margin: 2.5rem auto;
  background: rgba(60, 68, 79, 0.38);
  border: 1px solid var(--bright-gray);
  border-radius: var(--radius);
  padding: 2.25rem;
  text-align: center;
}

.vault-icon {
  font-size: 2.6rem;
  margin-bottom: 0.5rem;
}

.vault-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.5rem 0 0.5rem;
}

.vault-status {
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 1.4rem;
}

.vault-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bright-gray);
}

.vault-list {
  list-style: none;
  margin: 1rem 0;
}

.vault-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(94, 102, 113, 0.4);
}

.vault-list a {
  color: var(--waterfall);
  text-decoration: none;
  font-weight: 600;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--bright-gray);
  margin: 1.25rem 0;
}

/* Footer */
.footer {
  border-top: 1px solid var(--bright-gray);
  background: var(--bg-deep);
  padding: 1.25rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.86rem;
}

/* Fun Tab: public press counter */
.fun-card {
  max-width: 520px;
  margin: 1rem auto 0;
  background: linear-gradient(160deg, rgba(100, 197, 252, 0.12), rgba(27, 34, 42, 0.92));
  border: 1px solid var(--bright-gray);
  border-radius: var(--radius);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.fun-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--waterfall);
  background: rgba(100, 197, 252, 0.12);
  border: 1px solid rgba(100, 197, 252, 0.35);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}

.fun-count {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 1rem 0 0.25rem;
  color: var(--text-main);
  text-shadow: 0 0 28px rgba(100, 197, 252, 0.45);
  font-variant-numeric: tabular-nums;
}

.fun-count.bump {
  animation: funCountBump 0.35s ease;
}

.fun-count-label {
  color: var(--neutral-light-blue);
  font-size: 0.92rem;
  letter-spacing: 0.4px;
  margin-bottom: 1.75rem;
}

.fun-press-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.1rem 3.25rem;
  border: none;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-family: inherit;
  color: var(--dark-gunmetal);
  background: linear-gradient(135deg, var(--waterfall), #9fe0ff 45%, var(--waterfall));
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(100, 197, 252, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: funBob 3.2s ease-in-out infinite;
}

.fun-press-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 34px rgba(100, 197, 252, 0.5), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.fun-press-btn:active {
  transform: translateY(2px) scale(0.97);
}

.fun-press-btn.pressed {
  animation: funPop 0.45s ease;
}

.fun-press-glow {
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 55%);
  transform: translateX(-120%);
  animation: funSweep 3.4s ease-in-out infinite;
}

.fun-note {
  margin-top: 1.5rem;
  font-size: 0.82rem;
}

@keyframes funBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes funPop {
  0% { transform: scale(1); }
  35% { transform: scale(0.9); }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes funSweep {
  0%, 65% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes funCountBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); color: var(--waterfall); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .fun-press-btn,
  .fun-press-glow,
  .fun-press-btn.pressed,
  .fun-count.bump {
    animation: none;
  }
}

/* ---------- Module permalinks, copy buttons, filters, collapse ---------- */
.edu-article {
  min-width: 0;
}

.edu-article h1 {
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: 0.85rem;
}

.edu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.module-body p:last-child { margin-bottom: 0; }

.edu-article.is-collapsible.collapsed .module-body {
  position: relative;
  max-height: 9.5rem;
  overflow: hidden;
}

.edu-article.is-collapsible.collapsed .module-body::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4rem;
  background: linear-gradient(rgba(27, 34, 42, 0), rgba(27, 34, 42, 0.94) 72%);
}

.edu-article.filtered-out { display: none; }

.edu-article.is-target {
  border-color: var(--waterfall);
  box-shadow: 0 0 0 1px rgba(100, 197, 252, 0.5), 0 10px 26px rgba(0, 0, 0, 0.35);
}

.link-btn {
  background: transparent;
  border: 1px solid var(--shuttle-gray);
  color: var(--neutral-light-blue);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.link-btn:hover {
  color: var(--waterfall);
  border-color: var(--waterfall);
  background: rgba(100, 197, 252, 0.1);
}

.module-toggle { margin-top: 0.7rem; display: inline-block; }

.code-details { margin-top: 0.9rem; }

.code-details summary {
  cursor: pointer;
  color: var(--waterfall);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0.3rem 0;
  list-style: none;
}

.code-details summary::-webkit-details-marker { display: none; }
.code-details summary::before { content: "\25B8  "; }
.code-details[open] summary::before { content: "\25BE  "; }

.code-wrap { position: relative; }

.code-wrap .copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  background: rgba(19, 24, 30, 0.92);
}

.code-block {
  max-width: 100%;
  margin: 0.35rem 0 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.filter-chip {
  background: rgba(60, 68, 79, 0.4);
  border: 1px solid var(--bright-gray);
  color: var(--neutral-light-blue);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  color: var(--text-main);
  border-color: var(--waterfall);
}

.filter-chip.active {
  background: var(--waterfall);
  border-color: var(--waterfall);
  color: var(--dark-gunmetal);
}

.filter-count {
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}

.module-foot { margin-top: 1rem; }

img { max-width: 100%; }

/* ---------- Branded 404 ---------- */
.notfound-card {
  max-width: 560px;
  margin: 3rem auto;
  background: rgba(60, 68, 79, 0.38);
  border: 1px solid var(--bright-gray);
  border-radius: var(--radius);
  padding: 2.75rem 2rem;
  text-align: center;
}

.notfound-code {
  display: block;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--waterfall);
  line-height: 1;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 28px rgba(100, 197, 252, 0.45);
}

.notfound-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.85rem;
}

.notfound-card p { margin-bottom: 1.5rem; }

.notfound-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.notfound-actions .btn { text-decoration: none; display: inline-block; }

.notfound-hint { margin-bottom: 0; font-size: 0.85rem; }

/* ---------- Mobile ---------- */
@media (max-width: 680px) {
  .form-row, .grid-2 { grid-template-columns: 1fr; }
  .hero-card h1 { font-size: 1.9rem; }
  .fun-count { font-size: 3.4rem; }
  .fun-press-btn { width: 100%; padding: 1rem 1.5rem; }

  body { line-height: 1.55; }
  .main-container { padding: 0 1rem; margin: 1.25rem auto; }
  .nav-container { padding: 0.7rem 1rem; gap: 0.6rem; }
  .nav-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .nav-btn { flex: 0 0 auto; padding: 0.45rem 0.8rem; font-size: 0.85rem; }
  .brand-logo { width: 34px; height: 38px; }
  .brand-title { font-size: 1.1rem; letter-spacing: 1.5px; }
  .brand-subtitle { font-size: 0.62rem; }
  .hero-card { padding: 1.9rem 1.15rem; }
  .hero-lead { font-size: 1rem; }
  .section-header h2 { font-size: 1.4rem; }
  .section-header p { font-size: 0.92rem; }
  .info-card, .edu-article, .portfolio-card, .meme-card, .contact-card-wrap { padding: 1.1rem; }
  .edu-article h1 { font-size: 1.3rem; }
  .edu-article h3 { font-size: 1.05rem; }
  .edu-article p, .info-card p { font-size: 0.93rem; }
  .edu-tag { font-size: 0.67rem; letter-spacing: 0.6px; }
  .code-block { font-size: 0.78rem; padding: 0.75rem 0.8rem; }
  .code-wrap .copy-btn { top: 0.4rem; right: 0.4rem; }
  .card-img-wrap { height: 165px; }
  .meme-card .card-img-wrap { height: 210px; }
  .contact-card { gap: 0.85rem; }
  .contact-icon { width: 48px; height: 48px; font-size: 1.6rem; }
  .vault-box { padding: 1.5rem 1.15rem; }
  .footer-inner { flex-direction: column; gap: 0.35rem; font-size: 0.8rem; }
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
  }
  .filter-chip { flex: 0 0 auto; }
  .notfound-card { padding: 2rem 1.25rem; margin: 1.5rem auto; }
}

@media (max-width: 380px) {
  .brand-text { display: none; }
  .fun-count { font-size: 2.8rem; }
}

/* ---------- Print (study notes) ---------- */
@media print {
  .navbar, .footer, .admin-editor-panel, .filter-bar, .filter-count,
  .link-btn, .delete-btn, .module-toggle, .code-wrap .copy-btn,
  .hero-actions, .vault-btn, .fun-card, .notfound-actions {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000;
  }

  .tab-section { display: none !important; }
  .tab-section.active { display: block !important; }
  .tab-section.active .edu-article { display: block !important; }

  .main-container { margin: 0; padding: 0; max-width: none; }

  .section-header, .edu-article, .code-block {
    border-color: #999 !important;
    box-shadow: none !important;
  }

  .edu-article {
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  .edu-article.is-collapsible.collapsed .module-body { max-height: none; }
  .edu-article.is-collapsible.collapsed .module-body::after { display: none; }

  .edu-article p, .edu-article h1, .edu-article h3, .edu-tag { color: #000 !important; }

  .code-block {
    background: #f4f4f4 !important;
    color: #000 !important;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .code-details > summary { display: none; }
  .code-details > .code-wrap { display: block !important; }

  a { color: #000 !important; text-decoration: underline; }
}


/* ---------- Cheatsheets, glossary, reading list, toolkit ---------- */
.cheat-card .code-wrap { margin-top: 0.7rem; }

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1.25rem;
}

.glossary-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.search-input {
  max-width: 380px;
  margin-bottom: 0.75rem;
}

.resource-link {
  color: var(--waterfall);
  text-decoration: none;
}

.resource-link:hover { text-decoration: underline; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
}

.tool-card h3 { margin-bottom: 0.85rem; }

.tool-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--neutral-light-blue);
  margin-bottom: 0.35rem;
}

.tool-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.tool-row select {
  background: var(--bg-deep);
  border: 1px solid var(--shuttle-gray);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0 0.6rem;
  max-width: 100px;
  font-family: inherit;
}

.tool-btn { margin-top: 0.85rem; width: 100%; }

.tool-out {
  margin-top: 1rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.84rem;
}

.tool-out span {
  color: var(--neutral-light-blue);
  font-family: "Fira Code", Consolas, monospace;
  overflow-wrap: anywhere;
}

.tool-out b {
  color: var(--waterfall);
  display: inline-block;
  min-width: 128px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

.tool-error { color: var(--danger); font-size: 0.85rem; }

.tool-note { font-size: 0.8rem; margin-top: 1.25rem; }

@media (max-width: 680px) {
  .glossary-grid, .tools-grid { gap: 1rem; }
  .tool-out b { min-width: 104px; }
}

@media print {
  .tools-grid, .search-input, .glossary-card { display: none !important; }
}

/* keep long commands from widening grid cards on small screens */
.grid-2 > *, .grid-3 > * { min-width: 0; }
.info-card, .portfolio-card, .meme-card, .contact-card-wrap, .cheat-card, .tool-card { min-width: 0; }
.cheat-card .code-block { max-width: 100%; overflow-x: auto; }


/* ---------- Home: quick access + reference stats ---------- */
.hero-quick {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.6rem;
}

.quick-chip {
  background: rgba(60, 68, 79, 0.4);
  border: 1px solid var(--bright-gray);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-chip:hover {
  border-color: var(--waterfall);
  color: var(--waterfall);
  transform: translateY(-1px);
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat {
  background: rgba(60, 68, 79, 0.28);
  border: 1px solid var(--bright-gray);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.stat:hover {
  border-color: var(--waterfall);
  transform: translateY(-2px);
}

.stat-value {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--waterfall);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--neutral-light-blue);
  margin-top: 0.3rem;
}

/* ---------- Device Lab ---------- */
.lab-gate {
  max-width: 680px;
  margin: 0 auto;
  background: rgba(60, 68, 79, 0.38);
  border: 1px dashed var(--waterfall);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
}

.lab-gate-icon {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.lab-gate h3 { margin-bottom: 0.9rem; }

.lab-gate p {
  color: var(--neutral-light-blue);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}

.lab-gate-note {
  font-size: 0.8rem;
  margin: 1rem 0 0;
}

.lab-gate .btn { margin-top: 0.4rem; }

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.cap-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.cap-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--shuttle-gray);
  color: var(--neutral-light-blue);
}

.cap-badge.yes {
  color: var(--waterfall);
  border-color: rgba(100, 197, 252, 0.5);
  background: rgba(100, 197, 252, 0.1);
}

.cap-badge.no { opacity: 0.6; }

.lab-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.lab-meter {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 1px solid var(--shuttle-gray);
  margin-top: 1rem;
  overflow: hidden;
}

.lab-meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--waterfall), #9fe0ff);
  transition: width 0.08s linear;
}

.lab-video {
  display: none;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  margin-top: 1rem;
  border: 1px solid var(--shuttle-gray);
  background: #000;
}

.lab-video.is-live { display: block; }

.lab-note {
  font-size: 0.8rem;
  margin-top: 1.25rem;
}

@media (max-width: 680px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-value { font-size: 1.6rem; }
  .lab-gate { padding: 1.5rem 1.1rem; }
  .lab-actions .btn { flex: 1 1 46%; }
}

@media print {
  .lab-gate, .capability-grid, .lab-tools, .home-stats { display: none !important; }
}

.lab-warn {
  grid-column: 1 / -1;
  background: rgba(255, 92, 108, 0.08);
  border: 1px solid rgba(255, 92, 108, 0.45);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.lab-warn strong {
  display: block;
  color: var(--danger);
  margin-bottom: 0.35rem;
}

.lab-warn-btn { margin-top: 0.7rem; }

/* --- WALL OF HONOR -------------------------------- */
.honor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.honor-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius, 14px);
  border: 1px solid rgba(100, 197, 252, 0.25);
  background: linear-gradient(160deg, rgba(100, 197, 252, 0.08), rgba(24, 31, 39, 0.92));
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.honor-card:hover {
  transform: translateY(-6px);
  border-color: rgba(100, 197, 252, 0.65);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(100, 197, 252, 0.14);
}

.honor-photo {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.honor-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.65s ease;
}

.honor-card:hover .honor-photo img { transform: scale(1.07); }

.honor-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 48%, rgba(14, 19, 25, 0.88) 100%);
  pointer-events: none;
}

.honor-photo-fallback {
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  font-weight: 700;
  color: #64c5fc;
  background: radial-gradient(circle at 30% 20%, rgba(100, 197, 252, 0.22), rgba(24, 31, 39, 0.96));
}

.honor-card figcaption { padding: 1rem 1.15rem 1.25rem; }
.honor-card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }

.honor-sub {
  margin: 0;
  color: rgba(226, 236, 245, 0.72);
  font-size: 0.9rem;
  line-height: 1.45;
}

.honor-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.75rem 1.5rem;
  border: 1px dashed rgba(100, 197, 252, 0.35);
  border-radius: var(--radius, 14px);
  background: rgba(100, 197, 252, 0.04);
}

.honor-empty-icon { display: block; font-size: 2.6rem; margin-bottom: 0.6rem; }

@keyframes honorRise {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes honorHead {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#tab-honor.active .section-header { animation: honorHead 0.55s ease both; }

#tab-honor.active .honor-card,
#tab-honor.active .honor-empty {
  animation: honorRise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 110ms);
}

@media (prefers-reduced-motion: reduce) {
  #tab-honor.active .section-header,
  #tab-honor.active .honor-card,
  #tab-honor.active .honor-empty { animation: none; }
  .honor-card, .honor-photo img { transition: none; }
}

@media (max-width: 640px) {
  .honor-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .honor-card:hover { transform: none; }
}

/* --- FUN TAB: press latency & milestone ledger --- */
.fun-next {
  margin: 0.4rem 0 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.fun-latency {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  margin: 1rem 0 0.3rem;
  font-size: 0.85rem;
  color: rgba(226, 236, 245, 0.8);
}

.fun-latency b {
  color: #64c5fc;
  font-variant-numeric: tabular-nums;
}

.fun-milestones-wrap {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(140, 161, 180, 0.18);
  text-align: left;
}

.fun-milestones-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 236, 245, 0.6);
}

.fun-milestones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.fun-milestone {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(100, 197, 252, 0.06);
  border: 1px solid rgba(100, 197, 252, 0.16);
  font-size: 0.88rem;
}

.fun-milestone-value {
  font-weight: 700;
  color: #64c5fc;
  font-variant-numeric: tabular-nums;
}

.fun-milestone-label { color: rgba(226, 236, 245, 0.72); }

.fun-milestone-date {
  margin-left: auto;
  font-size: 0.8rem;
  color: rgba(226, 236, 245, 0.5);
  white-space: nowrap;
}

.fun-milestone-empty {
  font-size: 0.86rem;
  color: rgba(226, 236, 245, 0.55);
}

@media (max-width: 520px) {
  .fun-milestone { flex-wrap: wrap; }
  .fun-milestone-date { margin-left: 0; white-space: normal; }
}
