@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/young-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/young-serif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/atkinson-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/atkinson-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/atkinson-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/atkinson-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --oat: #F3EDE2;
  --card: #FFFCF6;
  --ink: #2B2622;
  --ink2: #6E645A;
  --rule: #E2D8C6;

  --diet: #C8553D;
  --fitness: #6B8F4E;
  --work: #3E5C76;
  --travel: #D9A441;
  --home: #C98B7B;
  --hobbies: #7A4E6E;
  --values: #2F7F7A;

  --gap: 16px;
  --sig-h: 140px;
  --card-shadow: 0 1px 0 #E2D8C6;
  --radius: 6px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--oat);
  color: var(--ink);
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

h1, h2, h3 { font-family: 'Young Serif', Georgia, serif; font-weight: 400; margin: 0; }

/* ---------- masthead ---------- */
.masthead { padding-top: 14px; }
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.site-name {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 28px;
  line-height: 1.1;
  color: var(--ink);
  text-decoration: none;
}
.tagline {
  margin: 10px 0 0;
  color: var(--ink2);
  font-size: 15px;
}

.btn-ink {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--card);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0 16px;
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.btn-ink:hover { background: #1d1917; }
.btn-ink.ghost { background: transparent; color: var(--ink); }

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  color: var(--ink2);
  font-family: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 8px 6px;
  min-height: 44px;
  white-space: nowrap;
}
.link-btn:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- your card ---------- */
.your-card { margin-top: 16px; }

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.panel-head h2 { font-size: 22px; }
.panel-sub { color: var(--ink2); font-size: 14px; margin: 0 0 14px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--oat);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 44px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: #a89a8b; }

.tag-groups { margin: 18px 0 6px; }
.tag-group { margin-bottom: 14px; }
.tag-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 0 14px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
  white-space: nowrap;
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] {
  color: var(--on, var(--card));
  background: var(--c, var(--ink));
  border-color: var(--c, var(--ink));
}

/* live signature preview */
.sig-preview {
  margin: 16px 0 4px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.sig-preview .sig { width: 88px; height: 110px; flex: none; }
.sig-preview-text { color: var(--ink2); font-size: 14px; }

.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

/* ---------- signature ---------- */
.sig {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.sig-bands {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 2px;
}
.sig-band { flex: 1 1 0; min-width: 0; }
.sig-initials {
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--card);
  color: var(--ink);
  font-family: 'Young Serif', Georgia, serif;
  font-size: 15px;
  line-height: 1;
  padding: 5px 7px;
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  border-top-right-radius: var(--radius);
}

/* ---------- filter bar ---------- */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 20px -20px 0;
  padding: 10px 20px 8px;
  background: var(--oat);
  border-bottom: 1px solid var(--rule);
}
.filter-row { display: flex; align-items: center; gap: 10px; }
.filter-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1 1 auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.filter-scroll::-webkit-scrollbar { height: 6px; }
.filter-scroll::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.cat-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.cat-chip .caret { color: var(--ink2); font-size: 11px; }
.cat-chip[aria-expanded="true"] { border-color: var(--ink); }

.tag-chip { --c: var(--ink); }
.tag-chip[aria-pressed="true"] { border-color: var(--c); }

.result-line {
  margin: 6px 0 2px;
  color: var(--ink2);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ---------- board ---------- */
.board {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  margin-top: var(--gap);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  will-change: transform;
}
.card .sig {
  width: 100%;
  height: var(--sig-h);
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}
.card .sig-initials { border-radius: 0; border-left: 0; }

.card-body { padding: 14px; min-width: 0; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.rank {
  color: var(--ink2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.match { text-align: center; flex: none; min-width: 64px; }
.match .num {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.match .lbl { display: block; color: var(--ink2); font-size: 12px; margin-top: 2px; }

.card-name { font-size: 20px; line-height: 1.2; }
.card-intro { margin: 4px 0 0; color: var(--ink); font-size: 15px; }
.card-desc {
  margin: 8px 0 0;
  color: var(--ink2);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--c);
  color: var(--ink);
  background: transparent;
}
.tag-pill.shared {
  background: var(--c);
  border-color: var(--c);
  color: var(--on);
}

.card.you { outline: 2px solid var(--ink); outline-offset: -2px; }

/* card display mode inside your-card panel */
.card-display { display: flex; flex-direction: column; gap: 12px; }
.card-display .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.badge-you {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
}
.card-display .body-row { display: flex; gap: 14px; }
.card-display .sig { width: 96px; height: 120px; flex: none; }
.card-display .text { min-width: 0; }
.card-display h3 { font-size: 20px; }

.empty {
  text-align: center;
  color: var(--ink2);
  padding: 40px 16px;
  font-size: 16px;
}

.foot {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--ink2);
  font-size: 13px;
}
.foot p { margin: 0; }

/* ---------- wider screens ---------- */
@media (min-width: 560px) {
  .card { flex-direction: row; }
  .card .sig {
    width: 124px;
    height: auto;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
    align-self: stretch;
  }
  .card .sig-initials { border-radius: 0; border-left: 0; }
}
@media (min-width: 760px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .card-body { padding: 16px; }
}
@media (min-width: 1080px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .chip { transition: none; }
  .chip:active { transform: none; }
  .card { transition: none !important; }
}
