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

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

:root {
  --bg-dark: #0d0d0d;
  --bg-card: #141414;
  --bg-code: #1a1a1a;
  --text-primary: #d9d9d9;
  --text-secondary: #8a8a8a;
  --text-muted: #484848;
  --accent: #d9d9d9;
  --accent-hover: #b0b0b0;
  --accent-html: #e06c75;
  --accent-css: #61afef;
  --accent-js: #e5c07b;
  --border: #2a2a2a;
  --border-subtle: #1a1a1a;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--text-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
::selection { background: rgba(217,217,217,0.12); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.app-layout { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: 240px; background: #0d0d0d;
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  padding: 24px 16px; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.sidebar-logo img { width: 32px; height: 32px; border-radius: 6px; }
.sidebar-logo span { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.sidebar-links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; min-height: 44px;
  color: var(--text-secondary); transition: all 0.15s;
}
.sidebar-link:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-link svg { width: 18px; height: 18px; opacity: 0.5; flex-shrink: 0; }
.sidebar-link:hover svg { opacity: 1; }
.sidebar-divider { height: 1px; background: var(--border-subtle); margin: 10px 0; }
.sidebar-cta {
  margin-top: auto; padding: 14px; background: var(--bg-card);
  border-radius: var(--radius-sm); text-align: center;
  border: 1px solid var(--border-subtle);
}
.sidebar-cta p { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }

/* sidebar overlay for mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99; backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ─── MAIN ─── */
.main-content { flex: 1; margin-left: 240px; }

/* ─── HEADER ─── */
.header-bar {
  display: flex; align-items: center;
  padding: 10px 32px; background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 50;
}
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mobile-menu-toggle {
  display: none; background: none; border: none;
  color: var(--text-primary); cursor: pointer; padding: 10px;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; border: none;
  cursor: pointer; transition: all 0.15s; font-family: var(--font-sans);
}
.btn-accent { background: var(--accent); color: #111; }
.btn-accent:hover { background: var(--accent-hover); color: #111; }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-secondary); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 6px 14px; }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
.btn-big { padding: 14px 32px; font-size: 15px; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ─── FLOATING SHAPES ─── */
.float-shape {
  position: absolute; pointer-events: none; z-index: 0;
  border: 1px solid; border-radius: 4px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: floatShape 12s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .float-shape { animation: none; }
}
.shape-circle { border-radius: 50%; }
.shape-square { border-radius: 4px; }
.shape-triangle {
  border-radius: 0;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border: none;
}
@keyframes floatShape {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(20px, -20px) rotate(5deg); }
  66% { transform: translate(-15px, 15px) rotate(-3deg); }
  100% { transform: translate(10px, -10px) rotate(2deg); }
}

/* ─── HERO ─── */
.hero {
  padding: 56px 32px 72px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 0;
  animation: heroGlow 12s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}
@keyframes heroGlow {
  0% { background: radial-gradient(circle at 30% 40%, rgba(217,217,217,0.05) 0%, rgba(97,175,239,0.05) 30%, transparent 60%); }
  25% { background: radial-gradient(circle at 70% 30%, rgba(229,192,123,0.05) 0%, rgba(152,195,121,0.05) 30%, transparent 60%); }
  50% { background: radial-gradient(circle at 50% 70%, rgba(198,120,221,0.05) 0%, rgba(224,108,117,0.05) 30%, transparent 60%); }
  75% { background: radial-gradient(circle at 20% 60%, rgba(97,175,239,0.05) 0%, rgba(229,192,123,0.05) 30%, transparent 60%); }
  100% { background: radial-gradient(circle at 80% 50%, rgba(224,108,117,0.05) 0%, rgba(198,120,221,0.05) 30%, transparent 60%); }
}
.hero > *:not(.float-shape):not(::before):not(::after) { position: relative; z-index: 1; }
.hero-logo { margin-bottom: 20px; }
.hero-logo img {
  width: 64px; height: 64px; opacity: 0.9;
  animation: logoPulse 3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hero-logo img { animation: none; }
}
@keyframes logoPulse {
  0% { filter: drop-shadow(0 0 0 rgba(217,217,217,0)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 20px rgba(217,217,217,0.15)); transform: scale(1.04); }
  100% { filter: drop-shadow(0 0 0 rgba(217,217,217,0)); transform: scale(1); }
}
.typing-cursor {
  display: inline-block; color: var(--accent);
  animation: blink 0.8s step-end infinite;
  font-weight: 200; margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }
.typing-dynamic { color: var(--accent); }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: -1.2px;
  line-height: 1.15; margin-bottom: 14px;
  max-width: 680px; margin-left: auto; margin-right: auto;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: clamp(15px, 2vw, 17px); color: var(--text-secondary);
  max-width: 520px; margin: 0 auto 28px; line-height: 1.7;
}
.hero-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ─── CODE DEMO ─── */
.code-demo {
  max-width: 700px; margin: 0 auto 36px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-code); text-align: left;
  box-shadow: var(--shadow);
  content-visibility: auto; contain-intrinsic-size: 400px;
}
.code-demo-tabs {
  display: flex; border-bottom: 1px solid var(--border-subtle);
  background: #111; padding: 0; overflow-x: auto;
}
.code-demo-tabs::-webkit-scrollbar { height: 0; }
.code-demo-tab {
  padding: 10px 16px; font-size: 12px; font-weight: 600;
  font-family: var(--font-sans); white-space: nowrap;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.5px;
  min-height: 40px;
}
.code-demo-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.code-demo-tab svg { width: 12px; height: 12px; flex-shrink: 0; }
.code-demo-content {
  padding: 18px 22px; font-family: var(--font-mono);
  font-size: clamp(12px, 1.5vw, 13px); line-height: 1.8; overflow-x: auto;
}
.code-demo-content .hl-tag { color: var(--accent-html); }
.code-demo-content .hl-attr { color: var(--accent-css); }
.code-demo-content .hl-string { color: #98c379; }
.code-demo-content .hl-selector { color: var(--accent-html); }
.code-demo-content .hl-prop { color: var(--accent-css); }
.code-demo-content .hl-value { color: var(--accent-js); }
.code-demo-content .hl-keyword { color: #c678dd; }
.code-demo-content .hl-function { color: var(--accent-css); }
.code-demo-content .hl-number { color: #d19a66; }

/* ─── FEATURES ─── */
.features { padding: 72px 32px; content-visibility: auto; contain-intrinsic-size: 600px; }
.features-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 28px;
  transition: all 0.25s;
}
.feature-card:hover { border-color: var(--border); transform: translateY(-3px); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; font-size: 22px;
  background: rgba(217,217,217,0.06); color: var(--accent);
}
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.feature-card p a { color: var(--accent); }
.feature-card p a:hover { text-decoration: underline; }

/* ─── EDITOR SHOWCASE ─── */
.editor-showcase { padding: 72px 32px; background: #0a0a0a; }
.editor-showcase-wrapper {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center;
}
.editor-showcase h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin-bottom: 16px; letter-spacing: -0.5px; }
.editor-showcase > p { color: var(--text-secondary); margin-bottom: 20px; line-height: 1.7; font-size: 14px; }
.editor-showcase-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.editor-showcase-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
  padding: 14px 16px; background: var(--bg-card);
  border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 0.2s;
}
.editor-showcase-list li:hover { border-color: var(--border); }
.editor-showcase-list li summary { cursor: pointer; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }

/* ─── FOOTER ─── */
.site-footer { background: #080808; border-top: 1px solid var(--border-subtle); padding: 48px 32px 24px; content-visibility: auto; contain-intrinsic-size: 200px; }
.footer-content {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px;
}
.footer-brand { margin-bottom: 8px; }
.footer-brand span { font-size: 17px; font-weight: 700; }
.footer-brand p { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.footer-col h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 14px; color: var(--text-muted);
}
.footer-col a { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1100px; margin: 36px auto 0;
  padding-top: 16px; border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}

/* ─── VISUALLY HIDDEN (accessibility) ─── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ─── FOCUS STYLES (accessibility) ─── */
a:focus-visible, button:focus-visible, .btn:focus-visible, .sidebar-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-showcase-wrapper { grid-template-columns: 1fr; gap: 36px; }
  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.show { display: block; }
  .mobile-menu-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .hero h1 { font-size: clamp(24px, 6vw, 28px); }
  .hero { padding: 40px 16px 56px; }
  .hero p { font-size: 14px; }
  .features-grid { grid-template-columns: 1fr; }
  .header-bar { padding: 6px 12px; }
  .features, .editor-showcase { padding: 40px 16px; }
  .footer-content { grid-template-columns: 1fr; }
  .site-footer { padding: 32px 16px 20px; }
  .code-demo { max-width: 100%; border-radius: 0; margin-left: -16px; margin-right: -16px; box-shadow: none; }
  .code-demo-content { padding: 14px 16px; }
  .editor-showcase h2 { font-size: 22px; }
  .btn-big { padding: 12px 24px; font-size: 14px; }
  .hero-buttons .btn-big { flex: 1; max-width: 220px; }
  .sidebar-cta { display: none; }
  .float-shape { display: none; }
}

@media (max-width: 480px) {
  .hero { padding: 32px 12px 48px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn-big { width: 100%; max-width: 280px; justify-content: center; }
  .feature-card { padding: 22px; }
  .editor-showcase { padding: 32px 12px; }
  .editor-showcase-wrapper { gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .code-demo-tab { min-height: 44px; padding: 10px 14px; }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  .typing-cursor { animation: none; }
  .feature-card { transition: none; }
  .feature-card:hover { transform: none; }
  .btn { transition: none; }
}

/* ─── SAFE AREA ─── */
.header-bar { padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); }
