:root {
  --bg: #080b10;
  --surface: rgba(22, 28, 38, 0.72);
  --surface-solid: #161c26;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --brand: #ff6b4a;
  --brand2: #ff3d8e;
  --brand-glow: rgba(255, 77, 142, 0.25);
  --ok: #34d399;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: #ff9f7a; text-decoration: none; transition: color 0.2s; }
a:hover { color: #ffc4a8; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(255, 107, 74, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(255, 61, 142, 0.08), transparent),
    var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.hide-mobile { display: block; }
@media (max-width: 768px) { .hide-mobile { display: none; } }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 11, 16, 0.82);
  backdrop-filter: blur(16px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text);
}
.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px var(--brand-glow);
}
.logo-text { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.logo-text small { display: block; font-size: 0.68rem; color: var(--muted); font-weight: 500; }

.nav-toggle {
  display: none;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 1.2rem;
  cursor: pointer;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.header-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.header-nav a:hover, .header-nav a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-ext { opacity: 0.85; }

.user-chip {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-primary, .btn-ghost {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  box-shadow: 0 8px 28px var(--brand-glow);
}
.btn-primary:hover { transform: translateY(-1px); color: white; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Hero */
.hero-banner { padding: 2rem 0 0.5rem; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 107, 74, 0.12);
  color: #ff9f7a;
  border: 1px solid rgba(255, 107, 74, 0.2);
  margin-bottom: 1rem;
}
.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 800;
}
.lead { color: var(--muted); font-size: 1.1rem; max-width: 52ch; margin: 0; }

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.hero-stats span { font-size: 0.82rem; color: var(--muted); }

.visual-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.visual-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.visual-bar em { font-style: normal; color: var(--muted); font-size: 0.9rem; }
.visual-bar.before { background: rgba(255,255,255,0.04); width: 100%; }
.visual-bar.after {
  background: linear-gradient(90deg, rgba(255,107,74,0.25), rgba(255,61,142,0.2));
  width: 28%;
  min-width: 120px;
}
.visual-note { margin: 0.5rem 0 0; color: var(--ok); font-size: 0.9rem; font-weight: 600; }

/* Tool */
.tool-section { padding: 0.5rem 0 2.5rem; }
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 960px) { .tool-grid { grid-template-columns: 1fr; } }

.card-glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  margin-bottom: 1rem;
}
.card-glass h3 { margin: 0 0 0.75rem; font-size: 1rem; }

.tool-controls { margin-bottom: 1rem; }
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.control-row:last-child { margin-bottom: 0; }
.control-row label { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.control-row input[type="range"] { flex: 1; accent-color: var(--brand2); }
.control-row select {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(22, 28, 38, 0.5);
  min-height: 260px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: rgba(255, 107, 74, 0.06);
  box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.08);
}
.dropzone-inner { text-align: center; padding: 2.5rem 1.5rem; }
.drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: grid;
  place-items: center;
  box-shadow: 0 12px 32px var(--brand-glow);
}
.drop-title { font-size: 1.25rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.drop-sub { color: var(--muted); margin: 0.5rem 0 0; font-size: 0.92rem; }

.progress { margin-top: 1.25rem; text-align: center; }
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.progress-fill {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.results { margin-top: 1.25rem; display: grid; gap: 1rem; }
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
  animation: fadeUp 0.35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.result-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.result-name { font-weight: 700; word-break: break-all; font-size: 1rem; }
.badge-ok {
  background: rgba(52, 211, 153, 0.12);
  color: var(--ok);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.result-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 500px) { .result-preview { grid-template-columns: 1fr; } }
.preview-box {
  border-radius: 12px;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid var(--border);
  aspect-ratio: 16/10;
  display: grid;
  place-items: center;
}
.preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-label { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.35rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.size-bars { display: grid; gap: 0.5rem; }
.size-bar-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.88rem; }
.size-bar-row span { width: 52px; color: var(--muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-fill.before { background: #475569; }
.bar-fill.after { background: linear-gradient(90deg, var(--brand), var(--brand2)); }

.result-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.download-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  text-decoration: none;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 8px 24px var(--brand-glow);
  transition: transform 0.15s;
}
.download-btn:hover { transform: translateY(-1px); color: white; }
.result-note { margin: 0; color: var(--muted); font-size: 0.82rem; }

.check-list { margin: 0; padding: 0; list-style: none; }
.check-list li {
  padding: 0.35rem 0 0.35rem 1.5rem;
  position: relative;
  color: var(--muted);
  font-size: 0.9rem;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}

.mini-post {
  display: block;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.mini-post:last-of-type { border-bottom: none; }
.mini-cat { display: block; font-size: 0.72rem; color: var(--brand); font-weight: 600; text-transform: uppercase; }
.mini-title { display: block; color: var(--text); font-size: 0.9rem; font-weight: 500; margin-top: 0.15rem; }
.link-more { display: inline-block; margin-top: 0.75rem; font-size: 0.88rem; font-weight: 600; }

/* Features strip */
.features-strip {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  background: rgba(255,255,255,0.02);
}
.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 800px) { .strip-grid { grid-template-columns: repeat(2, 1fr); } }
.strip-grid article { text-align: center; }
.strip-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.strip-grid h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.strip-grid p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Pages */
.page-hero { padding: 3rem 0 1.5rem; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0.5rem 0; letter-spacing: -0.03em; }

.blog-list { padding: 1rem 0 4rem; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.blog-card h2 { margin: 0.5rem 0; font-size: 1.15rem; line-height: 1.35; }
.blog-card h2 a { color: var(--text); }
.blog-card p { color: var(--muted); font-size: 0.92rem; margin: 0 0 1rem; }
.blog-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
}
.blog-meta { display: flex; gap: 1rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.75rem; }
.read-link { font-weight: 600; font-size: 0.9rem; }

.blog-article { padding: 1rem 0 4rem; max-width: 760px; }
.article-header { margin-bottom: 2rem; }
.back-link { display: inline-block; margin-bottom: 1rem; font-size: 0.9rem; }
.article-header h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.03em; }
.article-cta { margin-top: 2.5rem; text-align: center; }
.article-cta h3 { margin-top: 0; }

.prose h2 { margin-top: 2rem; font-size: 1.35rem; }
.prose p, .prose li { color: #cbd5e1; }
.prose code { background: rgba(255,255,255,0.06); padding: 0.15rem 0.4rem; border-radius: 6px; font-size: 0.9em; }

.features-page { padding: 1rem 0 4rem; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.feature-card { text-align: center; }
.feature-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.feature-card h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.cta-banner { text-align: center; padding: 2.5rem; }
.cta-banner h2 { margin: 0 0 1.25rem; }

.about-page { padding: 1rem 0 4rem; max-width: 760px; }

.ad-slot { margin: 1rem 0; text-align: center; }
.ad-slot:empty { display: none; margin: 0; }
.ad-sidebar { min-height: 0; }
.ad-top, .ad-bottom { min-height: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
  background: rgba(0,0,0,0.25);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand { font-size: 1.1rem; }
.site-footer p { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 0; }
.site-footer h4 { margin: 0 0 0.75rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.site-footer a { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.footer-stats { font-size: 0.85rem !important; }
.footer-copy { color: var(--muted); font-size: 0.82rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

.hidden { display: none !important; }
.legal { padding: 2rem 0 4rem; }

/* AI Chat */
.chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 28px var(--brand-glow);
}
.chat-panel {
  position: fixed;
  right: 1rem;
  bottom: 5rem;
  z-index: 61;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(480px, 70vh);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.chat-head strong { display: block; font-size: 0.95rem; }
.chat-head small { color: var(--muted); font-size: 0.75rem; }
.chat-head button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chat-msg {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
}
.chat-msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
.chat-msg.thinking { opacity: 0.7; font-style: italic; }
.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  outline: none;
}
.chat-form button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .header-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(8, 11, 16, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
  }
  .header-nav.open { display: flex; }
  .site-header .container { position: relative; }
}
