/* ============================================================
   R2S — shared base stylesheet
   Tokens · reset · typography · nav · footer · components
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #F4F7FB;
  --bg2:       #FFFFFF;
  --bg3:       #EEF2F7;
  --border:    #DDE4EF;
  --border2:   #C8D4E8;

  /* Brand & semantic */
  --accent:    #0066CC;
  --accent2:   #0099FF;
  --text:      #0A1628;
  --muted:     #7A8FAD;
  --muted2:    #5A7A9A;
  --success:   #0D7A3E;
  --danger:    #CC2200;
  --long:      #0D7A3E;
  --long-dim:  rgba(13,122,62,0.10);
  --short:     #CC2200;
  --short-dim: rgba(204,34,0,0.09);
  --gold:      #B45309;

  /* Typography */
  --mono:    'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Syne', system-ui, sans-serif;
  --sans:    'DM Sans', system-ui, sans-serif;
  --body:    'DM Sans', system-ui, sans-serif;
  --serif:   'Syne', system-ui, sans-serif; /* alias for legacy dashboard */

  /* Layout */
  --nav-h: 68px;
  --nav-top: 16px;
  --z-skip: 9999;
  --z-nav: 100;
  --z-mobile-cta: 90;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background dot-grid (decorative, applied via body::before in pages) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,102,204,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,102,204,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; height: auto; }

/* ──────────────────────────────────────────────────────────────
   SKIP LINK (accessibility)
   ────────────────────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: var(--z-skip);
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 16px; outline: 2px solid #fff; outline-offset: 2px; }

/* ──────────────────────────────────────────────────────────────
   NAVIGATION (universal floating glass nav + mobile hamburger)
   ────────────────────────────────────────────────────────────── */
.r2s-nav {
  position: fixed;
  top: var(--nav-top);
  left: 24px; right: 24px;
  z-index: var(--z-nav);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  height: var(--nav-h);
  background: rgba(244,247,251,0.82);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(10,22,40,0.07);
}

.r2s-nav .logo {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.r2s-nav .logo span { color: var(--accent); }

.r2s-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.r2s-nav .nav-links a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  transition: color .2s, background .15s;
}
.r2s-nav .nav-links a:hover { color: var(--text); background: var(--bg3); }
.r2s-nav .nav-links a.active { color: var(--accent); font-weight: 500; }
.r2s-nav .nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.r2s-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.nav-btn-ghost,
.nav-btn-primary {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 22px;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.4;
  transition: border-color .2s, color .2s, opacity .2s, background .2s;
}
.nav-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text);
}
.nav-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.nav-btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
}
.nav-btn-primary:hover { opacity: .9; }
.nav-btn-primary:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }

/* Mobile hamburger */
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.nav-burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-burger svg { display: block; }

/* Mobile menu panel (full-screen drawer) */
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(244,247,251,0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 200;
  display: none;
  flex-direction: column;
  padding: 88px 24px 32px;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu .mm-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu nav a {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu nav a:hover,
.mobile-menu nav a.active { color: var(--accent); }
.mobile-menu .mm-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-menu .mm-actions a {
  text-align: center;
  font-family: var(--sans);
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 500;
}

/* ──────────────────────────────────────────────────────────────
   MOBILE STICKY CTA BAR (landing/marketing pages only)
   ────────────────────────────────────────────────────────────── */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-mobile-cta);
  padding: 10px 16px;
  background: rgba(244,247,251,0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(10,22,40,0.08);
}
.mobile-cta-bar .mcb-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.mobile-cta-bar .mcb-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.04em;
  line-height: 1.35;
}
.mobile-cta-bar .mcb-text strong { color: var(--text); font-weight: 500; }
.mobile-cta-bar a {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* ──────────────────────────────────────────────────────────────
   FOOTER (3-column with social + disclaimer)
   ────────────────────────────────────────────────────────────── */
.r2s-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 56px 48px 24px;
  margin-top: 80px;
  background: transparent;
}
.r2s-footer .ft-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.r2s-footer .ft-brand .ft-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.r2s-footer .ft-wordmark {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.r2s-footer .ft-wordmark span { color: var(--accent); }
.r2s-footer .ft-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.r2s-footer .ft-desc {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.7;
  margin-top: 14px;
  font-weight: 300;
  max-width: 280px;
}
.r2s-footer .ft-col-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 500;
}
.r2s-footer .ft-col ul { list-style: none; padding: 0; margin: 0; }
.r2s-footer .ft-col li { margin-bottom: 8px; }
.r2s-footer .ft-col a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color .2s;
}
.r2s-footer .ft-col a:hover { color: var(--accent); }

.r2s-footer .ft-newsletter form {
  display: flex;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg2);
}
.r2s-footer .ft-newsletter input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.r2s-footer .ft-newsletter input::placeholder { color: var(--muted); }
.r2s-footer .ft-newsletter button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity .2s;
}
.r2s-footer .ft-newsletter button:hover { opacity: .9; }
.r2s-footer .ft-newsletter button:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.r2s-footer .ft-msg {
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 8px;
  min-height: 16px;
  letter-spacing: 0.2px;
}
.r2s-footer .ft-msg.success { color: var(--success); }
.r2s-footer .ft-msg.error { color: var(--danger); }

.r2s-footer .ft-social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.r2s-footer .ft-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted);
  transition: border-color .2s, color .2s;
}
.r2s-footer .ft-social a:hover { border-color: var(--accent); color: var(--accent); }
.r2s-footer .ft-social a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.r2s-footer .ft-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.r2s-footer .ft-copy {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.r2s-footer .ft-disclaimer {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.7;
  letter-spacing: 0.2px;
}

/* ──────────────────────────────────────────────────────────────
   SHARED BUTTONS / FORM BASE / FOCUS STATES
   ────────────────────────────────────────────────────────────── */
button { font-family: inherit; }

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

/* Default focus ring for interactive elements that don't define their own */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────────
   SKELETON SHIMMER (G3)
   ────────────────────────────────────────────────────────────── */
.skeleton {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--bg3) 0%,
    rgba(221,228,239,0.5) 50%,
    var(--bg3) 100%
  );
  background-size: 200% 100%;
  animation: r2s-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
  min-height: 12px;
}
.skeleton::before, .skeleton::after { display: none !important; }

@keyframes r2s-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sk-line {
  display: block;
  height: 12px;
  margin: 6px 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg3) 0%, rgba(221,228,239,0.5) 50%, var(--bg3) 100%);
  background-size: 200% 100%;
  animation: r2s-shimmer 1.4s ease-in-out infinite;
}
.sk-line.w-30 { width: 30%; } .sk-line.w-50 { width: 50%; }
.sk-line.w-70 { width: 70%; } .sk-line.w-90 { width: 90%; }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.sk-row .sk-cell { flex: 1; height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg3) 0%, rgba(221,228,239,0.5) 50%, var(--bg3) 100%);
  background-size: 200% 100%;
  animation: r2s-shimmer 1.4s ease-in-out infinite; }

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .r2s-nav { padding: 0 18px; left: 12px; right: 12px; }
  .r2s-nav .nav-links { display: none; }
  .r2s-nav .nav-right .nav-btn-ghost,
  .r2s-nav .nav-right .nav-btn-primary { display: none; }
  .nav-burger { display: inline-flex; }

  .mobile-cta-bar { display: block; }
  body.has-mobile-cta { padding-bottom: 72px; }

  .r2s-footer { padding: 48px 24px 24px; }
  .r2s-footer .ft-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .r2s-footer .ft-brand { grid-column: 1 / -1; }
  .r2s-footer .ft-bottom { flex-direction: column; }
}

@media (max-width: 540px) {
  .r2s-footer .ft-top { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High-contrast / forced-colors safety */
@media (forced-colors: active) {
  .r2s-nav, .r2s-footer, .mobile-cta-bar { border: 1px solid CanvasText; }
}
