/* RoseGuard public site — minimal / sharp / cream-charcoal-rose */
:root {
  --rg-charcoal: #1c1c20;
  --rg-charcoal-soft: #2a2a2f;
  --rg-cream: #faf7f4;
  --rg-cream-deep: #f0ebe6;
  --rg-line: rgba(28, 28, 32, 0.12);
  --rg-line-strong: rgba(28, 28, 32, 0.22);
  --rg-rose: #8a1c2d;
  --rg-rose-soft: #c47784;
  --rg-mute: #5c5c62;
  --rg-ink: #1c1c20;
  --rg-warn: #8a5c2b;
  --rg-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --rg-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body.rg-public {
  margin: 0;
  font-family: var(--rg-sans);
  color: var(--rg-ink);
  background: var(--rg-cream);
  line-height: 1.55;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--rg-rose);
}

.rg-container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* —— Header —— */
.rg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--rg-cream) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rg-line);
}

.rg-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1.5rem;
}

.rg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.rg-brand__mark {
  display: block;
}

.rg-brand:hover .rg-brand__text {
  color: var(--rg-rose);
}

.rg-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.rg-nav a {
  color: var(--rg-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 0.2s, border-color 0.2s;
}

.rg-nav a:hover {
  color: var(--rg-ink);
  border-bottom-color: var(--rg-rose);
}

/* —— Hero —— */
.rg-hero {
  position: relative;
  padding: clamp(3.5rem, 10vw, 6.5rem) 0 3rem;
  overflow: hidden;
}

.rg-hero {
  --rg-parallax-x: 0px;
  --rg-parallax-y: 0px;
}

.rg-hero__frame {
  position: absolute;
  inset: 0;
  transform: translate(var(--rg-parallax-x), var(--rg-parallax-y));
  transition: transform 0.15s ease-out;
  background-image:
    linear-gradient(90deg, var(--rg-line) 1px, transparent 1px),
    linear-gradient(var(--rg-line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, black 0%, transparent 88%);
  pointer-events: none;
}

.rg-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.rg-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--rg-mute);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.rg-hero__title {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 19ch;
}

.rg-hero__lede {
  margin: 0 0 1.25rem;
  color: var(--rg-mute);
  max-width: 48ch;
  font-size: 1.05rem;
}

.rg-hero__lede em {
  font-style: normal;
  color: var(--rg-rose);
  font-weight: 600;
}

.rg-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.rg-chip {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--rg-line-strong);
  background: rgba(255, 255, 255, 0.55);
  color: var(--rg-mute);
}

.rg-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.rg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rg-btn--primary {
  background: var(--rg-charcoal);
  color: var(--rg-cream);
  border-color: var(--rg-charcoal);
}

.rg-btn--primary:hover {
  background: var(--rg-rose);
  border-color: var(--rg-rose);
  color: #fff;
}

.rg-btn--ghost {
  background: transparent;
  border-color: var(--rg-line-strong);
  color: var(--rg-charcoal);
}

.rg-btn--ghost:hover {
  border-color: var(--rg-rose);
  color: var(--rg-rose);
}

.rg-btn--block {
  width: 100%;
}

.rg-hero__fine {
  margin: 0;
  font-size: 0.78rem;
  max-width: 62ch;
}

.rg-mono {
  font-family: var(--rg-mono);
  font-size: 0.78rem;
}

.rg-mono-faint {
  font-family: var(--rg-mono);
  font-size: 0.72rem;
  color: var(--rg-mute);
  line-height: 1.5;
}

/* Dashboard panel */
.rg-dash {
  border: 1px solid var(--rg-line-strong);
  background: #fff;
  box-shadow: 0 1px 0 rgba(28, 28, 32, 0.06);
}

.rg-dash__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--rg-line);
  background: var(--rg-charcoal);
  color: var(--rg-cream);
}

.rg-dash__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

.rg-dash__sys {
  flex: 1;
  opacity: 0.92;
  letter-spacing: 0.02em;
}

.rg-dash__slash {
  opacity: 0.45;
}

.rg-dash__badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  letter-spacing: 0.12em;
}

.rg-dash__title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rg-mute);
  margin: 0;
  padding: 0.85rem 1rem 0.25rem;
  font-weight: 600;
}

.rg-dash__metrics {
  margin: 0;
  padding: 0 1rem 1rem;
}

.rg-dash__metric {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rg-line);
}

.rg-dash__metric:last-child {
  border-bottom: none;
}

.rg-dash__dt {
  margin: 0 0 0.35rem;
  color: var(--rg-mute);
  font-size: 0.65rem;
}

.rg-dash__num {
  font-family: var(--rg-mono);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--rg-charcoal);
  letter-spacing: -0.03em;
}

.rg-dash__num--sm {
  font-size: 1.25rem;
}

.rg-dash__of {
  font-size: 0.75rem;
  color: var(--rg-mute);
  margin-left: 0.25rem;
}

.rg-dash__metric--accent .rg-dash__num {
  color: var(--rg-rose);
}

.rg-dash__metric--sub {
  padding: 0.5rem 0;
}

.rg-dash__alert {
  margin: 0 1rem 1rem;
  padding: 0.5rem 0.6rem;
  background: color-mix(in srgb, var(--rg-cream-deep) 80%, #fff);
  border-left: 2px solid var(--rg-warn);
  font-size: 0.68rem;
  color: var(--rg-mute);
}

/* —— Terminal / feed —— */
.rg-section {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.rg-section--tight {
  padding-top: 2rem;
}

.rg-section--cream {
  background: var(--rg-cream-deep);
  border-top: 1px solid var(--rg-line);
  border-bottom: 1px solid var(--rg-line);
}

.rg-section__head {
  margin-bottom: 1.75rem;
  max-width: 52ch;
}

.rg-section__title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.rg-section__intro {
  margin: 0;
  color: var(--rg-mute);
  font-size: 1rem;
}

.rg-terminal {
  border: 1px solid var(--rg-line-strong);
  background: var(--rg-charcoal);
  color: #e8e6e3;
  border-radius: 2px;
  overflow: hidden;
}

.rg-terminal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #141418;
}

.rg-terminal__label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.rg-terminal__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rg-rose-soft);
  animation: rg-pulse 1.8s ease-in-out infinite;
}

@keyframes rg-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.rg-terminal__log {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.85rem 1rem;
  min-height: 14rem;
  font-family: var(--rg-mono);
  font-size: 0.72rem;
  line-height: 1.65;
}

.rg-terminal__log li {
  padding: 0.2rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.5rem;
  margin-left: 0;
  opacity: 0;
  transform: translateY(4px);
  animation: rg-line-in 0.45s ease forwards;
}

.rg-terminal__log li span + span {
  margin-left: 0.35rem;
}

.rg-terminal__log li.is-live {
  border-left-color: var(--rg-rose-soft);
}

@keyframes rg-line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rg-log-meta {
  opacity: 0.45;
  margin-right: 0.5rem;
}

.rg-log-ok { color: #7fd4a6; }
.rg-log-warn { color: #e8c07d; }
.rg-log-bad { color: #e89898; }
.rg-log-info { color: #9ec5ff; }
.rg-log-sys {
  color: #9a97a8;
  font-style: italic;
}

/* —— Why split —— */
.rg-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.rg-split__sticky {
  position: sticky;
  top: 5.5rem;
}

.rg-prose p {
  margin: 0 0 1rem;
  color: var(--rg-mute);
  max-width: 52ch;
}

.rg-prose p:last-child {
  margin-bottom: 0;
}

.rg-list-line {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.rg-list-line li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.1rem;
  border-top: 1px solid var(--rg-line);
  color: var(--rg-mute);
  font-size: 0.95rem;
}

.rg-list-line li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  width: 4px;
  height: 4px;
  background: var(--rg-rose);
  border-radius: 1px;
}

.rg-muted {
  color: var(--rg-mute);
  font-size: 0.92rem;
}

/* —— Coverage map —— */
.rg-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--rg-line);
  border: 1px solid var(--rg-line-strong);
}

.rg-map__col {
  background: #fff;
  padding: 1.15rem 1.1rem;
  min-height: 100%;
}

.rg-map__col--span {
  grid-column: span 2;
}

.rg-map__cluster-title {
  margin: 0 0 0.65rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--rg-mute);
  font-weight: 600;
}

.rg-map__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rg-map__list li {
  font-size: 0.88rem;
  color: var(--rg-charcoal-soft);
  padding: 0.28rem 0;
  padding-left: 0.65rem;
  border-left: 1px solid var(--rg-line);
}

.rg-map__list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.rg-map__list--inline li {
  border-left: none;
  padding-left: 0;
}

.rg-telemetry {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--rg-line-strong);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
}

.rg-telemetry__item strong {
  font-weight: 600;
  color: var(--rg-charcoal);
}

.rg-telemetry__rule {
  width: 1px;
  height: 1rem;
  background: var(--rg-line-strong);
}

/* —— Beta + forms —— */
.rg-beta,
.rg-wait {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

.rg-beta__rules {
  margin-top: 1rem;
}

.rg-form {
  border: 1px solid var(--rg-line-strong);
  padding: 1.35rem 1.25rem;
  background: #fff;
}

.rg-form__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.stack-form label {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rg-charcoal-soft);
}

.stack-form input,
.stack-form textarea,
.stack-form select {
  /* 16px+ on fields stops iOS from zooming the page when an input is focused */
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--rg-line-strong);
  border-radius: 2px;
  background: var(--rg-cream);
  color: var(--rg-ink);
}

.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
  outline: 2px solid color-mix(in srgb, var(--rg-rose) 35%, transparent);
  border-color: var(--rg-rose);
}

.stack-form .check {
  display: flex !important;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500 !important;
}

.stack-form .check input {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--rg-rose);
}

.privacy-note {
  font-size: 0.78rem;
  color: var(--rg-mute);
  margin-top: 0.75rem;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

/* —— Footer —— */
.rg-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rg-line);
}

.rg-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--rg-mute);
}

.rg-footer__scope {
  margin: 0;
  font-family: var(--rg-mono);
  font-size: 0.72rem;
}

/* —— Toast —— */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, 92vw);
  padding: 0.85rem 1rem;
  border-radius: 2px;
  box-shadow: 0 8px 28px rgba(28, 28, 32, 0.18);
  color: #fff;
  z-index: 200;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
}

.toast-success { background: #1f6f4e; }
.toast-error { background: #8a2c2c; }
.toast-info { background: #3d5a7a; }

/* —— Cookie / consent bar (public) —— */
body.rg-public.rg-cookie-active {
  padding-bottom: 7.5rem;
}

@media (min-width: 640px) {
  body.rg-public.rg-cookie-active {
    padding-bottom: 5.5rem;
  }
}

.rg-cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: color-mix(in srgb, var(--rg-charcoal) 97%, var(--rg-rose) 3%);
  color: var(--rg-cream);
  border-top: 1px solid var(--rg-line-strong);
  box-shadow: 0 -6px 32px rgba(28, 28, 32, 0.2);
}

.rg-cookie[hidden] {
  display: none;
}

.rg-cookie__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1rem 0 1.15rem;
  max-width: min(1100px, 92vw);
  margin: 0 auto;
}

.rg-cookie__text {
  flex: 1 1 280px;
  min-width: 0;
}

.rg-cookie__title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--rg-cream);
}

.rg-cookie__body {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(250, 247, 244, 0.86);
  max-width: 52ch;
}

.rg-cookie__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.rg-cookie .rg-btn--ghost {
  color: var(--rg-cream);
  border-color: rgba(250, 247, 244, 0.35);
  background: transparent;
}

.rg-cookie .rg-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--rg-cream);
}

/* —— Reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .rg-hero__grid,
  .rg-split,
  .rg-beta,
  .rg-wait {
    grid-template-columns: 1fr;
  }

  .rg-split__sticky {
    position: static;
  }

  .rg-map {
    grid-template-columns: 1fr 1fr;
  }

  .rg-map__col--span {
    grid-column: span 2;
  }

  .rg-nav {
    display: none;
  }

  .rg-telemetry {
    flex-direction: column;
    align-items: flex-start;
  }

  .rg-telemetry__rule {
    display: none;
  }
}

@media (max-width: 520px) {
  .rg-map {
    grid-template-columns: 1fr;
  }

  .rg-map__col--span {
    grid-column: span 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.rg-public *,
  body.rg-public *::before,
  body.rg-public *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .rg-terminal__pulse {
    animation: none;
    opacity: 0.8;
  }
}

/* ========== Admin compatibility (dark console) ========== */
body.admin-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--rg-sans);
  background: linear-gradient(165deg, #14151c 0%, #1e1f28 100%);
  color: #eceae8;
}

body.admin-body .container {
  width: min(1140px, 92vw);
  margin: 0 auto;
}

body.admin-body .admin-wrap {
  padding: 2rem 0 3rem;
}

body.admin-body .glass {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 1.25rem;
}

body.admin-body .form label {
  display: grid;
  gap: 0.35rem;
  margin: 0.58rem 0;
  color: #ddd;
  font-weight: 600;
  font-size: 0.9rem;
}

body.admin-body .form input,
body.admin-body .form textarea,
body.admin-body .form select {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.66rem 0.72rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  color: #fdf8f7;
  background: rgba(10, 13, 24, 0.55);
}

body.admin-body .form input:focus,
body.admin-body .form textarea:focus,
body.admin-body .form select:focus {
  outline: 2px solid rgba(196, 119, 132, 0.35);
  border-color: #c47784;
}

body.admin-body .subtle {
  color: #a8a8af;
  font-size: 0.95rem;
}

body.admin-body .notice {
  margin-top: 0.75rem;
  color: #e8c07d;
  font-size: 0.9rem;
  background: rgba(232, 192, 125, 0.08);
  border: 1px solid rgba(232, 192, 125, 0.25);
  border-radius: 6px;
  padding: 0.55rem 0.62rem;
}

body.admin-body .btn {
  border: 0;
  border-radius: 6px;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}

body.admin-body .btn-primary {
  background: linear-gradient(135deg, #8a1c2d, #a83245);
  color: #fff;
}

body.admin-body .btn-outline {
  background: transparent;
  color: #eceae8;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

body.admin-body .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

body.admin-body .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #c47784;
  margin: 0.25rem 0 0;
}

body.admin-body .admin-card {
  max-width: 460px;
  margin: 6rem auto;
}

body.admin-body .admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

body.admin-body .admin-table {
  margin-top: 1rem;
  overflow-x: auto;
}

body.admin-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

body.admin-body th,
body.admin-body td {
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.55rem;
}

body.admin-body h1,
body.admin-body h2,
body.admin-body h3 {
  color: #f5f3f1;
}

body.admin-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}
