:root {
  --bg: #030712;
  --surface: #07111f;
  --surface-2: #0b1729;
  --surface-3: #0e2035;
  --text: #e5f0ff;
  --muted: #9fb1c8;
  --muted-2: #71849d;
  --border: #1f3a56;
  --border-soft: rgba(56, 189, 248, 0.18);
  --accent: #38bdf8;
  --green: #22c55e;
  --yellow: #facc15;
  --purple: #a78bfa;
  --danger: #fb7185;
  --radius: 22px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  background:
    radial-gradient(circle at 16% 0%, rgba(56, 189, 248, 0.13), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(167, 139, 250, 0.10), transparent 24%),
    linear-gradient(180deg, #030712, #07111f 42%, #030712 100%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.052) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.03) 0, rgba(255,255,255,.03) 1px, transparent 1px, transparent 7px);
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 14px;
  background: var(--accent);
  color: #001018;
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 99;
  font-weight: 900;
}
.skip-link:focus { left: 14px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - var(--container)) / 2));
  background: rgba(3, 7, 18, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-logo-card {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 15px;
  background: #f8fafc;
}
.brand-logo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand strong {
  display: block;
  line-height: 1.1;
  font-weight: 900;
}
.brand small {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.topnav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.9rem;
}
.topnav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}

main,
.site-footer {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.hero {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 54px;
  align-items: center;
  padding: 84px 0 92px;
}

.terminal-label,
.id,
.lab-head,
.record-card span,
.note-list article span,
.system-map span {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 850;
}

.terminal-label {
  color: var(--accent);
  font-size: 0.82rem;
  margin: 0 0 18px;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 820px;
  font-size: clamp(3.4rem, 7vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  margin-bottom: 26px;
}

h2 {
  font-size: clamp(2rem, 4vw, 4.1rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-copy,
.section-header > p,
.lab-row span,
.record-card p,
.note-list p,
.system-map p,
.contact-panel p {
  color: var(--muted);
}

.hero-copy {
  max-width: 720px;
  font-size: 1.12rem;
  margin-bottom: 26px;
}

.command-search {
  max-width: 760px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(3, 7, 18, 0.52);
  margin-bottom: 26px;
}
.command-search span {
  color: var(--green);
  font-family: var(--mono);
  font-weight: 900;
}
.command-search code {
  color: #dbeafe;
  font-family: var(--mono);
  font-size: 0.94rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 850;
}
.btn-primary {
  color: #001018;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.22);
}
.btn-secondary {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
}
.btn-ghost {
  color: var(--muted);
  border: 1px solid var(--border);
}

.status-panel,
.lab-table,
.featured-record,
.note-list article,
.system-map div,
.contact-panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    rgba(7, 17, 31, 0.84);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,.24);
}

.status-panel {
  overflow: hidden;
}
.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--accent);
}
.panel-toolbar span:nth-child(2) { background: var(--green); }
.panel-toolbar span:nth-child(3) { background: var(--purple); }
.panel-toolbar strong {
  margin-left: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.status-grid div {
  padding: 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.status-grid div:nth-child(2),
.status-grid div:nth-child(4) { border-right: 0; }
.status-grid div:nth-child(3),
.status-grid div:nth-child(4) { border-bottom: 0; }
.status-grid span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.status-grid strong {
  font-size: 1.3rem;
}

pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
}
pre code {
  color: #dbeafe;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.lab-index-section,
.featured-record,
.notes-section,
.system-map-section,
.contact-panel {
  margin: 0 0 96px;
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.55fr);
  gap: 38px;
  align-items: end;
  margin-bottom: 28px;
}

.section-header p {
  margin-bottom: 0;
}

.lab-table {
  overflow: hidden;
}
.lab-row {
  display: grid;
  grid-template-columns: 96px minmax(220px, 1.05fr) 150px 130px minmax(250px, 1.05fr) 92px;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.lab-row:last-child { border-bottom: 0; }
.lab-row:hover:not(.lab-head) { background: rgba(56,189,248,.055); }
.lab-head {
  color: var(--muted-2);
  background: rgba(3, 7, 18, 0.45);
  font-size: 0.72rem;
}
.lab-row > span:nth-child(2) {
  color: var(--text);
  font-weight: 750;
}
.id {
  color: var(--accent) !important;
  font-size: 0.76rem;
}
.lab-row a {
  color: var(--accent);
  font-weight: 850;
}
mark {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  background: transparent;
}
.published {
  color: var(--green);
  border: 1px solid rgba(34,197,94,.35);
  background: rgba(34,197,94,.08);
}
.draft {
  color: var(--yellow);
  border: 1px solid rgba(250,204,21,.35);
  background: rgba(250,204,21,.08);
}
.muted-row {
  opacity: 0.82;
}

.featured-record {
  padding: 28px;
}
.record-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}
.record-link {
  color: var(--accent);
  font-weight: 850;
  white-space: nowrap;
}
.record-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
}
.record-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(3, 7, 18, 0.38);
}
.record-card.large {
  grid-row: span 2;
}
.record-card span {
  display: block;
  color: var(--green);
  font-size: 0.72rem;
  margin-bottom: 8px;
}
.record-card p {
  margin: 0;
}
.architecture-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(56,189,248,.045);
}
.architecture-strip span {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}
.architecture-strip i {
  width: 34px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
}

.note-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.note-list article {
  padding: 22px;
}
.note-list article span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  margin-bottom: 16px;
}

.system-map {
  display: grid;
  grid-template-columns: 1fr 38px 1fr 38px 1fr 38px 1fr 38px 1fr;
  align-items: center;
}
.system-map div {
  min-height: 210px;
  padding: 22px;
}
.system-map span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  margin-bottom: 14px;
}
.system-map strong {
  display: block;
  font-size: 1.14rem;
  margin-bottom: 8px;
}
.system-map b {
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  opacity: 0.7;
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 30px;
}
.contact-panel h2 {
  max-width: 760px;
  font-size: clamp(1.8rem, 3vw, 3.3rem);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-footer p { margin: 0; }
.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.site-footer a:hover {
  color: var(--accent);
}

@media (max-width: 1040px) {
  .hero,
  .section-header,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .lab-row {
    grid-template-columns: 80px 1fr 120px;
  }

  .lab-head span:nth-child(n+4),
  .lab-row span:nth-child(n+4),
  .lab-row a {
    display: none;
  }

  .record-grid,
  .note-list {
    grid-template-columns: 1fr 1fr;
  }

  .system-map {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .system-map b {
    height: 34px;
    width: 2px;
    margin-inline: auto;
  }
}

@media (max-width: 700px) {
  .topbar {
    position: static;
    display: block;
    padding: 14px;
  }

  .topnav {
    margin-top: 12px;
  }

  main,
  .site-footer {
    width: min(100% - 28px, var(--container));
  }

  .hero {
    min-height: auto;
    padding: 62px 0 76px;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4.2rem);
    line-height: 0.95;
  }

  .status-panel {
    display: none;
  }

  .record-grid,
  .note-list {
    grid-template-columns: 1fr;
  }

  .record-header,
  .site-footer {
    display: block;
  }

  .site-footer div {
    margin-top: 14px;
  }

  .command-search {
    align-items: flex-start;
  }

  .command-search code {
    overflow-wrap: anywhere;
  }
}


/* Project detail pages */
.detail-main {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.detail-hero {
  padding: 72px 0 44px;
  border-bottom: 1px solid var(--border);
}

.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
}

.detail-nav a {
  color: var(--muted);
  font-weight: 750;
}

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

.detail-title-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 42px;
  align-items: end;
}

.detail-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.detail-title-grid h1 {
  max-width: 900px;
  font-size: clamp(3rem, 6vw, 5.6rem);
}

.detail-lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.12rem;
  margin-bottom: 0;
}

.detail-metadata {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(7, 17, 31, 0.76);
}

.detail-metadata div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(31, 58, 86, 0.72);
  padding-bottom: 9px;
}

.detail-metadata div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-metadata span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 850;
}

.detail-metadata strong {
  color: var(--text);
  text-align: right;
}

.detail-content {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding: 54px 0 96px;
}

.detail-sidebar {
  position: sticky;
  top: 98px;
  align-self: start;
  display: grid;
  gap: 10px;
}

.detail-sidebar a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(7, 17, 31, 0.55);
}

.detail-sidebar a:hover {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.5);
}

.detail-article {
  display: grid;
  gap: 22px;
}

.detail-section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    rgba(7, 17, 31, 0.82);
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0,0,0,.18);
}

.detail-section-card h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  margin-bottom: 14px;
}

.detail-section-card p,
.detail-section-card li {
  color: var(--muted);
}

.detail-section-card p:last-child,
.detail-section-card ul:last-child,
.detail-section-card ol:last-child {
  margin-bottom: 0;
}

.detail-section-card ul,
.detail-section-card ol {
  padding-left: 1.2rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 20px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.detail-grid-2,
.detail-grid-3 {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

.detail-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.detail-mini-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(3, 7, 18, 0.36);
}

.detail-mini-card span {
  display: block;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.detail-mini-card p {
  margin: 0;
}

.pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(56,189,248,.045);
}

.pipeline span {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.pipeline i {
  width: 34px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
}

.repo-cta {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
}

.next-projects {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
}

.next-projects a {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: rgba(7, 17, 31, 0.74);
  color: var(--text);
  font-weight: 850;
}

.next-projects a span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.next-projects a:hover {
  border-color: rgba(56, 189, 248, 0.55);
}

@media (max-width: 920px) {
  .detail-title-grid,
  .detail-content,
  .detail-grid-2,
  .detail-grid-3 {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .detail-main {
    width: min(100% - 28px, var(--container));
  }

  .detail-nav {
    display: block;
  }

  .detail-nav a {
    display: inline-block;
    margin: 0 10px 10px 0;
  }

  .detail-hero {
    padding-top: 42px;
  }

  .next-projects {
    flex-direction: column;
  }
}


.skill-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.skill-proof-grid div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(3, 7, 18, 0.36);
}

.skill-proof-grid span {
  display: block;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.skill-proof-grid p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 920px) {
  .skill-proof-grid {
    grid-template-columns: 1fr;
  }
}


.note-list article h3 a {
  color: inherit;
}

.note-list article h3 a:hover {
  color: var(--accent);
}

.note-row-link {
  background: rgba(34, 197, 94, 0.025);
}

/* Featured record clean switcher */
.featured-record-carousel {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.record-carousel-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 22px;
  margin-bottom: 22px;
}

.record-carousel-top h2 {
  margin-bottom: 0;
}

.record-stage {
  position: relative;
  min-height: 430px;
}

.record-slide {
  display: none;
  opacity: 0;
  transform: translateY(10px) scale(0.992);
  filter: blur(2px);
  pointer-events: none;
}

.record-slide.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
  animation: recordPageIn 420ms cubic-bezier(.2, .72, .2, 1) both;
}

.record-slide.active.from-left {
  animation-name: recordPageInFromLeft;
}

.record-slide.active.from-right {
  animation-name: recordPageInFromRight;
}

@keyframes recordPageInFromRight {
  0% {
    opacity: 0;
    transform: translateX(24px) rotateY(-3deg) scale(.992);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotateY(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes recordPageInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-24px) rotateY(3deg) scale(.992);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotateY(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes recordPageIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(.992);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.record-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(31, 58, 86, 0.72);
}

.record-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.34);
  color: var(--muted);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.record-tab:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.48);
  transform: translateY(-1px);
}

.record-tab.active {
  color: #001018;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(56, 189, 248, 0.16);
}

@media (max-width: 700px) {
  .record-carousel-top {
    display: block;
  }

  .record-stage {
    min-height: auto;
  }

  .record-selector {
    gap: 7px;
  }

  .record-tab {
    font-size: 0.68rem;
    padding: 7px 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record-slide.active,
  .record-slide.active.from-left,
  .record-slide.active.from-right {
    animation: none;
  }

  .record-tab {
    transition: none;
  }
}


/* Modern featured-record next button */
.record-switcher-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.record-next-modern {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 8px 0 18px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 999px;
  color: #e5f0ff;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(167, 139, 250, 0.10)),
    rgba(3, 7, 18, 0.5);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  overflow: hidden;
  font-weight: 850;
}

.record-next-modern::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
  transform: translateX(-120%);
  transition: transform 420ms ease;
}

.record-next-modern:hover::before {
  transform: translateX(120%);
}

.record-next-modern:hover {
  border-color: rgba(56, 189, 248, 0.65);
  transform: translateY(-1px);
}

.record-next-modern span {
  position: relative;
  z-index: 1;
}

.record-next-modern strong {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #001018;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.22);
}

.record-selector {
  margin-top: 14px;
}

@media (max-width: 700px) {
  .record-switcher-bar {
    justify-content: flex-start;
  }

  .record-next-modern {
    width: 100%;
    justify-content: space-between;
  }
}


/* Premium arrow icon for the featured-record button */
.record-next-modern .arrow-orb {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #001018;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.95), rgba(255,255,255,0.12) 28%, transparent 48%),
    linear-gradient(135deg, var(--accent), #7dd3fc 48%, #60a5fa);
  box-shadow:
    0 12px 28px rgba(56, 189, 248, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -10px 18px rgba(3, 7, 18, 0.12);
  overflow: hidden;
}

.record-next-modern .arrow-orb::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.record-next-modern .arrow-orb svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #03111f;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}

.record-next-modern:hover .arrow-orb svg {
  transform: translateX(2px);
}

.record-next-modern:hover .arrow-orb {
  box-shadow:
    0 16px 34px rgba(56, 189, 248, 0.36),
    0 0 0 5px rgba(56, 189, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -10px 18px rgba(3, 7, 18, 0.12);
}


/* Modern previous + next record controls */
.record-switcher-bar {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.record-cycle-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 8px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 999px;
  color: #e5f0ff;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(167, 139, 250, 0.10)),
    rgba(3, 7, 18, 0.5);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  overflow: hidden;
  font-weight: 850;
}

.record-prev-modern {
  padding-left: 8px;
  padding-right: 18px;
}

.record-next-modern {
  padding-left: 18px;
  padding-right: 8px;
}

.record-cycle-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
  transform: translateX(-120%);
  transition: transform 420ms ease;
}

.record-cycle-button:hover::before {
  transform: translateX(120%);
}

.record-cycle-button:hover {
  border-color: rgba(56, 189, 248, 0.65);
  transform: translateY(-1px);
}

.record-cycle-button span {
  position: relative;
  z-index: 1;
}

.record-cycle-button .arrow-orb {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #001018;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.95), rgba(255,255,255,0.12) 28%, transparent 48%),
    linear-gradient(135deg, var(--accent), #7dd3fc 48%, #60a5fa);
  box-shadow:
    0 12px 28px rgba(56, 189, 248, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -10px 18px rgba(3, 7, 18, 0.12);
  overflow: hidden;
}

.record-cycle-button .arrow-orb::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.record-cycle-button .arrow-orb svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #03111f;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}

.record-next-modern:hover .arrow-orb svg {
  transform: translateX(2px);
}

.record-prev-modern:hover .arrow-orb svg {
  transform: translateX(-2px);
}

.record-cycle-button:hover .arrow-orb {
  box-shadow:
    0 16px 34px rgba(56, 189, 248, 0.36),
    0 0 0 5px rgba(56, 189, 248, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -10px 18px rgba(3, 7, 18, 0.12);
}

@media (max-width: 700px) {
  .record-switcher-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-cycle-button {
    width: 100%;
    justify-content: space-between;
  }

  .record-prev-modern {
    justify-content: flex-start;
  }

  .record-next-modern {
    justify-content: space-between;
  }
}


/* Contact section typography spacing fix */
.contact-panel h2 {
  line-height: 1.08;
  letter-spacing: -0.045em;
  max-width: 760px;
}

@media (max-width: 700px) {
  .contact-panel h2 {
    line-height: 1.12;
    letter-spacing: -0.035em;
  }
}


/* Featured record header cleanup */
.record-carousel-top h2 {
  margin-top: 0;
}


/* Anchor scroll position fix for sticky navbar */
html {
  scroll-padding-top: 63px;
}

#top,
#index,
#featured,
#notes,
#system-map {
  scroll-margin-top: 63px;
}

@media (max-width: 700px) {
  html {
    scroll-padding-top: 24px;
  }

  #top,
  #index,
  #featured,
  #notes,
  #system-map {
    scroll-margin-top: 24px;
  }
}

/* =========================================================
   ENHANCEMENTS — scroll progress, reveal, lab filtering,
   active nav, count-up. Appended; honors the lab aesthetic.
   ========================================================= */

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 60;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
  transition: transform 80ms linear;
}

/* Active nav indicator */
.topnav a {
  position: relative;
  transition: color 160ms ease;
}
.topnav a.is-active {
  color: var(--accent);
}
.topnav a.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}

/* Topbar elevation on scroll */
.topbar.is-scrolled {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  border-bottom-color: var(--accent);
}

/* ---------- Lab index controls (real command search) ---------- */
.lab-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.lab-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 240px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(3, 7, 18, 0.6);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.lab-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}
.lab-search .prompt {
  color: var(--green);
  font-family: var(--mono);
  font-weight: 900;
}
.lab-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.92rem;
  outline: none;
  min-width: 0;
}
.lab-search input::placeholder {
  color: var(--muted-2);
}

.lab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lab-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.lab-chip:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.lab-chip.is-active {
  color: #001018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
}

.lab-count {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.lab-row.is-hidden { display: none; }

.lab-empty {
  display: none;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.lab-empty.is-shown { display: block; }
.lab-empty .blink { color: var(--accent); }

/* highlight matched search term */
.lab-row mark.hit {
  background: rgba(250, 204, 21, 0.22);
  color: #fde68a;
  padding: 0 2px;
  border-radius: 3px;
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 540ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 540ms cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: none;
}
[data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; }
[data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: 60ms; }
[data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: 120ms; }
[data-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: 180ms; }
[data-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: 240ms; }

@media (max-width: 700px) {
  .lab-count { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  [data-reveal],
  [data-reveal-stagger] > * { opacity: 1; transform: none; transition: none; }
}

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