/* Kinley — shared styles.
   Palette and card language from the brand kit; no build step, no webfonts,
   nothing loaded from a CDN. */

:root {
  --bg:         #FAF8F5;
  --surface:    #FFFFFF;
  --tint-navy:  #E8EDF3;
  --tint-sage:  #ECEEE1;
  --tint-clay:  #F7EDE7;

  --navy:       #1B2E44;
  --navy-deep:  #15273B;
  --navy-text:  #23405E;
  --ink:        #33404D;
  --ink-2:      #6B7885;
  --line:       #E4E0D9;

  --sage:       #9EA17A;
  --sage-text:  #5F6840;
  --clay:       #A45D3E;
  --on-dark:    #F7F4EF;

  --r-card: 26px;
  --r-inner: 16px;

  /* ui-rounded gives SF Pro Rounded on Apple devices — the same face the app
     uses. Everything after it is a graceful fallback; no webfont is loaded, so
     nothing can flash or fail. */
  --sans: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI",
          system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #101C28;
    --surface:   #17273A;
    --tint-navy: #1E3046;
    --tint-sage: #232C24;
    --tint-clay: #2E2119;
    --navy-text: #BCD2E8;
    --ink:       #E8E6E1;
    --ink-2:     #9AA7B4;
    --line:      #263749;
    --sage-text: #B7BB92;
    --clay:      #D08C68;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  /* Deliberately larger than a typical marketing site. The reader is often
     over fifty and often reading on a phone in a hospital corridor. */
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.2; }
h3 { font-size: 1.25rem; line-height: 1.3; }
p { margin: 0; }

a { color: var(--sage-text); text-underline-offset: 3px; }
a:hover { text-decoration: none; }

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

section { padding-block: clamp(3rem, 7vw, 5rem); }

.stack   { display: flex; flex-direction: column; gap: 1.25rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.55rem; }
.muted   { color: var(--ink-2); }
.prose   { max-width: 36rem; }

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.brand svg { width: 2.25rem; height: 2.25rem; color: var(--sage); flex: none; }
.brand .name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: var(--navy-text);
}

/* ---- Cards ---- */

.card {
  background: var(--tint-navy);
  border-radius: var(--r-card);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}
.card.sage  { background: var(--tint-sage); }
.card.clay  { background: var(--tint-clay); }
.card.plain { background: var(--surface); }

.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 44rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.grid-3 { display: grid; gap: 1rem; }
@media (min-width: 52rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 700;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  /* Generous target. Assume an unsteady hand. */
  min-height: 3.25rem;
}
.btn-primary { background: var(--navy); color: var(--on-dark); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-soft { background: var(--tint-sage); color: var(--sage-text); }
/* For secondary actions sitting ON a tinted card — btn-soft would be the same
   colour as the card and vanish. */
.btn-ghost { background: var(--surface); color: var(--navy-text); }
.btn-ghost:hover { background: var(--tint-navy); }
.btn-clay { background: var(--clay); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---- Forms ---- */

label.field { display: block; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }

input[type="text"] {
  font: inherit;
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: var(--r-inner);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 3.25rem;
}
input[type="text"]::placeholder { color: var(--ink-2); opacity: 0.7; }

.code-input {
  font-family: var(--mono);
  font-size: 1.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
}

/* ---- Rows ---- */

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding-block: 1rem;
}
.rows li + li { border-top: 1px solid var(--line); }
.bullet {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint-sage);
  color: var(--sage-text);
  font-weight: 700;
  font-size: 1rem;
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3.5rem;
  font-size: 1rem;
}
.footlinks { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* ---- Utility ---- */

.pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--tint-sage);
  color: var(--sage-text);
}
.center { text-align: center; }
.hidden { display: none !important; }

.doc h2 { margin-top: 2.5rem; }
.doc h3 { margin-top: 1.75rem; }
.doc p, .doc li { margin-top: 0.85rem; }
.doc ul { padding-left: 1.25rem; }
.doc { max-width: 42rem; }
