/* SpaceRouter — design system base stylesheet */

:root {
  --bg: #111111;
  --bg2: #181818;
  --text: #d4d4d4;
  --text-dim: #787878;
  --text-faint: #3a3a3a;
  --border: rgba(212, 212, 212, 0.1);
  --border-md: rgba(212, 212, 212, 0.18);
  --border-str: rgba(212, 212, 212, 0.28);
  --blue: #3B5BFF;
  --blue-bright: #6680FF;
  --blue-dim: rgba(59, 91, 255, 0.12);
  --node: #5468D4;
  --node-bright: #8B9EFF;
  --node-dim: rgba(139, 158, 255, 0.12);
  --onion: #7B3FE4;
  --onion-bright: #9B6BFF;
  --onion-dim: rgba(123, 63, 228, 0.12);
  --accent: var(--blue-bright);
  --accent-strong: var(--blue);
  --accent-dim: var(--blue-dim);
  --nav-h: 56px;
  --rail: 80px;
  --ff: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ff-brand: 'Plus Jakarta Sans', ui-sans-serif, sans-serif;
  --fs-display: clamp(20px, 3.8vw, 64px);
  --lh-display: 1;
  --lh-hero: 1.08;
  --ls-display: -0.02em;
  --ls-hero: -0.03em;
  --fs-eyebrow: 9.5px;
  --ls-eyebrow: 0.18em;
  --fs-tag: 9px;
  --fs-body: 15px;
  --fs-body-sm: 13px;
  --fs-btn: 15px;
  --btn-h: 40px;
  --btn-px: 24px;
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
}

@media (max-width: 1024px) { :root { --rail: 48px; } }
@media (max-width: 768px)  { :root { --rail: 32px; } }
@media (max-width: 520px)  { :root { --rail: 0px;  } }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  min-height: 100vh;
  font-family: var(--ff);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
p { font-size: var(--fs-body); line-height: 1.75; color: var(--text-dim); }
h1, h2, h3, h4 { font-family: var(--ff); font-weight: 600; color: var(--text); }

/* ── Custom cursor ── */
body { cursor: none; }
.cur {
  position: fixed; z-index: 9999; pointer-events: none;
  width: 7px; height: 7px;
  background: var(--text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s, background 0.15s;
}
.cur-ring {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 26px; height: 26px;
  border: 1px solid rgba(212, 212, 212, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.12s ease, height 0.12s ease;
}
@media (hover: none) { .cur, .cur-ring { display: none; } body { cursor: auto; } }

/* ── Global nav ── */
.gnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: var(--rail) auto 1fr auto var(--rail);
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.gnav-rail-l { border-right: 1px solid var(--border); }
.gnav-rail-r { border-left:  1px solid var(--border); }
.gnav-logo {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 22px;
  font-family: var(--ff);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-img {
  height: 22px;
  width: auto;
  display: block;
}
.logo-wordmark {
  height: 44px;
}
.gnav-links {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.gnav-link {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-dim);
  padding: 0 14px;
  display: flex;
  align-items: center;
  letter-spacing: 0.01em;
  transition: color 0.15s;
  white-space: nowrap;
  border-right: 1px solid var(--border);
}
.gnav-link:first-child { border-left: 1px solid var(--border); }
.gnav-link:hover { color: var(--text); }
.gnav-link.active { color: var(--text); }
.gnav-link.active { border-bottom: 1px solid var(--accent); }
.gnav-coords {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-left: 1px solid var(--border);
  min-width: 130px;
}
@media (max-width: 1024px) { .gnav-coords { min-width: 110px; padding: 0 12px; } }
@media (max-width: 900px)  { .gnav-rail-l, .gnav-rail-r, .gnav-links, .gnav-coords { display: none; } .gnav { grid-template-columns: minmax(0,1fr) auto; overflow: visible; } .gnav-logo { border-right: none; min-width: 0; overflow: hidden; } }
@media (max-width: 480px)  { .gnav-logo { padding: 0 14px; } .logo-wordmark { height: 44px; } }

/* ── Rail marker ── */
.rail-marker {
  position: fixed;
  left: 20px; top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center center;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  text-transform: uppercase;
  z-index: 40;
  pointer-events: none;
  white-space: nowrap;
}
@media (max-width: 1100px) { .rail-marker { display: none; } }

/* ── Hero ── */
.hero {
  padding-top: var(--nav-h);
  min-height: 720px;
  display: grid;
  grid-template-columns: var(--rail) 1fr var(--rail);
  border-bottom: 1px solid var(--border);
}
.hero-rail {
  border-right: 1px solid var(--border);
}
.hero-rail-r {
  border-right: none;
  border-left: 1px solid var(--border);
}
@media (max-width: 1024px) { .hero-rail { border-right: none; } .hero-rail-r { border-left: none; } }
@media (max-width: 520px)  { .hero-rail, .hero-rail-r { display: none; } }

.hero-content {
  min-width: 0;
  padding: 56px 48px 0;
  position: relative;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(102,128,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(102,128,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 40% 40%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 40% 40%, black 0%, transparent 70%);
}
.hero-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-eyebrow::after {
  content: "";
  display: block;
  height: 1px;
  width: 56px;
  background: var(--border-md);
}
.status-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--node-bright);
  flex-shrink: 0;
}
.status-live::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--node-bright);
  box-shadow: 0 0 8px var(--node-bright);
}
.hero-title {
  font-size: clamp(42px, 6.8vw, 92px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.03em;
  margin-bottom: 0;
}
.hero-title .line { display: block; white-space: nowrap; }
.hero-title .line-small {
  font-size: 0.82em;
  font-weight: 400;
}
@keyframes shine-sweep {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ── Hero entrance (initial hidden state set by JS in partials.js via RAF) ── */
.hero-anim-ready {
  /* JS sets opacity/transform inline, then transitions to visible */
  will-change: opacity, transform;
}
.hero-title .line-accent {
  display: block;
  font-weight: 800;
  background: linear-gradient(
    90deg,
    #3B5BFF 0%,
    #6680FF 30%,
    #c0cfff 48%,
    #ffffff 50%,
    #c0cfff 52%,
    #8b6fff 70%,
    #3B5BFF 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine-sweep 3.5s linear infinite;
  padding-bottom: 0.25em;
}
.hero-desc {
  font-size: var(--fs-body);
  color: var(--text-dim);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 40px;
  position: relative;
}
.line { display: block; }

/* ── Hero globe ── */
.hero-globe-area {
  position: absolute;
  top: 0; right: 0;
  width: 44%;
  bottom: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 22%, black 82%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 22%, black 82%, transparent 100%);
}
#globe-canvas { display: block; }
.globe-badge {
  position: absolute;
  top: 18px; right: 24px;
  display: flex; align-items: center; gap: 7px;
  z-index: 1; pointer-events: none;
}
.globe-badge span {
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.globe-badge .gdot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--blue);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}
@media (max-width: 900px) { .hero-globe-area { display: none; } }

/* ── Feature grid (tiles) ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
/* Non-tile feature grids: container draws top+left edge, each child draws right+bottom */
.feature-grid:not(.tiles-grid) {
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.feature-grid:not(.tiles-grid) > * {
  border-top: none;
  border-left: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feature-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 24px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  color: var(--text);
}
.feature-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}
.feature-num {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.feature-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  position: relative;
}
.feature-desc {
  margin-top: 10px;
  font-size: var(--fs-body-sm);
  line-height: 1.7;
  color: var(--text-dim);
  flex: 1;
  position: relative;
}
.feature-cta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--accent);
  position: relative;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }

/* ── Flush tile variant (hero cards) ── */
.tiles-grid {
  gap: 0;
  border-top: 1px solid var(--border);
  margin-left: -48px;
  margin-right: -48px;
}
.tiles-grid .feature-card {
  border-right: 1px solid var(--border);
  min-height: 260px;
}
.tiles-grid .feature-card:last-child {
  border-right: none;
}
@media (max-width: 900px) {
  .tiles-grid .feature-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .tiles-grid .feature-card:last-child {
    border-bottom: none;
  }
}

/* ── Sections ── */
.section {
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 4px);
}
.section-inner {
  padding: 80px var(--rail);
}
@media (max-width: 768px) { .section-inner { padding: 64px var(--rail); } }

.eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 20px;
  display: block;
}
.eyebrow-plain {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.sec-title {
  font-size: clamp(30px, 5.7vw, 96px);
  font-weight: 400;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  color: var(--text);
  margin-bottom: 20px;
}
.sec-title .accent { color: var(--accent); }
.section-desc {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 600px;
  margin-bottom: 48px;
}
.section-head { margin-bottom: 48px; }

/* Collapse borders between adjacent card-type siblings in the same container */
.section-inner > .card + .card,
.section-inner > .split-grid + .card,
.section-inner > .feature-grid + .card,
.section-inner > .card + .split-grid,
.section-inner > .card + .feature-grid,
.section-inner > .split-grid + .split-grid,
.section-inner > .split-grid + .feature-grid,
.section-inner > .feature-grid + .split-grid,
.section-inner > .feature-grid + .feature-grid {
  margin-top: -1px;
}

/* ── Two-column split ── */
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.split-grid > .card,
.split-grid > .feature-card,
.split-grid > .layer-card {
  border-top: none;
  border-left: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.split-grid > .card > .card-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.split-grid > .card > .card-inner > p {
  flex: 1;
}
.split-grid > .card > .card-inner > a {
  align-self: flex-start;
}
@media (max-width: 900px) { .split-grid { grid-template-columns: 1fr; } }

/* ── Cards ── */
.card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
}
.card-inner { padding: 28px; }
.card-wide {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.card-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.feat-list {
  list-style: none;
  padding: 0; margin: 0;
  margin-top: 20px;
}
.feat-list li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: var(--fs-body-sm);
  line-height: 1.65;
}
.feat-list li strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

/* ── Layer / ecosystem cards ── */
.layer-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 28px;
  display: flex;
  flex-direction: column;
  color: var(--text);
}
.layer-num {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.layer-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 12px;
}
.layer-desc {
  font-size: var(--fs-body-sm);
  line-height: 1.7;
  color: var(--text-dim);
  flex: 1;
}
.layer-cta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--accent);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 var(--btn-px);
  font-family: var(--ff);
  font-size: var(--fs-btn);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-md);
  border-radius: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text);
  transform: translateX(-101%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.btn:hover { color: var(--bg); border-color: var(--text); }
.btn:hover::before { transform: translateX(0); }
.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn-primary::before { background: var(--accent); }
.btn-primary:hover { color: #fff; border-color: var(--accent); }
.btn-outline {
  background: transparent;
  border-color: var(--border-md);
  color: var(--text);
}
.btn-outline:hover { color: var(--bg); border-color: var(--text); }

/* ── Tags / badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: none;
  border-radius: var(--radius-xs);
  font-family: var(--ff-mono);
  font-size: var(--fs-tag);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.badge.live {
  color: var(--node-bright);
  background: rgba(53,201,122,0.1);
}
.badge.live::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--node-bright);
  box-shadow: 0 0 6px var(--node-bright);
}
.badge.beta {
  color: #facc15;
  background: rgba(250,204,21,0.1);
}
.badge.beta::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #facc15;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 56px var(--rail) 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  align-items: flex-start;
  margin-bottom: 48px;
}
.footer-logo-link {
  display: flex;
  align-items: flex-start;
}
.footer-cols-right {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  padding-right: 48px;
}
.footer-col h4 {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li {
  margin-bottom: 10px;
  font-size: var(--fs-body-sm);
  color: var(--text-dim);
}
.footer-col li a:hover { color: var(--text); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
@media (max-width: 1280px) { .footer-logo-link { display: none; } .footer-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .footer-cols-right { flex-direction: column; gap: 32px; } }

/* ── Utility spacing ── */
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-7 { margin-top: 28px; }
.mt-8 { margin-top: 32px; }

/* ── Danger color ── */
:root { --danger: #f87171; }

/* ── Sub-page hero layout ── */
.page-hero { min-height: 720px; }
.page-hero .hero-content { padding-bottom: 64px; }
.hero-split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  margin-top: 36px;
}
@media (max-width: 900px) { .hero-split { grid-template-columns: 1fr; } }
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ── Inline link ── */
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

/* ── Code blocks ── */
pre.code {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  font-family: var(--ff-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  margin-top: 14px;
}
.tok-k { color: var(--accent); }
.tok-s { color: var(--node-bright); }

/* ── Tables ── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
  border: 1px solid var(--border);
  margin-top: 14px;
}
.tbl th {
  padding: 10px 16px;
  text-align: left;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.tbl td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl td strong { color: var(--text); font-weight: 600; }
.tbl td:first-child, .tbl td:nth-child(2) { white-space: nowrap; }

/* ── Flow diagram ── */
.flow { display: flex; gap: 0; }
.flow-box {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--border-md);
  text-align: center;
}
.flow-box + .flow-box { border-left: none; }
.flow-box .lbl {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.flow-box .val {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.flow-box .sub {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Additional badge variants ── */
.badge.soon { color: var(--text-dim); }

/* ── Additional redline styles ── */
.rl-block {
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin: 8px 0;
  position: relative;
}
.rl-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-right: 5px;
  letter-spacing: 0.05em;
  font-family: monospace;
}
.rl-badge-del { background: rgba(239,68,68,.2); color: #ef4444; }
.rl-badge-add { background: rgba(74,222,128,.2); color: #4ade80; }
.rl-badge-warn { background: rgba(251,191,36,.2); color: #fbbf24; }
.rl-note {
  border-left: 3px solid #fbbf24;
  background: rgba(251,191,36,.05);
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #fbbf24;
}
.rl-pending {
  background: rgba(251,191,36,.25);
  color: #f59e0b;
  border-radius: 3px;
  padding: 0 3px;
  cursor: help;
  outline: 1px dashed rgba(251,191,36,.6);
  position: relative;
}
.rl-pending::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e; color: #fbbf24;
  font-size: 12px; line-height: 1.5;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: pre-wrap;
  width: max-content; max-width: 300px;
  opacity: 0; transition: opacity .15s;
  z-index: 9999; pointer-events: none;
}
.rl-pending:hover::after { opacity: 1; }

/* ── Redline review styles ── */
.rl-del {
  color: #f87171 !important;
  text-decoration: line-through !important;
  background: rgba(239,68,68,.1);
  padding: 0 3px;
  border-radius: 2px;
}
.rl-add {
  color: #4ade80 !important;
  text-decoration: none !important;
  background: rgba(74,222,128,.1);
  padding: 0 3px;
  border-radius: 2px;
}
.rl-block-del {
  border-left: 3px solid #f87171;
  background: rgba(239,68,68,.06);
  padding: 12px 16px; margin: 8px 0;
  border-radius: 0 6px 6px 0;
}
.rl-block-add {
  border-left: 3px solid #4ade80;
  background: rgba(74,222,128,.06);
  padding: 12px 16px; margin: 8px 0;
  border-radius: 0 6px 6px 0;
  color: #4ade80 !important;
}
.rl-block-del * { color: #f87171 !important; text-decoration: line-through !important; }

[data-tip] { cursor: help; position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e; color: #e2e8f0;
  font-size: 12px; line-height: 1.5;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: pre-wrap;
  width: max-content; max-width: 280px;
  opacity: 0; transition: opacity .15s;
  z-index: 9999; pointer-events: none;
}
[data-tip]:hover::after { opacity: 1; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE SYSTEM
   ═══════════════════════════════════════════════════════ */

/* ── Hamburger button (visible ≤900px) ── */
.gnav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  height: var(--nav-h);
  width: 48px;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
}
.gnav-burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-dim);
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.18s ease, background 0.15s;
  transform-origin: center;
}
.gnav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: var(--text); }
.gnav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.gnav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: var(--text); }
@media (max-width: 900px) { .gnav-burger { display: flex; } }

/* ── Nav drawer (dropdown, hidden until burger pressed) ── */
.gnav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 199;
  background: rgba(17,17,17,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
@media (max-width: 900px) { .gnav-drawer { display: flex; } }
.gnav-drawer.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ── Burger menu dim overlay ── */
.gnav-overlay {
  position: fixed;
  inset: 0;
  z-index: 198;
  background: rgba(0, 0, 0, 0);
  transition: background 0.28s ease;
  pointer-events: none;
}
.gnav-overlay.active {
  background: rgba(0, 0, 0, 0.62);
  pointer-events: auto;
}

.gnav-d-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dim);
  padding: 15px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  letter-spacing: 0.005em;
  transition: color 0.15s, background 0.15s;
}
.gnav-d-link:last-child { border-bottom: none; }
.gnav-d-link:hover  { color: var(--text); background: rgba(255,255,255,0.03); }
.gnav-d-link.active { color: var(--text); border-left-color: var(--accent); padding-left: 22px; }

/* Pin hero-content to column 2 always — without this, display:none rails
   on ≤520px cause auto-placement to put hero-content in the 0px column 1. */
.hero-content { grid-column: 2; }

/* ── hero-content padding: strip inner offset on tablet/mobile so
   horizontal position matches section-inner (only the rail provides the edge). ── */
@media (max-width: 1024px) {
  .hero-content { padding-left: 0; padding-right: 0; }
  .tiles-grid   { margin-left: 0; margin-right: 0; }
}
@media (max-width: 640px) {
  .hero-content { padding-top: 40px; }
  .hero         { min-height: auto; }
  .page-hero    { min-height: auto; }
  .page-hero .hero-content { padding-bottom: 40px; }
  .hero-desc    { max-width: 100%; }
}
@media (max-width: 520px) {
  /* rails hidden: hero-content needs its own edge padding matching section-inner */
  .hero-content { padding-left: 16px; padding-right: 16px; }
  .tiles-grid   { margin-left: -16px; margin-right: -16px; }
}
@media (max-width: 400px) {
  .hero-content { padding-top: 28px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

/* ── Cards ── */
@media (max-width: 640px) {
  .card-inner { padding: 20px; }
  .layer-card { padding: 20px; }
}
@media (max-width: 400px) {
  .card-inner { padding: 16px; }
  .layer-card { padding: 16px; }
}

/* ── Section spacing ── */
@media (max-width: 640px) {
  .section-head { margin-bottom: 32px; }
  .section-desc { margin-bottom: 32px; }
}
@media (max-width: 520px) {
  .section-inner { padding: 48px 16px; }
  .footer        { padding: 40px 16px 28px; }
  .footer-grid   { gap: 40px; }
}
@media (max-width: 900px) { .footer-cols-right { padding-right: 0; } }
@media (max-width: 400px) { .section-inner { padding: 40px 16px; } }

/* ── Tables — reduce padding + allow cell-text wrap on small screens ── */
@media (max-width: 640px) {
  .tbl th, .tbl td { padding: 8px 10px; }
  .tbl { font-size: 12px; }
  /* Remove nowrap so long cell text reflows instead of forcing horizontal scroll */
  .tbl td:first-child, .tbl td:nth-child(2) { white-space: normal; }
}

/* ── Proxy app float — shrink on tablet, shown on mobile via proxy.html overlay ── */
@media (max-width: 900px)  { .proxy-app-float img { width: 200px; } }

/* ── Onion hero title 60% cap — full width on mobile ── */
.onion-title-wrap { max-width: 60%; }
@media (max-width: 900px)  { .onion-title-wrap { max-width: 100%; } }

/* ── Proxy integration section head flex → stack ── */
.integration-head {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .integration-head { flex-direction: column; gap: 24px; }
  .integration-head > .card { width: 100% !important; }
}

/* ── Scroll reveal (class added by partials.js via IntersectionObserver) ── */
.sr-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.sr-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .sr-reveal { opacity: 1; transform: none; transition: none; }
}
