/* ══════════════════════════════════════════════════
   DIC Mask Generator — Official Website Styles
   Theme: Indigo dark (BubbleTrack v3 inspired)
   ══════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg:             #09090b;
  --bg-secondary:   #111114;
  --card:           #18181b;
  --card-hover:     #1f1f23;
  --border:         rgba(255, 255, 255, 0.06);
  --border-hover:   rgba(255, 255, 255, 0.12);
  --text:           #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a;
  --indigo:         #6366f1;
  --indigo-light:   #818cf8;
  --indigo-dark:    #4f46e5;
  --indigo-glow:    rgba(99, 102, 241, 0.35);
  --indigo-subtle:  rgba(99, 102, 241, 0.08);
  --green:          #10b981;
  --green-glow:     rgba(16, 185, 129, 0.2);
  --amber:          #f59e0b;
  --red:            #ef4444;
  --blue:           #3b82f6;
  --font-body:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading:   "Space Grotesk", var(--font-body);
  --font-mono:      "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --nav-height:     64px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 24px); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--indigo-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--indigo); }
code { font-family: var(--font-mono); font-size: 0.875em; }

/* ── Layout ── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: 120px 0;
  position: relative;
  z-index: 1;
}

/* ── Ambient glow ── */
.glow-bg {
  position: fixed;
  top: -40%; left: -20%;
  width: 140%; height: 140%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Section header ── */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo-light);
  background: var(--indigo-subtle);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* ══════════════════════════════════════════════════
   Navigation
   ══════════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

#navbar.scrolled {
  background: rgba(9, 9, 11, 0.92);
  border-bottom-color: var(--border);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.nav-brand:hover { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--indigo);
  border-radius: 1px;
  transition: width 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background 0.2s;
}

.nav-github:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ══════════════════════════════════════════════════
   Hero
   ══════════════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: 40px;
}

.hero-stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 48px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-light);
  background: var(--indigo-subtle);
  border: 1px solid rgba(99, 102, 241, 0.15);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--indigo-light) 0%, var(--indigo) 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero-description {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  background: var(--indigo-dark);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transform: translateY(-1px);
}

/* Hero visual */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 900px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 60px rgba(99, 102, 241, 0.1),
    0 0 120px rgba(99, 102, 241, 0.05),
    0 25px 50px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.4s;
}

.hero-card:hover {
  box-shadow:
    0 0 80px rgba(99, 102, 241, 0.15),
    0 0 160px rgba(99, 102, 241, 0.08),
    0 25px 50px rgba(0, 0, 0, 0.4);
}

.hero-card img,
.hero-card video {
  width: 100%;
  display: block;
}

/* Window chrome */
.window-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}

.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.window-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
}

/* Scroll indicator */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 40px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(8px); opacity: 1; }
}

/* ══════════════════════════════════════════════════
   Features
   ══════════════════════════════════════════════════ */
#features {
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.feature-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--indigo-subtle);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  color: var(--indigo-light);
}

.feature-icon svg {
  width: 22px; height: 22px;
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* ══════════════════════════════════════════════════
   Demo
   ══════════════════════════════════════════════════ */
.demo-card {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 60px rgba(99, 102, 241, 0.08),
    0 25px 50px rgba(0, 0, 0, 0.3);
}

.demo-card video {
  width: 100%;
  display: block;
  background: #000;
}

/* ══════════════════════════════════════════════════
   Workflow
   ══════════════════════════════════════════════════ */
#workflow {
  background: var(--bg-secondary);
}

.workflow-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 0 0 160px;
  padding: 0 8px;
}

.step-number {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--indigo);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.step-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.step-icon svg {
  width: 24px; height: 24px;
}

.workflow-step h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.workflow-step p {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.workflow-connector {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 52px;
  color: var(--text-muted);
}

.workflow-connector svg {
  width: 40px; height: 12px;
}

/* ══════════════════════════════════════════════════
   Installation
   ══════════════════════════════════════════════════ */
.install-steps {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.install-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.install-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.install-step-num {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--indigo-subtle);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--indigo-light);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.install-card h3 {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
}

.install-note {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.install-note code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--indigo-light);
}

.install-note a {
  color: var(--indigo-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.install-tip {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 12px;
  line-height: 1.5;
}

.install-tip strong {
  color: var(--text-secondary);
}

.install-tip code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--indigo-light);
}

/* Code blocks */
.code-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.code-header span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-secondary);
  -webkit-overflow-scrolling: touch;
}

.code-block code {
  font-size: inherit;
}

/* Copy button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.copy-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.copy-btn.copied {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ══════════════════════════════════════════════════
   Citation
   ══════════════════════════════════════════════════ */
#citation {
  background: var(--bg-secondary);
}

.citation-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.paper-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--indigo-light);
  font-weight: 500;
  margin-bottom: 24px;
  padding: 10px 16px;
  background: var(--indigo-subtle);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  transition: background 0.2s, border-color 0.2s;
}

.paper-link:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--indigo-light);
}

.bibtex-block {
  margin-top: 0;
}

.bibtex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bibtex-header span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bibtex-block pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════
   Footer
   ══════════════════════════════════════════════════ */
footer {
  background: #060a14;
  padding: 48px 0 32px;
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

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

.footer-links a:hover { color: var(--text); }

.footer-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0 24px;
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ══════════════════════════════════════════════════
   Animations
   ══════════════════════════════════════════════════ */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */

/* Tablet landscape */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .workflow-steps { flex-wrap: wrap; gap: 16px; }
  .workflow-connector { display: none; }
  .workflow-step { flex: 0 0 calc(33.333% - 16px); }
}

/* Tablet portrait */
@media (max-width: 768px) {
  section { padding: 80px 0; }
  .container { padding: 0 20px; }
  .section-header { margin-bottom: 48px; }

  /* Nav mobile */
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(9, 9, 11, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 24px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 10px 0;
    font-size: 1rem;
  }

  .nav-links a::after { display: none; }

  .nav-github {
    justify-content: center;
    margin-top: 8px;
  }

  /* Features */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Workflow */
  .workflow-steps {
    flex-direction: column;
    align-items: center;
  }

  .workflow-step {
    flex: none;
    width: 100%;
    max-width: 280px;
  }

  /* Install */
  .install-card { padding: 20px; }
}

/* Mobile small */
@media (max-width: 480px) {
  section { padding: 64px 0; }
  .container { padding: 0 16px; }

  .hero-content h1 { font-size: 2rem; }
  .hero-badge { font-size: 0.6875rem; padding: 4px 10px; }
  .hero-subtitle { font-size: 1.0625rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { justify-content: center; }

  .section-header h2 { font-size: 1.5rem; }

  .feature-card { padding: 24px 20px; }

  .code-block pre { font-size: 0.75rem; padding: 12px; }

  .footer-content { flex-direction: column; gap: 24px; text-align: center; }
  .footer-links { justify-content: center; }
}
