/* HookFactory Lite — Krave Media brand styling.
   Palette + typography lifted from krave-creator-db so the tool sits
   coherently inside the broader Krave surface area. */

:root {
  --bg: #f4f1f8;
  --bg-elev: #ffffff;
  --bg-soft: #e8e1f5;
  --bg-card: #fbfaff;
  --neon: #d8fb37;
  --purple: #6754ff;
  --purple-deep: #4b3bcf;
  --text: #0a0a0a;
  --muted: #6b6783;
  --border: #e3dcef;
  --danger: #ef4444;
  --success: #22c55e;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow: 0 4px 16px rgba(10, 10, 10, 0.06);
  --shadow-lg: 0 24px 60px rgba(10, 10, 10, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--purple);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- top bar -------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand:hover { text-decoration: none; opacity: 0.85; }
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}
.brand-tag {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg-soft);
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.top-cta {
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}
.top-cta:hover { text-decoration: none; background: #1a1a1a; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-link {
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--purple); }

/* ---- hero ----------------------------------------------------------------- */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}
.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
  margin: 0 0 16px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 22px;
}
.hero h1 .hl {
  background: var(--neon);
  padding: 0 8px;
  display: inline-block;
  transform: skew(-3deg);
}
.hero-sub {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 40px;
}

/* ---- form ---------------------------------------------------------------- */
.form-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}
.form-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}
.form-card input[type=email],
.form-card input[type=url],
.form-card input[type=text] {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-card);
  transition: border-color 0.15s, background 0.15s;
}
.form-card input:focus {
  outline: none;
  border-color: var(--purple);
  background: #fff;
}
.form-row { margin-bottom: 22px; }
.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.form-hint a { font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  border: 0;
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--text);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: #1a1a1a; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  background: #d1d1d1;
  cursor: wait;
}
.btn-neon {
  background: var(--neon);
  color: var(--text);
}
.btn-neon:hover { background: #c5e632; }

.credits-pill {
  background: var(--bg-soft);
  color: var(--purple-deep);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 18px;
}

/* ---- proof bar ----------------------------------------------------------- */
.proofbar {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 36px 0;
  background: var(--bg-elev);
}
.proofbar-eyebrow {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 24px;
}
/* Proofbar uses fixed-height "cells" so each logo lands at uniform visual
   weight regardless of intrinsic aspect ratio. The source PNGs in /logos/
   were pre-trimmed and normalized via sharp so there's no transparent
   padding inside the images themselves. */
.proofbar-logos {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: clamp(20px, 4vw, 48px);
}
.proofbar-cell {
  width: 100%;
  max-width: 160px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.proofbar-cell img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.6);
  transition: filter 0.2s;
}
.proofbar-cell img:hover {
  filter: grayscale(0%) opacity(1);
}

@media (max-width: 640px) {
  .proofbar-logos { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .proofbar-cell { height: 36px; }
}

/* ---- how-it-works -------------------------------------------------------- */
.section {
  padding: 80px 0;
}
.section-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
  margin: 0 0 14px;
  text-align: center;
}
.section-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
  margin: 0 0 56px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.step-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--purple);
  line-height: 1;
  margin-bottom: 14px;
}
.step h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
}
.step p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* ---- FAQ ----------------------------------------------------------------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 14px;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  float: right;
  color: var(--purple);
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq-body {
  padding-top: 14px;
  color: var(--muted);
  font-size: 15px;
}

/* ---- built-by strip ----------------------------------------------------- */
.builtby {
  margin-top: 56px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.builtby-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  text-align: center;
}
.builtby-logo {
  height: 22px;
  width: auto;
  display: block;
  opacity: 0.85;
}
.builtby-text {
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  letter-spacing: -0.005em;
}
@media (max-width: 640px) {
  .builtby-text { font-size: 13px; }
}

/* ---- footer block ------------------------------------------------------- */
.footer-block {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 64px 0 56px;
}
.footer-block-inner {
  text-align: center;
}
.footer-logo {
  display: inline-block;
  margin-bottom: 22px;
}
.footer-logo:hover { opacity: 0.85; text-decoration: none; }
.footer-logo img {
  height: 38px;
  width: auto;
  display: block;
}
.footer-tagline {
  font-size: 15px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 30px;
  line-height: 1.55;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 4vw, 44px);
  margin-bottom: 32px;
}
.footer-nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
.footer-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: var(--purple);
  color: var(--purple);
}
.footer-disclaimer {
  font-size: 12px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  letter-spacing: 0.01em;
}
.hide-mobile { display: inline; }
@media (max-width: 640px) {
  .footer-block { padding: 48px 0 40px; }
  .footer-tagline { font-size: 14px; }
  .hide-mobile { display: none; }
}

/* legacy .footer kept for any straggling pages, identical visual to the new
   footer-block so we don't have to track down every reference. */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--muted); }

/* ---- progress page ------------------------------------------------------- */
.progress-wrap {
  padding: 56px 0;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 880px) {
  .progress-wrap { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
.progress-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.progress-card h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}
.progress-card p { color: var(--muted); margin: 0 0 24px; }

.progress-bar {
  height: 10px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple), var(--neon));
  transition: width 0.5s ease;
}
.progress-pct {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
}

.stepper {
  margin-top: 28px;
  list-style: none;
  padding: 0;
}
.stepper li {
  padding: 10px 0 10px 30px;
  position: relative;
  font-size: 14px;
  color: var(--muted);
}
.stepper li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid var(--border);
}
.stepper li.done { color: var(--text); }
.stepper li.done::before {
  background: var(--neon);
  border-color: var(--neon);
}
.stepper li.active { color: var(--text); font-weight: 600; }
.stepper li.active::before {
  background: var(--purple);
  border-color: var(--purple);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(103, 84, 255, 0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(103, 84, 255, 0); }
}

/* ---- proof card carousel (right rail on progress page) ------------------- */
.proof-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.proof-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  animation: fadeIn 0.6s ease;
}
.proof-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 8px;
}
.proof-card-body {
  font-size: 15px;
  line-height: 1.5;
}
.proof-card-attr {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- results page -------------------------------------------------------- */
.result-header {
  padding: 48px 0 32px;
  text-align: center;
}
.result-header h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 8px;
}
.result-header p {
  color: var(--muted);
  margin: 0 0 28px;
}

.result-section { margin-bottom: 56px; }
.result-section-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-section-title .badge {
  background: var(--neon);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.hooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.hook-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.hook-card-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hook-tier {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 11px;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  color: var(--purple-deep);
}
.hook-tier.tier-A { background: var(--neon); color: var(--text); }
.hook-tier.tier-B { background: var(--bg-soft); color: var(--purple-deep); }
.hook-text {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin: 6px 0 4px;
}
.hook-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.hook-meta strong { color: var(--text); font-weight: 600; }
.hook-mechanisms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.hook-mechanism {
  font-size: 11px;
  background: var(--bg-soft);
  color: var(--purple-deep);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.body-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.body-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
}
.body-card .body-angle {
  font-size: 13px;
  color: var(--purple-deep);
  font-weight: 600;
  margin-bottom: 14px;
}
.body-actions {
  margin: 0;
  padding: 0;
  list-style: none;
}
.action-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.action-row:last-child { border-bottom: 0; }
.action-thumb {
  width: 96px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-soft);
  display: block;
}
.action-thumb-empty {
  background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 6px, var(--bg-card) 6px, var(--bg-card) 12px);
}
.action-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  min-width: 0;
}
.action-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.action-row .ts {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: var(--bg-soft);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
}
.action-row .verb {
  font-weight: 700;
  color: var(--purple-deep);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.action-note { color: var(--text); }
.action-broll {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.action-broll strong { color: var(--text); font-weight: 600; }

@media (max-width: 520px) {
  .action-row { grid-template-columns: 72px 1fr; gap: 10px; }
  .action-thumb { width: 72px; height: 44px; }
}

.combinations-intro {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 22px;
  max-width: 720px;
}
.combinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.combo-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  min-height: 96px;
}
.combo-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  background: var(--neon);
  color: var(--text);
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 4px;
}
.combo-hook {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.combo-body {
  font-size: 11px;
  color: var(--muted);
  margin-top: auto;
}

.upsell-card {
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
  margin: 48px 0;
}
.upsell-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
}
.upsell-card p {
  color: #d1d1d1;
  margin: 0 0 22px;
  font-size: 15px;
}

/* ---- error / 404 states -------------------------------------------------- */
.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 14px;
}
.upsell-inline {
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 14px;
  text-align: center;
}
.upsell-inline h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.upsell-inline p {
  color: #d1d1d1;
  font-size: 14px;
  margin: 0 0 16px;
}

/* ---- print styles (for PDF download via window.print()) ----------------- */
@media print {
  body { background: #fff; color: #000; font-size: 11px; }
  .topbar, .footer, .footer-block, .builtby, .upsell-card, #downloadPdfBtn, .top-cta, .proofbar { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .result-header { padding: 0 0 16px; }
  .result-header h1 { font-size: 22px; }
  .hooks-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hook-card, .body-card, .combo-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .result-section { break-inside: avoid-page; }
  .result-section-title { font-size: 18px; }
  .combinations-grid { grid-template-columns: repeat(3, 1fr); }
  .action-row { grid-template-columns: 64px 1fr; gap: 8px; padding: 6px 0; }
  .action-thumb { width: 64px; height: 36px; }
  a[href]::after { content: ""; }
}
