/*
Theme Name: RSU Flow
Theme URI: https://rsuflow.com
Author: RSU Flow
Author URI: https://rsuflow.com
Description: Educational research on equity compensation mechanics and rules-based vesting frameworks.
Version: 1.0.2
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rsuflow
*/

:root {
  --bg: #0b0f17;
  --surface: #111827;
  --surface-card: #0d1524;
  --accent: #2563eb;
  --accent-flow: #10b981;
  --text: #f9fafb;
  --text-dim: #9ca3af;
  --urgent: #00ff41;
  --grid: #1f2937;
  --warn: #f59e0b;
  --danger: #ef4444;

  --font-head: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Roboto Mono', 'SF Mono', Menlo, Consolas, monospace;
  --font-hand: 'Caveat', cursive, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}

.mono {
  font-family: var(--font-mono);
}

.hand {
  font-family: var(--font-hand);
}

/* Header & Navigation */
.rsu-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 15, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grid);
}

.rsu-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.rsu-logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.rsu-logo-link img {
  height: 40px;
  width: auto;
  display: block;
}

.rsu-navlinks {
  display: flex;
  align-items: center;
  gap: 24px;
}

.rsu-navlink {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.rsu-navlink:hover {
  color: var(--text);
}

.rsu-header-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rsu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.rsu-btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.rsu-btn-primary:hover {
  background: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.15);
}

.rsu-btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--grid);
}

.rsu-btn-outline:hover {
  border-color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
}

.rsu-btn-urgent {
  background: var(--urgent);
  color: #0b0f17;
  border-color: var(--urgent);
}

.rsu-btn-urgent:hover {
  background: #33ff66;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

/* Mobile Toggle */
.rsu-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--grid);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.rsu-mobile-drawer {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--grid);
  padding: 24px;
  flex-direction: column;
  gap: 18px;
  z-index: 999;
}

.rsu-mobile-drawer.open {
  display: flex;
}

.rsu-mobile-drawer a {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
  .rsu-navlinks {
    display: none;
  }
  .rsu-menu-toggle {
    display: block;
  }
}

/* Telemetry Stream Bar */
.rsu-telemetry-bar {
  background: #080c14;
  border-bottom: 1px solid var(--grid);
  padding: 10px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  white-space: nowrap;
}

.rsu-telemetry-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rsu-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--urgent);
  box-shadow: 0 0 10px var(--urgent);
  margin-right: 8px;
  animation: rsuPulse 2s infinite ease-in-out;
}

@keyframes rsuPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Sections */
.rsu-section {
  border-top: 1px solid var(--grid);
  padding: 96px 24px;
}

.rsu-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Command Pill */
.rsu-cmd-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #080c14;
  border: 1px solid var(--grid);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.rsu-cmd-pill code {
  color: var(--text);
  font-weight: 500;
}

/* Hero Diagram Box & Animated State Machine */
.rsu-hero-diagram-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 12px;
  padding: 24px;
  overflow: hidden;
}

@keyframes rsuDashFlow {
  from { stroke-dashoffset: 32; }
  to { stroke-dashoffset: 0; }
}

@keyframes rsuDashFlowReverse {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 32; }
}

@keyframes rsuRadarRipple {
  0% { r: 16px; opacity: 0.95; stroke-width: 2px; }
  100% { r: 42px; opacity: 0; stroke-width: 0.5px; }
}

@keyframes rsuNodeGlowGreen {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(0, 255, 65, 0.4)); }
  50% { filter: drop-shadow(0 0 12px rgba(0, 255, 65, 0.9)); }
}

@keyframes rsuNodeGlowRed {
  0%, 100% { opacity: 0.85; filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.3)); }
  50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.7)); }
}

@keyframes rsuGatePulse {
  0%, 100% { stroke: #2563eb; }
  50% { stroke: #60a5fa; }
}

.rsu-flow-conduit {
  stroke-dasharray: 8 6;
  animation: rsuDashFlow 1.6s linear infinite;
}

.rsu-flow-emerald {
  stroke-dasharray: 10 6;
  animation: rsuDashFlow 1.2s linear infinite;
}

.rsu-flow-drift {
  stroke-dasharray: 6 8;
  animation: rsuDashFlowReverse 3s linear infinite;
}

.rsu-radar-circle-1 {
  animation: rsuRadarRipple 2.2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
  transform-origin: 500px 110px;
}

.rsu-radar-circle-2 {
  animation: rsuRadarRipple 2.2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite 1.1s;
  transform-origin: 500px 110px;
}

.rsu-card-divest {
  animation: rsuNodeGlowGreen 2.5s ease-in-out infinite;
}

.rsu-card-gamble {
  animation: rsuNodeGlowRed 3s ease-in-out infinite;
}

.rsu-gate-border {
  animation: rsuGatePulse 3s ease-in-out infinite;
}

/* Traps Grid */
.rsu-traps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.rsu-trap-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 10px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rsu-trap-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.rsu-card-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--urgent);
}

/* Interactive Calculator Container */
.rsu-calc-wrapper {
  background: #080c14;
  border: 1px solid var(--grid);
  border-radius: 14px;
  padding: 40px;
  margin-top: 48px;
}

.rsu-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

@media (max-width: 860px) {
  .rsu-calc-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .rsu-calc-wrapper {
    padding: 24px;
  }
}

.rsu-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.rsu-input-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

.rsu-input-value {
  color: var(--text);
  font-weight: 700;
}

.rsu-range-slider {
  width: 100%;
  height: 6px;
  background: var(--grid);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.rsu-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--text);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.rsu-select {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
}

.rsu-output-box {
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rsu-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rsu-stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.rsu-stat-label {
  font-size: 14px;
  color: var(--text-dim);
}

.rsu-stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}

.rsu-stat-val.urgent {
  color: var(--urgent);
}

.rsu-stat-val.warn {
  color: var(--warn);
}

.rsu-stat-val.danger {
  color: var(--danger);
}

/* Diagrams Grid */
.rsu-diagrams-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 48px;
}

.rsu-diagram-card {
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 12px;
  padding: 24px;
}

.rsu-diagram-card img {
  width: 100%;
  height: auto;
  display: block;
}

/* Video Grid */
.rsu-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.rsu-video-card {
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rsu-video-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.rsu-video-card img {
  width: 100%;
  height: auto;
  display: block;
}

.rsu-video-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rsu-video-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.3;
  margin: 0;
}

.rsu-video-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

/* Subscribe Section */
.rsu-subscribe-box {
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 12px;
  padding: 64px 32px;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.rsu-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.rsu-input {
  flex: 1 1 260px;
  min-height: 48px;
  background: #080c14;
  border: 1px solid var(--grid);
  border-radius: 6px;
  padding: 0 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
}

.rsu-input:focus {
  border-color: var(--accent);
}

/* Footer */
.rsu-footer {
  border-top: 1px solid var(--grid);
  background: #080c14;
  padding: 64px 24px 32px;
}

.rsu-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.rsu-footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
}

.rsu-footer-links-group {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.rsu-footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rsu-footer-col h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rsu-footer-col a {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.rsu-footer-col a:hover {
  color: var(--accent);
}

.rsu-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.rsu-disclaimer {
  max-width: 720px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}

/* Single Post & Research Archive */
.rsu-post-back {
  display: inline-block;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.rsu-post-back:hover {
  text-decoration: underline;
}

.entry-content h2 {
  font-size: clamp(22px, 3vw, 28px);
  color: var(--text);
  margin: 40px 0 16px 0;
  padding-top: 16px;
  border-top: 1px solid var(--grid);
}

.entry-content h3 {
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--text);
  margin: 28px 0 12px 0;
}

.entry-content p {
  margin: 0 0 18px 0;
  color: var(--text-dim);
}

.entry-content strong {
  color: var(--text);
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content a:hover {
  color: var(--urgent);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
  color: var(--text-dim);
}

.entry-content li {
  margin-bottom: 10px;
}

.entry-content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  color: var(--urgent);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--grid);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 8px;
  overflow: hidden;
}

.entry-content th,
.entry-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--grid);
}

.entry-content th {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.entry-content td {
  color: var(--text-dim);
}

.entry-content tr:last-child td {
  border-bottom: none;
}

.rsu-callout {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
}

.rsu-callout-warn {
  border-left-color: var(--warn);
}

.rsu-callout-urgent {
  border-left-color: var(--urgent);
}

.rsu-post-footer-box {
  margin-top: 48px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rsu-research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.rsu-post-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 24px;
  background: var(--surface-card);
  border: 1px solid var(--grid);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.rsu-post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.rsu-post-card h4,
.rsu-post-card h3,
.rsu-post-card h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
  line-height: 1.3;
}

.rsu-post-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
  }

  .entry-content th,
  .entry-content td {
    padding: 10px 12px;
  }
}
