@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  --navy:    #0f172a;
  --navy2:   #1e293b;
  --navy3:   #334155;
  --indigo:  #6366f1;
  --indigo2: #818cf8;
  --indigo3: #c7d2fe;
  --cyan:    #06b6d4;
  --cyan2:   #67e8f9;
  --emerald: #10b981;
  --amber:   #f59e0b;
  --rose:    #f43f5e;
  --white:   #ffffff;
  --off:     #f8fafc;
  --muted:   #94a3b8;
  --border:  rgba(99,102,241,0.18);
  --glass:   rgba(255,255,255,0.05);
  --shadow:  0 20px 60px rgba(15,23,42,0.4);
  --r:       16px;
  --r2:      24px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--navy);
  color: #e2e8f0;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: rgba(99,102,241,0.35); color: #fff; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--indigo); border-radius: 3px; }

/* ═══════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════ */
@keyframes fadeUp   { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes slideLeft{ from { opacity:0; transform:translateX(-20px); } to { opacity:1; transform:translateX(0); } }
@keyframes float    { 0%,100% { transform:translateY(0px); } 50% { transform:translateY(-10px); } }
@keyframes spin     { to { transform:rotate(360deg); } }
@keyframes shimmer  { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 20px rgba(99,102,241,0.3), 0 0 60px rgba(99,102,241,0.1); }
  50%     { box-shadow: 0 0 40px rgba(99,102,241,0.6), 0 0 80px rgba(99,102,241,0.2); }
}
@keyframes orbit {
  from { transform: rotate(0deg) translateX(120px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(120px) rotate(-360deg); }
}
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes counter { from { opacity:0; transform:scale(0.5); } to { opacity:1; transform:scale(1); } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes popIn {
  0%   { opacity:0; transform:scale(0.7) translateY(10px); }
  70%  { transform:scale(1.04) translateY(-2px); }
  100% { opacity:1; transform:scale(1) translateY(0); }
}

/* ═══════════════════════════════════════════
   HERO / TOP NAV
═══════════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15,23,42,0.75);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 12px;
  animation: fadeIn 0.8s ease both;
}
.site-nav .nav-logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--indigo2);
  padding: 0 12px 0 4px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
  letter-spacing: 0.05em;
}
.site-nav button, .site-nav a {
  padding: 7px 18px;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  background: transparent;
  color: #94a3b8;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-top: 0;
}
.site-nav button:hover, .site-nav a:hover {
  background: rgba(99,102,241,0.18);
  color: #fff;
}
.site-nav .nav-cta {
  background: var(--indigo) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.site-nav .nav-cta:hover {
  background: var(--indigo2) !important;
  transform: translateY(-1px);
}

/* legacy compat */
.top-buttons { display: none; }

/* ═══════════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 70%),
              radial-gradient(ellipse 50% 40% at 80% 80%, rgba(6,182,212,0.08) 0%, transparent 60%),
              radial-gradient(ellipse 40% 30% at 10% 60%, rgba(16,185,129,0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* animated grid */
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
  pointer-events: none;
}

/* floating orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}
.orb-1 { width:300px;height:300px; background:rgba(99,102,241,0.12); top:-80px;right:10%; animation-delay:0s; }
.orb-2 { width:200px;height:200px; background:rgba(6,182,212,0.1);   bottom:20%;left:5%;  animation-delay:-2s; }
.orb-3 { width:150px;height:150px; background:rgba(16,185,129,0.08); top:40%;right:5%;   animation-delay:-4s; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--indigo2);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: popIn 0.6s 0.2s ease both;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--indigo2);
  box-shadow: 0 0 8px var(--indigo2);
}

h1, .hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, var(--indigo2) 50%, var(--cyan2) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.7s 0.3s ease both, gradient-shift 4s ease infinite;
  display: table;
  margin: 0 auto 20px;
  border-bottom: none;
  padding-bottom: 0;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto 40px;
  animation: fadeUp 0.7s 0.45s ease both;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeUp 0.7s 0.6s ease both;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), #4f46e5);
  color: #fff;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 8px 30px rgba(99,102,241,0.4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-top: 0;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(99,102,241,0.55);
}
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-top: 0;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

/* stats row */
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 64px;
  animation: fadeUp 0.7s 0.8s ease both;
  flex-wrap: wrap;
  justify-content: center;
}
.stat-item {
  text-align: center;
}
.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--indigo2);
  display: block;
}
.stat-lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  animation: fadeIn 1s 1.2s ease both;
}
.scroll-indicator::after {
  content: '';
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--indigo), transparent);
  animation: float 1.5s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   SECTION WRAPPER
═══════════════════════════════════════════ */
.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--indigo2);
  margin-bottom: 8px;
  display: block;
}
.section-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}

/* ═══════════════════════════════════════════
   CARDS / GLASS
═══════════════════════════════════════════ */
.card {
  background: rgba(30,41,59,0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--r2);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.card:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   PAGE HEADER (h2 inside content)
═══════════════════════════════════════════ */
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 56px 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::before {
  content: '';
  width: 3px; height: 20px;
  background: linear-gradient(to bottom, var(--indigo), var(--cyan));
  border-radius: 2px;
  flex-shrink: 0;
}
h3 { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 14px; }

/* ═══════════════════════════════════════════
   INSTRUCTION BOX
═══════════════════════════════════════════ */
.instruction-box {
  background: rgba(30,41,59,0.5);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r2);
  padding: 32px 36px;
  max-width: 860px;
  margin: 0 auto 60px;
  animation: fadeUp 0.6s 0.2s ease both;
  position: relative;
  overflow: hidden;
}
.instruction-box::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--indigo), var(--cyan), var(--emerald));
  background-size: 200%;
  animation: shimmer 3s linear infinite;
}
.instruction-box h2 { margin-top: 0; }

.example-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}
@media (max-width: 600px) { .example-container { grid-template-columns: 1fr; } }

#exampleGraph {
  height: 240px;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r);
  background: rgba(15,23,42,0.6);
  overflow: hidden;
}
#exampleGraph svg { width: 100%; height: 100%; }

.example-input {
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--r);
  padding: 20px 24px;
}
.example-input p { font-size: 13.5px; color: #94a3b8; margin-bottom: 6px; line-height: 1.6; }
.example-input strong { color: var(--indigo2); font-weight: 600; }

/* ═══════════════════════════════════════════
   FORM / INPUT BOX
═══════════════════════════════════════════ */
.inputBox {
  background: rgba(30,41,59,0.5);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--r2);
  padding: 44px 48px;
  max-width: 860px;
  margin: 0 auto 60px;
  animation: fadeUp 0.6s 0.25s ease both;
  position: relative;
  overflow: hidden;
}
.inputBox::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--indigo), var(--cyan), transparent);
}

.form-group { margin-bottom: 36px; }

label, label.heading, label.heading.dark {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
label i { font-size: 14px; color: var(--indigo2); }

input[type="text"], textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 14.5px;
  font-family: 'Fira Code', monospace;
  background: rgba(15,23,42,0.7);
  color: #e2e8f0;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r);
  margin-bottom: 0;
  transition: all 0.25s;
  resize: vertical;
  line-height: 1.65;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15), 0 0 20px rgba(99,102,241,0.1);
  background: rgba(15,23,42,0.9);
}
textarea { height: 160px; }

.hint {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.hint i { color: var(--indigo2); margin-top: 2px; flex-shrink: 0; }
.hint strong { color: var(--muted); font-weight: 600; }

/* ═══════════════════════════════════════════
   CONVERT BUTTON
═══════════════════════════════════════════ */
.convert-btn {
  background: linear-gradient(135deg, var(--indigo) 0%, #4f46e5 100%);
  color: #fff;
  padding: 15px 42px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 8px 30px rgba(99,102,241,0.35);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  text-transform: uppercase;
}
.convert-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 44px rgba(99,102,241,0.55);
}
.convert-btn:active { transform: translateY(0); }
.convert-btn i { font-size: 14px; transition: transform 0.3s; }
.convert-btn.loading i { animation: spin 0.7s linear infinite; }

/* ═══════════════════════════════════════════
   STEPS OUTPUT
═══════════════════════════════════════════ */
#steps, .steps-output {
  font-family: 'Fira Code', monospace;
  font-size: 13.5px;
  line-height: 1.9;
  background: rgba(15,23,42,0.8);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 3px solid var(--indigo);
  color: #a5b4fc;
  padding: 24px 28px;
  border-radius: var(--r);
  overflow-x: auto;
  max-width: 860px;
  white-space: pre-wrap;
  animation: fadeIn 0.4s ease both;
}
pre {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(99,102,241,0.15);
  color: #a5b4fc;
  padding: 20px 24px;
  border-radius: var(--r);
  overflow-x: auto;
  max-width: 860px;
  white-space: pre-wrap;
  line-height: 1.7;
}

/* ═══════════════════════════════════════════
   DFA TABLE
═══════════════════════════════════════════ */
#dfaTable { max-width: 860px; overflow-x: auto; animation: fadeUp 0.4s ease both; }

.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-family: 'Fira Code', monospace;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid rgba(99,102,241,0.18);
}
.modern-table th {
  background: rgba(99,102,241,0.18);
  color: var(--indigo2);
  padding: 14px 20px;
  border: 1px solid rgba(99,102,241,0.15);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}
.modern-table td {
  padding: 12px 20px;
  border: 1px solid rgba(99,102,241,0.08);
  color: #e2e8f0;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.modern-table tr:hover td {
  background: rgba(99,102,241,0.1);
  color: #c7d2fe;
}
.modern-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
td.final-state { color: var(--emerald) !important; font-weight: 600; }
td.empty-state  { color: #475569; }

/* ═══════════════════════════════════════════
   GRAPH CONTAINERS
═══════════════════════════════════════════ */
#nfaGraph, #dfaGraph {
  width: 100%;
  max-width: 860px;
  height: 420px;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r2);
  margin-top: 16px;
  overflow: hidden;
  position: relative;
}
#nfaGraph svg, #dfaGraph svg { width: 100%; height: 100%; }

/* ═══════════════════════════════════════════
   THEORY / GRAPH SECTION LINKS
═══════════════════════════════════════════ */
.theory-section, .graph-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 10px;
  animation: slideLeft 0.5s ease both;
}
.theory-section h2, .graph-section h2 { margin: 0; font-size: 1.2rem; }

.theory-btn, .graph-btn {
  text-decoration: none;
  background: rgba(99,102,241,0.12);
  color: var(--indigo2);
  padding: 9px 22px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  border: 1px solid rgba(99,102,241,0.3);
  transition: all 0.25s;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.theory-btn:hover, .graph-btn:hover {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 6px 24px rgba(99,102,241,0.4);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   THEORY PAGE
═══════════════════════════════════════════ */
.theory-content { max-width: 860px; margin: 0 auto; padding: 0 32px 80px; }
.theory-content p {
  color: #94a3b8;
  line-height: 1.8;
  font-size: 15px;
  margin-bottom: 20px;
}
.theory-img {
  width: 100%;
  max-width: 860px;
  display: block;
  margin: 24px auto;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r);
  background: rgba(30,41,59,0.5);
}

/* ═══════════════════════════════════════════
   LOGO
═══════════════════════════════════════════ */
.logo { display: none; }

/* ═══════════════════════════════════════════
   DESCRIPTION
═══════════════════════════════════════════ */
.description {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 680px;
  margin: 0 auto 40px;
  text-align: center;
  font-weight: 400;
}

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: rgba(30,41,59,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16,185,129,0.4);
  color: #6ee7b7;
  padding: 12px 24px 12px 16px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 999;
  display: none;
  align-items: center;
  gap: 10px;
  animation: popIn 0.4s ease both;
}
.toast.show { display: flex; }
.toast-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  text-align: center;
  padding: 40px 20px 60px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-top: 1px solid rgba(99,102,241,0.25);
  background: linear-gradient(135deg, #818cf8, #06b6d4, #10b981);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
  text-shadow: none;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 200px; height: 1px;
  background: linear-gradient(90deg, transparent, #6366f1, #06b6d4, transparent);
  box-shadow: 0 0 12px rgba(99,102,241,0.6);
}

/* ═══════════════════════════════════════════
   ANIMATED STEP COUNTER
═══════════════════════════════════════════ */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--cyan));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
  animation: counter 0.4s ease both;
}

/* ═══════════════════════════════════════════
   FEATURES ROW (homepage cards)
═══════════════════════════════════════════ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 80px;
  padding: 0 32px;
  animation: fadeUp 0.6s 0.3s ease both;
}
.feature-card {
  background: rgba(30,41,59,0.45);
  border: 1px solid rgba(99,102,241,0.14);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--indigo), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.feature-card:hover { border-color: rgba(99,102,241,0.35); transform: translateY(-4px); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 15px; margin-bottom: 8px; }
.feature-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* ═══════════════════════════════════════════
   GRAPH CARD (graphs.html)
═══════════════════════════════════════════ */
.graph-card {
  background: rgba(30,41,59,0.5);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--r2);
  padding: 28px 32px;
  max-width: 900px;
  margin: 0 auto 32px;
  animation: fadeUp 0.5s ease both;
  position: relative;
  overflow: hidden;
}
.graph-card:nth-child(2) { animation-delay: 0.1s; }
.graph-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--indigo), var(--cyan));
}
.graph-card h2 { margin-top: 0; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 680px) {
  .hero { padding: 100px 24px 60px; }
  .hero-stats { gap: 24px; }
  .inputBox { padding: 28px 20px; }
  .section { padding: 0 20px 60px; }
  .site-nav .nav-logo { display: none; }
  h1 { font-size: 2rem; }
}
/* ═══════════════════════════════════
   GLOBAL SCALE UP (BIG UI)
═══════════════════════════════════ */

/* Base font size increase */
html {
  font-size: 18px; /* default 16 → bigger */
}

/* Headings */
h1, .hero-title {
  font-size: clamp(3rem, 6vw, 5.5rem) !important;
}

h2 {
  font-size: 2.2rem !important;
}

h3 {
  font-size: 1.5rem !important;
}

/* Text */
.hero-sub,
.description,
.theory-content p {
  font-size: 1.3rem !important;
}

p, label {
  font-size: 1.1rem !important;
}

/* Inputs */
input[type="text"], textarea {
  font-size: 1.1rem !important;
  padding: 18px 22px !important;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.convert-btn {
  font-size: 1.2rem !important;
  padding: 18px 40px !important;
}

/* Table */
.modern-table {
  font-size: 1.1rem !important;
}

.modern-table th {
  font-size: 1rem !important;
  padding: 18px !important;
}

.modern-table td {
  font-size: 1.05rem !important;
  padding: 16px !important;
}

/* Steps output */
#steps, .steps-output, pre {
  font-size: 1.05rem !important;
  padding: 28px !important;
}

/* Graph size BIG */
#nfaGraph, #dfaGraph {
  height: 600px !important; /* was 420px */
}

/* Example graph */
#exampleGraph {
  height: 350px !important;
}

/* Cards spacing */
.card,
.inputBox,
.instruction-box {
  padding: 50px !important;
}

/* Stats */
.stat-num {
  font-size: 2.5rem !important;
}

.stat-lbl {
  font-size: 1rem !important;
}

/* Navbar */
.site-nav button,
.site-nav a {
  font-size: 1rem !important;
  padding: 10px 22px !important;
}

/* Feature cards */
.feature-card h3 {
  font-size: 1.3rem !important;
}

.feature-card p {
  font-size: 1.1rem !important;
}
/* ═══════════════════════════════════
   ANIMATED SUBSET STEPS
═══════════════════════════════════ */

.step-block {
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 4px solid var(--indigo);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  animation: fadeUp 0.5s ease forwards;
  opacity: 0;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #c7d2fe;
  margin-bottom: 10px;
}

.processing {
  font-size: 0.85rem;
  color: var(--cyan2);
  margin-left: auto;
  position: relative;
}

.processing::after {
  content: '';
  animation: dots 1.2s infinite;
}

@keyframes dots {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}

.state-highlight {
  color: var(--emerald);
  font-weight: 700;
}

.transition-line {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  margin: 4px 0;
  background: rgba(99,102,241,0.08);
  animation: glow 1.2s infinite alternate;
}


@keyframes glow {
  from { background: rgba(99,102,241,0.08); }
  to   { background: rgba(99,102,241,0.25); }
}

.step-divider {
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(to right, transparent, var(--indigo), transparent);
}

/* delay animation per step */
.step-block:nth-child(1){animation-delay:0.2s}
.step-block:nth-child(2){animation-delay:0.6s}
.step-block:nth-child(3){animation-delay:1s}
.step-block:nth-child(4){animation-delay:1.4s}
.step-block:nth-child(5){animation-delay:1.8s}
/* ═══════════════════════════════════════════
   TWO-COLUMN STEP LAYOUT WITH MINI SVG
═══════════════════════════════════════════ */
.step-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.step-text-col {
  flex: 1 1 0;
  min-width: 0;
}
.step-mini-col {
  flex: 0 0 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mini animated SVG */
.mini-state-svg {
  width: 300px;
  height: 200px;
  border-radius: 12px;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(99,102,241,0.18);
  overflow: visible;
  animation: fadeIn 0.5s ease both;
}

/* Node pop-in */
@keyframes nodePop {
  0%   { opacity: 0; transform: scale(0.3); }
  70%  { transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
.node-pop {
  animation: nodePop 0.45s ease both;
}

/* Edge draw-in */
@keyframes edgeDraw {
  from { stroke-dashoffset: 200; opacity: 0; }
  to   { stroke-dashoffset: 0;   opacity: 0.9; }
}
.edge-anim {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: edgeDraw 0.5s ease both;
}

/* Pulse rings */
@keyframes pulseRing {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}
.pulse-ring {
  transform-origin: center;
  animation: pulseRing 1.2s ease-out infinite;
}
@keyframes pulseRingGreen {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}
.pulse-ring-green {
  transform-origin: center;
  animation: pulseRingGreen 1.2s 0.3s ease-out infinite;
  stroke: #10b981 !important;
}

/* Step header extras */
.step-title { font-size: 0.95rem; }
.final-badge {
  margin-left: auto;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.4);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 50px;
  letter-spacing: 0.05em;
}

/* Transition row pills */
.trans-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.trans-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.trans-row.dead { opacity: 0.55; }
.sym-pill {
  background: rgba(99,102,241,0.18);
  color: var(--indigo2);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 6px;
  padding: 1px 8px;
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  font-weight: 600;
}
.arrow { color: var(--muted); font-size: 0.85rem; }
.to-state {
  color: #c7d2fe;
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
}
.final-state-pill { color: #6ee7b7 !important; }
.dead-state {
  color: var(--muted);
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
}
.new-badge {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 50px;
}
.old-badge {
  background: rgba(148,163,184,0.1);
  border: 1px solid rgba(148,163,184,0.2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 50px;
}

/* Responsive: stack on small screens */
@media (max-width: 580px) {
  .step-layout { flex-direction: column; }
  .step-mini-col { flex: unset; width: 100%; }
  .mini-state-svg { width: 100%; height: 180px; }
}

/* ═══════════════════════════════════════════
   MODE TABS  (NFA / Regex)
═══════════════════════════════════════════ */
.mode-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  background: rgba(30,41,59,0.5);
  color: var(--muted);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.22s;
}
.mode-tab:hover {
  background: rgba(99,102,241,0.12);
  color: #e2e8f0;
}
.mode-tab.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(99,102,241,0.12));
  border-color: rgba(99,102,241,0.5);
  color: var(--indigo2);
  box-shadow: 0 0 18px rgba(99,102,241,0.2);
}

/* ── REGEX PANEL ── */
.regex-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.22);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  color: var(--cyan2);
  font-size: 0.85rem;
  line-height: 1.6;
}
.regex-info-banner i { flex-shrink: 0; margin-top: 2px; }

.regex-examples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.regex-ex-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.regex-chip {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: var(--indigo2);
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.18s;
}
.regex-chip:hover {
  background: rgba(99,102,241,0.22);
  border-color: rgba(99,102,241,0.5);
  transform: translateY(-1px);
}

/* code tag inside hints */
code {
  background: rgba(99,102,241,0.12);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82em;
  color: var(--indigo2);
}

