/* RankMerlin marketing site
   Identity: light poster (filatov reference) over the rollups structure:
   off-white paper, ink type, orange accent ramp, hairline rails,
   oversized regular-weight grotesque headings, mono uppercase labels.
   Fonts: Inter + DM Mono. */

:root {
  --bg: #f2f1ee;
  --bg-deep: #eae8e4;
  --bg-panel: #f7f6f3;
  --txt: #131110;
  --accent: #ee5722;
  --txt-2: #3f3a36;
  --muted: #e45a20;
  --faint: #a09a94;
  --on-accent: #fff8f4;
  --on-accent-soft: #6b645e;
  --line: rgba(25, 20, 15, 0.28);
  --line-soft: rgba(25, 20, 15, 0.16);
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', monospace;
  --rail: 28px;
  --pad: clamp(20px, 4vw, 56px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Paper grain, sits above the background and glow, below content */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.10 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.30 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cursor-follow warm glow under the grain. JS (fx.js) drives --mx / --my;
   without JS it just sits as a soft static light near the hero. */
#bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    620px circle at var(--mx, 65%) var(--my, 30%),
    rgba(238, 87, 34, 0.14),
    rgba(249, 165, 131, 0.07) 45%,
    transparent 72%
  );
}
@media (hover: none) {
  #bg-glow { display: none; }
}

.rails {
  position: relative;
  z-index: 2;
  margin: 0 var(--rail);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- type ---------- */

h1, h2 {
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--txt);
}
h1 { font-size: clamp(42px, 6.2vw, 84px); }
h2 { font-size: clamp(34px, 4.6vw, 62px); }
h3 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 400; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.body-lg { font-size: 18px; color: var(--txt-2); }
.body-md { font-size: 15.5px; color: var(--txt-2); }

.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 13px 22px;
  border-radius: 3px;
  border: 1px solid var(--txt-2);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn-solid {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-solid:hover { background: var(--txt); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}
.btn-ghost:hover { background: rgba(238, 87, 34, 0.08); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 241, 238, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--pad);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-mark { width: 30px; height: 30px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 34px);
}
.lnk {
  font-size: 14.5px;
  color: var(--txt-2);
  transition: color 0.15s ease;
}
.lnk:hover { color: var(--txt); }

/* ---------- hero ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.hero-copy {
  padding: clamp(60px, 9vh, 130px) var(--pad) clamp(40px, 6vh, 80px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-copy .sub {
  margin-top: 22px;
  max-width: 460px;
  font-size: 16.5px;
  color: var(--txt-2);
}
.hero-viz {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}
.hero-viz svg { width: min(92%, 640px); height: auto; }

/* scan form */
.scan-form {
  margin-top: 34px;
  display: flex;
  max-width: 500px;
}
.scan-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 3px 0 0 3px;
  padding: 13px 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--txt);
  outline: none;
}
.scan-form input::placeholder { color: var(--faint); }
.scan-form input:focus { border-color: var(--txt-2); }
.scan-form .btn { border-radius: 0 3px 3px 0; }
.scan-form input:disabled, .scan-form .btn:disabled { opacity: 0.55; cursor: default; }

.scan-error {
  margin-top: 14px;
  font-size: 14px;
  color: #c8341a;
  max-width: 460px;
}
.scan-steps { margin-top: 22px; max-width: 460px; }
.scan-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--txt-2);
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.scan-steps .tick { color: var(--accent); }
.scan-steps .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--txt-2);
  animation: pulse 1.1s ease-in-out infinite;
  flex: none;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* AI summary row (dogfooding: we are an AI-visibility product) */
.ai-summary {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ai-summary .lbl { font-size: 13px; color: var(--faint); }
.ai-summary a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 1px;
  transition: color 0.15s ease;
}
.ai-summary a:hover { color: var(--txt); }

/* ---------- crawler strip ---------- */

.crawlers {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px var(--pad);
  flex-wrap: wrap;
}
.crawlers .lbl { font-size: 13.5px; color: var(--muted); }
.crawlers ul { display: flex; gap: clamp(14px, 3vw, 40px); flex-wrap: wrap; }
.crawlers li {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--txt-2);
}

/* ---------- sections ---------- */

section { border-top: 1px solid var(--line); }

.sec-head {
  text-align: center;
  padding: clamp(70px, 10vh, 130px) var(--pad) clamp(40px, 6vh, 70px);
}
.sec-head .eyebrow { margin-bottom: 18px; }
.sec-head p { margin: 20px auto 0; max-width: 560px; }

/* two scores */
.scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.score-col { padding: clamp(36px, 5vw, 64px) var(--pad) clamp(50px, 7vh, 90px); }
.score-col + .score-col { border-left: 1px solid var(--line); }
.score-col .score-num {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.score-col p { margin-top: 14px; max-width: 480px; }
.check-list { margin-top: 30px; counter-reset: chk; }
.check-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
  color: var(--txt-2);
}
.check-list li::before {
  counter-increment: chk;
  content: counter(chk, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  flex: none;
  width: 22px;
}

/* action rows (01 / 02 / 03) */
.action-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr;
  border-top: 1px solid var(--line);
}
.action-row:first-of-type { border-top: none; }
.action-num {
  padding: clamp(30px, 4vw, 56px) var(--pad);
  border-right: 1px solid var(--line);
}
.action-num .n {
  font-family: var(--mono);
  font-size: clamp(30px, 3.4vw, 46px);
  color: var(--muted);
}
.action-body { padding: clamp(30px, 4vw, 56px) var(--pad); }
.action-body .eyebrow { margin-bottom: 12px; }
.action-body h3 { margin-bottom: 12px; }
.action-body > p { max-width: 560px; }
.action-steps { margin-top: 26px; max-width: 560px; }
.action-steps li {
  position: relative;
  padding: 9px 0 9px 20px;
  font-size: 14.5px;
  color: var(--txt-2);
}
.action-steps li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--txt-2);
  opacity: 0.55;
}

/* sites grid */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.site-cell {
  padding: clamp(30px, 3.5vw, 50px) clamp(20px, 2.5vw, 40px) clamp(44px, 6vh, 70px);
}
.site-cell + .site-cell { border-left: 1px solid var(--line); }
.site-cell .eyebrow { margin-bottom: 14px; }
.site-cell p { font-size: 14.5px; color: var(--txt-2); }

/* honesty */
.honesty { padding: clamp(70px, 10vh, 130px) var(--pad); }
.honesty .eyebrow { margin-bottom: 22px; }
.honesty .statement {
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 900px;
  color: var(--txt);
}
.honesty-points {
  margin-top: 46px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 44px);
}
.honesty-points li {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 14.5px;
  color: var(--txt-2);
}
.honesty-points .k {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* faq */
.faq-wrap { padding: 0 var(--pad) clamp(70px, 10vh, 120px); max-width: 1060px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  font-size: 16.5px;
  color: var(--txt);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--mono);
  font-size: 20px;
  color: var(--txt-2);
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { padding: 0 60px 24px 0; font-size: 15px; color: var(--txt-2); max-width: 820px; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  min-height: 340px;
}
.footer-left {
  padding: clamp(40px, 6vh, 70px) var(--pad);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.footer-left .brand { margin-bottom: 18px; }
.footer-left .tag { max-width: 380px; font-size: 15px; color: var(--txt-2); }
.footer-arcs {
  position: absolute;
  right: -140px;
  bottom: -220px;
  width: 480px;
  opacity: 0.5;
  pointer-events: none;
}
.footer-right {
  padding: clamp(40px, 6vh, 70px) var(--pad);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  text-align: right;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.footer-links a { font-size: 14.5px; color: var(--txt-2); }
.footer-links a:hover { color: var(--txt); }
.copyright { font-size: 13px; color: var(--faint); }

/* marquee ticker */
.ticker {
  border-top: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  padding: 16px 0;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 46px;
  animation: ticker 36s linear infinite;
  will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker span, .ticker a {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ticker span { color: var(--muted); }
.ticker a { color: var(--txt); }
.ticker .sep-line { display: inline-block; width: 64px; height: 1px; background: var(--line); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- legal pages ---------- */

.legal { max-width: 780px; margin: 0 auto; padding: clamp(60px, 9vh, 110px) var(--pad) clamp(70px, 10vh, 120px); }
.legal h1 { font-size: clamp(34px, 4.5vw, 56px); }
.legal .updated { margin-top: 14px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.legal-body { margin-top: 40px; }
.legal-body h2 { font-size: 22px; font-weight: 500; letter-spacing: 0; margin: 34px 0 12px; }
.legal-body p, .legal-body li { font-size: 15.5px; color: var(--txt-2); margin-bottom: 12px; }
.legal-body ul { list-style: disc; padding-left: 22px; }
.legal-body a { color: var(--txt); border-bottom: 1px solid var(--line); }

/* ---------- 404 ---------- */

.nf { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 60px var(--pad); }
.nf .code { font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  :root { --rail: 14px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { border-right: none; }
  .hero-viz { border-top: 1px solid var(--line); padding: 30px 0; }
  .scores-grid { grid-template-columns: 1fr; }
  .score-col + .score-col { border-left: none; border-top: 1px solid var(--line); }
  .sites-grid { grid-template-columns: 1fr 1fr; }
  .site-cell:nth-child(3) { border-left: none; }
  .site-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .honesty-points { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-left { border-right: none; border-bottom: 1px solid var(--line); }
  .footer-right { align-items: flex-start; text-align: left; }
  .footer-links { align-items: flex-start; }
  .hide-sm { display: none; }
}

@media (max-width: 620px) {
  .action-row { grid-template-columns: 1fr; }
  .action-num { border-right: none; padding-bottom: 0; }
  .sites-grid { grid-template-columns: 1fr; }
  .site-cell + .site-cell { border-left: none; border-top: 1px solid var(--line); }
  .scan-form { flex-direction: column; }
  .scan-form input { border-right: 1px solid var(--line); border-radius: 3px 3px 0 0; }
  .scan-form .btn { border-radius: 0 0 3px 3px; justify-content: center; }
  .faq-item p { padding-right: 0; }
}

/* ---------- motion ---------- */
/* Reveal-on-scroll: fx.js tags elements with .rv and flips .in-view.
   Everything gated on prefers-reduced-motion. */

@media (prefers-reduced-motion: no-preference) {
  .rv {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  .rv.in-view {
    opacity: 1;
    transform: none;
  }

  /* hero dial: arcs draw themselves in, then the AI arc breathes */
  .arc-seo {
    stroke-dashoffset: 1070;
    animation: dial-draw 1.5s cubic-bezier(0.6, 0, 0.2, 1) 0.35s forwards;
  }
  .arc-ai {
    stroke-dashoffset: 235;
    animation:
      dial-draw 1.1s cubic-bezier(0.6, 0, 0.2, 1) 1.1s forwards,
      dial-breathe 4.5s ease-in-out 3s infinite;
  }
  .dial-spin {
    animation: dial-spin 90s linear infinite;
    transform-origin: 50% 50%;
    transform-box: fill-box;
  }
  .dial-labels, .dial-notes {
    opacity: 0;
    animation: dial-fade 0.9s ease 1.7s forwards;
  }
  .dial-notes { animation-delay: 2.1s; }

  .footer-arcs {
    animation: dial-spin 120s linear infinite;
    transform-origin: 50% 50%;
  }

  .btn { transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease; }
  .btn:hover { transform: translateY(-1px); }
}

@keyframes dial-draw { to { stroke-dashoffset: 0; } }
@keyframes dial-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes dial-fade { to { opacity: 1; } }
@keyframes dial-spin { to { transform: rotate(360deg); } }
