/* ============================================================
   Quillon — Design System
   Premium dark-first design for quillon.app
   ============================================================ */

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

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

/* --- Design Tokens --- */
:root {
  /* Colors — dark mode (default) */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2035;
  --bg-card: rgba(26, 32, 53, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);

  --fg-primary: #f0f2f7;
  --fg-secondary: #94a3b8;
  --fg-muted: #64748b;

  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --accent-glow-strong: rgba(59, 130, 246, 0.3);

  --gradient-accent: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-bg: linear-gradient(180deg, #0a0e1a 0%, #111827 100%);
  --gradient-hero: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59, 130, 246, 0.12) 0%, transparent 60%);

  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-gap: 120px;
  --content-max: 1140px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Light Mode --- */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(0, 0, 0, 0.02);
    --bg-glass-hover: rgba(0, 0, 0, 0.04);

    --fg-primary: #0f172a;
    --fg-secondary: #475569;
    --fg-muted: #94a3b8;

    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-glow: rgba(37, 99, 235, 0.08);
    --accent-glow-strong: rgba(37, 99, 235, 0.15);

    --gradient-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    --gradient-hero: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.06) 0%, transparent 60%);

    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
  }
}

/* --- Base Styles --- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--fg-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

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

/* --- Container --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-base);
}

@media (prefers-color-scheme: light) {
  .nav {
    background: rgba(248, 250, 252, 0.85);
  }
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--fg-primary);
  text-decoration: none;
}

.nav-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--fg-primary);
}

.nav-cta {
  background: var(--gradient-accent);
  color: white !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px !important;
  font-weight: 600 !important;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: white !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--fg-primary);
  margin: 5px 0;
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 160px 24px 80px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 32px;
}

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

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
}

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 800px;
  margin: 0 auto 24px;
}

.hero h1 .gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--fg-secondary);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gradient-accent);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
  color: white;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass);
  color: var(--fg-primary);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  color: var(--fg-primary);
}

/* --- Editor Preview --- */
.editor-preview {
  max-width: 860px;
  margin: 64px auto 0;
  position: relative;
}

.editor-screenshot {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.editor-window {
  background: #1e2337;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 80px rgba(59, 130, 246, 0.08);
}

@media (prefers-color-scheme: light) {
  .editor-window {
    background: #1e2337;
    box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 0 0 1px rgba(0, 0, 0, 0.08);
  }
}

.editor-titlebar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-dots {
  display: flex;
  gap: 8px;
}

.editor-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.editor-dots span:nth-child(1) {
  background: #ff5f57;
}

.editor-dots span:nth-child(2) {
  background: #febc2e;
}

.editor-dots span:nth-child(3) {
  background: #28c840;
}

.editor-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-sans);
}

.editor-body {
  display: flex;
  min-height: 320px;
}

/* Sidebar */
.editor-sidebar {
  width: 180px;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 0;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  padding: 8px 14px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: rgba(255, 255, 255, 0.6);
  cursor: default;
}

.sidebar-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-light);
}

.sidebar-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.sidebar-item .file-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

/* Code area */
.editor-code {
  flex: 1;
  padding: 16px 0;
  overflow: hidden;
}

.code-line {
  display: flex;
  padding: 0 16px;
  line-height: 1.7;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: pre;
}

.line-number {
  width: 36px;
  text-align: right;
  color: rgba(255, 255, 255, 0.2);
  user-select: none;
  padding-right: 16px;
  flex-shrink: 0;
}

.line-content {
  flex: 1;
}

/* Syntax colors */
.syn-keyword {
  color: #c084fc;
}

.syn-type {
  color: #67e8f9;
}

.syn-func {
  color: #60a5fa;
}

.syn-string {
  color: #fbbf24;
}

.syn-comment {
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
}

.syn-number {
  color: #f472b6;
}

.syn-property {
  color: #34d399;
}

.syn-plain {
  color: rgba(255, 255, 255, 0.85);
}

.syn-operator {
  color: rgba(255, 255, 255, 0.5);
}

/* Typing cursor */
.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--accent-light);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Editor status bar */
.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-sans);
}

.statusbar-left,
.statusbar-right {
  display: flex;
  gap: 16px;
}

/* --- Section Common --- */
.section {
  padding: var(--section-gap) 24px;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--fg-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

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

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.6;
}

/* --- Showcase Section --- */
.showcase {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
}

.showcase-content {
  max-width: 480px;
}

.showcase-content h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.showcase-content p {
  font-size: 16px;
  color: var(--fg-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}

.showcase-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showcase-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--fg-secondary);
}

.showcase-list li .check {
  width: 22px;
  height: 22px;
  background: var(--accent-glow);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  font-size: 12px;
  flex-shrink: 0;
}

.showcase-visual {
  position: relative;
}

.showcase-visual .editor-window {
  transform: perspective(1200px) rotateY(-5deg) rotateX(2deg);
  transition: transform var(--transition-slow);
}

.showcase-visual:hover .editor-window {
  transform: perspective(1200px) rotateY(-2deg) rotateX(1deg);
}

/* --- Why Section / Comparison --- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.why-card {
  text-align: center;
  padding: 40px 28px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.why-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.why-icon {
  font-size: 40px;
  margin-bottom: 20px;
}

.why-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.why-card p {
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.6;
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  position: relative;
}

.cta-section p {
  font-size: 17px;
  color: var(--fg-secondary);
  margin-bottom: 36px;
  position: relative;
}

.cta-section .hero-actions {
  position: relative;
}

/* --- Footer --- */
.footer {
  padding: 48px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--fg-primary);
}

.footer-copy {
  font-size: 13px;
  color: var(--fg-muted);
}

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

.footer-links a {
  font-size: 13px;
  color: var(--fg-secondary);
}

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

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

.reveal-delay-5 {
  transition-delay: 0.5s;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --section-gap: 80px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    gap: 16px;
  }

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

  .nav-toggle {
    display: block;
  }

  .features-grid,
  .why-grid {
    grid-template-columns: 1fr;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .showcase-visual .editor-window {
    transform: none;
  }

  .showcase-visual:hover .editor-window {
    transform: none;
  }

  .editor-sidebar {
    display: none;
  }

  .editor-body {
    min-height: 200px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .hero {
    padding: 120px 24px 60px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 32px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}