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

:root {
  --bg: #0b0b10;
  --surface: #14141e;
  --border: #252535;
  --accent: #f97316;
  --accent-hover: #ea6c0a;
  --text: #e8e8f0;
  --muted: #7878a0;
  --add: #16a34a;
  --add-bg: rgba(22,163,74,0.12);
  --add-border: rgba(22,163,74,0.3);
  --del: #dc2626;
  --del-bg: rgba(220,38,38,0.12);
  --del-border: rgba(220,38,38,0.3);
  --success: #4ade80;
  --radius: 14px;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.88em; background: rgba(249,115,22,0.1); color: #fdba74; padding: 1px 5px; border-radius: 4px; }

/* ── NAV ─────────────────────────────────────────────────────── */
.navbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; height: 60px; background: rgba(11,11,16,0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-logo { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.nav-logo span { color: var(--accent); }

/* ── HERO ────────────────────────────────────────────────────── */
.hero { padding: 90px 20px 70px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 800px; height: 600px; background: radial-gradient(ellipse, rgba(249,115,22,0.15) 0%, transparent 70%); pointer-events: none; }
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-badge { display: inline-block; background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.3); color: #fdba74; font-size: 0.8rem; font-weight: 600; padding: 4px 14px; border-radius: 20px; margin-bottom: 24px; letter-spacing: 0.04em; text-transform: uppercase; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 20px; }
.gradient-text { background: linear-gradient(135deg, #f97316, #fdba74); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 600px; margin: 0 auto 32px; }
.hero-sub strong { color: var(--text); }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 48px; }
.hero-note { font-size: 0.8rem; color: var(--muted); }
.hero-stats { display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 32px; }
.hstat { display: flex; flex-direction: column; align-items: center; padding: 0 28px; }
.hstat strong { font-size: 1.6rem; font-weight: 800; background: linear-gradient(135deg, #f97316, #fdba74); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hstat span { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.hstat-div { width: 1px; height: 36px; background: var(--border); }

/* ── SECTIONS ────────────────────────────────────────────────── */
.section-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section-inner--narrow { max-width: 720px; }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; text-align: center; margin-bottom: 48px; letter-spacing: -0.02em; }

/* ── FEATURES ────────────────────────────────────────────────── */
.features { padding: 80px 20px; border-top: 1px solid var(--border); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: border-color 0.2s, transform 0.2s; }
.feature-card:hover { border-color: rgba(249,115,22,0.35); transform: translateY(-2px); }
.feat-icon { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* ── TOOL ────────────────────────────────────────────────────── */
.tool-section { padding: 80px 20px; border-top: 1px solid var(--border); background: var(--surface); }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

/* view toggle */
.view-toggle { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-btn { background: transparent; border: none; color: var(--muted); font-size: 0.82rem; font-weight: 600; padding: 7px 14px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.view-btn.active { background: var(--accent); color: #0b0b10; }
.view-btn:hover:not(.active) { background: rgba(249,115,22,0.1); color: var(--text); }

/* input panels */
.input-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.input-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.panel-header { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); gap: 8px; }
.panel-title { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; flex: 1; }
.fmt-badge { font-size: 0.72rem; font-weight: 700; padding: 2px 10px; border-radius: 20px; background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.25); color: #fdba74; letter-spacing: 0.04em; }
.panel-textarea { width: 100%; min-height: 220px; background: transparent; border: none; color: var(--text); padding: 14px 16px; font-size: 0.88rem; font-family: 'SF Mono', 'Fira Code', monospace; line-height: 1.65; resize: vertical; outline: none; }
.panel-textarea::placeholder { color: var(--muted); font-family: inherit; }

/* stats bar */
.stats-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat-add { font-size: 0.82rem; font-weight: 700; color: var(--add); }
.stat-del { font-size: 0.82rem; font-weight: 700; color: var(--del); }
.stat-eq  { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.hidden { display: none !important; }

/* empty state */
.empty-state { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-icon { font-size: 3rem; }
.empty-state p { color: var(--muted); font-size: 0.95rem; }

/* ── DIFF OUTPUT ──────────────────────────────────────────────── */
.diff-output { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.82rem; line-height: 1.6; }

/* split view */
.diff-split { display: grid; grid-template-columns: 1fr 1fr; }
.split-pane { overflow-x: auto; }
.split-pane.left-pane  { border-right: 1px solid var(--border); }

/* unified view */
.diff-unified {}
.unified-pane { overflow-x: auto; }

/* shared row styles */
.diff-row { display: flex; align-items: flex-start; min-height: 22px; padding: 1px 0; }
.diff-row:hover { background: rgba(255,255,255,0.02); }
.ln { min-width: 44px; padding: 0 10px; color: #44445a; text-align: right; user-select: none; font-size: 0.75rem; flex-shrink: 0; padding-top: 1px; }
.u-marker { min-width: 20px; text-align: center; font-weight: 700; flex-shrink: 0; padding-top: 1px; }
.diff-row span:last-child { flex: 1; padding: 0 12px 0 4px; white-space: pre-wrap; word-break: break-all; }
.diff-eq  { color: var(--text); }

/* added / removed rows */
.diff-row.diff-add  { background: var(--add-bg); }
.diff-row.diff-add  .u-marker { color: var(--add); }
.diff-row.diff-add  span:last-child { color: #86efac; }
.diff-row.diff-del  { background: var(--del-bg); }
.diff-row.diff-del  .u-marker { color: var(--del); }
.diff-row.diff-del  span:last-child { color: #fca5a5; }
.diff-row.diff-phantom { background: rgba(255,255,255,0.015); }
.diff-row.diff-phantom span:last-child { color: var(--border); }
.diff-row.diff-trunc { background: rgba(249,115,22,0.08); border-top: 1px solid rgba(249,115,22,0.2); }
.diff-row.diff-trunc .diff-cell-full { padding: 6px 12px; color: #fdba74; font-size: 0.78rem; font-style: italic; }

/* inline word highlights */
mark.word-del { background: rgba(220,38,38,0.35); color: #fca5a5; border-radius: 2px; padding: 0 1px; }
mark.word-add { background: rgba(22,163,74,0.35);  color: #86efac; border-radius: 2px; padding: 0 1px; }

/* ── HOW IT WORKS ─────────────────────────────────────────────── */
.how-section { padding: 80px 20px; border-top: 1px solid var(--border); }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 24px; text-align: center; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.3); color: var(--accent); font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.step p { font-size: 0.88rem; color: var(--muted); line-height: 1.65; }

/* ── ABOUT ───────────────────────────────────────────────────── */
.about-section { padding: 80px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.about-content { display: flex; flex-direction: column; gap: 16px; }
.about-content p { font-size: 0.95rem; color: var(--muted); line-height: 1.8; }
.about-content em { color: var(--text); font-style: italic; }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq-section { padding: 80px 20px; border-top: 1px solid var(--border); }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.faq-item summary { padding: 18px 20px; 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::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 18px; font-size: 0.9rem; color: var(--muted); line-height: 1.7; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 9px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: background 0.15s, transform 0.1s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #0b0b10; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1e1e2e; border: 1px solid var(--border); color: var(--text); font-size: 0.88rem; font-weight: 500; padding: 10px 20px; border-radius: 30px; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: 1000px; margin: 0 auto; padding: 60px 20px 40px; display: flex; gap: 60px; flex-wrap: wrap; }
.footer-brand { flex: 2; min-width: 220px; }
.footer-brand p { color: var(--muted); font-size: 0.88rem; margin-top: 10px; line-height: 1.7; }
.footer-home-link { display: inline-block; margin-top: 12px; font-size: 0.85rem; color: var(--muted); transition: color 0.15s; }
.footer-home-link:hover { color: var(--text); }
.footer-links { flex: 1; min-width: 120px; }
.footer-links h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 14px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.88rem; color: var(--muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; padding: 20px; font-size: 0.8rem; color: var(--muted); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .input-panels { grid-template-columns: 1fr; }
  .diff-split { grid-template-columns: 1fr; }
  .split-pane.left-pane { border-right: none; border-bottom: 1px solid var(--border); }
  .hero { padding: 70px 16px 60px; }
  .hero-stats { padding: 16px; flex-wrap: wrap; }
  .hstat { padding: 0 12px; }
  .hstat-div { display: none; }
  .footer-inner { gap: 32px; }
}
