/* ihatebg v1 — style.css
   Design: Jester + Sage. Paper white, ink black, one signal-red accent.
   No gradients, no marquee tickers, no AI-generated look. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-v22-latin-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-v22-latin-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-v22-latin-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #FBFAF7;
  --ink: #16130E;
  --muted: #6E675C;
  --line: #E7E0D2;
  --card: #FFFFFF;
  --accent: #E23A1E;
  --accent-ink: #FFFFFF;
  --accent-dark: #B92B12;
  --checker-a: #EDEDED;
  --checker-b: #FFFFFF;
  --radius: 14px;
  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 500; }
p { margin: 0 0 1em; }
a { color: var(--accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; text-decoration: none; color: var(--ink); }
.wordmark .bg-red { color: var(--accent); }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.family-nav { color: var(--accent); font-weight: 500; }
.site-nav a.family-nav:hover { color: var(--accent); text-decoration: underline; }
.brand-url { font-size: 0.8rem; color: var(--muted); font-family: var(--font-display); }

/* ---------- hero / tool ---------- */
.hero { padding: 56px 0 64px; text-align: left; }
.hero .kicker {
  display: inline-block; font-family: var(--font-display); font-size: 0.85rem; font-weight: 500;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
  padding: 4px 14px; margin-bottom: 20px;
}
.hero h1 { max-width: 16ch; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 56ch; }

.dropzone {
  margin-top: 32px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  min-height: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 48px 24px; text-align: center;
  cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); border-style: solid; transform: scale(1.01); }
.dropzone .dz-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; }
.dropzone .dz-sub { color: var(--muted); font-size: 0.95rem; }
.dropzone .dz-icon { font-size: 2.5rem; }
.btn {
  display: inline-block; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem;
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 10px;
  padding: 14px 32px; cursor: pointer; text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { font-size: 0.9rem; padding: 9px 18px; border-radius: 8px; }

.trust-row {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px;
  font-family: var(--font-display); font-size: 0.95rem; color: var(--muted);
}
.trust-row span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* ---------- model status ---------- */
.model-status {
  margin-top: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); font-size: 0.95rem; display: none;
}
.model-status.show { display: block; }
.model-status .bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.model-status .bar i { display: block; height: 100%; background: var(--accent); width: 0%; transition: width 0.2s; }
.model-status .note { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

/* ---------- results ---------- */
.results { margin-top: 40px; display: none; }
.results.show { display: block; }
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.result-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.result-card .preview {
  aspect-ratio: 4/3; position: relative; cursor: pointer;
  background-image: linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-color: var(--checker-b);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.result-card .preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.result-card .preview .hold-hint {
  position: absolute; bottom: 8px; right: 8px; font-size: 0.72rem; color: var(--muted);
  background: rgba(255,255,255,0.85); padding: 2px 8px; border-radius: 999px;
}
.result-card .meta { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.result-card .fname { font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-card .actions { display: flex; gap: 8px; }
.result-card .prog { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.result-card .prog i { display: block; height: 100%; background: var(--accent); width: 0%; }
.result-card .status-line { font-size: 0.85rem; color: var(--muted); }
.result-card.error .status-line { color: var(--accent); }

/* ---------- editor modal ---------- */
.editor-modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(22, 19, 14, 0.7); align-items: center; justify-content: center; padding: 20px;
}
.editor-modal.open { display: flex; }
.editor-box {
  background: var(--paper); border-radius: var(--radius); max-width: 900px; width: 100%;
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
}
.editor-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.editor-head h3 { margin: 0; }
.editor-canvas-wrap {
  flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px;
  background-image: linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-color: var(--checker-b);
}
.editor-canvas-wrap canvas { max-width: 100%; max-height: 60vh; cursor: crosshair; touch-action: none; }
.editor-tools { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tool-btn {
  font-family: var(--font-display); font-size: 0.9rem; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink);
}
.tool-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.editor-tools label { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.editor-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }

/* ---------- before/after slider ---------- */
.ba-slider { position: relative; max-width: 760px; margin: 32px auto 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); user-select: none; touch-action: pan-y; }
.ba-slider .ba-before-img { display: block; width: 100%; height: auto; pointer-events: none; }
.ba-slider .ba-after {
  position: absolute; top: 0; left: 0; bottom: 0; width: 50%; overflow: hidden;
  background-image: linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-color: var(--checker-b);
}
.ba-slider .ba-after img { display: block; height: 100%; width: auto; max-width: none; pointer-events: none; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; width: 3px; background: var(--accent); cursor: ew-resize;
  transform: translateX(-1.5px);
}
.ba-handle::after {
  content: "◂ ▸"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--accent); color: #fff; font-size: 0.75rem; padding: 8px 10px; border-radius: 999px; white-space: nowrap;
}
.ba-labels { display: flex; justify-content: space-between; max-width: 760px; margin: 10px auto 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 32px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.step .n { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--accent); }
.step h3 { margin: 12px 0 8px; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.dare {
  margin-top: 32px; border: 2px solid var(--ink); border-radius: var(--radius); padding: 28px;
  background: var(--ink); color: var(--paper);
}
.dare h3 { color: var(--paper); }
.dare p { color: #CFC8BB; margin: 0; }
.dare code { background: rgba(255,255,255,0.12); padding: 2px 8px; border-radius: 6px; font-size: 0.9em; }

/* ---------- comparison ---------- */
.compare { width: 100%; border-collapse: collapse; margin-top: 32px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.compare th, .compare td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.compare th { font-family: var(--font-display); }
.compare th.us { color: var(--accent); }
.compare tr:last-child td { border-bottom: none; }
.compare td:first-child { color: var(--muted); }
.fineprint { font-size: 0.85rem; color: var(--muted); margin-top: 16px; }

/* ---------- faq ---------- */
.faq { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.faq summary { font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; cursor: pointer; }
.faq summary::marker { color: var(--accent); }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* ---------- sponsor ---------- */
.sponsor-slot {
  margin-top: 32px; border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; color: var(--muted);
}
.sponsor-slot .s-label { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; }
.sponsor-slot p { margin: 12px 0 0; font-size: 0.95rem; }

/* ---------- family promo ---------- */
.family-promo { padding: 48px 0; }
.family-promo-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 32px; background: var(--paper);
}
.family-promo .family-kicker { font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.family-promo .family-title { font-family: var(--font-display); font-size: 1.9rem; margin: 0 0 8px; }
.family-promo .family-title a { color: inherit; text-decoration: none; }
.family-promo .family-title a:hover { text-decoration: underline; }
.family-promo .family-blurb { color: var(--muted); margin: 0; max-width: 52ch; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.site-footer .wordmark { font-size: 1.2rem; }
.privacy-note { max-width: 52ch; }

/* ---------- checker divider ---------- */
.checker-divider {
  height: 28px; opacity: 0.5;
  background-image: linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 28px 28px; background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}

@media (max-width: 640px) {
  section { padding: 52px 0; }
  .site-nav { display: none; }
  .dropzone { min-height: 220px; padding: 32px 16px; }
  .editor-tools { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
