/* ===========================================================================
   opticompress — landing page styles
   Zero JavaScript. One hand-written stylesheet. Dark mode only.
   =========================================================================== */

:root {
  /* Base palette */
  --bg: #050505;
  --bg-secondary: #0a0a0a;
  --bg-card: #0e0f11;
  --bg-code: #08090a;
  --text: #a1a1aa;
  --text-bright: #ededed;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --max-width: 820px;
  --nav-height: 56px;

  /* Accents — amber primary, plus supporting hues */
  --accent: #f2b53c;
  --accent-dim: rgba(242, 181, 60, 0.15);
  --blue: #60a5fa;
  --purple: #c084fc;
  --red: #f43f5e;
  --green: #5fd08a;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  /* Flat base + a subtle top-center accent glow, pinned to the viewport. */
  background-image: radial-gradient(circle at 50% 0%, rgba(242, 181, 60, 0.06) 0%, transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  min-height: 100vh;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { animation: none; }
}

/* --- Links & type --------------------------------------------------------- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover { color: #ffce6b; }

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

strong { color: var(--text-bright); font-weight: 600; }
em { color: var(--text); font-style: italic; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.38em;
  color: var(--text-bright);
  white-space: nowrap;
}

/* --- Fixed glass nav ------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.logo:hover { color: var(--accent); opacity: 0.85; }
.nav-links {
  display: flex;
  gap: 26px;
  align-items: center;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text-bright); }

/* --- Content column ------------------------------------------------------- */
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) 24px 96px;
}

section { margin-top: 76px; scroll-margin-top: calc(var(--nav-height) + 24px); }
.hero { margin-top: 8px; }

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  padding-bottom: 0.6rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  margin-bottom: 0.55rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.section-lead {
  color: var(--text);
  margin-bottom: 1.8rem;
  max-width: 62ch;
}

/* --- Hero ----------------------------------------------------------------- */
.hero-hook {
  font-family: var(--mono);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 1rem;
  color: var(--accent); /* fallback */
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-hook {
    background: linear-gradient(90deg, var(--green) 0%, var(--accent) 72%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.hero h1 {
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text-bright);
  margin-bottom: 1.1rem;
}

.hero-sub {
  font-size: 1.06rem;
  color: var(--text);
  max-width: 60ch;
  margin-bottom: 2rem;
}

/* --- Code blocks ---------------------------------------------------------- */
.code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 0;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}
.dots { display: inline-flex; gap: 6px; }
.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
}
.code-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
}
.code code {
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.75;
  background: none;
  border: none;
  padding: 0;
  color: var(--text-bright);
  white-space: pre;
}

/* Manual syntax highlighting */
.code .c    { color: var(--text-dim); }             /* comments   */
.code .cmd  { color: var(--text-bright); font-weight: 500; } /* commands */
.code .tool { color: var(--accent); font-weight: 600; }      /* optc     */
.code .env  { color: var(--blue); }                 /* env var    */
.code .val  { color: var(--green); }                /* value      */
.code .flag { color: var(--purple); }               /* flags      */

/* --- Stat row ------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 40px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.stat:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.stat-num {
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Pipeline ------------------------------------------------------------- */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.step {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  transition: background 0.18s ease, transform 0.18s ease;
}
.step:hover { background: rgba(255, 255, 255, 0.02); transform: translateY(-2px); }
.step-blue   { border-top-color: var(--blue); }
.step-accent { border-top-color: var(--accent); }
.step-purple { border-top-color: var(--purple); }
.step-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.5rem;
}
.step h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.step-sub {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0;
}
.step p { font-size: 0.86rem; color: var(--text); margin: 0; }

.arrow {
  flex: 0 0 auto;
  align-self: center;
  color: var(--text-dim);
  font-family: var(--mono);
}
.arrow::after { content: "\2192"; font-size: 1.2rem; } /* → */

/* --- Feature cards -------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  overflow: hidden;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.85;
}
.card:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.card p { font-size: 0.9rem; margin: 0; }

/* --- Results table -------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody th,
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 400;
}
tbody tr:last-child th,
tbody tr:last-child td { border-bottom: none; }
tbody th { text-align: left; }
tbody th code { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
thead th.num { text-align: right; }

tr.lose { background: rgba(244, 63, 94, 0.05); }
tr.lose td, tr.lose th { color: var(--text-muted); }
.ratio-good { color: var(--green); font-weight: 600; }
.ratio-bad  { color: var(--red); font-weight: 600; }
.tag-lose {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* --- Sample figure -------------------------------------------------------- */
.sample {
  margin: 2rem 0 0;
}
.sample img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  image-rendering: pixelated; /* preserve the crisp bitmap glyphs */
}
.sample figcaption {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-align: center;
}
#results .code { margin-top: 2rem; }

/* --- Honest callout ------------------------------------------------------- */
.callout {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.callout h3 { margin-bottom: 1rem; }
.callout ul { list-style: none; }
.callout li {
  font-size: 0.92rem;
  padding-left: 0;
  margin-bottom: 0.85rem;
}
.callout li:last-child { margin-bottom: 0; }
.lead-word {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.4em;
}
.lead-word.good    { color: var(--green); }
.lead-word.bad     { color: var(--red); }
.lead-word.neutral { color: var(--blue); }

/* --- Cite ----------------------------------------------------------------- */
.cite-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  font-weight: 500;
}

/* --- Footer --------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text-bright); }
.footer-meta { color: var(--text-dim); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 700px) {
  .nav-inner { padding: 0 16px; }
  .nav-links { gap: 15px; }
  .nav-links a { font-size: 0.8rem; }

  .content { padding: calc(var(--nav-height) + 32px) 18px 72px; }
  section { margin-top: 56px; }

  .hero h1 { font-size: 2.4rem; }
  .hero-hook { font-size: 0.98rem; }
  .hero-sub { font-size: 1rem; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }

  .pipeline { flex-direction: column; }
  .arrow { align-self: center; transform: rotate(0deg); }
  .arrow::after { content: "\2193"; } /* ↓ */

  .code pre { padding: 14px; }
  .code code { font-size: 0.78rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}
