:root {
  --bg: #0b0f14;
  --panel: #121922;
  --panel-2: #182331;
  --text: #e8f0f7;
  --muted: #9fb0c0;
  --accent: #2dd4bf;
  --accent-2: #22c55e;
  --border: #253241;
  --danger: #ef4444;
  --shadow: 0 12px 30px rgba(0,0,0,.25);
  --radius: 16px;
  --mono: "Cascadia Mono", "Fira Code", Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: linear-gradient(180deg, #0b0f14 0%, #0c131b 100%);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(11,15,20,.82);
  border-bottom: 1px solid rgba(37,50,65,.7);
}
.header-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:72px; }
.brand { display:flex; align-items:center; gap:12px; font-weight: 800; color: var(--text); }
.brand-badge {
  width: 38px; height: 38px; border-radius: 12px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color:#041016; font-family: var(--mono); font-weight:700;
}
.nav { display:flex; gap:18px; flex-wrap:wrap; }
.nav a { color: var(--muted); font-size: .95rem; }
.nav a.active, .nav a:hover { color: var(--text); text-decoration:none; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.hero { padding: 64px 0 28px; }
.hero-grid { display:grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items:center; }
.eyebrow { color: var(--accent); font-weight:700; letter-spacing:.04em; text-transform: uppercase; font-size:.82rem; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 12px; }
h1 { font-size: clamp(2.1rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
h3 { font-size: 1.15rem; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 68ch; }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top: 22px; }
.button {
  appearance:none; border:1px solid var(--border); background: var(--panel);
  color: var(--text); padding: 12px 16px; border-radius: 12px; cursor:pointer;
  font-weight:700; transition: .18s ease; box-shadow: var(--shadow);
}
.button:hover { transform: translateY(-1px); background: var(--panel-2); text-decoration:none; }
.button.primary { background: linear-gradient(135deg, var(--accent), #14b8a6); color:#071115; border-color: transparent; }
.button.good { background: linear-gradient(135deg, var(--accent-2), #16a34a); color:#07110a; border-color: transparent; }
.button.ghost { box-shadow:none; }
.section { padding: 24px 0 56px; }
.grid-3 { display:grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display:grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  background: linear-gradient(180deg, rgba(18,25,34,.95), rgba(15,21,29,.95));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card p { color: var(--muted); margin: 0; }
.kpis { display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.kpi { padding: 16px; border-radius: 14px; background: rgba(24,35,49,.7); border:1px solid var(--border); }
.kpi strong { display:block; font-size:1.08rem; margin-bottom:4px; }
.tool-layout { display:grid; grid-template-columns: 390px 1fr; gap: 20px; align-items:start; }
.panel {
  background: linear-gradient(180deg, rgba(18,25,34,.97), rgba(12,18,26,.97));
  border:1px solid var(--border); border-radius: var(--radius); padding:18px; box-shadow: var(--shadow);
}
.field { display:grid; gap: 8px; margin-bottom: 16px; }
.field.inline { grid-template-columns: repeat(2,1fr); gap:12px; }
label { font-weight:700; font-size:.95rem; }
input[type="text"], textarea, select {
  width:100%; padding: 12px 13px; border-radius: 12px; border:1px solid var(--border);
  background:#0c131b; color:var(--text); font: inherit;
}
input[type="range"] { width: 100%; }
.small { color: var(--muted); font-size: .9rem; }
.dropzone {
  border: 1.5px dashed #3a556d; border-radius: 14px; padding: 18px;
  background: rgba(12,19,27,.75); text-align:center; color:var(--muted);
}
.dropzone.dragover { border-color: var(--accent); background: rgba(25,43,58,.6); color: var(--text); }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; margin-bottom: 14px; }
.preview-wrap { display:grid; gap:14px; }
.preview-box, .ascii-output {
  background:#091018; border:1px solid var(--border); border-radius: 14px; overflow:auto;
}
.preview-box { min-height: 220px; display:grid; place-items:center; padding: 14px; }
.ascii-output { padding: 16px; min-height: 420px; }

/* FIX #1: text-to-ascii output shares same styles as image output */
pre#ascii-output,
pre#text-ascii-output,
pre.ascii-sample {
  margin:0; color:#d8f3ff; font-family: var(--mono); font-size: 10px; line-height: 1;
  white-space: pre; min-height: 380px;
}
pre.ascii-sample { min-height: auto; }

.notice {
  padding: 12px 14px; border-radius: 12px; border:1px solid var(--border);
  background: rgba(15,24,35,.8); color: var(--muted);
}
.success { color: #86efac; }
.footer { padding: 28px 0 48px; border-top:1px solid rgba(37,50,65,.7); color: var(--muted); }
.footer-grid { display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.list-clean { padding-left: 18px; color: var(--muted); }
.examples { display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.example-card { display:grid; gap:10px; }
.muted { color: var(--muted); }
.tagrow { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.tag { border:1px solid var(--border); background: rgba(24,35,49,.65); border-radius:999px; padding:6px 10px; font-size:.85rem; color:var(--muted); }
.copy-status { min-height: 1.2em; font-size: .9rem; }
.code-preview { background:#091018; border-radius: 14px; padding:14px; border:1px solid var(--border); overflow:auto; }

.page-head { margin-bottom: 22px; }
.page-head p { max-width: 72ch; }
.faq { display:grid; gap:14px; }
.faq-item { background: linear-gradient(180deg, rgba(18,25,34,.97), rgba(12,18,26,.97)); border:1px solid var(--border); border-radius: var(--radius); padding:18px; }
.faq-item h3 { margin-bottom: 8px; }
.hero-panel pre { font-size: 11px; line-height: 1; color:#d8f3ff; }
.clip-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.button.small { padding:10px 12px; font-size:.92rem; }
.preview-box img { max-height: 360px; width:auto; border-radius: 10px; }
.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; }

@media (max-width: 980px) {
  .hero-grid, .tool-layout, .grid-3, .grid-2, .examples, .kpis { grid-template-columns: 1fr; }
  .clip-actions { flex-direction: column; }

  /* FIX #2: mobile nav via hamburger */
  .hamburger { display: block; }
  .nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    background: rgba(11,15,20,.97);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 18px;
    gap: 14px;
    z-index: 99;
  }
  .nav.open { display: flex; }
}


.ad-slot {
  width: min(970px, calc(100% - 32px));
  min-height: 90px;
  margin: 18px auto 26px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(24,35,49,.55);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ad-slot::before { content: "Advertisement"; }
@media print { .ad-slot { display: none !important; } }
