/* Kaleido — public site + sign-up. Per-hobby colors come from /themes/<slug>.css (--theme-*). */
:root {
  --bg: #faf9fd;
  --surface: #ffffff;
  --text: #1d1b29;
  --muted: #625f75;
  --border: #e4e2ee;
  --brand: #6d4aff;
  --brand-text: #ffffff;
  --ok-bg: #e4f6ec;   --ok-text: #11663a;
  --warn-bg: #fff4d6; --warn-text: #7a5300;
  --err-bg: #fde7e9;  --err-text: #9b1c2c;
  --info-bg: #ece9ff; --info-text: #3b2a9c;
  --theme-primary: var(--brand);
  --theme-accent: #f97316;
  --theme-tint: #f4f0ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 16, 40, .06), 0 6px 24px rgba(20, 16, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121119;
    --surface: #1c1a26;
    --text: #edecf4;
    --muted: #a5a2b8;
    --border: #2e2b3c;
    --brand: #9d86ff;
    --brand-text: #121119;
    --ok-bg: #12321f;   --ok-text: #8fe0b0;
    --warn-bg: #3a2e0c; --warn-text: #f5d27a;
    --err-bg: #3e161c;  --err-text: #ffa3ae;
    --info-bg: #221d45; --info-text: #c2b6ff;
    --shadow: none;
    color-scheme: dark;
  }
  /* Theme tints are light colors: on dark backgrounds use a dark tint of the hobby color and light text */
  .themed .self-card, .themed .signup-head, .themed .cta-theme, body .cta-theme, body .avatar-card { background: color-mix(in srgb, var(--theme-primary) 18%, var(--surface)); color: var(--text); }
  .themed .self-card-fantasy { background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 20%, var(--surface)), color-mix(in srgb, var(--theme-accent) 22%, var(--surface))); }
  /* Hobby colors can be dark (browns, navies): lighten them for small labels on dark surfaces */
  /* Links and labels in the hobby color: lightened so they keep 4.5:1 on dark surfaces */
  body a, body .eyebrow, .themed .self-card .eyebrow { color: color-mix(in srgb, var(--theme-primary) 55%, #fff); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--theme-primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.15rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--theme-primary); margin-bottom: .4em; }
.error-text { color: var(--err-text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
main { min-height: 60vh; padding-bottom: 48px; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.35rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 8px; }
.logo img { width: 36px; height: 36px; display: block; }
.site-header nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-header nav a:not(.btn) { color: var(--text); text-decoration: none; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0 16px; }
.footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  background: var(--brand); color: var(--brand-text); border: 2px solid var(--brand); border-radius: 999px; padding: 10px 22px;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-small { padding: 6px 16px; font-size: .9rem; }
.btn-large { padding: 14px 30px; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--theme-primary); border-color: currentColor; }
.btn-theme { background: var(--theme-primary); border-color: var(--theme-primary); color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Heroes */
.home-hero { padding: 72px 0 48px; background: radial-gradient(1200px 400px at 80% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent); }
.home-hero h1 { max-width: 760px; }
.home-hero .lead { max-width: 640px; }
.theme-hero { color: #fff; background-color: var(--theme-primary); background-size: cover; background-position: center; padding: 56px 0 64px; }
.theme-hero a:not(.btn) { color: #fff; }
.theme-hero .eyebrow { color: #fff; opacity: .9; }
.theme-hero h1 { max-width: 700px; text-shadow: 0 2px 16px rgba(0, 0, 0, .25); }
.theme-hero .lead { max-width: 560px; }
.theme-hero .btn-theme { background: #fff; color: var(--theme-primary); border-color: #fff; }
.members { font-weight: 600; opacity: .95; }
.breadcrumbs { margin-bottom: 16px; color: var(--muted); }
.theme-hero .breadcrumbs { color: rgba(255, 255, 255, .85); }
.page-head { padding-top: 40px; }

/* Sections */
.how, .category, .hobby-intro, .two-selves, .cta-band { margin-top: 48px; }
.hobby-intro { max-width: 760px; }
.steps-grid { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.steps-grid li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); counter-increment: step; }
.steps-grid li::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--theme-primary); color: #fff; font-weight: 700; margin-bottom: 8px; }
.steps-grid strong { display: block; }
.cta-band { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 16px; }
.cta-theme { background: var(--theme-tint); border-color: transparent; color: var(--text); }

/* Hobby cards */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hobby-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease; }
.hobby-card:hover { transform: translateY(-2px); }
.hobby-card img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; }
.hobby-card-body { display: block; padding: 12px 14px 16px; }
.hobby-card-title { display: block; font-weight: 700; font-size: 1.05rem; }
.hobby-card-tagline { display: block; color: var(--muted); font-size: .9rem; }

/* Two selves */
.two-selves { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.self-card { background: var(--theme-tint); color: var(--text); border-radius: var(--radius); padding: 22px 24px; }
.self-card .eyebrow { color: var(--theme-primary); }
.self-card-fantasy { background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 14%, #fff), color-mix(in srgb, var(--theme-accent) 18%, #fff)); }
blockquote { margin: 0; font-style: italic; }

/* Forms & sign-up */
.signup { padding-top: 32px; }
.narrow-inner { max-width: 620px; }
.signup-head { background: var(--theme-tint); color: #1d1b29; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px; }
.signup-head a { color: var(--theme-primary); }
.progress { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; }
.progress li { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: #625f75; }
.progress li.is-done { color: #1d1b29; }
.progress li.is-current { background: var(--theme-primary); color: #fff; font-weight: 700; }
.form { display: grid; gap: 14px; margin: 16px 0; }
.form label { display: grid; gap: 4px; font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); width: 100%;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--theme-primary); }
input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--theme-primary) 55%, transparent); outline-offset: 2px; }
input[readonly] { opacity: .7; }
[aria-invalid="true"] { border-color: var(--err-text); }
.hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
.field-error { color: var(--err-text); font-size: .9rem; margin: -8px 0 0; }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form label.check input { margin-top: 5px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 6px; }
.option, .option-inline { display: flex !important; gap: 10px; align-items: center; font-weight: 400 !important; }
.option-inline { display: inline-flex !important; margin-right: 16px; }
.option { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; cursor: pointer; }
.option-card { align-items: flex-start; }
.option-card input { margin-top: 6px; }
.city-results:empty { display: none; }
.gender-custom { margin-top: 10px; }
.avatar-soon { border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px; }
.avatar-soon p { margin: 4px 0 0; }
.hobby-pick { margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex !important; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 500 !important; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--theme-primary); background: color-mix(in srgb, var(--theme-primary) 12%, var(--surface)); }

/* Review / account */
.review-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 16px 0; }
.review-card { background: var(--theme-tint); color: #1d1b29; border-radius: var(--radius); padding: 18px 20px; }
.review-card h2 { margin-bottom: 4px; }
.review-card .muted { color: #625f75; }
.review-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 16px 0 24px; }
.review-list dt { font-weight: 700; }
.review-list dd { margin: 0; }
@media (max-width: 520px) { .review-list { grid-template-columns: 1fr; } .review-list dd { margin-bottom: 8px; } }
.status-card { border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.status-info { background: var(--info-bg); color: var(--info-text); }
.status-ok { background: var(--ok-bg); color: var(--ok-text); }
.status-error { background: var(--err-bg); color: var(--err-text); }

/* Flash */
.flashes { padding-top: 16px; }
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.flash-success { background: var(--ok-bg); color: var(--ok-text); }
.flash-warning { background: var(--warn-bg); color: var(--warn-text); }
.flash-error { background: var(--err-bg); color: var(--err-text); }
.flash-info { background: var(--info-bg); color: var(--info-text); }

/* Legal */
.prose { max-width: 760px; padding-top: 40px; }

/* Catalog of 140+ hobbies: see-all links and the filter box */
.see-all { margin: 12px 0 0; font-weight: 600; }
.hobby-filter { margin-top: 24px; }
.hobby-filter input, .hobby-pick-filter { max-width: 520px; }
input[data-filter] { margin-bottom: 8px; }
[data-filter-item][hidden], [data-filter-group][hidden] { display: none !important; }

/* Avatars (Phase 2) */
.rules { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.rules ul { margin: 6px 0 0; padding-left: 18px; }
.avatar-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 8px; }
.avatar-card { background: var(--theme-tint); color: var(--text); border-radius: var(--radius); padding: 18px 20px; text-align: center; }
.avatar-card .form { text-align: left; }
.avatar-card .btn-ghost { color: var(--theme-primary); }
.avatar { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; margin: 4px auto 10px; display: block; border: 4px solid #fff; box-shadow: var(--shadow); background: #fff; }
.avatar-small { width: 96px; height: 96px; margin: 0 0 8px; border-width: 3px; }
.avatar-empty { display: grid; place-items: center; font-size: 4rem; font-weight: 800; color: var(--theme-primary); background: color-mix(in srgb, var(--theme-primary) 12%, #fff); }
.pending-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .75); border: 1px dashed #a5a2b8; }
.pending-box p { margin: 4px 0; }

/* Discovery (Phase 4) */
.discover { padding-top: 28px; }
.filters-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; margin-bottom: 24px; }
.filters-form fieldset { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters-form legend { width: 100%; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-row label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.filter-row input[type="number"] { width: 90px; }
.filter-row .grow { flex: 1 1 220px; }
.filters-form details summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.filters-form .chips { margin-bottom: 8px; }
.people-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 20px; }
.person-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.person-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.person-card.is-real { border-color: var(--brand); }
.person-body { display: grid; gap: 2px; padding: 10px 12px 14px; }
.person-kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.person-name { font-weight: 700; font-size: 1.05rem; }
.person-meta { font-size: .85rem; color: var(--muted); }
.person-bio { font-size: .9rem; }
.pager { display: flex; gap: 10px; justify-content: center; }
.person-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.person-head h1 { margin: 0; }
.badge-match, .badge-soft { padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .85rem; }
.badge-match { background: var(--ok-bg); color: var(--ok-text); }
.badge-soft { background: var(--info-bg); color: var(--info-text); }
.chip-common { border-color: var(--theme-primary); font-weight: 700; }
a.chip { text-decoration: none; color: var(--text); }
.actions-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 20px 0; }
.h3 { font-size: 1.15rem; margin-top: 24px; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.inline-form { display: inline; }

/* Chats (Phase 5) */
.unread { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: var(--brand-text); font-size: .75rem; font-weight: 700; text-align: center; }
.chat-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.chat-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.chat-item.invitation { border-color: var(--brand); }
.chat { padding-top: 24px; }
.chat-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.chat-head h1 { margin: 0; font-size: 1.6rem; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; margin-top: 16px; }
@media (max-width: 820px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 320px; display: flex; flex-direction: column; }
.messages { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; flex: 1; align-content: start; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.mine { justify-content: flex-end; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.bubble { max-width: min(520px, 80%); background: var(--bg); border-radius: 14px 14px 14px 4px; padding: 8px 12px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.msg.mine .bubble { background: color-mix(in srgb, var(--brand) 16%, var(--surface)); border-radius: 14px 14px 4px 14px; }
.msg-name { font-weight: 700; font-size: .8rem; }
.msg-meta { font-size: .72rem; color: var(--muted); }
.msg-meta a { color: var(--muted); }
.msg-system { text-align: center; font-size: .8rem; color: var(--muted); }
.hidden-note { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 6px 10px; }
.composer { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.composer textarea { flex: 1; }
.chat-side { display: grid; gap: 12px; align-content: start; }
.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.member-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.side-actions { align-items: center; }
.inline-invite { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 20px; }
.inline-invite label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }

/* Non-blocking "confirm your email" reminder on the home page */
.verify-banner { margin-top: 20px; }
.verify-banner h2 { margin-top: 0; font-size: 1.15rem; }
.verify-banner form { margin: 0; }

/* Pictures step: the whole avatar is the file picker; one "Continue" uploads both */
.avatar-pick { display: grid; justify-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.avatar-pick input[type=file] { width: 100%; max-width: 260px; font-size: .85rem; }
.avatar-pick:hover .avatar, .avatar-pick:focus-within .avatar { outline: 3px solid var(--theme-primary); outline-offset: 2px; }
.avatar-pick-text { color: var(--theme-primary); }
.saved-note { color: var(--ok-text); font-weight: 600; margin: 0; }

/* Plans & checkout modal */
.plans-page { padding-top: 32px; }
.plan-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 24px 0; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: grid; gap: 6px; align-content: start; box-shadow: var(--shadow); }
.plan-card h2 { margin: 0; }
.plan-featured { border: 2px solid var(--brand); }
.plan-price { font-size: 2rem; font-weight: 800; margin: 0; }
.plan-features { padding-left: 18px; margin: 8px 0 12px; display: grid; gap: 4px; }
.plan-current { color: var(--ok-text); font-weight: 700; margin: 0; }
.checkout-modal { width: min(560px, calc(100vw - 32px)); height: min(720px, calc(100vh - 40px)); padding: 0; border: none; border-radius: var(--radius); background: var(--surface); color: var(--text); }
.checkout-modal::backdrop { background: rgba(10, 8, 20, .6); }
.checkout-modal[open] { display: flex; flex-direction: column; }
.checkout-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.checkout-modal iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.profile-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 16px 0 28px; }
.profile-item.in-search { outline: 3px solid var(--theme-primary); }
.avatar-small { width: 96px; height: 96px; }
.identity-form { padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* Contact note on the home page */
.support-note { text-align: center; margin: 32px auto 48px; }
.support-note h2 { margin-bottom: 4px; }
.support-note a { font-weight: 700; }

/* Plans teaser on the home page */
.plans-teaser { text-align: center; margin-top: 48px; }
.plans-teaser p { max-width: 640px; margin: 0 auto 16px; }
@media (max-width: 520px) { .site-header nav { gap: 10px 14px; font-size: .95rem; } }
