/* Red Schematic / Cyber-Brutalist — nicholascabel.com */
:root {
  --rs-bg: #100202;
  --rs-panel: #1a0505;
  --rs-red: #ef4444;
  --e2: cubic-bezier(0.2, 0.8, 0.2, 1);
  --rs-header-h: 148px;
  /* Shared content rhythm (all RS pages) */
  --rs-gutter-x: clamp(1rem, 3.5vw, 2.25rem);
  --rs-header-pad-top: 1.35rem;
}

::selection {
  background: #ef4444;
  color: #000;
}

html {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

body,
body * {
  text-transform: lowercase !important;
}

.rs-page-body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--rs-bg);
  color: #ef4444;
  -webkit-tap-highlight-color: transparent;
}

/* Multi-layer grid: 80px + 16px sub-grid */
.rs-grid-layers {
  background-color: var(--rs-bg);
  background-image: linear-gradient(
      to right,
      rgba(127, 29, 29, 0.22) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(127, 29, 29, 0.22) 1px, transparent 1px),
    linear-gradient(to right, rgba(220, 38, 38, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(220, 38, 38, 0.12) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: 0 0, 0 0, 0 0, 0 0;
}

.rs-radial-stack {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
      ellipse 90% 60% at 50% 0%,
      rgba(239, 68, 68, 0.12),
      transparent 55%
    ),
    radial-gradient(
      ellipse 50% 45% at 100% 40%,
      rgba(127, 29, 29, 0.18),
      transparent 60%
    );
}

.rs-vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 35%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.rs-bg-auto.rs-grid-layers,
.rs-bg-auto.rs-radial-stack,
.rs-bg-auto.rs-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.rs-bg-auto.rs-grid-layers {
  z-index: 0;
}
.rs-bg-auto.rs-radial-stack {
  z-index: 1;
}
.rs-bg-auto.rs-vignette {
  z-index: 2;
}

@keyframes rs_scan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-scan {
  animation: rs_scan 3.5s linear infinite;
}

.rs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.55);
  padding: 0.65rem 1.35rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ef4444;
  background: rgba(16, 2, 2, 0.65);
  backdrop-filter: blur(12px);
  text-decoration: none;
  transition: transform 0.2s var(--e2), background 0.2s var(--e2), color 0.2s var(--e2),
    border-color 0.2s var(--e2), box-shadow 0.2s var(--e2);
}

.rs-btn:hover {
  transform: scale(1.03);
  background: #ef4444;
  color: #000;
  border-color: #ef4444;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.45);
}

.rs-feature-card {
  border: 1px solid rgba(127, 29, 29, 0.35);
  background: rgba(26, 5, 5, 0.45);
  backdrop-filter: blur(18px);
  border-radius: 0.25rem;
  cursor: crosshair;
}

.rs-hollow {
  color: transparent;
  -webkit-text-stroke: 1px rgba(239, 68, 68, 0.85);
}

.rs-vertical-rail {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.5em;
}

.rs-main,
main.rs-main {
  position: relative;
  z-index: 10;
}

body.rs-site {
  background-color: var(--rs-bg) !important;
  color: #ef4444 !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  padding-left: var(--rs-gutter-x);
  padding-right: var(--rs-gutter-x);
  padding-bottom: 5.75rem;
}

/* Clear fixed header + breathe under nav */
body.rs-site > main:first-of-type,
body.rs-site > .wrap:first-of-type,
body.rs-site > main {
  padding-top: calc(var(--rs-header-h, 148px) + var(--rs-header-pad-top));
}

body.rs-site .bl-shell {
  padding-top: calc(var(--rs-header-h, 148px) + var(--rs-header-pad-top));
}

body.rs-site .page,
body.rs-site .shell,
body.rs-site .container,
body.rs-site main {
  position: relative;
  z-index: 10;
}

/* Legacy page backgrounds — RS shell injects its own layers */
body.rs-site #bg-container,
body.rs-site #bgwrap {
  display: none !important;
}

/* --- Layered system header --- */
.nicholas-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: #ef4444;
  -webkit-font-smoothing: antialiased;
}

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

.nc-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
  border-bottom: 1px solid rgba(127, 29, 29, 0.3);
  background: rgba(16, 2, 2, 0.95);
  padding: 0.4rem 0.75rem;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(239, 68, 68, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 640px) {
  .nc-status-strip {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.nc-status-strip .nc-strong {
  font-weight: 800;
  color: #ef4444;
}
.nc-status-strip .nc-bright {
  color: rgba(239, 68, 68, 0.9);
}
.nc-status-strip .nc-dim {
  color: rgba(239, 68, 68, 0.8);
}

.nc-telemetry {
  display: none;
}
@media (min-width: 640px) {
  .nc-telemetry {
    display: inline;
  }
}

.nc-node {
  display: none;
}
@media (min-width: 768px) {
  .nc-node {
    display: inline;
    margin-left: auto;
    opacity: 0.5;
  }
}

.nc-ai-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(127, 29, 29, 0.3);
  background: rgba(12, 2, 2, 0.95);
  padding: 0.35rem 0.75rem;
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(239, 68, 68, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 640px) {
  .nc-ai-strip {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.nc-ai-strip .nc-ai-label {
  font-weight: 800;
  color: rgba(239, 68, 68, 0.7);
}
.nc-ai-strip .nc-ai-sep {
  flex-shrink: 0;
  color: rgba(127, 29, 29, 0.5);
}
.nc-ai-strip .nc-ai-list {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(239, 68, 68, 0.45);
}

.nc-nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  border-bottom: 1px solid rgba(220, 38, 38, 0.5);
  background: rgba(26, 5, 5, 0.75);
  padding: 0.6rem 0.75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@media (min-width: 640px) {
  .nc-nav-row {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.nc-brand {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 0.5rem;
  border-radius: 2px;
  border: 1px solid rgba(220, 38, 38, 0.5);
  background: rgba(16, 2, 2, 0.6);
  padding: 0.35rem 0.55rem;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.22);
  transition: transform 0.15s var(--e2);
}
@media (min-width: 640px) {
  .nc-brand {
    font-size: 15px;
    padding: 0.4rem 0.65rem;
    gap: 0.55rem;
  }
}
.nc-brand:hover {
  transform: scale(1.02);
}

.nc-brand-dot {
  height: 8px;
  width: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: nc-header-pulse 2s ease-in-out infinite;
}
@media (min-width: 640px) {
  .nc-brand-dot {
    height: 9px;
    width: 9px;
  }
}

@keyframes nc-header-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.nc-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nc-brand-hub {
  color: #f87171;
  font-size: 1.08em;
  letter-spacing: 0.04em;
}

.nc-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@media (min-width: 640px) {
  .nc-nav {
    gap: 0.5rem 1.75rem;
    font-size: 11px;
  }
}

.nc-nav a {
  text-decoration: none;
  color: rgba(239, 68, 68, 0.45);
  transition: color 0.15s ease, filter 0.15s ease;
}
.nc-nav a:hover {
  color: #ef4444;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.nc-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .nc-tools {
    gap: 0.65rem;
  }
}

.nc-clock {
  display: none;
  font-size: 9px;
  letter-spacing: 0.02em;
  color: rgba(239, 68, 68, 0.35);
}
@media (min-width: 768px) {
  .nc-clock {
    display: block;
  }
}

.nc-auth-btn {
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid rgba(220, 38, 38, 0.5);
  background: rgba(16, 2, 2, 0.8);
  padding: 0.4rem 0.6rem;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ef4444;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.nc-auth-btn:hover {
  transform: scale(1.05);
  border-color: #ef4444;
  background: #ef4444;
  color: #000;
}

.nicholas-header.rs-secure .nc-auth-btn {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
}

.nicholas-header .rs-contact-dd {
  position: relative;
}
.nicholas-header .rs-contact-dd summary {
  list-style: none;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid rgba(127, 29, 29, 0.3);
  padding: 0.4rem 0.6rem;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(239, 68, 68, 0.8);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.nicholas-header .rs-contact-dd summary::-webkit-details-marker {
  display: none;
}
.nicholas-header .rs-contact-dd summary:hover {
  transform: scale(1.05);
  border-color: #ef4444;
  background: #ef4444;
  color: #000;
}

.nicholas-header .rs-contact-panel {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 1101;
  margin-top: 0.35rem;
  min-width: min(100vw - 1.5rem, 16rem);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: 2px;
  background: rgba(26, 5, 5, 0.98);
  padding: 0.35rem 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nicholas-header .rs-contact-panel a {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(239, 68, 68, 0.85);
  transition: background 0.12s ease, color 0.12s ease;
}
.nicholas-header .rs-contact-panel a:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.nicholas-header .rs-contact-panel .nc-contact-rule {
  margin: 0.35rem 0;
  border: 0;
  border-top: 1px solid rgba(127, 29, 29, 0.4);
}
.nicholas-header .rs-contact-panel a.nc-contact-muted {
  font-size: 9px;
  color: rgba(239, 68, 68, 0.5);
}

.nc-scan-track {
  position: relative;
  height: 2px;
  width: 100%;
  overflow: hidden;
  background: rgba(69, 10, 10, 0.4);
}

.nc-scan-line {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(45%, 280px);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(239, 68, 68, 0.95),
    transparent
  );
  opacity: 0.9;
  animation: rs_header_scan 3.2s linear infinite;
}

@keyframes rs_header_scan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(calc(100vw + 100%));
  }
}

/* CLI footer */
.rs-cli-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  border-top: 1px solid rgba(127, 29, 29, 0.3);
  background: rgba(16, 2, 2, 0.9);
  padding: 0.55rem 1rem;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(239, 68, 68, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 640px) {
  .rs-cli-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.rs-cli-footer-inner {
  display: flex;
  max-width: 1680px;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  margin: 0 auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

@media (min-width: 640px) {
  .rs-cli-footer-inner {
    gap: 0.25rem 2.5rem;
  }
}

.rs-cli-footer .rs-cli-prompt {
  color: rgba(239, 68, 68, 0.8);
}
.rs-cli-footer .rs-cli-accent {
  color: #ef4444;
}
.rs-cli-footer .rs-cli-muted {
  color: rgba(239, 68, 68, 0.35);
}
.rs-cli-footer .rs-cli-check {
  display: none;
}
@media (min-width: 640px) {
  .rs-cli-footer .rs-cli-check {
    display: inline;
  }
}
.rs-cli-footer .rs-cli-copy {
  margin-left: auto;
}

.rs-cli-footer .rs-cli-footer-link {
  color: #ef4444;
  text-decoration: none;
}
.rs-cli-footer .rs-cli-footer-link:hover {
  text-decoration: underline;
}

/* Legacy decorative layers — RS shell provides background */
body.rs-site canvas#snow,
body.rs-site .bg-wrap {
  display: none !important;
}

/* —— Migrated pages: shared RS alignment (local :root still fine-tunes) —— */
body.rs-site.page-projects .hero h1,
body.rs-site.page-projects .card h3 {
  color: #ef4444;
}
body.rs-site.page-projects .hero p,
body.rs-site.page-projects .meta {
  color: rgba(239, 68, 68, 0.55);
}
body.rs-site.page-projects .card {
  border-color: rgba(127, 29, 29, 0.45);
  background: linear-gradient(180deg, rgba(26, 5, 5, 0.75), rgba(16, 2, 2, 0.5));
}
body.rs-site.page-projects .card:hover {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(239, 68, 68, 0.12) inset;
}
body.rs-site.page-projects .thumb {
  background: radial-gradient(800px 420px at 20% 0%, rgba(239, 68, 68, 0.15), transparent 60%),
    radial-gradient(800px 420px at 90% 120%, rgba(127, 29, 29, 0.2), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.55));
}
body.rs-site.page-projects .dot {
  background: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}
body.rs-site.page-projects .pill {
  border-color: rgba(127, 29, 29, 0.45);
  background: rgba(16, 2, 2, 0.6);
  color: rgba(239, 68, 68, 0.85);
}
body.rs-site.page-projects .btn.primary {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  color: #000;
}
body.rs-site.page-projects .redirect-card {
  background: rgba(16, 2, 2, 0.95);
  border-color: rgba(127, 29, 29, 0.5);
  color: #ef4444;
}
body.rs-site.page-projects .redirect-card p {
  color: rgba(239, 68, 68, 0.55);
}

body.rs-site.page-contact .hero h1 {
  color: #ef4444;
}
body.rs-site.page-contact .hero p {
  color: rgba(239, 68, 68, 0.55);
}
body.rs-site.page-contact .panel {
  border-color: rgba(127, 29, 29, 0.4);
  background: linear-gradient(180deg, rgba(26, 5, 5, 0.55), rgba(16, 2, 2, 0.4));
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}
body.rs-site.page-contact .node {
  border-color: rgba(127, 29, 29, 0.35);
  background: rgba(16, 2, 2, 0.5);
  color: #ef4444;
}
body.rs-site.page-contact .node:hover,
body.rs-site.page-contact .node:focus {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2) inset;
}
body.rs-site.page-contact .tag {
  color: #ef4444;
}
body.rs-site.page-contact .simlog {
  border-top-color: rgba(127, 29, 29, 0.35);
  background: rgba(16, 2, 2, 0.75);
  color: rgba(239, 68, 68, 0.85);
}
body.rs-site.page-contact .simtime {
  color: rgba(239, 68, 68, 0.5);
}
body.rs-site.page-contact .simok {
  color: #ef4444;
}
body.rs-site.page-contact .led i {
  background: rgba(239, 68, 68, 0.45);
}
body.rs-site.page-contact .footer {
  display: none;
}

body.rs-site.page-resume::before {
  display: none !important;
}

body.rs-site.page-resume main.wrap {
  padding-top: calc(var(--rs-header-h, 148px) + var(--rs-header-pad-top));
}

body.rs-site.page-software .footer {
  display: none;
}

body.rs-site.page-quotes .vignette {
  z-index: 5 !important;
}

body.rs-site.page-music .music-bg {
  display: none;
}

body.rs-site.page-qr canvas.bgfx {
  display: none;
}

body.rs-site.page-bgtest-3d .prvt-vignette {
  display: none;
}

body.rs-site.page-archive #stars {
  display: none !important;
}
