/* ===============
   CommentAnywhere – Landing Styles (complete)
   =============== */

/* --- CSS Reset / Base --- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #e6ecf3;
  background: #0b0f17;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* --- Design Tokens (Dark default) --- */
:root{
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #0f1522;
  --card: #141c2b;
  --text: #e6ecf3;
  --muted: #9fb0c9;
  --line: #1b2436;
  --brand: #4c8bf5;
  --brand-2: #7aa2ff;
  --accent: #22c55e;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
}

/* --- Layout --- */
.container { width: min(1100px, 92vw); margin: 0 auto; }
.row { display: flex; gap: 1rem; }
.row.center { align-items: center; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1rem, 3vw, 2rem); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px){ .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr; } }

/* --- Header --- */
.site-header{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: .2px; padding: .9rem 0; display: inline-block; }
.nav a { color: var(--muted); margin-left: 1rem; padding: .5rem .4rem; border-radius: 8px; }
.nav a:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.nav .btn.ghost { border: 1px solid #23314d; }

/* --- Hero --- */
.hero{
  position: relative;
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem);
  background:
    radial-gradient(800px 400px at 75% -10%, rgba(76,139,245,.25), transparent 60%),
    radial-gradient(700px 360px at -10% 0%, rgba(34,197,94,.18), transparent 55%),
    linear-gradient(180deg, #0b0f17 0%, #0c101a 100%);
  overflow: hidden;
}
.hero::after{
  content: ""; position: absolute; inset: -20% -10% auto; height: 320px;
  background: radial-gradient(650px 180px at 50% 100%, rgba(122,162,255,.08), transparent 60%);
  pointer-events: none; filter: blur(10px);
}
.hero h1{ margin: 0 0 .6rem; font-size: clamp(2.1rem, 3.2vw + 1rem, 3.6rem); line-height: 1.05; }
.lead{ color: var(--muted); font-size: clamp(1rem, .7vw + .95rem, 1.2rem); max-width: 60ch; }

/* --- Buttons --- */
.btn{ display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1rem; border-radius: 12px; font-weight: 700; border: 1px solid #24324e; transition: transform .06s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary{ background: linear-gradient(180deg, var(--brand), var(--brand-2)); border: none; color: white; }
.btn.ghost{ background: transparent; color: var(--text); }

.cta{ margin-top: 1rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.tiny{ color: var(--muted); font-size: .9rem; margin-top: .5rem; }

/* --- Hero art mock --- */
.hero-art { display: grid; place-items: center; }
.panel-mock { background: var(--surface); border: 1px solid #1d2536; border-radius: .9rem; padding: .75rem; width: 100%; max-width: 520px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.panel-header { display:flex; align-items:center; justify-content:space-between; color: var(--muted); font-weight: 600; }
.panel-header .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); display: inline-block; }
.thread { margin-top: .75rem; position: relative; }
.card { background: var(--card); border-radius: .75rem; padding: .75rem; border: 1px solid #24304a; }
.card + .connector { height: 22px; width: 2px; background: #26334f; margin: .25rem 0 .25rem 16px; border-radius: 2px; }
.card.reply { margin-left: 18px; }
.meta { color: var(--muted); font-size: .85rem; display:flex; gap:.5rem; }
.reply-pill { margin-top: .75rem; border: 1px dashed #2c3a58; color: var(--muted); padding: .5rem .75rem; border-radius: .6rem; font-size: .9rem; }

/* --- Features --- */
.features{ padding: 3rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feat{ background: var(--card); border: 1px solid #1c2740; border-radius: var(--radius); padding: 1rem; box-shadow: 0 10px 24px rgba(2,8,23,.25) inset, 0 10px 30px rgba(0,0,0,.25);
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease; }
.feat:hover{ transform: translateY(-2px); border-color: #273655; box-shadow: var(--shadow); }
.feat h3{ margin: .25rem 0 .35rem; font-size: 1.1rem; }
.feat p{ color: var(--muted); margin: 0; }

/* Decorative icons without changing HTML */
.features .feat::before{ content: ""; display: inline-block; width: 24px; height: 24px; margin-right: .5rem; vertical-align: -6px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
  background: radial-gradient(circle at 30% 30%, white 0%, white 18%, transparent 19%),
              linear-gradient(135deg, #7aa2ff, #4c8bf5);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M12 3c5 0 9 3.58 9 8 0 4.42-4 8-9 8-1.07 0-2.09-.16-3.04-.46L4 21l1.05-3.16C4.4 16.48 4 15.27 4 14c0-4.42 4-8 8-8z"/></svg>') center/contain no-repeat; }
.features .feat:nth-child(2)::before{ background: linear-gradient(135deg, #22c55e, #86efac); }
.features .feat:nth-child(3)::before{ background: linear-gradient(135deg, #a78bfa, #60a5fa); }

/* --- How It Works --- */
.how{ padding: 3rem 0; }
.steps{ counter-reset: step; list-style: none; padding-left: 0; color: var(--muted); }
.steps li{ display: grid; grid-template-columns: 36px auto; gap: .75rem; align-items: start; margin: .6rem 0; }
.steps li::before{ counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 36px; height: 36px; background: #182238; color: #dbe6f6; border: 1px solid #23314d; border-radius: 10px; font-weight: 800; }
.screenshot.ph{ display: grid; place-items: center; min-height: 260px; border-radius: var(--radius); border: 1px dashed #2b3a5a; color: var(--muted); background: linear-gradient(180deg, #0f1522, #0c101a); }
.screenshot { display:block; width:100%; border-radius: var(--radius); border: 1px solid #22314d; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* --- FAQ --- */
.faq{ padding: 3rem 0; border-top: 1px solid var(--line); }
.faq details{ background: var(--surface); border: 1px solid #1b2741; border-radius: 12px; padding: .9rem 1rem; margin: .6rem 0; }
.faq summary{ cursor: pointer; font-weight: 700; color: #dbe6f6; }
.faq p{ color: var(--muted); }

/* --- Footer --- */
.site-footer{ padding: 1rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer a{ color: var(--muted); }
.site-footer a:hover{ color: var(--text); }

/* --- Utilities --- */
.centered{ text-align: center; }
.hidden{ display: none !important; }

/* ==========================
   Light Theme Overrides
   ========================== */
body.theme-light{
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --card: #ffffff;
  --text: #0b1020;
  --muted: #4a5568;
  --line: #e3e8f0;
  --brand: #3b82f6;
  --brand-2: #60a5fa;
  --accent: #16a34a;
  --danger: #dc2626;
}
body.theme-light{ color: var(--text); background: var(--bg); }
body.theme-light .site-header{ background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: var(--line); }
body.theme-light .nav a:hover{ background: color-mix(in srgb, var(--surface) 60%, transparent); }

/* Fix light theme contrast for hero & buttons */
body.theme-light .hero {
  background: linear-gradient(180deg, #f7f9fc 0%, #ffffff 100%) !important;
}
body.theme-light .hero h1 { color: var(--text) !important; }
body.theme-light .hero .lead { color: #475569 !important; }
body.theme-light .btn { border-color: #c9d4e6 !important; background: transparent; color: var(--text) !important; }
body.theme-light .btn:hover { background: #f3f6fc !important; border-color: #b8c6dc !important; }

/* Light theme refinements for feature cards & FAQ */
body.theme-light .feat h3 { color: #1e293b; }
body.theme-light .feat p { color: #334155; }
body.theme-light .feat { background: #ffffff; box-shadow: 0 6px 14px rgba(0,0,0,.05); border-color: #e6edf7; }

body.theme-light .faq details { background: #ffffff; border-color: #dbe1ea; box-shadow: 0 4px 12px rgba(0,0,0,.04); }
body.theme-light .faq summary { color: #1e293b; }
body.theme-light .faq p { color: #334155; }

/* --- Trending Page --- */
.section.trending{ padding: 2.2rem 0 3rem; }
.section.trending h1 { margin: 0 0 .5rem; font-size: clamp(1.6rem, 1.3vw + 1rem, 2rem); }
.section.trending .muted { color: var(--muted); }
.trending-controls { margin: 1rem 0 1rem; color: var(--muted); }
.trending-controls select { background: var(--surface); color: var(--text); border: 1px solid #24324e; border-radius: 8px; padding: .35rem .5rem; }
.trending-list { margin: 0; padding-left: 1.2rem; list-style: none; counter-reset: item; }
.trending-list li { display: grid; grid-template-columns: 28px 18px 1fr auto; gap: .6rem; align-items: center; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.trending-list li:last-child { border-bottom: none; }
.trending-list .rank { width: 28px; text-align: right; color: var(--muted); font-weight: 700; }
.trending-list .fav { opacity: .9; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.trending-list a { color: #dbe6f6; word-break: break-all; }
.trending-list a:hover { color: white; text-decoration: underline; }
.trending-list .count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Light theme tweaks for trending */
body.theme-light .trending-list a { color: #1e293b; }
body.theme-light .trending-list a:hover { color: #0b1020; }
body.theme-light .trending-controls select { border-color: #c9d4e6; background: #fff; color: #0b1020; }

/* --- Changelog (Markdown) --- */
.section.changelog{ padding: 2.2rem 0 3rem; }
.md{ line-height: 1.6; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6{ margin: 1.2rem 0 .5rem; }
.md p{ margin: .5rem 0; }
.md ul{ margin: .4rem 0 .8rem 1.2rem; }
.md li{ margin: .2rem 0; }
.md a{ color: var(--brand-2); }
.md pre{ background: var(--surface); border: 1px solid #22314d; border-radius: 10px; padding: .75rem; overflow:auto; }
.md code{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
body.theme-light .md pre{ border-color: #e1e7f1; background: #f8fafc; }

/* --- Report form --- */
.section.report{ padding: 2.2rem 0 3rem; }
.form{ max-width: 860px; }
.form .row{ display:flex; gap: .9rem; flex-wrap: wrap; margin: .6rem 0; }
.form label{ display:flex; flex-direction: column; gap: .35rem; }
.form input, .form textarea, .form select{
  appearance: none; background: var(--surface); color: var(--text);
  border: 1px solid #24324e; border-radius: 10px; padding: .6rem .7rem; width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus{ outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); border-color: var(--brand); }
.help{ color: var(--muted); font-size: .95rem; }
body.theme-light .form input, body.theme-light .form textarea, body.theme-light .form select{ background: #fff; border-color: #c9d4e6; color: #0b1020; }
