/* Flow — warm, quiet, journal-like. One accent: ember. */

:root {
  /* After hack4impact.ch: warm paper, deep navy ink, Swiss red, a yellow highlighter. */
  --navy: #16213a;
  --red: #e2231a;
  --red-dark: #b81b14;
  --yellow: #ffd23f;

  --paper: #fbfaf7;
  --sheet: #ffffff;
  --ink: var(--navy);
  --ink-soft: #46516b;
  --ink-faint: #8d96ab;
  --rule: #e3dfd5;
  --tint: #f2efe8;
  --wash: #f7f5f0;
  --shadow: 0 1px 2px rgba(22, 33, 58, .06), 0 8px 24px rgba(22, 33, 58, .06);

  /* The one warm accent */
  --ember: var(--red);
  --ember-ink: #ffffff;
  --ember-hover: var(--red-dark);

  /* Excitement, cold → hot */
  --heat-1: #c4cad8;
  --heat-2: #8d96ab;
  --heat-3: var(--yellow);
  --heat-4: #f5822a;
  --heat-5: var(--red);
  --heat-off: #ebe7de;

  --goal: var(--ink-soft);
  --focus: var(--navy);
  --focus-soft: rgba(22, 33, 58, .12);

  --value-bg: var(--tint);
  --value-ink: var(--ink-soft);

  --noticed: var(--tint);
  --noticed-ink: var(--ink-soft);
  --exploring: #e6f4ea;
  --exploring-ink: #1e6b3a;
  --committed: #fde8e6;
  --committed-ink: var(--red-dark);

  --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

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

a { color: inherit; }

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand__mark {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 5px;
  background: var(--red);
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem 5rem;
}

/* ---------- Buttons & inputs ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 550;
  padding: .45rem 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.button:hover { border-color: var(--ink-faint); }

.button--accent {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--ember-ink);
}

.button--accent:hover { background: var(--ember-hover); border-color: var(--ember-hover); }

.button--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}

.button--quiet:hover { background: var(--tint); border-color: transparent; }

.input {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  padding: .6rem .8rem;
}

.input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-soft);
}

.input::placeholder { color: var(--ink-faint); }

.input--title {
  font-size: 1.35rem;
  font-weight: 600;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  padding: .4rem 0;
}

.input--title:focus { box-shadow: none; }

.input--area { resize: vertical; min-height: 6rem; }

.input--select { width: auto; padding-right: 2rem; }

.label {
  display: block;
  color: var(--ink-soft);
  font-size: .9rem;
  margin-bottom: .4rem;
}

/* ---------- Flash & empty ---------- */

.flash {
  margin: 0 0 1rem;
  padding: .55rem .9rem;
  border-radius: var(--radius);
  background: var(--value-bg);
  color: var(--value-ink);
  font-size: .9rem;
}

.flash--soft { background: var(--tint); color: var(--ink-soft); }

/* "Check your inbox to confirm …", with its Send again button inline */
.flash--confirm { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .75rem; }
.flash__button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}

.empty__lead {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

/* ---------- Filters ---------- */

.filters {
  display: flex;
  align-items: flex-start;
  gap: .25rem;
  margin: .5rem 0 1.25rem;
}

.filters__toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.filters__toggle:hover,
.filters__toggle[aria-expanded="true"] { background: var(--tint); color: var(--ink); }

/* A filter is on: the button says so even with the list closed. */
.filters__toggle.is-active { color: var(--red); }

.filters__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  min-height: 2rem;
  animation: filters-in .18s ease-out;
}

.filters__list[hidden] { display: none; }

@keyframes filters-in {
  from { opacity: 0; transform: translateX(-.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .filters__list { animation: none; }
}

.filter {
  color: var(--ink-faint);
  font-size: .875rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  text-decoration: none;
}

.filter:hover { color: var(--ink); }

.filter.is-current { background: var(--tint); color: var(--ink); }

/* ---------- Feed ---------- */

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.entry__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--sheet);
  border: 1px solid var(--rule);
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}

.entry__link:hover { border-color: var(--ink-faint); box-shadow: var(--shadow); }

.entry__body { min-width: 0; display: grid; gap: .3rem; }

.entry__title {
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .9rem;
}

.entry__aside {
  display: grid;
  justify-items: end;
  gap: .3rem;
  font-size: .8rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.entry--archived .entry__link { background: transparent; opacity: .55; }

@media (max-width: 540px) {
  .entry__link { grid-template-columns: auto 1fr; }
  .entry__aside { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; gap: .6rem; }
}

/* ---------- Excitement: embers ---------- */

.heat {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.heat__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--heat-off);
}

.heat--lg .heat__dot { width: 14px; height: 14px; }
.heat--lg { gap: 5px; }

.heat--1 .heat__dot.is-on { background: var(--heat-1); }
.heat--2 .heat__dot.is-on { background: var(--heat-2); }
.heat--3 .heat__dot.is-on { background: var(--heat-3); }
.heat--4 .heat__dot.is-on { background: var(--heat-4); }
.heat--5 .heat__dot.is-on { background: var(--heat-5); box-shadow: 0 0 6px color-mix(in srgb, var(--heat-5) 55%, transparent); }

.feed .heat { flex-direction: column-reverse; gap: 3px; }
.feed .heat__dot { width: 8px; height: 8px; }

/* ---------- Goal alignment ---------- */

.goal {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--ink-faint);
}

.goal__track {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--heat-off);
  overflow: hidden;
}

.goal__fill {
  display: block;
  height: 100%;
  background: var(--goal);
  border-radius: 2px;
}

/* Widths as classes, not style attributes, so the Content Security Policy needs no inline styles. */
.goal__fill--1 { width: 20%; }
.goal__fill--2 { width: 40%; }
.goal__fill--3 { width: 60%; }
.goal__fill--4 { width: 80%; }
.goal__fill--5 { width: 100%; }

/* ---------- Values ---------- */

.values { display: inline-flex; flex-wrap: wrap; gap: .3rem; }

.value {
  font-size: .75rem;
  color: var(--value-ink);
  background: var(--value-bg);
  border-radius: 999px;
  padding: .05rem .55rem;
}

.values--pick { margin-top: .6rem; }

.value--button {
  border: none;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

.value--button:hover { background: var(--yellow); color: var(--ink); }

/* ---------- Status pills ---------- */

.pill {
  display: inline-block;
  font-size: .72rem;
  font-weight: 550;
  letter-spacing: .01em;
  border-radius: 999px;
  padding: .08rem .6rem;
  background: var(--noticed);
  color: var(--noticed-ink);
}

.pill--exploring { background: var(--exploring); color: var(--exploring-ink); }
.pill--committed { background: var(--committed); color: var(--committed-ink); }
.pill--archived  { background: transparent; color: var(--ink-faint); border: 1px solid var(--rule); }

/* ---------- Sheets (form, detail) ---------- */

.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem;
}

@media (max-width: 540px) { .sheet { padding: 1.25rem; } }

.sheet__title {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.sheet__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.back {
  display: inline-block;
  color: var(--ink-faint);
  font-size: .875rem;
  text-decoration: none;
  margin-bottom: .75rem;
}

.sheet__top .back { margin: 0; }

.back:hover { color: var(--ink); }

/* ---------- Form ---------- */

.form { display: grid; gap: 1.5rem; }

.form__errors {
  margin: 0;
  padding: .75rem 1rem .75rem 2rem;
  border-radius: var(--radius);
  background: var(--tint);
  color: var(--ink-soft);
  font-size: .9rem;
}

.form__actions { display: flex; gap: .5rem; }

.scale__row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.scale__word {
  min-width: 11rem;
  font-size: .9rem;
  color: var(--ink-soft);
}

.range {
  flex: 1;
  max-width: 18rem;
  accent-color: var(--ink-soft);
}

.range--goal { accent-color: var(--goal); }
.range--heat { accent-color: var(--heat-3); }
.scale[data-level="1"] .range--heat { accent-color: var(--heat-1); }
.scale[data-level="2"] .range--heat { accent-color: var(--heat-2); }
.scale[data-level="4"] .range--heat { accent-color: var(--heat-4); }
.scale[data-level="5"] .range--heat { accent-color: var(--heat-5); }
.scale[data-level="5"] .range--heat + .scale__word { color: var(--committed-ink); font-weight: 550; }

@media (max-width: 540px) {
  .scale__row { flex-direction: column; align-items: stretch; gap: .25rem; }
  .range { max-width: none; }
}

.more summary {
  cursor: pointer;
  color: var(--ink-faint);
  font-size: .9rem;
  list-style: none;
}

.more summary::before { content: "+ "; }
.more[open] summary::before { content: "− "; }
.more[open] summary { margin-bottom: 1rem; }
.more .field + .field { margin-top: 1rem; }

.danger-zone {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

/* ---------- Detail ---------- */

.detail__title {
  margin: 0 0 1.25rem;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.signals {
  display: grid;
  gap: .6rem;
  margin: 0 0 1rem;
}

.signal {
  display: grid;
  grid-template-columns: 6rem 1fr;
  align-items: center;
}

.signal dt { color: var(--ink-faint); font-size: .85rem; }

.signal dd {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}

.signal .goal__track { width: 70px; height: 5px; }
.signal .goal__label { display: none; }

.signal__word { color: var(--ink-soft); font-size: .9rem; }

.detail__source { margin: 0; color: var(--ink-soft); font-style: italic; }

.detail__notes {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.detail__notes p { margin: 0 0 .75rem; }

/* ---------- Stages ---------- */

.stages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin: 1.75rem 0 0;
  padding: .75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stage__form { display: inline; }

.stage {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: .875rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  cursor: pointer;
}

button.stage:hover { background: var(--tint); color: var(--ink); }

.stage.is-current {
  background: var(--committed);
  color: var(--committed-ink);
  font-weight: 600;
  cursor: default;
}

.stage--adjacent { font-size: .8rem; }

.stages__arrow { color: var(--rule); font-size: .8rem; }

/* ---------- Action log (kanban) ---------- */

.log { margin-top: 2rem; }

.log__title {
  margin: 0 0 .9rem;
  font-size: 1rem;
  font-weight: 600;
}

.log__form {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 540px) { .log__form { flex-wrap: wrap; } }

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

@media (max-width: 640px) { .board { grid-template-columns: 1fr; } }

.board__column {
  background: var(--wash);
  border-radius: var(--radius);
  padding: .75rem;
}

.board__heading {
  margin: 0 0 .6rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

.board__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.board__empty { margin: 0; color: var(--rule); }

.card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: .6rem .75rem;
}

.board__column--completed .card { border-color: transparent; }

.card__body {
  margin: 0 0 .35rem;
  font-size: .925rem;
  overflow-wrap: anywhere;
}

.card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .75rem;
  color: var(--ink-faint);
}

.card__moves { display: inline-flex; gap: .1rem; }
.card__moves form { display: inline; }

.card__move {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  padding: 0 .3rem;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}

.card:hover .card__move, .card__move:focus-visible { opacity: 1; }
.card__move:hover { background: var(--tint); color: var(--ink); }

@media (hover: none) { .card__move { opacity: 1; } }

@media (max-width: 540px) {
  .masthead { padding-top: 1.25rem; }
  .signal { grid-template-columns: 5.5rem 1fr; }
  .signal dd { gap: .5rem; }
}

/* ---------- Masthead nav ---------- */

.masthead__nav { display: flex; align-items: center; gap: 1rem; }

.masthead__link {
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 550;
  text-decoration: none;
}

.masthead__link:hover, .masthead__link.is-current { color: var(--ink); }

.page-title {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

/* Small red label above a heading, and the yellow highlighter under one */
.eyebrow {
  margin: .5rem 0 .4rem;
  color: var(--red);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.highlight {
  background: linear-gradient(transparent 62%, var(--yellow) 62%, var(--yellow) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Goals list ---------- */

.goals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .6rem;
}

.goal-row__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}

.goal-row__link:hover { border-color: var(--ink-faint); box-shadow: var(--shadow); }

.goal-row__body { display: grid; gap: .2rem; min-width: 0; }

.goal-row__title { font-family: var(--display); font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }

.goal-row__description { color: var(--ink-soft); font-style: italic; font-size: .95rem; }

.goal-row__aside {
  display: grid;
  justify-items: end;
  gap: .3rem;
  flex: none;
  font-size: .8rem;
  color: var(--ink-faint);
}

.pill--default { background: var(--yellow); color: var(--ink); }

@media (max-width: 540px) {
  .goal-row__link { flex-direction: column; align-items: flex-start; }
  .goal-row__aside { justify-items: start; grid-auto-flow: column; gap: .6rem; }
}

/* ---------- A goal's page ---------- */

.goal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin: .5rem 0 1.25rem;
}

/* A long word in the title wraps instead of pushing Edit off a phone screen. */
.goal-head > div { min-width: 0; }
.goal-head > .button { flex-shrink: 0; }

.goal-head__title {
  overflow-wrap: break-word;
  hyphens: auto;
  margin: 0;
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
  letter-spacing: -.01em;
}

@media (max-width: 540px) { .goal-head__title { font-size: 1.75rem; } }

.goal-head__description {
  margin: .25rem 0 0;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- Goal picking in the opportunity form ---------- */

.goal-pick { display: grid; gap: 1rem; }

.goal-pick__choices {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.goal-pick__choices .label { width: 100%; padding: 0; }

.goal-chip { cursor: pointer; }

.goal-chip__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.goal-chip__label {
  display: inline-block;
  font-size: .9rem;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .35rem .9rem;
  transition: background .15s, border-color .15s;
}

.goal-chip:hover .goal-chip__label { border-color: var(--ink-faint); }

.goal-chip__input:checked + .goal-chip__label {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 550;
}

.goal-chip__input:focus-visible + .goal-chip__label { box-shadow: 0 0 0 3px var(--focus-soft); }

.goal-pick__name { color: var(--ink); font-style: normal; font-weight: 550; }

.check {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink-soft);
  font-size: .9rem;
  cursor: pointer;
}

.check__input { accent-color: var(--red); width: 1rem; height: 1rem; }

.entry__goal {
  font-size: .75rem;
  font-weight: 550;
  color: var(--exploring-ink);
}

.hint { margin: 0; color: var(--ink-faint); font-size: .875rem; }

/* ---------- Display type ---------- */

.detail__title, .empty__lead, .log__title, .input--title, .sheet__title {
  font-family: var(--display);
  letter-spacing: -.015em;
}

.detail__title { font-weight: 700; }
.sheet { box-shadow: var(--shadow); }

/* ---------- Signing in and settings ---------- */

.sheet__lead { margin: 0 0 1.5rem; color: var(--ink-soft); }

.tokens {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  gap: .6rem;
}

.tokens:not(:has(li)) { margin: 0; }

.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.token-row__body { display: grid; gap: .15rem; min-width: 0; }
.token-row__name { font-weight: 600; overflow-wrap: anywhere; }
.token-row__meta { color: var(--ink-faint); font-size: .85rem; }

.settings-section { margin-bottom: 2.5rem; }
.settings-section p { color: var(--ink-soft); }

.token-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.token-form .input { flex: 1 1 14rem; }

.token-note { margin: 0; font-size: .9rem; color: var(--ink-soft); overflow-wrap: anywhere; }

.token {
  margin: 0 0 .75rem;
  padding: .9rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: .8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.page-foot { margin: 2rem 0 0; text-align: center; font-size: .9rem; color: var(--ink-faint); }
.page-foot__link { color: var(--ink-faint); }

/* ---------- Inside the iOS app ---------- */

.native .page { padding-top: 1rem; }

/* The native navigation bar has its own back button. */
.native .back { display: none; }
.native .sheet__top { justify-content: flex-end; }

.native-actions {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1rem 0;
  display: flex;
  justify-content: flex-end;
}

/* When the app supports native buttons, the in-page fallback disappears. */
[data-bridge-components~="button"] .native-actions { display: none; }

/* Forms are saved with the ✓ in the navigation bar and closed with ✕. */
[data-bridge-components~="submit"] .form__actions { display: none; }
