/* Be My Friend AI. Brand per plan/03 §14: warm paper, ink, terracotta; Fraunces / Atkinson Hyperlegible / Caveat. */
:root {
  --paper: #FBF6EE; --paper-2: #F4ECDF; --ink: #2B2A33; --ink-soft: #5C5A66; --terracotta: #C2553B; --terracotta-dark: #9E412C;
  --sage: #4F7353; --sky: #DCE8F2; --ai: #5B5BD6; --line: #E8DFD1; --focus: #1f5fbf; --err: #A1261B; --btn-ink: #fff;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif; --sans: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Segoe Script', cursive; --r: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #1E1C22; --paper-2: #26232B; --ink: #F1ECE4; --ink-soft: #B8B2C0; --terracotta: #E07A5F; --terracotta-dark: #F09A82;
    --sage: #8FB394; --sky: #2A3340; --ai: #A5A3F5; --line: #3A3640; --focus: #8ab4ff; --err: #ff9b8f; --btn-ink: #1E1C22; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 var(--sans); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta-dark); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5.5vw, 2.9rem); margin: .2em 0 .45em; }
h2 { font-size: clamp(1.45rem, 4vw, 1.9rem); margin: 1.6em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.3em 0 .3em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: .35em; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 40rem; }
.center { margin-left: auto; margin-right: auto; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo .q { color: var(--terracotta); }
.tag-ai { display: inline-block; font-family: var(--sans); font-size: .62rem; font-weight: 700; letter-spacing: .06em; color: #fff; background: var(--ai); border-radius: 6px; padding: 1px 6px; vertical-align: .35em; margin-left: 4px; }
@media (prefers-color-scheme: dark) { .tag-ai { color: #1E1C22; } }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center; font-size: 1rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--terracotta-dark); text-decoration: underline; }
.staging { background: #3a2f00; color: #ffe9a6; text-align: center; font-size: .85rem; padding: 4px 16px; }

/* buttons */
.btn { display: inline-block; background: var(--terracotta); color: var(--btn-ink); font: 700 1.05rem/1.2 var(--sans); padding: 14px 24px; border-radius: 999px; border: 2px solid var(--terracotta); text-decoration: none; cursor: pointer; min-height: 48px; }
.btn:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); color: var(--btn-ink); }
.btn.ghost { background: transparent; color: var(--terracotta-dark); }
.btn.ghost:hover { background: var(--paper-2); }
.btn[disabled] { opacity: .6; cursor: wait; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 1.2em 0; }

/* hero */
.hero { display: grid; gap: 28px; padding: 32px 0 12px; align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.05fr .95fr; padding-top: 56px; } }
.hero .lede { font-size: 1.15rem; color: var(--ink-soft); }
.small { font-size: .92rem; color: var(--ink-soft); }
.photo { border-radius: var(--r); overflow: hidden; background: var(--paper-2); }
.photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
figure { margin: 0; }
figcaption { font-size: .8rem; color: var(--ink-soft); padding-top: 6px; }

/* sections */
.section { padding: 28px 0; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1em 0; padding: 0; list-style: none; }
.card { background: var(--sky); border-radius: var(--r); padding: 18px 20px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 52px; margin-bottom: 18px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--terracotta); color: var(--btn-ink); font: 700 1rem/36px var(--sans); text-align: center; }
.note { border-left: 4px solid var(--sage); background: var(--paper-2); padding: 14px 18px; border-radius: 0 var(--r) var(--r) 0; margin: 1.2em 0; }
.note.ai { border-left-color: var(--ai); }
.note.warn { border-left-color: var(--terracotta); }
.split { display: grid; gap: 28px; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }
.sig { font-family: var(--hand); font-size: 2.4rem; font-weight: 500; line-height: 1; color: var(--ink); margin: .2em 0 .6em; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1em 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* letters */
.letter-list { list-style: none; padding: 0; display: grid; gap: 18px; }
.letter-list a.item { display: grid; gap: 14px; text-decoration: none; color: inherit; background: var(--paper-2); border-radius: var(--r); padding: 14px; }
@media (min-width: 640px) { .letter-list a.item { grid-template-columns: 200px 1fr; } }
.letter-list h2 { margin: 0 0 .3em; font-size: 1.3rem; color: var(--terracotta-dark); }
.letter-list p { margin: 0; color: var(--ink-soft); }
.meta { font-size: .9rem; color: var(--ink-soft); }
.letter-body { font-size: 1.08rem; }
.footer-note { font-size: .9rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 1.5em; }

/* forms */
.form { max-width: 40rem; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend, .label { font-weight: 700; display: block; margin-bottom: 6px; padding: 0; }
.field { margin-bottom: 20px; }
.hint { display: block; font-size: .92rem; color: var(--ink-soft); margin: -2px 0 6px; }
input[type=text], input[type=email], select, textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 2px solid #8d8778; border-radius: 10px; padding: 11px 12px; min-height: 48px; }
textarea { min-height: 170px; resize: vertical; }
.checks { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--terracotta); }
.check span small { display: block; color: var(--ink-soft); font-size: .88rem; }
.cols { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.err { color: var(--err); font-weight: 700; font-size: .95rem; margin: 6px 0 0; }
.err:empty { display: none; }
[aria-invalid=true] { border-color: var(--err) !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.progress { font-size: .95rem; color: var(--ink-soft); margin-bottom: 8px; }
.combo { position: relative; }
.combo ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--paper); border: 2px solid #8d8778; border-radius: 10px; max-height: 300px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.combo li { padding: 10px; border-radius: 8px; cursor: pointer; margin: 0; }
.combo li[aria-selected=true], .combo li:hover { background: var(--sky); }
.counter { font-size: .88rem; color: var(--ink-soft); text-align: right; }
.status { padding: 14px 18px; border-radius: var(--r); background: var(--paper-2); }
.status.bad { border-left: 4px solid var(--err); }
.cf-turnstile { margin: 10px 0; min-height: 65px; }

/* step 7: question, map, cities */
.question { background: var(--paper-2); border-radius: var(--r); padding: 4px 20px 6px; }
.question h2, .question h3 { margin-top: .8em; }
.map-top { padding-left: 1.2em; }
.world { width: 100%; height: auto; display: block; background: var(--sky); border-radius: var(--r); }
.world path { fill: #cfc6b6; stroke: var(--paper); stroke-width: .6; }
.world path.on { fill: var(--terracotta); }
@media (prefers-color-scheme: dark) { .world path { fill: #4a4552; } }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: .92rem; color: var(--ink-soft); margin: 8px 0 0; padding: 0; list-style: none; }
.legend span { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; background: #cfc6b6; }
.legend .on span { background: var(--terracotta); }
.live { border-left: 4px solid var(--ai); background: var(--paper-2); padding: 14px 18px; border-radius: 0 var(--r) var(--r) 0; margin: 1.2em 0; }
.live strong { font-size: 1.1rem; }
.places { list-style: none; padding: 0; display: grid; gap: 12px; }
.places li { background: var(--paper-2); border-radius: var(--r); padding: 12px 16px; margin: 0; }
.places h3 { margin: 0 0 .2em; font-size: 1.1rem; }
.places p { margin: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { font-weight: 700; cursor: pointer; min-height: 24px; }
.faq details p { margin: .6em 0 0; }
.city-list { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.city-list a { display: block; background: var(--sky); border-radius: var(--r); padding: 16px 18px; text-decoration: none; color: var(--ink); min-height: 48px; }
.city-list a strong { font-family: var(--serif); font-size: 1.25rem; color: var(--terracotta-dark); display: block; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px; font-size: .92rem; color: var(--ink-soft); }
.foot p { max-width: 46rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0; }
.foot nav a { color: var(--ink); }
@media (max-width: 420px) { body { font-size: 17px; } .btn { width: 100%; text-align: center; } .cta-row { flex-direction: column; align-items: stretch; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
