:root {
  --bg: #0c0c10;
  --surface: #14141c;
  --surface2: #1c1c28;
  --border: #2a2a3a;
  --accent: #e8a83e;
  --accent-hover: #f0bc5a;
  --accent-dim: rgba(232, 168, 62, 0.15);
  --btn-bg: #c48a2a;
  --btn-bg-hover: #d89e3a;
  --text: #eaeaf2;
  --text-muted: #8888a0;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(12,12,16,0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  flex-shrink: 0;
}

.nav-logo svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex: 1;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

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

.nav-links .nav-external::after {
  content: '\2197';
  font-size: 0.75rem;
  margin-left: 0.2rem;
  opacity: 0.6;
}

.nav-cta { margin-left: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-primary {
  background: var(--btn-bg);
  color: #fff;
}
.btn-primary:hover {
  background: var(--btn-bg-hover);
  color: #fff;
}

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

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  border-radius: 10px;
}

/* MAIN */
main { padding-top: var(--nav-height); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* HERO */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid rgba(232, 168, 62, 0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero h1 span { color: var(--accent); }

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* WORKFLOW SECTION */
.workflow {
  padding: 5rem 0;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.workflow-step {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
  position: relative;
}

.workflow-step:hover {
  border-color: var(--accent);
}

.workflow-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.workflow-step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* SECTION HEADINGS */
.section-label {
  text-align: center;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 3rem;
}

/* FEATURES */
.features { padding: 5rem 0; }

.feature-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.feature-card {
  flex: 0 1 calc(33.333% - 0.84rem);
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.2s;
}

.feature-card:hover { border-color: var(--accent); }

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ENGINE SUPPORT */
.engines { padding: 5rem 0; }

.engine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.engine-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s;
}

.engine-card:hover { border-color: var(--accent); }

.engine-card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.engine-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.engine-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.engine-card .badge {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
}

.badge-ready {
  background: rgba(76, 175, 80, 0.15);
  color: #66bb6a;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-soon {
  background: rgba(255, 193, 7, 0.12);
  color: #ffca28;
  border: 1px solid rgba(255, 193, 7, 0.25);
}

.badge-planned {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* EXPORT FORMATS */
.formats { padding: 5rem 0; }

.format-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
}

.format-item {
  flex: 0 1 calc(25% - 0.75rem);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.format-item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.format-item h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.format-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ */
.faq-section { padding: 5rem 0; }

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.faq-item[open] { border-color: var(--accent); }

.faq-item summary {
  padding: 1.1rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.15s ease;
}

.faq-answer p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 1rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* CTA STRIP */
.cta-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0;
  text-align: center;
}

.cta-strip h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.cta-strip p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.cta-strip .btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* FOOTER */
footer {
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  list-style: none;
}

/* PAGE HEADER */
.page-header {
  padding: 4rem 0 2rem;
  text-align: center;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* DOCS CONTENT */
.docs-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.docs-content h2:first-child {
  margin-top: 1rem;
  padding-top: 0;
  border-top: none;
}

.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
}

.docs-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.docs-content code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--accent);
}

.docs-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.docs-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.7;
}

.docs-content ul, .docs-content ol {
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.docs-content th, .docs-content td {
  text-align: left;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.docs-content th {
  background: var(--surface);
  font-weight: 700;
  color: var(--text);
}

.docs-content td {
  color: var(--text-muted);
}

/* HAMBURGER */
.nav-toggle { display: none; }

.nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  -webkit-tap-highlight-color: transparent;
}

.nav-hamburger span,
.nav-hamburger span::before,
.nav-hamburger span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
  position: relative;
}

.nav-hamburger span::before,
.nav-hamburger span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
}

.nav-hamburger span::before { top: -7px; }
.nav-hamburger span::after  { top: 7px; }

.nav-toggle:checked ~ .nav-hamburger span { background: transparent; }
.nav-toggle:checked ~ .nav-hamburger span::before { top: 0; transform: rotate(45deg); }
.nav-toggle:checked ~ .nav-hamburger span::after  { top: 0; transform: rotate(-45deg); }

body:has(.nav-toggle:checked) { overflow: hidden; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .nav-hamburger { display: flex; }
  .nav-cta { display: none; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0; bottom: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 0;
    overflow-y: auto;
    z-index: 99;
  }

  .nav-toggle:checked ~ .nav-links { display: flex; }

  .nav-links a {
    font-size: 1.05rem;
    padding: 0.85rem 0.75rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .workflow-steps {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 640px) {
  .container { padding: 0 1.25rem; }
  .hero { padding: 3rem 0 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.5rem); }

  .feature-card { flex: 1 1 100%; }
  .workflow-steps { grid-template-columns: 1fr; }
  .format-item { flex: 1 1 100%; }

  .footer-links { flex-wrap: wrap; gap: 0.75rem 1.25rem; }
  .page-header { padding: 2.5rem 0 1.5rem; }
  .section-title { font-size: clamp(1.4rem, 5vw, 1.75rem); }
  .cta-strip { padding: 3rem 0; }
  .cta-strip .btn-group { flex-direction: column; align-items: center; }

  nav {
    padding: 0 1.25rem;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg);
  }
}

@media (max-width: 380px) {
  .container { padding: 0 1rem; }
  nav { padding: 0 1rem; }
  .hero { padding: 2rem 0 1.5rem; }
  .btn-lg { padding: 0.65rem 1.25rem; font-size: 0.95rem; }
}

/* ABOUT PAGE */
.about-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.about-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.about-content strong {
  color: var(--text);
}

.about-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 3rem 0 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.project-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.project-card {
  flex: 0 1 calc(50% - 0.625rem);
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.2s;
  color: var(--text);
  text-decoration: none;
  display: block;
}

.project-card:hover {
  border-color: var(--accent);
  color: var(--text);
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.project-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.project-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* SKIP LINK */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--btn-bg);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 200;
  font-weight: 600;
  font-size: 0.9rem;
}
.skip-link:focus {
  top: 0;
  color: #fff;
}

/* PERFORMANCE */
.features,
.engines,
.formats,
.faq-section,
.cta-strip {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* ACCESSIBILITY */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

@media (pointer: coarse) {
  .faq-item summary { min-height: 48px; padding: 1rem 1.25rem; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
