:root {
  --bg: #0d0e0c;
  --bg-2: #14150f;
  --panel: #191a13;
  --panel-2: #20211a;
  --line: #33342a;
  --ink: #f3efe2;
  --ink-soft: #b8b6a6;
  --ink-faint: #7c7b6c;
  --lime: #c9f24a;
  --lime-dim: #a9cf3a;
  --coral: #ff6a45;
  --radius: 16px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(120% 90% at 80% -10%, #1c1d13 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 60px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; cursor: pointer; transition: opacity 0.2s; }
.brand:hover { opacity: 0.75; }
.brand-mark { color: var(--lime); font-size: 22px; }
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

/* hero */
.hero { padding: clamp(48px, 9vw, 96px) 0 40px; }
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--lime-dim);
  margin: 0 0 22px;
}
.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.display .ink { font-style: italic; color: var(--lime); }
.lede {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 19px);
  margin: 0 0 40px;
}

/* composer card */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.composer-card { padding: clamp(22px, 4vw, 36px); }
.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.field-label.mt { margin-top: 30px; }
.muted { color: var(--ink-faint); text-transform: none; letter-spacing: 0; font-family: var(--sans); }

.url-row {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 4px 4px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.url-row:focus-within {
  border-color: var(--lime-dim);
  box-shadow: 0 0 0 4px rgba(201, 242, 74, 0.1);
}
.url-proto { font-family: var(--mono); color: var(--ink-faint); font-size: 16px; }
.url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  padding: 14px 10px;
}
.url-input::placeholder { color: var(--ink-faint); }

/* lens grid */
.lens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.lens {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 13px;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  position: relative;
}
.lens:hover { transform: translateY(-2px); border-color: #4a4b3a; }
.lens.active {
  border-color: var(--lime);
  background: linear-gradient(180deg, rgba(201, 242, 74, 0.12), rgba(201, 242, 74, 0.03));
}
.lens.active::after {
  content: "✓";
  position: absolute;
  top: 12px; right: 14px;
  color: var(--lime);
  font-weight: 700;
}
/* Collapsed by default: only the title (.lens-title) shows. The emoji is hidden
   and the description (.lens-sub) is revealed on hover / focus / when active. */
.lens-emoji { display: none; }
.lens-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  padding-right: 18px; /* clears the active ✓ badge in the top-right */
}
.lens-sub {
  display: block;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.35;
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
}
.lens:hover .lens-sub,
.lens:focus-visible .lens-sub,
.lens.active .lens-sub {
  max-height: 80px;
  margin-top: 8px;
  opacity: 1;
}

/* Mobile: once a lens is chosen, collapse the rest (other lenses + the custom
   brief) so "Run the review" appears right under the chosen lens — no scrolling
   past 19 other options. Tapping the chosen lens reopens the full list. */
@media (max-width: 720px) {
  .composer-card.lens-chosen .lens:not(.active) { display: none; }
  .composer-card.lens-chosen #briefBlock { display: none; }
  /* Replace the corner ✓ with a full-width "tap to change" hint on its own line
     so it never collides with the (possibly wrapping) lens title. */
  .composer-card.lens-chosen .lens.active::after {
    content: "Tap to change";
    position: static;
    display: block;
    margin-top: 10px;
    color: var(--lime-dim);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
  }
}

.custom-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  padding: 15px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.custom-input::placeholder { color: var(--ink-faint); }
.custom-input:focus {
  border-color: var(--lime-dim);
  box-shadow: 0 0 0 4px rgba(201, 242, 74, 0.1);
}

.run-btn {
  margin-top: 28px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--lime);
  color: #14150c;
  border: none;
  border-radius: 12px;
  padding: 18px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, opacity 0.2s;
}
.run-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.run-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.run-arrow { transition: transform 0.2s; }
.run-btn:hover:not(:disabled) .run-arrow { transform: translateX(4px); }
.hint {
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  margin: 14px 0 0;
  font-family: var(--mono);
}

/* marquee */
.marquee {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  width: max-content;
  animation: slide 32s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-faint);
}
.marquee-track span { color: var(--ink-soft); }
@keyframes slide { to { transform: translateX(-50%); } }

/* stages */
.stage { padding: 40px 0 60px; }

/* loader */
.loader { text-align: center; padding: 60px 0; }
.scope-ring {
  width: 84px; height: 84px;
  margin: 0 auto 28px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--lime);
  border-right-color: var(--lime-dim);
  animation: spin 0.9s cubic-bezier(0.6, 0.1, 0.3, 0.9) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-family: var(--serif); font-size: 26px; margin: 0 0 26px; }
.steps { list-style: none; padding: 0; max-width: 380px; margin: 0 auto; text-align: left; }
.steps li {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-faint);
  padding: 9px 0 9px 30px;
  position: relative;
  transition: color 0.3s;
}
.steps li::before {
  content: "○";
  position: absolute; left: 6px;
  color: var(--ink-faint);
}
.steps li.active { color: var(--ink); }
.steps li.active::before { content: "◉"; color: var(--lime); }
.steps li.done { color: var(--ink-soft); }
.steps li.done::before { content: "✓"; color: var(--lime-dim); }

/* error */
.error-card { padding: 32px; text-align: center; }
.error-card h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 8px; color: var(--coral); }
.ghost-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 24px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn:hover { border-color: var(--lime); }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.error-actions .ghost-btn { margin-top: 0; }

/* ---- report shell (in-app preview mirrors the downloadable report) ---- */
.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.act-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.act-btn:hover { border-color: var(--lime); transform: translateY(-1px); }
.act-btn.primary { background: var(--lime); color: #14150c; border-color: var(--lime); }
.act-btn.secondary { background: transparent; }

/* The rendered report is themed with the reviewed site's colors, in its own container */
.report-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
}
/* The preview frame flows straight into the paywall, so square off its base. */
.report-frame.locked-frame { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }

/* Paywall panel shown under the 10% preview */
.paywall {
  border-top: 2px solid var(--lime);
  border-radius: 0 0 var(--radius) var(--radius);
  background:
    radial-gradient(120% 130% at 50% 0%, rgba(201, 242, 74, 0.1), transparent 60%),
    linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  padding: clamp(28px, 5vw, 44px) clamp(22px, 5vw, 40px);
  text-align: center;
  box-shadow: var(--shadow);
}
.pw-lock { font-size: 30px; line-height: 1; margin-bottom: 14px; }
.pw-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 3.5vw, 34px); letter-spacing: -0.02em; margin: 0 0 12px;
}
.pw-sub {
  max-width: 520px; margin: 0 auto 24px; color: var(--ink-soft); font-size: 15.5px;
}
.pw-sub b { color: var(--ink); }
.pw-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--lime); color: #14150c; border: none;
  border-radius: 12px; padding: 15px 28px; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: 17px;
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
.pw-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 34px -14px rgba(201, 242, 74, 0.65); }
.pw-btn:disabled { opacity: 0.55; cursor: progress; }
.pw-btn span { transition: transform 0.2s; }
.pw-btn:hover:not(:disabled) span { transform: translateX(4px); }
.pw-note { margin: 16px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-faint); }

.foot {
  border-top: 1px solid var(--line);
  padding: 26px clamp(20px, 5vw, 60px);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 12px;
  display: flex; gap: 10px; align-items: center;
}
.foot .dot { opacity: 0.5; }
.foot-link {
  margin-left: auto;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  transition: border-color 0.2s, color 0.2s;
}
.foot-link:hover { border-color: var(--lime); color: var(--lime); }
@media (max-width: 560px) { .foot-link { margin-left: 0; } }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .display { font-size: clamp(38px, 12vw, 60px); }
}
