/* ===================================================
   PhysiSim – Premium CSS Design System
   =================================================== */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #10101a;
  --bg-panel: rgba(255, 255, 255, 0.04);
  --bg-panel-hover: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(99, 179, 237, 0.6);
  --text-primary: #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #63b3ed;
  --accent-purple: #9f7aea;
  --accent-cyan: #00e5ff;
  --accent-green: #48bb78;
  --accent-orange: #f6ad55;
  --accent-pink: #fc8181;
  --gradient-main: linear-gradient(135deg, #63b3ed, #9f7aea);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 30px rgba(99, 179, 237, 0.2);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Orbitron', sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f0f4ff;
  --bg-secondary: #e8edf8;
  --bg-panel: rgba(255, 255, 255, 0.8);
  --bg-panel-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(255, 255, 255, 0.9);
  --border-color: rgba(99, 122, 180, 0.2);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-primary: #1a1f36;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-panel-hover: rgba(240, 244, 255, 0.95);
  --shadow-panel: 0 8px 32px rgba(99, 102, 241, 0.08);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
  min-height: 100vh;
}

/* ---- Particle Canvas ---- */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================================================
   NAVBAR
=================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(240, 244, 255, 0.75);
}

.navbar.scrolled {
  padding: 12px 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  font-size: 1.6rem;
}

.nav-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.nav-controls {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.btn-icon:hover {
  background: var(--bg-panel-hover);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-blue);
}

/* ===================================================
   HERO SECTION
=================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  z-index: 1;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(99, 179, 237, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(159, 122, 234, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(99, 179, 237, 0.12);
  border: 1px solid rgba(99, 179, 237, 0.3);
  color: var(--accent-blue);
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 24px;
  animation: fadeInDown 0.6s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeInUp 0.7s 0.1s ease both;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 36px;
  animation: fadeInUp 0.7s 0.2s ease both;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeInUp 0.7s 0.3s ease both;
}

.btn-primary {
  background: var(--gradient-main);
  border: none;
  color: #fff;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 179, 237, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-arrow {
  transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-secondary {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary:hover {
  background: var(--bg-panel-hover);
  border-color: var(--accent-purple);
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-sep {
  color: var(--border-color);
  font-size: 1.5rem;
}

/* Hero Visual (Atom) */
.hero-visual {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: orbit linear infinite;
}

.ring-1 {
  width: 200px;
  height: 200px;
  border-color: rgba(99, 179, 237, 0.3);
  animation-duration: 8s;
  transform: rotateX(75deg);
}

.ring-2 {
  width: 290px;
  height: 290px;
  border-color: rgba(159, 122, 234, 0.2);
  animation-duration: 12s;
  animation-direction: reverse;
  transform: rotateX(75deg) rotateY(45deg);
}

.ring-3 {
  width: 370px;
  height: 370px;
  border-color: rgba(0, 229, 255, 0.15);
  animation-duration: 18s;
  transform: rotateX(60deg) rotateZ(30deg);
}

.atom-core {
  font-size: 4rem;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes orbit {
  from {
    transform: rotateZ(0deg) rotateX(75deg);
  }

  to {
    transform: rotateZ(360deg) rotateX(75deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: scrollBounce 2s ease-in-out infinite;
  box-shadow: 0 0 12px var(--accent-blue);
}

@keyframes scrollBounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }

  50% {
    transform: translateY(10px);
    opacity: 0.4;
  }
}

/* ===================================================
   SECTION COMMON
=================================================== */
.topic-section,
.workspace,
.guide-section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ===================================================
   TOPIC CARDS
=================================================== */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.topic-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.topic-card:hover::before,
.topic-card.active::before {
  transform: scaleX(1);
}

.topic-card:hover {
  background: var(--bg-panel-hover);
  border-color: rgba(99, 179, 237, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 179, 237, 0.1);
}

.topic-card.active {
  background: rgba(99, 179, 237, 0.08);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

.topic-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
  display: block;
}

.topic-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.topic-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.topic-tag {
  display: inline-block;
  background: rgba(99, 179, 237, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(99, 179, 237, 0.25);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===================================================
   WORKSPACE
=================================================== */
/* Workspace is HIDDEN on the home/index page.
   It only appears when a topic card is selected (body.focused). */
.workspace {
  display: none;
  background: var(--bg-secondary);
  padding: 80px 0;
}

[data-theme="light"] .workspace {
  background: rgba(230, 235, 255, 0.5);
}

/* ===================================================
   BACK BAR  (hidden by default)
=================================================== */
.back-bar {
  display: none;
  padding: 0;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 900;
  position: sticky;
  top: 64px;
  /* sit just below navbar */
  animation: slideDown 0.35s ease both;
}

[data-theme="light"] .back-bar {
  background: rgba(240, 244, 255, 0.75);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.back-bar .container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 179, 237, 0.1);
  border: 1px solid rgba(99, 179, 237, 0.3);
  color: var(--accent-blue);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-back:hover {
  background: rgba(99, 179, 237, 0.2);
  border-color: var(--accent-blue);
  transform: translateX(-2px);
  box-shadow: 0 0 16px rgba(99, 179, 237, 0.2);
}

.back-arrow {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.btn-back:hover .back-arrow {
  transform: translateX(-3px);
}

.back-topic-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-left: 1px solid var(--border-color);
  padding-left: 16px;
}

.back-topic-label span:first-child {
  font-size: 1.1rem;
}

/* ===================================================
   FOCUSED MODE  (body.focused)
   — Hides all sections except workspace
=================================================== */
body.focused .hero,
body.focused .topic-section,
body.focused .guide-section,
body.focused .footer {
  display: none !important;
}

body.focused .workspace {
  display: block;
  /* override the default display:none */
  min-height: calc(100vh - 64px - 52px);
  /* full screen minus navbar + back-bar */
  padding: 60px 0 60px;
  /* top padding ensures content clears the sticky back-bar */
  animation: workspaceFadeIn 0.4s ease both;
}

@keyframes workspaceFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.focused .back-bar {
  display: block;
}

/* Give the grid breathing room below the sticky back-bar */
body.focused .workspace-grid {
  margin-top: 28px;
}

/* Ensure sticky back-bar doesn't overlap content on anchor scroll */
body.focused {
  scroll-padding-top: 130px;
}


.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Step-by-Step + Result shown side-by-side */
.solution-result-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.solution-result-row .panel {
  flex: 1;
  min-width: 0;
  /* prevent flex children from overflowing */
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .solution-result-row {
    flex-direction: column;
  }
}


/* ===================================================
   PANELS
=================================================== */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  margin-bottom: 20px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-panel);
}

.panel:hover {
  border-color: rgba(99, 179, 237, 0.2);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.panel-icon {
  font-size: 1rem;
}

.panel-header h3 {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex: 1;
}

.panel-body {
  padding: 20px;
}

.panel-actions {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Topic Header — full-width row above the two-column grid */
.ws-topic-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0 12px;
  margin-bottom: 0;
}

.ws-topic-header span:first-child {
  font-size: 2rem;
}

.ws-topic-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.ws-topic-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* ===================================================
   INPUT FIELDS
=================================================== */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group label .unit-badge {
  background: rgba(99, 179, 237, 0.1);
  color: var(--accent-blue);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.input-group input,
.input-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.93rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1), 0 0 12px rgba(99, 179, 237, 0.08);
  background: rgba(99, 179, 237, 0.04);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group input.error {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.1);
}

.input-group .error-msg {
  font-size: 0.75rem;
  color: var(--accent-pink);
  margin-top: 4px;
  display: none;
}

.input-group input.error+.error-msg {
  display: block;
}

.btn-example {
  background: rgba(159, 122, 234, 0.12);
  border: 1px solid rgba(159, 122, 234, 0.3);
  color: var(--accent-purple);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-left: auto;
}

.btn-example:hover {
  background: rgba(159, 122, 234, 0.2);
}

/* ===================================================
   FORMULA BOX
=================================================== */
.formula-box {
  background: rgba(99, 179, 237, 0.05);
  border: 1px solid rgba(99, 179, 237, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 14px;
}

.formula-main {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  display: block;
}

.formula-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.formula-var {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.formula-var strong {
  color: var(--accent-cyan);
}

.concept-box {
  background: rgba(72, 187, 120, 0.05);
  border: 1px solid rgba(72, 187, 120, 0.2);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===================================================
   SOLUTION STEPS
=================================================== */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: stepReveal 0.4s ease both;
}

@keyframes stepReveal {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.step-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ===================================================
   RESULT DISPLAY
=================================================== */
.result-display {
  padding: 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99, 179, 237, 0.08), rgba(159, 122, 234, 0.08));
}

.result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.result-value {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.result-unit {
  font-size: 1rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.result-extra {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
  text-align: center;
}

.result-chip span {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 1rem;
}

/* ===================================================
   ANIMATION CANVAS
=================================================== */
.anim-panel {
  position: relative;
}

.anim-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.btn-icon-sm {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon-sm:hover {
  background: rgba(99, 179, 237, 0.15);
  border-color: var(--accent-blue);
}

.canvas-wrapper {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

[data-theme="light"] .canvas-wrapper {
  background: rgba(230, 235, 255, 0.5);
}

#simCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
}

.canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.canvas-placeholder span {
  font-size: 3rem;
  opacity: 0.3;
}

.sim-status {
  padding: 8px 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  border-top: 1px solid var(--border-color);
}

.sim-status.running {
  color: var(--accent-green);
}

.sim-status.done {
  color: var(--accent-blue);
}

/* ===================================================
   GRAPH
=================================================== */


.graph-tabs {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.graph-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.73rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
}

.graph-tab.active,
.graph-tab:hover {
  background: rgba(99, 179, 237, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.chart-wrapper {
  padding: 16px;
  height: 260px;
}

#chartCanvas {
  height: 100% !important;
}

/* ===================================================
   USER GUIDE
=================================================== */
.guide-section {
  padding: 80px 0;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.guide-step {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: var(--transition);
  position: relative;
}

.guide-step:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 179, 237, 0.3);
}

.guide-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
  display: block;
  opacity: 0.7;
}

.guide-step h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.guide-step p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===================================================
   FOOTER
=================================================== */
.footer {
  position: relative;
  z-index: 1;
  padding: 48px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.footer-note {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ===================================================
   ANIMATIONS
=================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* Reveal animations on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================
   RESPONSIVE
=================================================== */
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 14px 16px;
  }

  .hero {
    padding: 100px 16px 60px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .topics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .guide-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-value {
    font-size: 2rem;
  }
}

@media (max-width: 420px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}