* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: #000;
  color: #fff;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
  font-size: 16px;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid #333;
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #fff;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  border: 1px solid #666;
  padding: 0.4rem 1rem;
  border-radius: 4px;
}

.nav-link:hover {
  color: #ccc;
  border-color: #999;
}

/* Background Canvas */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.15;
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 60px;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  color: #fff;
}

.subtitle {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.cta-button {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #fff;
  color: #000;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 1px solid #fff;
  cursor: pointer;
  letter-spacing: 0.1em;
}

.cta-button:hover {
  background: #000;
  color: #fff;
  border-color: #fff;
}

.cta-button:active {
  opacity: 0.8;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Sections */
.section {
  padding: 5rem 0;
  position: relative;
  border-top: 1px solid #1a1a1a;
}

.section-alt {
  background: #050505;
}

.section h2 {
  font-size: 2.2rem;
  margin-bottom: 3rem;
  color: #fff;
  text-align: center;
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* What Section */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.text-block {
  font-size: 1rem;
  color: #ccc;
}

.text-block p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.text-block em {
  color: #fff;
  font-style: italic;
}

.equation-block {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
}

.equation {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  margin: 1rem 0;
  font-size: 1.2em;
}

.equation-desc {
  font-size: 0.9rem;
  color: #999;
  text-align: center;
  margin-top: 1rem;
}

/* Math Grid */
.math-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.math-card {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 2rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.math-card:hover {
  border-color: #666;
  background: #0f0f0f;
}

.math-card h3 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: 500;
}

.math-card p {
  color: #bbb;
  font-size: 0.95rem;
}

/* Visualization Containers */
.viz-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin: 3rem 0;
}

.viz-container-reverse {
  grid-template-columns: 1fr 1fr;
  direction: rtl;
}

.viz-container-reverse > * {
  direction: ltr;
}

.viz-canvas {
  width: 100%;
  height: 400px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  display: block;
}

.viz-description h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 500;
}

.viz-description p {
  color: #ccc;
  font-size: 1rem;
  line-height: 1.8;
}

.viz-description em {
  color: #fff;
  font-style: italic;
}

/* Coloring Section */
.coloring-explanation {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.coloring-explanation h3 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 500;
}

.coloring-explanation p {
  color: #bbb;
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.coloring-explanation em {
  color: #fff;
  font-style: italic;
}

.color-assignment {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #333;
}

.color-assignment h4 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.coloring-demo {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 2rem;
}

.coloring-demo h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 500;
}

.coloring-demo > p:first-of-type {
  color: #bbb;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.coloring-canvas {
  width: 100%;
  height: 450px;
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  display: block;
  margin: 1.5rem 0;
}

.demo-description {
  color: #888;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  margin: 1.5rem 0 0 0;
}

/* Computation Demo */
.computation-demo {
  margin-top: 3rem;
  padding: 2rem;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
}

.computation-demo h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 500;
}

.computation-demo > p {
  color: #aaa;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.computation-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.computation-formula {
  font-size: 0.95rem;
  color: #fff;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.computation-canvas {
  width: 100%;
  height: 350px;
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  display: block;
}

@media (max-width: 768px) {
  .computation-container {
    grid-template-columns: 1fr;
  }
}

/* Examples Grid */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.examples-grid > a {
  text-decoration: none;
  display: block;
  height: 100%;
}

.example-card {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.example-card:hover {
  border-color: #666;
  background: #0f0f0f;
}

.example-card h3 {
  color: #fff;
  padding: 1rem;
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 500;
  background: #000;
  border-bottom: 1px solid #333;
}

.example-image {
  flex: 1;
  min-height: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.9rem;
  padding: 0;
  overflow: hidden;
}

.example-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Properties Grid */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.property {
  background: #0a0a0a;
  border-left: 1px solid #555;
  padding: 1.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.property:hover {
  background: #0f0f0f;
  border-left-color: #999;
}

.property h4 {
  color: #fff;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.property p {
  color: #bbb;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Applications */
.applications {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.app-item {
  background: #0a0a0a;
  border: 1px solid #333;
  padding: 2rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.app-item:hover {
  border-color: #666;
  background: #0f0f0f;
}

.app-item h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 500;
}

.app-item p {
  color: #ccc;
  font-size: 0.98rem;
  line-height: 1.7;
}

/* CTA Footer */
.cta-footer {
  background: #050505;
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  padding: 5rem 0;
  text-align: center;
}

.cta-footer h2 {
  margin-bottom: 1rem;
  font-size: 2.2rem;
  color: #fff;
  font-weight: 400;
}

.cta-footer > .container > p {
  font-size: 1rem;
  color: #aaa;
  margin-bottom: 2rem;
}

.cta-button-large {
  font-size: 1rem;
  padding: 0.9rem 2.5rem;
}

/* Footer */
.footer {
  background: #000;
  border-top: 1px solid #1a1a1a;
  padding: 2rem;
  text-align: center;
  color: #666;
  font-size: 0.85rem;
}

/* KaTeX Styling */
.katex {
  font-size: 1em;
  color: #fff;
}

.katex-display {
  margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .viz-container,
  .viz-container-reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
    direction: ltr;
  }

  .viz-canvas {
    height: 300px;
  }

  .math-grid {
    grid-template-columns: 1fr;
  }

  .examples-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 80px;
    height: auto;
    min-height: 70vh;
    padding-bottom: 2rem;
  }

  .section {
    padding: 3rem 0;
  }

  .nav-container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .cta-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .section h2 {
    font-size: 1.6rem;
  }

  .container {
    padding: 0 1rem;
  }
}
