/* =========================================================
   RULEBUG · CYBERPUNK V2 — shared design system
   ========================================================= */

:root {
  /* Palette - More distinctive cyberpunk colors */
  --c-bg: #010103;
  --c-bg-2: #050308;
  --c-bg-3: #0a040d;
  --c-red: #ff003f;
  --c-red-soft: #ff4a6a;
  --c-red-deep: #b30022;
  --c-red-glow: rgba(255, 0, 63, .65);
  --c-cyan: #00ffff;
  --c-purple: #bf00ff;
  --c-white: #f8f8f8;
  --c-gray: #8a8a8a;
  --c-gray-dim: #4a4a4a;
  --c-line: rgba(255, 0, 63, .3);
  --c-panel: rgba(10, 4, 8, .6);

  /* Typography - More distinctive fonts */
  --f-display: 'Oxanium', 'Rajdhani', system-ui, sans-serif;
  --f-mono: 'Share Tech Mono', 'JetBrains Mono', ui-monospace, monospace;
  --f-accent: 'Orbitron', 'Rajdhani', system-ui, sans-serif;

  /* Sizes */
  --nav-h: 64px;
  --gutter: 6vw;
  --gutter-tight: 3vw;

  /* Shadows */
  --sh-panel: 0 0 25px rgba(255, 0, 63, .2), inset 0 0 35px rgba(255, 0, 63, .08);
  --sh-red: 0 0 22px var(--c-red-glow);
  --sh-purple: 0 0 18px rgba(191, 0, 255, .3);

  /* Easing */
  --ease-bug: cubic-bezier(.2, .7, .2, 1);
}

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

html,
body {
  background: var(--c-bg);
  color: var(--c-white);
  font-family: var(--f-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  min-height: 100dvh;
  opacity: 0;
  transition: opacity .35s ease-out;
}

body.rb-ready {
  opacity: 1;
}

/* Nav never hides — persists across transitions */
.rb-nav {
  opacity: 1 !important;
}

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

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: var(--c-red);
  color: var(--c-bg);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--c-bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-red), var(--c-red-deep));
}

/* =========================================================
   BACKGROUND LAYERS (used per-page)
   ========================================================= */
.rb-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 25%, rgba(155, 0, 21, .35) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(155, 0, 21, .18) 0%, transparent 60%),
    linear-gradient(180deg, #020204 0%, #08060a 50%, #02020a 100%);
}

/* Sevilla photo woven into the page bg as a faint, distant layer.
   Adds the same cinematographic atmosphere across every page. */
.rb-bg-city {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image: url('../assets/sevilla-cyberpunk-bg.jpg');
  background-size: cover;
  background-position: center 60%;
  opacity: .22;
  filter: contrast(1.05) brightness(.6) saturate(.8);
  mix-blend-mode: screen;
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
}

.rb-bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 0, 31, .05) 1px, transparent 1px) 0 0 / 100% 80px,
    linear-gradient(90deg, rgba(255, 0, 31, .05) 1px, transparent 1px) 0 0 / 80px 100%;
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
}

.rb-bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('../assets/noise.png');
  opacity: .10;
  mix-blend-mode: overlay;
  animation: noiseShift 1.2s steps(4) infinite;
}

.rb-bg-scanlines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
      rgba(255, 0, 31, .04) 0px, rgba(255, 0, 31, .04) 1px,
      transparent 2px, transparent 4px);
  mix-blend-mode: screen;
}

@keyframes noiseShift {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-2px, 1px);
  }

  50% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(-1px, 2px);
  }

  100% {
    transform: translate(0, 0);
  }
}

/* Bug swarm canvas (procedural particles) */
#bugSwarm {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .45;
}

/* =========================================================
   NAVBAR
   ========================================================= */
.rb-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(2, 2, 4, .85), rgba(2, 2, 4, .25) 80%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--c-line);
}

.rb-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-red) 30%, var(--c-red) 70%, transparent);
  opacity: .5;
}

.rb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--c-white);
  font-size: 14px;
}

.rb-logo img {
  width: 26px;
  height: 26px;
  filter: brightness(1.1) drop-shadow(0 0 8px var(--c-red-glow));
}

.rb-logo .red {
  color: var(--c-red);
}

.rb-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  font-family: var(--f-mono);
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rb-nav ul a {
  color: var(--c-gray);
  padding: 6px 0;
  position: relative;
  transition: color .25s var(--ease-bug);
}

.rb-nav ul a:hover {
  color: var(--c-white);
}

.rb-nav ul a.active {
  color: var(--c-red);
}

.rb-nav ul a::before {
  content: "[";
  opacity: 0;
  margin-right: 6px;
  color: var(--c-red);
  transition: opacity .25s;
}

.rb-nav ul a::after {
  content: "]";
  opacity: 0;
  margin-left: 6px;
  color: var(--c-red);
  transition: opacity .25s;
}

.rb-nav ul a:hover::before,
.rb-nav ul a:hover::after,
.rb-nav ul a.active::before,
.rb-nav ul a.active::after {
  opacity: 1;
}

.rb-burger {
  display: none;
  width: 28px;
  height: 28px;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.rb-burger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--c-red);
  transition: transform .3s var(--ease-bug);
}

.rb-burger span:nth-child(1) {
  top: 6px;
}

.rb-burger span:nth-child(2) {
  top: 13px;
}

.rb-burger span:nth-child(3) {
  top: 20px;
}

.rb-burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.rb-burger.open span:nth-child(2) {
  opacity: 0;
}

.rb-burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .rb-nav ul {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(2, 2, 4, .97);
    border-bottom: 1px solid var(--c-line);
    transform: translateY(-200%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .35s var(--ease-bug);
    padding: 20px var(--gutter);
    font-size: 13px;
  }

  .rb-nav ul.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .rb-nav ul li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--c-line);
  }

  .rb-burger {
    display: block;
  }
}

/* =========================================================
   PAGE TRANSITION CURTAIN
   ========================================================= */
.rb-curtain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: linear-gradient(90deg, #ff001f 0%, #9b0015 50%, #02020a 100%);
  transform: translateX(-100%);
  transition: transform .55s cubic-bezier(.7, 0, .3, 1);
}

.rb-curtain.show {
  transform: translateX(0);
}

.rb-curtain.exit {
  transform: translateX(100%);
}

.rb-curtain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../assets/glitch-lines.png');
  background-size: cover;
  opacity: .4;
  mix-blend-mode: screen;
}

/* =========================================================
   FOOTER
   ========================================================= */
.rb-footer {
  position: relative;
  z-index: 5;
  padding: 80px var(--gutter) 28px;
  border-top: 1px solid var(--c-line);
  font-family: var(--f-mono);
  color: var(--c-gray);
}

.rb-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-red) 30%, var(--c-red) 70%, transparent);
  opacity: .5;
}

.rb-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 60px;
}

.rb-footer h4 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--c-white);
  margin-bottom: 14px;
}

.rb-footer ul {
  list-style: none;
}

.rb-footer ul li {
  margin: 6px 0;
  font-size: 14px;
  letter-spacing: .04em;
}

.rb-footer ul a {
  color: var(--c-gray);
  transition: color .2s;
}

.rb-footer ul a:hover {
  color: var(--c-red);
}

.rb-footer p {
  font-size: 14px;
  line-height: 1.7;
}

.rb-footer .accent {
  color: var(--c-red);
}

.rb-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--c-line);
  padding-top: 18px;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rb-footer-bottom .terminal {
  color: var(--c-red-soft);
}

.rb-footer-bottom .terminal .blink {
  display: inline-block;
  width: 8px;
  height: 11px;
  background: var(--c-red);
  margin-left: 4px;
  vertical-align: -1px;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .rb-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .rb-footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* =========================================================
   COMMON UI BLOCKS
   ========================================================= */

/* Section title */
.rb-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: 14px;
}

.rb-section-tag::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--c-red);
}

.rb-section-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(36px, 5.4vw, 84px);
  line-height: .95;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--c-white);
  margin-bottom: 22px;
}

.rb-section-title .red {
  color: var(--c-red);
}

.rb-section-lead {
  font-family: var(--f-display);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.55;
  color: var(--c-gray);
  max-width: 720px;
}

/* HUD panel */
.rb-panel {
  position: relative;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  box-shadow: var(--sh-panel);
  padding: 16px;
  font-family: var(--f-mono);
}

.rb-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(var(--c-red), var(--c-red)) 0 0/14px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 0 0/1px 14px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 0/14px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 0/1px 14px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 0 100%/14px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 0 100%/1px 14px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 100%/14px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 100%/1px 14px no-repeat;
}

.rb-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--c-white);
}

.rb-panel-dots {
  display: flex;
  gap: 5px;
}

.rb-panel-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-red);
  box-shadow: 0 0 6px var(--c-red-glow);
  font-style: normal;
}

.rb-panel-dots i:nth-child(2) {
  background: #5a0010;
  box-shadow: none;
}

.rb-panel-dots i:nth-child(3) {
  background: #2a0008;
  box-shadow: none;
}

/* CTA button */
.rb-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-white);
  background: linear-gradient(180deg, rgba(255, 0, 31, .18), rgba(255, 0, 31, .04));
  border: 1px solid var(--c-red);
  position: relative;
  overflow: hidden;
  transition: transform .3s var(--ease-bug);
}

.rb-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s var(--ease-bug);
}

.rb-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 0, 31, .35);
}

.rb-btn:hover::before {
  transform: translateX(100%);
}

.rb-btn::after {
  content: "→";
  font-family: var(--f-mono);
  color: var(--c-red);
  font-size: 14px;
}

.rb-btn.solid {
  background: var(--c-red);
  color: var(--c-bg);
  border-color: var(--c-red);
}

.rb-btn.solid::after {
  color: var(--c-bg);
}

.rb-btn.ghost {
  background: transparent;
  border-color: var(--c-line);
  color: var(--c-gray);
}

.rb-btn.ghost:hover {
  color: var(--c-white);
  border-color: var(--c-red);
}

/* Tag chip */
.rb-tag {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-red);
  border: 1px solid var(--c-line);
  background: rgba(255, 0, 31, .05);
  margin-right: 6px;
  margin-bottom: 6px;
}

.rb-tag.cyan {
  color: var(--c-cyan);
  border-color: rgba(0, 217, 255, .3);
  background: rgba(0, 217, 255, .04);
}

.rb-tag.white {
  color: var(--c-white);
  border-color: rgba(243, 243, 243, .18);
  background: rgba(243, 243, 243, .02);
}

/* Scroll reveal */
.rb-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .7s var(--ease-bug), transform .7s var(--ease-bug);
}

.js .rb-reveal {
  opacity: 0;
  transform: translateY(20px);
}

.js .rb-reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.rb-reveal[data-delay="1"] {
  transition-delay: .08s;
}

.rb-reveal[data-delay="2"] {
  transition-delay: .16s;
}

.rb-reveal[data-delay="3"] {
  transition-delay: .24s;
}

.rb-reveal[data-delay="4"] {
  transition-delay: .32s;
}

.rb-reveal[data-delay="5"] {
  transition-delay: .40s;
}

.rb-reveal[data-delay="6"] {
  transition-delay: .48s;
}

/* Glitch text */
.rb-glitch {
  position: relative;
  display: inline-block;
}

.rb-glitch::before,
.rb-glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.rb-glitch::before {
  color: var(--c-red);
  transform: translate(-2px, 0);
  clip-path: inset(0 0 60% 0);
  animation: gA 5s infinite steps(1);
}

.rb-glitch::after {
  color: var(--c-cyan);
  opacity: .35;
  transform: translate(2px, 0);
  clip-path: inset(60% 0 0 0);
  animation: gB 5s infinite steps(1);
}

@keyframes gA {

  0%,
  90%,
  100% {
    transform: translate(0, 0);
    clip-path: inset(0 0 60% 0);
    opacity: 0;
  }

  91% {
    transform: translate(-3px, 1px);
    opacity: .9;
    clip-path: inset(10% 0 70% 0);
  }

  93% {
    transform: translate(2px, -1px);
    opacity: .8;
    clip-path: inset(40% 0 30% 0);
  }

  95% {
    transform: translate(-2px, 0);
    opacity: .9;
    clip-path: inset(60% 0 20% 0);
  }

  97% {
    opacity: 0;
  }
}

@keyframes gB {

  0%,
  88%,
  100% {
    transform: translate(0, 0);
    opacity: 0;
  }

  89% {
    transform: translate(3px, -1px);
    opacity: .35;
    clip-path: inset(30% 0 30% 0);
  }

  92% {
    transform: translate(-2px, 1px);
    opacity: .4;
    clip-path: inset(50% 0 10% 0);
  }

  94% {
    transform: translate(1px, 0);
    opacity: .35;
    clip-path: inset(70% 0 5% 0);
  }

  96% {
    opacity: 0;
  }
}

/* =========================================================
   PAGE HERO (consolidated across pages)
   ========================================================= */
.rb-page-hero {
  position: relative;
  padding: calc(var(--nav-h) + 84px) var(--gutter) 56px;
  overflow: hidden;
}
.rb-page-hero h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(48px, 9vw, 160px);
  line-height: .9;
  letter-spacing: -.012em;
  text-transform: uppercase;
  color: var(--c-white);
  margin: 16px 0 24px;
  position: relative;
  z-index: 2;
}
.rb-page-hero h1 .red { color: var(--c-red); }
.rb-page-hero .lead,
.rb-page-hero > p {
  font-family: var(--f-display);
  font-size: clamp(16px, 1.4vw, 22px);
  line-height: 1.55;
  color: var(--c-gray);
  max-width: 760px;
  position: relative;
  z-index: 2;
}
.rb-page-hero .rb-section-tag {
  position: relative;
  z-index: 2;
}

/* =========================================================
   HUD CHROME UTILITIES
   Apply .rb-hero-hud on the section, then drop chrome spans inside.
   ========================================================= */
.rb-hero-hud {
  position: relative;
  overflow: hidden;
}

.rb-hud-corners {
  position: absolute;
  inset: 16px;
  pointer-events: none;
  z-index: 4;
  background:
    linear-gradient(var(--c-red), var(--c-red)) 0    0    / 22px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 0    0    / 1px 22px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 0    / 22px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 0    / 1px 22px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 0    100% / 22px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 0    100% / 1px 22px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 100% / 22px 1px no-repeat,
    linear-gradient(var(--c-red), var(--c-red)) 100% 100% / 1px 22px no-repeat;
  opacity: .8;
}

.rb-hud-coords,
.rb-hud-id,
.rb-hud-stat,
.rb-hud-meta {
  position: absolute;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  z-index: 5;
  line-height: 1.6;
}
.rb-hud-stat {
  display: inline-flex; align-items: center; gap: 10px;
  top: 28px; left: var(--gutter);
  color: var(--c-red);
}
.rb-hud-stat::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--c-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--c-red-glow);
  animation: rbDot 1.2s steps(2) infinite;
}
@keyframes rbDot { 50% { opacity: .15; } }

.rb-hud-id   { top: 28px; right: var(--gutter); color: rgba(255,255,255,.7); }
.rb-hud-coords { bottom: 28px; right: var(--gutter); color: rgba(255,255,255,.7); text-align: right; }
.rb-hud-meta { bottom: 28px; left: var(--gutter); color: var(--c-red); }

.rb-hud-scan {
  position: absolute;
  left: var(--gutter); right: var(--gutter);
  bottom: 18px;
  height: 2px;
  background: rgba(255,0,31,.10);
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}
.rb-hud-scan::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--c-red), transparent);
  transform: translateX(-100%);
  animation: rbScan 2.8s linear infinite;
}
@keyframes rbScan { to { transform: translateX(100%); } }

/* Mobile HUD scaling */
@media (max-width: 900px) {
  .rb-hud-coords,
  .rb-hud-id,
  .rb-hud-stat,
  .rb-hud-meta { font-size: 8.5px; letter-spacing: .18em; }
  .rb-hud-stat   { top: 18px; }
  .rb-hud-id     { top: 18px; }
  .rb-hud-coords { bottom: 18px; }
  .rb-hud-meta   { bottom: 18px; }
  .rb-hud-corners { inset: 12px; }
}

/* =========================================================
   MICROINTERACTIONS
   ========================================================= */
.rb-link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--c-red);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  transition: color .25s var(--ease-bug);
}
.rb-link-arrow::after {
  content: "→";
  display: inline-block;
  transition: transform .35s var(--ease-bug);
}
.rb-link-arrow:hover { color: var(--c-red-soft); }
.rb-link-arrow:hover::after { transform: translateX(5px); }

.rb-lift {
  transition: transform .4s var(--ease-bug), box-shadow .4s, border-color .3s;
}
.rb-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(255, 0, 31, .18);
}

/* Hover-reveal underline (for nav-like inline links) */
.rb-underline {
  position: relative;
  display: inline-block;
}
.rb-underline::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease-bug);
}
.rb-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Subtle title parallax / lift */
.rb-title-float {
  display: inline-block;
  will-change: transform;
  animation: rbTitleFloat 9s ease-in-out infinite;
}
@keyframes rbTitleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Focus rings for accessibility (subtle red glow) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--c-red);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(255, 0, 31, .15);
}

/* =========================================================
   SPACING TOKENS (utility helpers, 8pt scale)
   ========================================================= */
.rb-mt-1 { margin-top: 8px;  } .rb-mt-2 { margin-top: 16px; }
.rb-mt-3 { margin-top: 24px; } .rb-mt-4 { margin-top: 32px; }
.rb-mt-6 { margin-top: 48px; } .rb-mt-8 { margin-top: 64px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .15s !important;
  }

  body {
    scroll-behavior: auto;
  }
}

@media (max-width: 700px) {
  :root {
    --nav-h: 58px;
    --gutter: 20px;
    --c-line: rgba(255, 0, 63, 0.12);
  }

  html {
    scroll-padding-top: calc(var(--nav-h) + 14px);
  }

  body {
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 0, 63, 0.05), transparent 45%),
      var(--c-bg);
    font-size: 15px;
  }

  .rb-bg-grid {
    display: block !important;
    opacity: 0.035 !important;
  }

  .rb-bg-scanlines {
    display: block !important;
    opacity: 0.025 !important;
  }

  .rb-bg-noise {
    display: block !important;
    opacity: 0.05 !important;
  }

  #bugSwarm {
    display: none !important;
  }

  .rb-bg {
    background:
      linear-gradient(180deg, rgba(255, 0, 63, 0.04), transparent 260px),
      #020204;
  }

  .rb-bg-city {
    opacity: .12;
    background-position: center top;
    mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
  }

  .rb-nav {
    height: var(--nav-h);
    padding: 0 var(--gutter);
    background: rgba(3, 3, 6, .94);
    border-bottom-color: rgba(255, 0, 63, 0.15);
  }

  .rb-logo {
    font-size: 14px;
    letter-spacing: .12em;
  }

  .rb-logo img {
    width: 22px;
    height: 22px;
  }

  .rb-nav ul {
    top: var(--nav-h);
    min-height: calc(100dvh - var(--nav-h));
    padding: 22px var(--gutter) calc(24px + env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, rgba(8, 3, 6, .98), rgba(2, 2, 4, .98)),
      var(--c-bg);
  }

  .rb-nav ul li {
    padding: 0;
    border-bottom: 1px solid rgba(255, 0, 63, 0.12);
  }

  .rb-nav ul a {
    display: flex;
    align-items: center;
    min-height: 52px;
    font-size: 14px;
    letter-spacing: .18em;
    color: var(--c-white);
  }

  .rb-nav ul a::before,
  .rb-nav ul a::after {
    display: none;
  }

  .rb-nav ul a.active {
    color: var(--c-red-soft);
  }

  .rb-burger {
    width: 44px;
    height: 44px;
    margin-right: -10px;
  }

  .rb-burger span {
    left: 9px;
    right: 9px;
  }

  .rb-section-title {
    font-size: clamp(30px, 10vw, 44px);
    line-height: 1.04;
    letter-spacing: -0.01em;
  }

  .rb-section-tag {
    font-size: 11.5px;
    letter-spacing: .16em;
    margin-bottom: 10px;
  }

  .rb-section-tag::before {
    display: none !important;
  }

  .rb-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    padding: 14px 18px;
    font-size: 13px;
    letter-spacing: .14em;
    border-color: rgba(255, 0, 63, .5);
    background: rgba(255, 0, 63, .10);
  }

  .rb-btn:active,
  .submit:active,
  .fbtn:active,
  .cat:active {
    transform: scale(.98);
  }

  .js .rb-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition-delay: 0s !important;
  }

  .rb-hud-corners {
    display: block !important;
    inset: 12px !important;
    opacity: 0.5 !important;
  }

  .rb-hud-scan {
    display: block !important;
    bottom: 8px !important;
    height: 1px !important;
    opacity: 0.45 !important;
  }

  .rb-hud-stat {
    display: inline-flex !important;
    top: 14px !important;
    left: var(--gutter) !important;
    font-size: 8.5px !important;
    opacity: 0.75 !important;
  }

  .rb-hud-coords {
    display: block !important;
    bottom: 14px !important;
    right: var(--gutter) !important;
    font-size: 8.5px !important;
    opacity: 0.55 !important;
  }

  .rb-hud-id,
  .rb-hud-meta {
    display: none !important;
  }

  .rb-footer {
    padding-top: 56px;
  }

  .rb-footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    margin-bottom: 34px;
  }

  .rb-footer h4 {
    letter-spacing: .16em;
  }

  .hero {
    min-height: auto !important;
    overflow: visible !important;
    margin-bottom: 24px !important;
  }

  #threeHero,
  .hero::after {
    display: none !important;
  }

  .hero .rb-hud-corners,
  .hero .rb-hud-scan,
  .hero .rb-hud-stat,
  .hero .rb-hud-coords {
    display: none !important;
  }

  .hero-grid {
    min-height: auto !important;
    padding: calc(var(--nav-h) + 36px) var(--gutter) 48px !important;
    display: block !important;
  }

  .hero-center {
    align-items: flex-start !important;
    text-align: left !important;
    gap: 12px;
  }

  .hero-eyebrow {
    max-width: 100%;
    font-size: 10px !important;
    letter-spacing: .25em !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    color: var(--c-red) !important;
    font-weight: 600 !important;
  }

  .hero-title {
    font-size: clamp(44px, 14vw, 72px) !important;
    line-height: .94 !important;
    letter-spacing: -0.02em !important;
    margin-top: 4px;
    text-shadow: 0 0 15px rgba(255, 0, 63, 0.35), 0 0 30px rgba(191, 0, 255, 0.12);
  }

  .hero-sub {
    letter-spacing: .14em !important;
    max-width: 100%;
    line-height: 1.5;
    text-align: left;
    margin-top: 4px !important;
    font-size: 12.5px !important;
  }

  .hero-tag {
    display: none !important;
  }

  .hero-ctas {
    width: 100%;
    margin-top: 18px;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
  }

  .hero-ctas .rb-btn {
    flex: 1 1 50% !important;
    justify-content: center !important;
    font-size: 11px !important;
    letter-spacing: .08em !important;
    padding: 12px 6px !important;
    min-height: auto !important;
    white-space: nowrap !important;
    gap: 6px !important;
  }

  .hero-ctas .rb-btn::after {
    font-size: 12px !important;
  }

  .marquee {
    display: flex !important;
    height: 36px !important;
    border: none !important;
    background: transparent !important;
    margin: 20px 0 36px !important;
  }

  .marquee-track {
    gap: 30px !important;
  }

  .marquee-track span {
    font-size: 13px !important;
    color: rgba(255, 0, 63, 0.16) !important;
    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;
    gap: 30px !important;
  }

  .marquee-track span::after {
    color: rgba(255, 0, 63, 0.16) !important;
    font-size: 8px !important;
  }

  .section-head {
    margin-bottom: 28px !important;
  }

  .section,
  .pillars,
  .process,
  .svc-grid,
  .manifest,
  .lib-grid,
  .posts,
  .team-grid,
  .contact-wrap {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .section {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  .page-hero,
  .rb-page-hero {
    padding: calc(var(--nav-h) + 36px) var(--gutter) 28px !important;
  }

  .page-hero h1,
  .rb-page-hero h1 {
    font-size: clamp(38px, 14vw, 64px) !important;
    line-height: .98 !important;
    letter-spacing: 0 !important;
    margin-bottom: 16px !important;
  }

  .bug-stage {
    min-height: 260px !important;
    border-color: rgba(255, 0, 63, .18) !important;
  }

  .preview-banner,
  .cta-banner {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 34px 18px !important;
  }

  .manifesto,
  .manifest-top,
  .services-row,
  .svc-grid,
  .process-grid,
  .projects-strip,
  .pillars-grid,
  .team-grid,
  .contact-wrap,
  .article-shell {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .manifesto-text,
  .manifest .text {
    font-size: 17px !important;
    line-height: 1.55 !important;
  }

  .manifesto-stat {
    display: grid !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 10px 14px !important;
    border-left: 2px solid var(--c-red) !important;
    background: rgba(255, 0, 63, 0.02) !important;
    margin-bottom: 8px;
  }

  .manifesto-stat .num {
    min-width: 70px !important;
    font-size: 26px !important;
  }

  .svc,
  .svc-big,
  .pillar,
  .step,
  .post,
  .book,
  .tcard,
  .contact-block,
  .terminal-box {
    padding: 24px 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-top: 2px solid var(--c-red) !important;
    background: rgba(5, 3, 7, 0.6) !important;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  .svc-big {
    padding: 0 !important;
  }

  .svc-body,
  .tcard-body,
  .terminal-body {
    padding: 20px !important;
  }

  .svc-cover,
  .svc-img,
  .book-img,
  .proj,
  .tcard-photo {
    min-height: 0;
    aspect-ratio: 16 / 10 !important;
  }

  .svc-title,
  .svc-name,
  .pillar h3,
  .step h4,
  .post h3,
  .book-title,
  .tcard-name {
    font-size: clamp(24px, 8vw, 32px) !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
  }

  .svc-desc,
  .svc-text,
  .pillar p,
  .step p,
  .post p,
  .book-desc,
  .tcard-desc,
  .rb-section-lead {
    font-size: 14.5px !important;
    line-height: 1.65 !important;
  }

  .svc-features,
  .row2 {
    grid-template-columns: 1fr !important;
  }

  .projects-strip {
    margin-top: 22px !important;
  }

  .proj {
    aspect-ratio: 16 / 11 !important;
  }

  .contact-left h1 {
    font-size: clamp(44px, 16vw, 68px) !important;
  }

  .terminal-head {
    gap: 12px;
    padding: 12px 14px !important;
    font-size: 12px !important;
    letter-spacing: .12em !important;
  }

  .field input,
  .field textarea {
    min-height: 48px;
    font-size: 16px !important;
  }

  .submit {
    width: 100%;
    min-height: 50px;
    letter-spacing: .14em !important;
  }

  .filters,
  .cats {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  .fbtn,
  .cat {
    min-height: 44px;
    padding: 10px 12px !important;
    font-size: 12px !important;
    letter-spacing: .12em !important;
  }

  .article-hero {
    padding: calc(var(--nav-h) + 36px) var(--gutter) 26px !important;
  }

  .article-hero h1 {
    font-size: clamp(32px, 12vw, 52px) !important;
    line-height: 1.02 !important;
    letter-spacing: 0 !important;
  }

  .article-content p,
  .article-content li {
    font-size: 16px !important;
    line-height: 1.72 !important;
  }

  .article-content h2 {
    font-size: clamp(24px, 8vw, 34px) !important;
    margin-top: 36px !important;
  }

  .article-side {
    position: static !important;
  }

  .rb-glitch::before,
  .rb-glitch::after {
    display: none;
  }
}
