/* ── RegexNest Design System ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0B0F19;
  color: #E2E8F0;
  line-height: 1.7;
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1.05rem);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #67B8FF;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #A7D8FF;
}

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

ul, ol {
  list-style: none;
}

/* ── Custom Properties ── */
:root {
  --bg-primary: #0B0F19;
  --bg-secondary: #111827;
  --bg-elevated: #1A2236;
  --bg-card: #151D30;
  --bg-card-hover: #1C2640;
  --border-subtle: rgba(103, 184, 255, 0.08);
  --border-medium: rgba(103, 184, 255, 0.15);
  --text-primary: #E2E8F0;
  --text-secondary: #94A8C0;
  --text-muted: #5A6F8A;
  --accent-primary: #6366F1;
  --accent-primary-light: #818CF8;
  --accent-neon: #00D4FF;
  --accent-neon-glow: rgba(0, 212, 255, 0.25);
  --accent-green: #22C55E;
  --accent-green-soft: rgba(34, 197, 94, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --max-width: 1200px;
  --header-height: 64px;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.2;
  color: #F8FAFC;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: clamp(2.2rem, 2rem + 2.5vw, 3.8rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.6rem, 1.4rem + 1.5vw, 2.6rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.2rem, 1.1rem + 0.8vw, 1.6rem);
  letter-spacing: -0.01em;
}

h4 {
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.25rem);
}

p {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: rgba(99, 102, 241, 0.1);
  color: #A5B4FC;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

pre {
  background: #0D1220;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  color: #C9D1D9;
  line-height: 1.6;
}

/* ── Header / Navigation ── */
.rn-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
}

.rn-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.rn-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: #F8FAFC;
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.rn-logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.rn-logo-text {
  background: linear-gradient(135deg, #F8FAFC 0%, #67B8FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rn-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rn-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.rn-nav-link:hover,
.rn-nav-link.active {
  color: #F8FAFC;
  background: rgba(103, 184, 255, 0.08);
}

.rn-nav-cta {
  margin-left: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-primary) 0%, #818CF8 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.rn-nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  color: #fff;
}

/* Mobile menu toggle */
.rn-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

.rn-menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* ── Hero Section ── */
.rn-hero {
  padding: clamp(4rem, 8vw, 8rem) 0 clamp(3rem, 5vw, 5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.rn-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(0, 212, 255, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.rn-hero > * {
  position: relative;
  z-index: 1;
}

.rn-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-neon);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.rn-hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-neon);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.rn-hero-title {
  margin-bottom: 1.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.rn-hero-title .highlight {
  background: linear-gradient(135deg, var(--accent-neon) 0%, var(--accent-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rn-hero-subtitle {
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.rn-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.rn-hero-preview {
  margin-top: clamp(3rem, 5vw, 5rem);
  background: #0D1220;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glow), var(--shadow-card);
  text-align: left;
}

.rn-hero-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.rn-hero-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #374151;
}

.rn-hero-preview-dot:first-child { background: #EF4444; }
.rn-hero-preview-dot:nth-child(2) { background: #F59E0B; }
.rn-hero-preview-dot:nth-child(3) { background: #22C55E; }

.rn-hero-preview-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 0.7rem + 0.3vw, 0.9rem);
  line-height: 1.8;
  color: #94A3B8;
}

.rn-hero-preview-body .keyword { color: #C084FC; }
.rn-hero-preview-body .string { color: #34D399; }
.rn-hero-preview-body .regex { color: #F59E0B; }
.rn-hero-preview-body .comment { color: #4B5563; }
.rn-hero-preview-body .func { color: #67B8FF; }

/* ── Sections ── */
.rn-section {
  padding: clamp(3.5rem, 6vw, 6rem) 0;
}

.rn-section-alt {
  background: var(--bg-secondary);
}

.rn-section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto clamp(2.5rem, 4vw, 3.5rem);
}

.rn-section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-neon);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
  display: block;
}

.rn-section-heading {
  margin-bottom: 1rem;
}

.rn-section-desc {
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
  line-height: 1.75;
}

/* ── Buttons ── */
.rn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.rn-btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #818CF8 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
}

.rn-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
  color: #fff;
}

.rn-btn-secondary {
  background: rgba(103, 184, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.rn-btn-secondary:hover {
  background: rgba(103, 184, 255, 0.15);
  border-color: rgba(103, 184, 255, 0.3);
  color: #F8FAFC;
}

.rn-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.rn-btn-ghost:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.04);
}

/* ── Cards ── */
.rn-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.rn-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(1.5rem, 2vw, 2rem);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.rn-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.rn-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.rn-card:hover::before {
  opacity: 1;
}

.rn-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  color: var(--accent-primary-light);
  font-size: 1.2rem;
}

.rn-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: #F8FAFC;
}

.rn-card-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.rn-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-neon);
  text-decoration: none;
  transition: gap var(--transition-fast);
}

.rn-card-link:hover {
  gap: 0.6rem;
}

/* ── Image ── */
.rn-image {
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rn-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Two Column Layout ── */
.rn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

/* ── Code Block Wrapper ── */
.rn-code-block {
  background: #0D1220;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: #94A3B8;
  overflow-x: auto;
  position: relative;
}

.rn-code-block-label {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

/* ── Stats Row ── */
.rn-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1.5rem;
  margin: clamp(2rem, 4vw, 3rem) 0;
}

.rn-stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.rn-stat-number {
  font-size: clamp(1.8rem, 2rem + 1vw, 2.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-neon), var(--accent-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.rn-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Feature List ── */
.rn-feature-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rn-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.rn-feature-item:hover {
  border-color: var(--border-medium);
}

.rn-feature-check {
  color: var(--accent-green);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.rn-feature-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.rn-feature-text strong {
  color: #F8FAFC;
  font-weight: 600;
}

/* ── Divider ── */
.rn-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: clamp(2rem, 4vw, 3rem) 0;
}

/* ── Footer ── */
.rn-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: clamp(2.5rem, 4vw, 4rem) 0 clamp(1.5rem, 2vw, 2rem);
}

.rn-footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: clamp(2rem, 3vw, 3rem);
  margin-bottom: clamp(2rem, 3vw, 3rem);
}

.rn-footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  max-width: 280px;
  line-height: 1.7;
}

.rn-footer-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.rn-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rn-footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.rn-footer-links a:hover {
  color: #F8FAFC;
}

.rn-footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.rn-footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rn-footer-socials {
  display: flex;
  gap: 1rem;
}

.rn-footer-socials a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.rn-footer-socials a:hover {
  color: var(--accent-neon);
}

/* ── Lead Paragraph ── */
.rn-lead {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 680px;
}

/* ── Body Text ── */
.rn-body {
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .rn-grid-2 {
    grid-template-columns: 1fr;
  }

  .rn-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .rn-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(11, 15, 25, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.25rem;
  }

  .rn-nav.open {
    display: flex;
  }

  .rn-nav-link {
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.75rem;
  }

  .rn-nav-cta {
    margin-left: 0;
    margin-top: 0.5rem;
    text-align: center;
    width: 100%;
  }

  .rn-menu-toggle {
    display: block;
  }

  .rn-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .rn-footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .rn-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .rn-hero-actions .rn-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .rn-card-grid {
    grid-template-columns: 1fr;
  }

  .rn-stats {
    grid-template-columns: 1fr;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: #2A3450;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3A4A6A;
}

/* ── Selection ── */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #F8FAFC;
}
/* universal guards (not a template) */
*{box-sizing:border-box}img,svg,video{max-width:100%;height:auto}h1,h2,h3,h4,p,li,a,span,blockquote{overflow-wrap:break-word;word-break:normal}html{-webkit-text-size-adjust:100%}body{margin:0}
