/* Countkind website styles (WEBSITE_STYLE_v1, with WEBSITE_LAYOUT_v1 overriding where they differ).
   Colours come only from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
input, button, select, textarea { font-family: inherit; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body-phone-size);
  line-height: var(--body-phone-line);
  overflow-wrap: break-word;
}
@media (min-width: 768px) {
  body { font-size: var(--body-size); line-height: var(--body-line); }
}

/* Headings never split a word: no hyphenation and balanced lines (WEBSITE_LAYOUT_v1). The only exception is a
   single word wider than the whole line, which happens only at very large text settings (200% on a small
   phone): it may then wrap rather than push the page sideways (WEBSITE_STYLE_v1, 200% text). */
h1, h2 {
  font-family: var(--font-heading);
  font-variation-settings: var(--heading-axes);
  font-weight: 600;
  margin: 0 0 var(--s16);
  hyphens: none; -webkit-hyphens: none;
  overflow-wrap: break-word; word-break: normal;
  text-wrap: balance;
}
/* Years and dates in marketing text: Fraunces, so "2027" has no slashed zero (Atkinson slashes 0). */
.year { font-family: var(--font-heading); font-variation-settings: var(--heading-axes); }
h1 { font-size: var(--h1-phone-size); line-height: var(--h1-phone-line); }
h2 { font-size: var(--h2-phone-size); line-height: var(--h2-phone-line); }
@media (min-width: 768px) {
  h1 { font-size: var(--display-size); line-height: var(--display-line); }
  h2 { font-size: var(--h2-size); line-height: var(--h2-line); }
}
h3 {
  font-family: var(--font-body);
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  font-weight: 700;
  margin: 0 0 var(--s4);
}
p { margin: 0 0 var(--s16); }
ul, ol { margin: 0 0 var(--s16); }

a { color: var(--pine); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--pine-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: calc(var(--max-width) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
/* Text sections keep a readable line length but share the hero's left edge. */
.narrow > * { max-width: 44rem; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--surface); color: var(--ink); padding: var(--s12) var(--s16);
  min-height: var(--target); display: inline-flex; align-items: center;
}
.skip:focus { left: var(--s8); top: var(--s8); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header (WEBSITE_LAYOUT_v1): primary logo file, 56px tall on desktop and 46px on phones (the brand
   README's -small file below 160px wide); "Launching 2027" on the right in Fraunces. No button here. */
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s8) var(--s16);
  padding-top: var(--s16); padding-bottom: var(--s16);
}
.logo-link { display: inline-flex; align-items: center; min-height: var(--target); border-radius: var(--radius-chip); }
.logo-primary { display: block; width: auto; height: 46px; }
@media (min-width: 768px) { .logo-primary { height: 56px; } }
.launching {
  margin: 0; font-family: var(--font-heading); font-variation-settings: var(--heading-axes);
  font-weight: 600; font-size: 0.9375rem; line-height: 1.2; color: var(--pine); white-space: nowrap;
}
@media (min-width: 768px) { .launching { font-size: 1.125rem; } }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--target); min-width: var(--target);
  font-family: var(--font-body); font-size: var(--button-size); line-height: var(--button-line); font-weight: 700;
  padding: var(--s12) var(--s24); border-radius: var(--radius-pill); border: 2px solid var(--pine);
  background: var(--pine); color: var(--on-pine); cursor: pointer; text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--pine-deep); border-color: var(--pine-deep); color: var(--on-pine); }
.btn[disabled] { cursor: wait; }
.btn-outline { background: var(--surface); color: var(--pine); border-color: var(--border); padding: var(--s8) var(--s16); }
.btn-outline:hover { background: var(--surface); color: var(--pine-deep); border-color: var(--pine-deep); }

.signup { max-width: 34rem; }
.signup-row { display: flex; flex-wrap: wrap; gap: var(--s8); }
.signup input[type="email"] {
  flex: 1 1 14rem; min-width: 0; min-height: var(--target);
  font: inherit; color: var(--ink); background: var(--surface);
  padding: var(--s8) var(--s16); border: 2px solid var(--border); border-radius: var(--radius);
}
.signup input[type="email"]::placeholder { color: var(--muted); opacity: 1; }
.signup .btn { flex: 0 0 auto; }
@media (max-width: 519px) { .signup .btn { width: 100%; } }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.microcopy { font-size: var(--small-size); line-height: var(--small-line); color: var(--muted); margin: var(--s8) 0 0; }
.turnstile-slot:empty { display: none; }
.turnstile-slot { margin-top: var(--s8); }

/* Form problems: ink words, an icon, and the try-again colour only. Never red. */
.form-error {
  display: flex; gap: var(--s8); align-items: flex-start;
  color: var(--ink); font-size: var(--small-size); line-height: var(--small-line);
  margin: var(--s8) 0 0; padding-left: var(--s8); border-left: 3px solid var(--try-again);
}
.form-error:empty { display: none; }
.form-error::before {
  content: ""; flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: 0.125rem;
  background-color: var(--try-again);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm1 12H7v-2h2v2zm0-3.5H7V4h2v4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm1 12H7v-2h2v2zm0-3.5H7V4h2v4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hero (WEBSITE_LAYOUT_v1) */
.hero { padding: var(--s24) 0 var(--section-gap); }
.hero h1 { font-size: var(--hero-h1-phone); line-height: 1.1; margin-bottom: var(--s16); }
.hero-sub { font-size: 1.125rem; line-height: 1.55; max-width: 34em; margin-bottom: var(--s24); }
.hero .signup { max-width: 560px; }
.hero .signup input[type="email"], .hero .signup .btn, .final .signup input[type="email"], .final .signup .btn { min-height: 60px; }
.hero .signup-row, .final .signup-row { flex-direction: column; }
.hero .signup input[type="email"], .final .signup input[type="email"] { flex: 0 0 auto; width: 100%; }
.hero .signup .btn, .final .signup .btn { width: 100%; }
.hero .microcopy, .final .microcopy { font-size: 0.9375rem; line-height: 1.45; margin-top: 12px; }
.price-line {
  display: flex; flex-direction: column; gap: var(--s4);
  margin: 28px 0 0; font-size: 1rem; line-height: 1.5; color: var(--muted);
}
.price-line strong { color: var(--ink); font-weight: 700; }
.price-dot { display: none; }
.hero-figure { margin: var(--s32) 0 0; }
.hero-figure img { display: block; width: 100%; height: auto; }
.tablet-frame { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.hero-figure figcaption { margin-top: var(--s12); font-size: 0.875rem; line-height: 1.5; color: var(--muted); text-align: center; }
@media (min-width: 768px) {
  .hero { padding: 40px 0 88px; }
  .hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; column-gap: 64px; align-items: center; }
  .hero h1 { font-size: var(--hero-h1); line-height: 1.06; letter-spacing: -0.012em; }
  .hero-sub { font-size: 1.25rem; }
  .hero .signup-row, .final .signup-row { flex-direction: row; flex-wrap: nowrap; }
  .hero .signup input[type="email"], .final .signup input[type="email"] { flex: 1 1 auto; width: auto; }
  .hero .signup .btn, .final .signup .btn { width: auto; }
  .price-line { flex-direction: row; align-items: center; gap: var(--s12); }
  .price-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
  /* Desktop: the app screen inside a plain tablet frame drawn from tokens (ink bezel, camera dot in muted). */
  .hero-figure { margin: 0; justify-self: end; width: 100%; max-width: 460px; }
  .tablet-frame {
    position: relative; padding: 20px; background: var(--ink); border: 1px solid var(--line); border-radius: 36px; overflow: visible;
  }
  .tablet-frame::before {
    content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 8px; height: 8px; border-radius: 50%; background: var(--muted);
  }
  .tablet-frame img { border-radius: 16px; }
  .hero-figure figcaption { text-align: right; }
}

/* Five-counter motif: once, as a small divider before the final sign-up. */
.motif-divider { display: block; width: 5.5rem; height: auto; margin: 0 0 var(--s24); color: var(--pine); }

/* Sections */
section { padding: var(--section-gap) 0; }
.band { background: var(--pine-tint); }

/* "Sound familiar?": heading left, the three lines right with a hairline above each (desktop); one column on phones. */
.familiar-list { margin-bottom: var(--s24); }
.familiar .familiar-list li { background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: var(--s16) 0; margin: 0; font-size: 1.15em; }
.familiar-grid > div > p { max-width: 44rem; }
@media (min-width: 768px) {
  .familiar-grid { display: grid; grid-template-columns: 1fr 1.6fr; column-gap: 64px; align-items: start; }
}
.familiar-list, .steps { padding: 0; margin: 0 0 var(--s24); list-style: none; }
.familiar-list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s16); margin-bottom: var(--s12);
}
.steps { display: grid; gap: var(--s16); counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.steps li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s16) var(--s16) var(--s16) calc(var(--s16) + 2.5rem + var(--s12)); position: relative;
}
@media (min-width: 768px) {
  .steps li { padding: var(--s24) var(--s24) var(--s24) calc(var(--s24) + 2.5rem + var(--s12)); }
  .steps li::before { left: var(--s24) !important; top: var(--s24) !important; }
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: var(--s16); top: var(--s16); width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--pine); color: var(--on-pine); font-family: var(--font-body); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: var(--body-size);
}
.steps p { margin: 0; }
.price { white-space: nowrap; }

.faq-item + .faq-item { margin-top: var(--s24); }
.faq dt { font-weight: 700; }
.faq dd { margin: var(--s4) 0 0; }

/* Footer: secondary logo (pine wordmark on paper). */
.site-footer {
  border-top: 1px solid var(--line); padding: var(--s32) 0 var(--s48);
  font-size: var(--small-size); line-height: var(--small-line); color: var(--muted);
}
.footer-logo { margin: 0 0 var(--s12); }
.footer-logo img { display: block; width: 168px; height: auto; }
.site-footer p { margin: 0 0 var(--s4); }
.footer-links { display: flex; flex-wrap: wrap; column-gap: var(--s16); list-style: none; padding: 0; margin: 0; }
.footer-links a, .back-link, .partner-link {
  display: inline-flex; align-items: center; min-height: var(--target); color: var(--pine);
}

/* Simple pages */
.page { padding: var(--s32) 0 var(--s48); }
.page h2 { margin-top: var(--s32); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s16); margin: var(--s24) 0;
}
@media (min-width: 768px) { .card { padding: var(--s24); } }
.card h2 { margin-top: 0; }

/* Switched-off sections (rendered only when their flag is on) */
.chips { display: flex; flex-wrap: wrap; gap: var(--s8); border: 0; padding: 0; margin: 0 0 var(--s16); }
.chips { margin-bottom: var(--s24); }
.chips legend { font-weight: 700; margin-bottom: var(--s8); padding: 0; }
.legend-note { display: block; font-weight: 400; font-size: var(--small-size); line-height: var(--small-line); color: var(--muted); }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--s16);
  border: 2px solid var(--border); border-radius: var(--radius-chip); background: var(--surface); cursor: pointer;
}
.chip input:checked + span { border-color: var(--pine); background: var(--pine-tint); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.field { margin-bottom: var(--s16); }
.field label { display: block; font-weight: 700; margin-bottom: var(--s8); }
.field select, .field textarea {
  width: 100%; min-height: var(--target); font: inherit; color: var(--ink); background: var(--surface);
  padding: var(--s8) var(--s12); border: 2px solid var(--border); border-radius: var(--radius);
}
