/* ============================================================
   RankLens — public site
   Rule: colour appears only where something moved.
   Everything else is ink on paper.
   ============================================================ */

:root {
  --ink:      #16201d;
  --ink-2:    #34433e;
  --paper:    #eef0ec;
  --surface:  #ffffff;
  --line:     #d8ded9;
  --line-soft:#e7ebe7;
  --muted:    #6a7a73;

  /* movement only */
  --up:       #1d6b54;
  --up-wash:  #e2efe9;
  --down:     #a1362b;
  --down-wash:#fbeceb;

  --radius:   10px;
  --radius-lg:18px;

  --display: 'Bricolage Grotesque', Georgia, serif;
  --ui: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--up); }

:focus-visible { outline: 2px solid var(--up); outline-offset: 3px; border-radius: 3px; }

img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 700px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */

.nav {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 20;
}
.nav-in {
  max-width: 1080px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 28px;
}
.logo {
  font-family: var(--display);
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em;
  text-decoration: none; display: flex; align-items: center; gap: 9px;
}
.logo i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--up); display: block;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; font-size: 14.5px; }
.nav-links a { text-decoration: none; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 100px;
  background: var(--ink); color: var(--paper);
  text-decoration: none; font-size: 14.5px; font-weight: 500;
  border: 1px solid var(--ink);
}
.pill:hover { background: var(--up); border-color: var(--up); color: #fff; }
.pill-ghost { background: transparent; color: var(--ink); }
.pill-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ------------------------------------------------------------
   Hero — rows resolving into a sentence
   ------------------------------------------------------------ */

.hero { padding: 84px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }

.hero h1 {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 20px;
}
.hero p.sub {
  font-size: 18px; line-height: 1.55; color: var(--ink-2);
  margin: 0 0 30px; max-width: 46ch;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { margin: 22px 0 0; font-size: 14px; color: var(--muted); }

/* the demo fragment */
.fragment {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px 20px;
  box-shadow: 0 1px 0 var(--line-soft), 0 18px 40px -28px rgba(22,32,29,.35);
}
.fragment-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line-soft);
}
.frag-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.frag-table th {
  text-align: right; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 0 0 8px; border-bottom: 1px solid var(--line-soft);
}
.frag-table th:first-child { text-align: left; }
.frag-table td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; }
.frag-table td:first-child { text-align: left; color: var(--ink-2); }
.frag-table tr:last-child td { border-bottom: 0; }
.up { color: var(--up); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }
.dim { color: var(--muted); }

.frag-out {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 15px; line-height: 1.55;
}
.frag-out b { font-weight: 600; }

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */

.band { padding: 72px 0; border-top: 1px solid var(--line); }
.band-surface { background: var(--surface); }

.band h1,
.band h2 {
  font-family: var(--display);
  font-size: clamp(27px, 3.4vw, 36px);
  letter-spacing: -0.022em; line-height: 1.14;
  font-weight: 600; margin: 0 0 14px;
}
.band .intro { font-size: 17px; color: var(--ink-2); max-width: 60ch; margin: 0 0 40px; }

/* services — asymmetric, not identical cards */
.services { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }

.svc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
}
.band-surface .svc { background: var(--paper); }
.svc-lead { grid-column: span 7; }
.svc-side { grid-column: span 5; }
.svc-third { grid-column: span 4; }

.svc h3 {
  font-family: var(--display);
  font-size: 20px; font-weight: 600; letter-spacing: -0.015em;
  margin: 0 0 9px;
}
.svc p { margin: 0; color: var(--ink-2); font-size: 15px; }
.svc ul { margin: 14px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; }
.svc li { margin-bottom: 5px; }

/* how it works — a real sequence, so numbers are earned */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: s; }
.step { counter-increment: s; }
.step::before {
  content: counter(s);
  display: block; font-family: var(--display); font-size: 15px;
  color: var(--up); font-weight: 600; margin-bottom: 10px;
  border-top: 2px solid var(--up); padding-top: 10px; width: 100%;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.step p { margin: 0; font-size: 14.5px; color: var(--ink-2); }

/* templates list */
.tpl-list { border-top: 1px solid var(--line); }
.tpl-row {
  display: grid; grid-template-columns: 210px 1fr auto;
  gap: 24px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.tpl-row .src { font-size: 13px; color: var(--muted); }
.tpl-row h3 { margin: 0 0 3px; font-size: 16.5px; font-weight: 600; }
.tpl-row p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.tpl-row .state { font-size: 12.5px; color: var(--up); background: var(--up-wash); padding: 3px 10px; border-radius: 100px; white-space: nowrap; }
.tpl-row .state.soon { color: var(--muted); background: var(--paper); border: 1px solid var(--line); }
.band-surface .tpl-row .state.soon { background: var(--surface); }

/* privacy block — the one place we go dark */
.stance {
  background: var(--ink); color: #dfe6e2;
  border-radius: var(--radius-lg);
  padding: 46px 44px;
}
.stance h2 { color: #fff; margin-bottom: 16px; }
.stance p { color: #b9c5c0; max-width: 60ch; margin: 0 0 14px; font-size: 16px; }
.stance ul { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.stance li { padding-left: 22px; position: relative; color: #cfd9d5; font-size: 15px; }
.stance li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
}

/* pricing note */
.price-note {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: start;
}
.price-figure {
  font-family: var(--display); font-size: 46px; line-height: 1;
  letter-spacing: -0.03em; font-weight: 600; margin: 0 0 8px;
}

/* ------------------------------------------------------------
   Blog
   ------------------------------------------------------------ */

.post-list { border-top: 1px solid var(--line); }
.post-item {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.post-item:hover h2 { color: var(--up); }
.post-meta { font-size: 13px; color: var(--muted); }
.post-meta .tag { display: block; color: var(--ink-2); margin-bottom: 3px; }
.post-item h2 {
  font-family: var(--display); font-size: 21px; font-weight: 600;
  letter-spacing: -0.018em; margin: 0 0 6px; line-height: 1.25;
}
.post-item p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 68ch; }

/* article */
.article { padding: 60px 0 80px; }
.article h1 {
  font-family: var(--display);
  font-size: clamp(30px, 4.2vw, 42px);
  letter-spacing: -0.028em; line-height: 1.1; font-weight: 600;
  margin: 0 0 16px;
}
.article-meta { font-size: 14px; color: var(--muted); margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.article-body { font-size: 17px; line-height: 1.72; }
.article-body p { margin: 0 0 20px; max-width: 72ch; }
.article-body h2 {
  font-family: var(--display); font-size: 23px; font-weight: 600;
  letter-spacing: -0.018em; margin: 38px 0 12px;
}
.article-body ul { margin: 0 0 22px; padding-left: 20px; max-width: 72ch; }
.article-body li { margin-bottom: 8px; }
.article-body code {
  background: var(--surface); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 4px; font-size: 14.5px;
}
.article-body strong { font-weight: 600; }

.post-table {
  width: 100%; border-collapse: collapse; margin: 0 0 24px;
  font-size: 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.post-table th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.post-table td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); }
.post-table tr:last-child td { border-bottom: 0; }

.article-foot {
  margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------
   CTA + footer
   ------------------------------------------------------------ */

.cta-band { padding: 76px 0; border-top: 1px solid var(--line); text-align: center; }
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { color: var(--ink-2); max-width: 52ch; margin: 0 auto 26px; font-size: 17px; }

.foot { border-top: 1px solid var(--line); padding: 34px 0; font-size: 14px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot a { color: var(--ink-2); text-decoration: none; margin-left: 18px; }
.foot a:hover { color: var(--up); }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .services > * { grid-column: 1 / -1 !important; }
  .steps { grid-template-columns: 1fr 1fr; }
  .price-note { grid-template-columns: 1fr; gap: 24px; }
  .tpl-row { grid-template-columns: 1fr; gap: 6px; }
  .tpl-row .state { justify-self: start; }
}

@media (max-width: 620px) {
  .hero { padding: 52px 0 44px; }
  .band { padding: 52px 0; }
  .steps { grid-template-columns: 1fr; }
  .post-item { grid-template-columns: 1fr; gap: 8px; }
  .nav-links { gap: 14px; font-size: 14px; }
  .nav-links .hide-sm { display: none; }
  .stance { padding: 32px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
