:root {
  color-scheme: light;
  --bg: #eef3f9;
  --surface: #f8fbfe;
  --text: #12263f;
  --muted: #5c7089;
  --line: #d9e3f0;
  --brand: #2f6fd0;
  --brand-ink: #ffffff;
  --brand-soft: #dbe9fb;
  --ok: #1c7a46;
  --ok-soft: #e5f4ea;
  --info: #2a64c4;
  --info-soft: #dbe9fb;
  --warn: #a15408;
  --warn-soft: #fcefdc;
  --danger: #b03030;
  --danger-soft: #fbe8e8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 38, 63, 0.05), 0 2px 8px rgba(18, 38, 63, 0.04);
  --disp: 'Source Serif 4', Georgia, serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans-latin-wght-normal.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }

/* Dark mode disabled for now — site stays on light theme regardless of system preference. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
}
h1, h2, h3 { font-family: var(--disp); line-height: 1.15; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--brand); }
small, .hint { color: var(--muted); font-size: 0.85rem; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 0.5rem 1rem; z-index: 50; }
.skip:focus { left: 0; }

.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-family: var(--disp); font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 0.25rem; flex-wrap: wrap; flex: 1; }
.nav a { padding: 0.4rem 0.7rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--brand-soft); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.who { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--muted); }

main { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem 3rem; outline: none; }
.footer { text-align: center; padding: 1.5rem 1rem 2.5rem; color: var(--muted); font-size: 0.85rem; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }
.grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stack > * + * { margin-top: 0.75rem; }

.btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 0.5rem 0.95rem; border-radius: 8px; min-height: 40px;
}
.btn:hover { border-color: var(--brand); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 0.25rem 0.6rem; min-height: 32px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

input[type="text"], input[type="email"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
  font: inherit; width: 100%; padding: 0.5rem 0.65rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 0.85rem; }
.field > label, .labeled { display: block; font-weight: 600; font-size: 0.9rem; }
.field > label > *:not(span), .labeled > *:not(span) { margin-top: 0.3rem; font-weight: 400; }
.labeled span { display: block; }

.checks { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.checks.states { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 0.2rem 0.4rem; }
.check { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 400; font-size: 0.92rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; }

.badge {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.muted { background: var(--bg); color: var(--muted); border-color: var(--line); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.notice { padding: 0.7rem 0.9rem; border-radius: 8px; background: var(--info-soft); color: var(--text); margin-bottom: 0.9rem; }
.notice.warn { background: var(--warn-soft); }
.notice.error { background: var(--danger-soft); }

.hero { padding: 2.5rem 0 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.hero-badge { display: inline-flex; padding: 0.4rem 1rem; border-radius: 999px; background: var(--brand-soft); color: var(--info); font-size: 0.85rem; font-weight: 600; }
.hero h1 { font-size: 3rem; font-weight: 400; max-width: 18ch; line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
.hero h1 em { font-style: normal; font-weight: 700; color: var(--brand); }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 40ch; margin: 0; }
.hero .row { justify-content: center; }
.hero-tag { font-family: var(--disp); font-style: italic; font-size: 1.1rem; color: var(--warn); margin: 0; }
.match-stack { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 0.7rem; margin: 1rem auto 0; }
.match-card { border-radius: 16px; background: var(--text); color: var(--surface); padding: 1rem 1.4rem; display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; box-shadow: 0 16px 32px rgba(18,38,63,0.12); }
.match-card .role { font-family: var(--disp); font-size: 1.05rem; }
.match-card .meta { color: #9db4d6; font-size: 0.85rem; }
.match-ring { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.match-ring.ring-98 { background: conic-gradient(#1c7a46 0 98%, rgba(255,255,255,0.15) 98% 100%); }
.match-ring.ring-88 { background: conic-gradient(#1c7a46 0 88%, rgba(255,255,255,0.15) 88% 100%); }
.match-ring.ring-78 { background: conic-gradient(#e0a72a 0 78%, rgba(255,255,255,0.15) 78% 100%); }
.match-ring span { width: 31px; height: 31px; border-radius: 50%; background: var(--text); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.7rem; }
.stat-row { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; padding: 2rem 0; text-align: center; }
.stat-row .stat { flex: 1; min-width: 200px; max-width: 250px; padding: 1.75rem 1.4rem; border-radius: 20px; border: 1px solid; }
.stat-row .stat.stat-a { background: linear-gradient(160deg, #dbe9fb, var(--bg)); border-color: #c3d7f0; }
.stat-row .stat.stat-b { background: linear-gradient(160deg, #fdf1e7, var(--bg)); border-color: #f0d9bd; }
.stat-row .stat.stat-c { background: linear-gradient(160deg, #e5f4ea, var(--bg)); border-color: #c5e6d0; }
.stat-row .stat h4 { font-family: var(--disp); font-size: 1.4rem; font-weight: 700; margin: 0; }
.stat-row .stat.stat-a h4 { color: #1d4c9c; }
.stat-row .stat.stat-b h4 { color: var(--warn); }
.stat-row .stat.stat-c h4 { color: var(--ok); }
.stat-row .stat p { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 0; }
.points { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1.25rem 0; }
.points .card { margin: 0; }
.points { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1.25rem 0; }
.points .card { margin: 0; }

.result h3 { margin-bottom: 0.15rem; }
.tags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.4rem 0; }
.tag { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.05rem 0.45rem; font-size: 0.82rem; }

.messages { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.75rem 0 1rem; }
.msg { max-width: 82%; padding: 0.55rem 0.8rem; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--brand-soft); }
.msg.system { align-self: center; max-width: 92%; background: transparent; border-style: dashed; color: var(--muted); font-size: 0.9rem; }
.msg small { display: block; margin-bottom: 0.15rem; }

.board { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: start; }
.col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem; min-height: 120px; }
.col h3 { font-size: 0.95rem; display: flex; justify-content: space-between; }
.pcard { display: block; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.6rem; margin-top: 0.5rem; cursor: pointer; color: inherit; font: inherit; }
.pcard:hover { border-color: var(--brand); }
.pcard.alert { border-color: var(--warn); }

.stats { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.9rem; }
.stat b { display: block; font-size: 1.5rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tablewrap { overflow-x: auto; }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--bg); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.counter { text-align: right; }
.counter.over { color: var(--danger); font-weight: 600; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: 0.05rem 0.3rem; border-radius: 4px; }
.tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs .btn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 60; max-width: min(92vw, 380px); }
.toast { background: var(--text); color: var(--bg); padding: 0.6rem 0.9rem; border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .msg { max-width: 94%; }
  .topbar { gap: 0.5rem; }
}

a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--brand); }
a.btn { display: inline-block; text-decoration: none; }
.tabs a.btn { text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
details > summary { cursor: pointer; font-weight: 600; margin: 0.5rem 0; }
[hidden] { display: none !important; }

main.legal { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
main.legal h1 { margin-bottom: 0.75rem; }
main.legal h2 { margin-top: 1.5rem; }
main.legal ul, main.legal ol { padding-left: 1.4rem; margin: 0 0 0.75rem; }
main.legal li { margin-bottom: 0.3rem; }

progress.bar { width: 100%; height: 10px; border: 0; border-radius: 6px; overflow: hidden; background: var(--bg); accent-color: var(--brand); }
progress.bar::-webkit-progress-bar { background: var(--bg); border-radius: 6px; }
progress.bar::-webkit-progress-value { background: var(--brand); border-radius: 6px; }
progress.bar::-moz-progress-bar { background: var(--brand); border-radius: 6px; }

/* credentials, availability, review */
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.85rem; cursor: pointer; color: inherit; }
.chip.on { background: #dbeafe; border-color: #93b4e6; }
.chip:hover { border-color: #93b4e6; }
.chip-wrap { display: inline-block; margin: 0 0.3rem 0.3rem 0; }
.state-list { display: flex; flex-wrap: wrap; gap: 0.3rem; max-height: 11rem; overflow: auto; }
.linklike { background: none; border: 0; padding: 0; color: #2557a7; text-decoration: underline; cursor: pointer; font-size: 0.8rem; }
.cred-group { margin-bottom: 0.4rem; }
.tag.cred { display: inline-block; margin: 0.15rem 0.3rem 0.15rem 0; }
.avail-grid { display: grid; grid-template-columns: 4.5rem repeat(4, 1fr); gap: 0.25rem; align-items: center; max-width: 30rem; }
.avail-grid .cell { text-align: center; }
.avail-grid .head { font-size: 0.78rem; color: var(--muted, #667); text-align: center; }
.steps { display: flex; gap: 0.5rem; margin: 0 0 1rem; font-size: 0.85rem; color: var(--muted, #667); }
.steps .on { color: inherit; font-weight: 600; }
.tip { border-left: 3px solid #93b4e6; background: #f1f6fd; padding: 0.5rem 0.75rem; border-radius: 6px; margin: 0.4rem 0; }
.tip button { margin-left: 0.4rem; }
.preview { border: 1px dashed #93b4e6; border-radius: 10px; padding: 0.9rem; background: #fbfdff; }
.preview h3 { margin: 0.6rem 0 0.2rem; font-size: 0.95rem; }
details.section > summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0; }
details.section.problem > summary::after { content: ' · needs attention'; color: #b45309; font-weight: 500; font-size: 0.82rem; }
.review { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.review-panel { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow: auto; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } .review-panel { position: static; max-height: none; } }
.preview .hot { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 1px dashed transparent; border-radius: 10px; padding: 0.5rem 0.6rem; margin: 0.15rem 0; cursor: pointer; }
.preview .hot:hover { border-color: #93b4e6; background: #f1f6fd; }
.preview .hot.suggest { border-color: #cfe0f7; }
.preview .hot.current { border-color: #2557a7; background: #eaf2fd; }

/* ===== Mobile nav (checkbox-hack, JS-free) ===== */
.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle {
  display: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  order: 2;
}
.nav-toggle:hover { background: var(--bg); }

@media (max-width: 760px) {
  .topbar { position: sticky; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar .brand { order: 1; }
  .topbar .who { order: 3; }
  .topbar .nav {
    order: 4;
    flex-basis: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    gap: 0.15rem;
    transition: max-height 0.28s ease, opacity 0.2s ease;
  }
  #nav-toggle:checked ~ .nav {
    max-height: 60vh;
    opacity: 1;
    overflow-y: auto;
    transition: max-height 0.32s ease, opacity 0.28s ease;
  }
  .topbar .nav a.btn { width: 100%; text-align: left; border-radius: 10px; }
}

/* ===== Fluid typography ===== */
.hero h1 { font-size: clamp(1.9rem, 6vw + 0.6rem, 3rem); }
.hero p.lede { font-size: clamp(1rem, 2.4vw + 0.5rem, 1.15rem); }
.hero-tag { font-size: clamp(0.95rem, 1.6vw + 0.5rem, 1.1rem); }
.stat-row .stat h4 { font-size: clamp(1.15rem, 2.6vw + 0.5rem, 1.4rem); }

/* ===== Hover / tap micro-interactions ===== */
.btn, .card, a.card, .match-card, .stat-row .stat, .pcard {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(18,38,63,0.14); }
  .card:hover, a.card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(18,38,63,0.10); }
  .match-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 20px 40px rgba(18,38,63,0.18); }
  .stat-row .stat:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(18,38,63,0.10); }
}
.btn:active, .pcard:active { transform: scale(0.97); }
.match-card:active { transform: scale(0.99); }

/* ===== Entrance animation for hero content ===== */
@media (prefers-reduced-motion: no-preference) {
  .hero-badge, .hero h1, .hero p.lede, .hero .row, .hero-tag, .match-stack { animation: dc-rise 0.55s ease both; }
  .hero-badge { animation-delay: 0.02s; }
  .hero h1 { animation-delay: 0.08s; }
  .hero p.lede { animation-delay: 0.15s; }
  .hero .row { animation-delay: 0.2s; }
  .hero-tag { animation-delay: 0.25s; }
  .match-stack { animation-delay: 0.3s; }
  .match-stack .match-card { animation: dc-rise 0.5s ease both; }
  .match-stack .match-card:nth-child(1) { animation-delay: 0.34s; }
  .match-stack .match-card:nth-child(2) { animation-delay: 0.42s; }
  .match-stack .match-card:nth-child(3) { animation-delay: 0.5s; }
  .stat-row .stat { animation: dc-rise 0.5s ease both; }
  .stat-row .stat:nth-child(1) { animation-delay: 0.1s; }
  .stat-row .stat:nth-child(2) { animation-delay: 0.18s; }
  .stat-row .stat:nth-child(3) { animation-delay: 0.26s; }
}
@keyframes dc-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Extra breathing room + touch-friendly tap targets on small screens */
@media (max-width: 480px) {
  .hero { padding: 1.8rem 0 0.5rem; gap: 1.1rem; }
  .match-card { padding: 0.85rem 1.1rem; }
  .btn { padding: 0.65rem 1.1rem; }
  .stat-row { gap: 0.85rem; }
  .stat-row .stat { min-width: 45%; padding: 1.3rem 1rem; }
}
