/* Rankly: calm, system fonts only, no external requests.
   Text colours: heading, body, muted. Accent is for buttons and small marks only. */

:root {
  --bg: #F7F8F7;
  --alt: #EEF4F2;
  --card: #FFFFFF;
  --line: #D7E0DD;

  --heading: #14211F;
  --body: #4A5553;
  --muted: #7A8583;

  --accent: #0F5C4D;
  --accent-dark: #0B4A3E;

  --r-card: 20px;
  --r-btn: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 31, .05), 0 18px 40px -12px rgba(20, 33, 31, .14);

  --gap: 64px;
  --gutter: 20px;
  --wrap: 1120px;

  color-scheme: light;
}

@media (min-width: 720px) {
  :root { --gap: 96px; --gutter: 32px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 40px; }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 1.125rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p { max-width: 60ch; }

/* Links: plain, underlined, heading colour */
a {
  color: var(--heading);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 10px 14px;
  background: var(--heading);
  color: #fff;
  border-radius: var(--r-btn);
  z-index: 10;
}
.skip:focus { left: 8px; }

/* Headings */
h1, h2, h3 { color: var(--heading); }
h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
}
h2 {
  margin-bottom: 32px;
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.15;
}
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 0;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: .95rem; }
.btn-block { width: 100%; }

/* Header */
.site-header { padding: 20px 0; }
.bar { display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand-mark { color: var(--accent); }

/* Sections: 64px between them on mobile, 96px on desktop */
.section { padding: calc(var(--gap) / 2) 0; }
.section-alt { background: var(--alt); }
.section-sub { margin: -16px 0 32px; }

/* Hero */
.hero { padding: 24px 0 calc(var(--gap) / 2); }
.hero-grid { display: grid; gap: 48px; }
.lede {
  margin: 20px 0 32px;
  max-width: 30ch;
  font-size: 1.25rem;
  line-height: 1.5;
}
.hero-note { margin-top: 16px; font-size: .95rem; color: var(--muted); }

/* Example text thread: the one memorable element */
.example { width: 100%; max-width: 340px; }
.phone {
  padding: 14px 18px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.notch {
  display: block;
  width: 44px;
  height: 5px;
  margin: 0 auto 20px;
  background: var(--line);
  border-radius: 3px;
}
.thread { display: flex; flex-direction: column; gap: 12px; }
.event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--alt);
  border-radius: var(--r-btn);
  font-size: .95rem;
  color: var(--heading);
}
.event svg { flex: none; color: var(--accent); }
.bubble {
  max-width: 84%;
  padding: 10px 14px;
  font-size: 1rem;
  line-height: 1.45;
  border-radius: 16px;
}
.bubble-out {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble-in {
  align-self: flex-start;
  background: var(--alt);
  color: var(--heading);
  border-bottom-left-radius: 4px;
}
.example figcaption { margin-top: 14px; font-size: .9rem; color: var(--muted); }

/* How it works */
.steps { display: grid; gap: 28px; counter-reset: step; }
.steps li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--muted);
}

/* What you get */
.features { display: grid; gap: 20px 48px; max-width: 900px; }
.features li { position: relative; padding-left: 38px; color: var(--heading); }
.features li::before {
  content: "";
  position: absolute;
  left: 9px;
  top: .32em;
  width: 8px;
  height: 14px;
  border: solid var(--accent);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Pricing */
.price-card {
  max-width: 520px;
  padding: 32px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.price-big {
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--heading);
}
.price-then { margin-top: 12px; font-size: clamp(1.2rem, 5.2vw, 1.5rem); font-weight: 600; line-height: 1.3; color: var(--heading); }
.price-fine { margin-top: 12px; font-size: .95rem; }
.price-card .btn { margin-top: 28px; }
.also { margin-top: 28px; }

/* FAQ */
.faq { max-width: 720px; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  position: relative;
  padding: 20px 40px 20px 0;
  color: var(--heading);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .15s ease;
}
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
details p { padding-bottom: 20px; }

/* Form */
.form {
  display: grid;
  gap: 20px;
  max-width: 560px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.field { display: grid; gap: 8px; }
label { color: var(--heading); font-size: 1rem; font-weight: 600; }
input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  background: #fff;
  color: var(--heading);
  font: inherit;
  font-size: 1rem;
  border: 1.5px solid var(--muted);
  border-radius: var(--r-btn);
}
input:focus { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: #B42318; border-width: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; font-size: .95rem; color: var(--heading); }

/* Footer: one row on desktop */
.site-footer { padding: 32px 0 40px; border-top: 1px solid var(--line); font-size: .95rem; }
.foot { display: flex; flex-direction: column; gap: 12px; }
.foot p { max-width: none; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-footer a { color: var(--body); }

/* Privacy and Terms */
.legal { padding: 24px 0 calc(var(--gap) / 2); }
.legal .narrow > * { max-width: 42rem; }
.back { display: inline-block; margin-bottom: 32px; color: var(--body); text-decoration: none; }
.back:hover { text-decoration: underline; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); }
.legal .updated { margin-top: 12px; font-size: .95rem; color: var(--muted); }
.legal h2 { margin: 48px 0 12px; font-size: 1.375rem; }
.legal p { margin-top: 16px; }
.legal h2 + p { margin-top: 0; }
.legal ul { display: grid; gap: 8px; margin-top: 16px; padding-left: 1.25em; list-style: disc; }
.legal li::marker { color: var(--muted); }
.legal .back-end { margin: 48px 0 0; }
.legal .back-end .back { margin-bottom: 0; }

/* Tablet and up */
@media (min-width: 720px) {
  .site-header { padding: 28px 0; }
  .hero { padding-top: 40px; }
  h2 { margin-bottom: 40px; }
  .section-sub { margin-bottom: 40px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .steps li { display: block; padding-top: 24px; }
  .steps li::before { display: block; margin-bottom: 12px; }
  .features { grid-template-columns: repeat(2, 1fr); gap: 24px 48px; }
  .price-card { padding: 40px; }
  .form { padding: 32px; }
  .foot { flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
  .legal { padding-top: 32px; }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 340px; align-items: center; gap: 72px; }
}

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