/* FairFeed · Munich demo. Light only: white ground, Consul blue as the brand.
   Design source: the "FairFeed in Consul Blue" mockup (2026-09-14). */

/* Self-hosted, so the page makes no call to a font service. */
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page:        #FFFFFF;
  --deck:        #F2F5F8;
  --surface:     #FFFFFF;
  --surface-2:   #F6F8FA;
  --ink:         #122230;
  --ink-soft:    #52616D;
  --ink-faint:   #84919B;
  --line:        #DDE4EA;
  --line-strong: #C5D0D8;
  --blue:        #1779BA;
  --blue-ink:    #0E5486;
  --blue-wash:   #E4EFF7;
  --green:       #1F7A4D;
  --green-wash:  #E2F1E8;
  --red:         #BF4330;
  --red-wash:    #F8E7E3;
  --amber:       #7A5A12;
  --amber-wash:  #F3EDDB;
  --gold:        #D4A21F;
  --gold-ink:    #6E5210;
  --gold-wash:   #FCF3D6;
  --card-shadow: 0 6px 18px rgba(16, 36, 54, 0.10), 0 1px 2px rgba(16, 36, 54, 0.06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

/* ─── SCREEN SHELL ────────────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  /* an embedding frame that sizes itself to its content makes 100dvh
     collapse to nothing; this keeps the screen visible there */
  min-height: 560px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  overflow: hidden;
}
@media (min-width: 520px) {
  .screen { border-inline: 1px solid var(--line); }
}

.debug-strip {
  flex-shrink: 0;
  background: var(--amber-wash);
  color: var(--amber);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 3px 8px;
}

.app-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.head-row { display: flex; align-items: center; gap: 9px; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.mark svg { display: block; }
.wordmark { font-weight: 600; font-size: 14.5px; letter-spacing: -0.005em; flex: 1; }
.chip-quiet {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 6px;
}

/* one bar for the three steps: brief → examples → feed */
.segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.seg { height: 3px; border-radius: 2px; background: var(--line); }
.seg.done { background: var(--blue); }

.step-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.step-count { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.info-btn {
  width: 24px; height: 24px; padding: 0; border: none; background: none; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; color: var(--ink-faint); border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.info-btn[aria-expanded="true"] { color: var(--blue); }
.info-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.info-pop, .app-body .info-pop {
  font-size: 13px; color: var(--ink); line-height: 1.45;
  background: var(--blue-wash); border-radius: 8px; padding: 8px 11px;
}

.finish {
  font-size: 11.5px; font-weight: 600; color: #FFFFFF;
  background: var(--blue); border: none; border-radius: 999px; padding: 4px 11px; cursor: pointer;
}
.reject-pill {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.reject-pill.live { color: var(--red); border-color: var(--red); background: var(--red-wash); }
.reject-pill.nudge { animation: nudge 420ms ease; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.app-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-body h1 {
  font-family: var(--serif); font-size: 23px; font-weight: 600;
  line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance;
}
.app-body p { font-size: 14.5px; line-height: 1.55; }
.soft { color: var(--ink-soft); }

/* ─── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  border: 1.5px solid var(--blue); border-radius: 999px; background: var(--blue); color: #FFFFFF;
  font-size: 15.5px; font-weight: 600; padding: 13px 18px; cursor: pointer; width: 100%;
}
.btn.ghost { background: var(--surface); color: var(--blue-ink); }
.btn:disabled { background: var(--line-strong); border-color: var(--line-strong); color: #FFFFFF; cursor: not-allowed; }
.btn.push { margin-top: auto; }
.btn:focus-visible, .swipe-btn:focus-visible, .finish:focus-visible, .readmore:focus-visible, .deck:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* ─── CONSENT ─────────────────────────────────────────────────── */
.terms { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.term { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding-block: 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.term dt { font-weight: 600; }
.term dd { color: var(--ink-soft); }
.choice { display: flex; flex-direction: column; gap: 9px; margin-top: auto; padding-top: 6px; }

/* ─── BRIEF ───────────────────────────────────────────────────── */
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { display: flex; gap: 10px; align-items: flex-start; }
.note-mark { flex-shrink: 0; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; margin-top: 1px; }
.note-mark.warn { background: var(--amber-wash); color: var(--amber); }
.note-mark.ai { background: var(--blue-wash); color: var(--blue-ink); }
.note p { font-size: 13px; color: var(--ink-soft); }
.note strong { color: var(--ink); font-weight: 600; }

.field {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 13px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  min-height: 150px;
  resize: vertical;
  outline: none;
}
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.field::placeholder { color: var(--ink-faint); }
.field-hint { font-size: 12.5px; color: var(--blue-ink); font-weight: 500; text-align: right; margin-top: -6px; }
.field-hint.warn { color: var(--ink-soft); }
.error { font-size: 13px; color: var(--red); background: var(--red-wash); border-radius: 8px; padding: 8px 10px; }

/* ─── BADGES ──────────────────────────────────────────────────── */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.badge-cat { background: var(--blue-wash); color: var(--blue-ink); }
.badge-guess { background: var(--surface); color: var(--ink-soft); border: 1px dashed var(--line-strong); }
.badge-guess b { color: var(--ink); font-weight: 600; }
.badge-lift { background: var(--gold-wash); color: var(--gold-ink); border: 1px solid var(--gold); flex-shrink: 0; line-height: inherit; }
button.badge-lift { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.badge-lift[aria-expanded="true"] { background: var(--gold); color: var(--ink); }
button.badge-lift:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.badge svg { display: block; }

/* lifted proposals: gold edge, and the eye opens one line saying why */
.card.lifted { border: 1.5px solid var(--gold); box-shadow: 0 0 0 3px var(--gold-wash), var(--card-shadow); }
.card.under.lifted { box-shadow: none; }
.lift-pop {
  position: absolute; top: 43px; left: 15px; right: 15px; z-index: 2;
  font-size: 13px; line-height: 1.45; color: var(--gold-ink);
  background: var(--gold-wash); border: 1px solid var(--gold); border-radius: 8px;
  padding: 8px 11px; box-shadow: var(--card-shadow);
}

/* ─── SWIPE DECK ──────────────────────────────────────────────── */
.deck { flex: 1; position: relative; background: var(--deck); overflow: hidden; outline: none; }

.card {
  position: absolute;
  inset: 14px 14px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 13px 15px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  will-change: transform;
}
.card:active { cursor: grabbing; }
.card.under { transform: translateY(8px) scale(0.965); pointer-events: none; }
.card.under > * { opacity: 0.35; }
.card.ghost { transform: translateY(8px) scale(0.965); pointer-events: none; box-shadow: none; background: var(--surface-2); }
.card.snap { transition: transform 220ms cubic-bezier(.2, .8, .2, 1); }
.card.fly { transition: transform 300ms ease-in, opacity 300ms ease-in; }

.card-img { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); pointer-events: none; flex-shrink: 0; }
.card-title { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.card-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.card.no-img .card-desc { -webkit-line-clamp: 11; }
.reason { border-left: 2px solid var(--blue); padding-left: 9px; font-size: 13px; color: var(--ink-soft); font-style: italic; }
.readmore { align-self: flex-start; background: none; border: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.stamp {
  position: absolute;
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 8px; border: 2px solid currentColor;
  background: var(--surface); opacity: 0; pointer-events: none; white-space: nowrap;
}
.stamp.more { top: 18px; left: 16px; color: var(--green); transform: rotate(-10deg); }
.stamp.less { top: 18px; right: 16px; color: var(--red); transform: rotate(10deg); }
.stamp.neutral { bottom: 18px; left: 50%; transform: translateX(-50%); color: var(--ink-soft); }

.swipe-bar {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 11px 14px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.swipe-row { display: flex; justify-content: center; align-items: center; gap: 24px; }
.swipe-btn {
  font-size: 21px; font-weight: 600; line-height: 1;
  width: 54px; height: 54px; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink-soft);
  box-shadow: 0 2px 6px rgba(16, 36, 54, 0.08);
  -webkit-tap-highlight-color: transparent;
}
.swipe-btn.neutral { width: 42px; height: 42px; font-size: 18px; }
.swipe-btn.less { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.swipe-btn.more { color: var(--green); border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.swipe-btn.locked { opacity: 0.45; border-style: dashed; color: var(--ink-faint); border-color: var(--line-strong); }
/* ─── CALIBRATION GRID ────────────────────────────────────────── */
/* Not the feed: a grid of four, its own Less / More under each photo. */
.cal-row { display: flex; align-items: center; gap: 8px; }
.cal-tag { flex: 1; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-ink); }
.app-body h1.cal-ask { font-size: 21px; }
/* minmax(0, 1fr) and min-width: 0, or a 900px photo widens its column past the screen */
.cal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cal-tile { position: relative; min-width: 0; background: var(--surface); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
/* the ring sits on top of photo and buttons, so a chosen state is never covered */
.cal-tile::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.cal-tile.more::after { box-shadow: inset 0 0 0 3px var(--green); }
.cal-tile.less::after { box-shadow: inset 0 0 0 3px var(--red); }
.cal-tile.less .cal-open { opacity: 0.55; }
.cal-tile.less .cal-img { filter: grayscale(0.8); }
.cal-open { flex: 1; display: flex; flex-direction: column; border: none; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--ink); }
.cal-img { width: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--deck); }
.cal-img.noimg { display: grid; place-items: center; font-size: 12px; color: var(--ink-faint); }
.cal-title { font-size: 13px; font-weight: 600; line-height: 1.3; margin: 7px 9px 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.duo { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.duo button {
  border: none; background: var(--surface); padding: 9px 2px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  -webkit-tap-highlight-color: transparent;
}
.duo button + button { border-left: 1px solid var(--line); }
.duo button.less[aria-pressed="true"] { background: var(--red-wash); color: var(--red); }
.duo button.more[aria-pressed="true"] { background: var(--green-wash); color: var(--green); }
.duo button:focus-visible, .cal-open:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.progress-line { text-align: center; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.progress-line strong { color: var(--ink-soft); font-weight: 600; }

/* ─── PROFILE ─────────────────────────────────────────────────── */
.profile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.profile-label { font-size: 10px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-faint); }
.profile-text { font-family: var(--serif); font-size: 19px; line-height: 1.42; }
.profile-text mark { background: var(--blue-wash); color: var(--blue-ink); border-radius: 3px; padding: 0 3px; }
.profile-wait { display: flex; flex-direction: column; gap: 8px; }
.profile-wait span { height: 14px; border-radius: 4px; background: var(--line); animation: pulse 1.2s ease-in-out infinite; }
.profile-wait span:nth-child(2) { width: 85%; }
.profile-wait span:nth-child(3) { width: 60%; }
@keyframes pulse { 50% { opacity: 0.45; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.chip.want { background: var(--blue-wash); color: var(--blue-ink); }
.chip.avoid { background: var(--red-wash); color: var(--red); }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tally div { border-radius: 10px; padding: 8px 6px; text-align: center; font-size: 11px; font-weight: 600; display: flex; flex-direction: column; gap: 1px; }
.tally b { font-size: 18px; font-variant-numeric: tabular-nums; }
.t-more { background: var(--green-wash); color: var(--green); }
.t-neut { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.t-less { background: var(--red-wash); color: var(--red); }

/* ─── END ─────────────────────────────────────────────────────── */
.status { font-size: 13.5px; border-radius: 10px; padding: 11px 13px; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.status.ok { background: var(--green-wash); color: var(--green); border-color: transparent; }
.status strong { font-variant-numeric: tabular-nums; }

/* ─── LOADING ─────────────────────────────────────────────────── */
.loading { flex: 1; display: grid; place-items: center; color: var(--ink-soft); font-size: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin 0.9s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── READ MORE ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(18, 34, 48, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface);
  width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.modal h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; padding-right: 36px; text-wrap: balance; }
.modal p { font-size: 15px; color: var(--ink-soft); line-height: 1.6; white-space: pre-line; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-size: 15px; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .reject-pill.nudge, .profile-wait span, .spinner { animation: none; }
  .card.snap, .card.fly { transition: none; }
}
