/* Nate & Nina. Mount Shasta at dusk: snowfield, ink, alpenglow, lamplight, juniper. */
/* Self-hosted fonts (SIL Open Font License, see fonts/OFL-*.txt) */
@font-face { font-family: 'Spectral'; src: url('fonts/spectral-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Spectral'; src: url('fonts/spectral-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Spectral'; src: url('fonts/spectral-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --snow: #F3F4F7;
  --paper: #FFFFFF;
  --ink: #22263A;
  --ink-2: #555B70;
  --line: #DADDE6;
  --rose: #B95468;
  --rose-ink: #FFFFFF;
  --rose-soft: #F6E3E7;
  --lamp: #E3AE3F;
  --lamp-ink: #2B2108;
  --lamp-soft: #FBF0D6;
  --juniper: #4F6F5C;
  --juniper-soft: #E2ECE5;
  --focus: #3C5BD6;

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 8px;
  --r-lg: 18px;
  --gutter: 18px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --snow: #161A26;
    --paper: #1F2433;
    --ink: #E8E9F0;
    --ink-2: #A5AABD;
    --line: #333A4E;
    --rose: #E5899B;
    --rose-ink: #2A0F16;
    --rose-soft: #3A2430;
    --lamp: #F0C35C;
    --lamp-ink: #241A04;
    --lamp-soft: #3A3120;
    --juniper: #93BAA1;
    --juniper-soft: #213129;
    --focus: #9DB1FF;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.top {
  max-width: 36rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--gutter) 6px;
}
.brand { font: 600 1.15rem/1 var(--serif); text-decoration: none; letter-spacing: 0.005em; }
.break-btn {
  font: 600 0.88rem/1 var(--sans); text-decoration: none;
  padding: 9px 14px; border-radius: 999px;
  border: 1.5px solid var(--lamp); color: var(--ink); background: transparent;
}
.break-btn:hover { background: var(--lamp-soft); }

.breakbar {
  display: block; text-decoration: none;
  background: var(--lamp); color: var(--lamp-ink);
  font: 600 0.95rem/1.35 var(--sans);
  padding: 11px var(--gutter);
  text-align: center;
}
.breakbar[hidden] { display: none; }

main { max-width: 36rem; margin: 0 auto; padding: 8px var(--gutter) 0; }

.flash {
  margin: 10px 0 0; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--juniper-soft); color: var(--ink); font-size: 0.95rem;
}
.error-msg {
  margin: 12px 0; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--rose-soft); color: var(--ink); font-size: 0.95rem;
}

/* ---------- the one big sentence ---------- */
.hero { padding: 34px 0 26px; }
.when { margin: 0 0 10px; color: var(--ink-2); font-size: 0.95rem; }
.say {
  margin: 0;
  font: 400 clamp(2.05rem, 8.4vw, 2.85rem)/1.12 var(--serif);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.hero .btn { margin-top: 24px; }

h1.page {
  margin: 26px 0 6px;
  font: 400 clamp(1.8rem, 7vw, 2.3rem)/1.15 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.lede { margin: 0 0 18px; color: var(--ink-2); max-width: 34em; }
h2 {
  margin: 34px 0 10px;
  font: 600 1.05rem/1.3 var(--sans);
}
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.88rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
}
.btn.primary { background: var(--rose); border-color: var(--rose); color: var(--rose-ink); }
.btn.lamp { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); }
.btn.quiet { background: transparent; border-color: transparent; padding: 0 8px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn:active { transform: translateY(1px); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.actions.end { justify-content: flex-end; }
form.inline { display: inline; margin: 0; }

/* ---------- forms ---------- */
label.field, .field-label { display: block; font-weight: 600; margin: 0 0 6px; }
.hint { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.9rem; margin-top: 2px; }
textarea, input[type=text], input[type=password] {
  width: 100%; font: 400 1rem/1.5 var(--sans); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 12px;
}
textarea { min-height: 84px; resize: vertical; }
textarea:focus, input:focus { border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }

/* Numbered steps: used only where the content really is an order. */
ol.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 26px 40px; }
ol.steps > li::before {
  content: counter(s);
  position: absolute; left: 0; top: 0;
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 0.82rem/1 var(--sans);
  border: 1.5px solid var(--ink-2); color: var(--ink-2);
}
ol.steps > li:not(:last-child)::after {
  content: ''; position: absolute; left: 13px; top: 32px; bottom: 6px; width: 1.5px; background: var(--line);
}

/* ---------- word picker (feelings / needs) ---------- */
.picker { border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.picker .tray {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 46px; padding: 8px 10px; border-bottom: 1.5px solid var(--line);
}
.picker .tray .empty { color: var(--ink-2); font-size: 0.92rem; }
.picker .tray .count { margin-left: auto; color: var(--ink-2); font-size: 0.82rem; }
.picker details { border-top: 1px solid var(--line); }
.picker details:first-of-type { border-top: 0; }
.picker .side { padding: 8px 12px 2px; font-size: 0.85rem; color: var(--ink-2); }
.picker summary {
  cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 0.95rem;
  list-style: none; display: flex; justify-content: space-between;
}
.picker summary::-webkit-details-marker { display: none; }
.picker summary::after { content: '+'; color: var(--ink-2); font-weight: 400; }
.picker details[open] summary::after { content: '\2212'; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); font-size: 0.92rem; line-height: 1.2; background: var(--snow);
}
.chip input:checked + span { background: var(--rose-soft); border-color: var(--rose); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip input:disabled + span { opacity: 0.45; }
.tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--rose-soft); font-size: 0.88rem; line-height: 1.2;
}
.tag.need { background: var(--juniper-soft); }
.credit { margin-top: 10px; font-size: 0.78rem; color: var(--ink-2); }


/* compact picker (set up by app.js): group pills, one open at a time */
.picker.compact .side { padding: 10px 12px 0; }
.picker.compact .bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 10px; }
.pill {
  font: 600 0.88rem/1.2 var(--sans); color: var(--ink); cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper);
}
.pill.has { border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.pill[aria-expanded=true] { background: var(--ink); color: var(--snow); border-color: var(--ink); box-shadow: none; }
.picker.compact .panel { border-top: 1.5px solid var(--line); padding-top: 12px; background: var(--snow); border-radius: 0 0 var(--r-sm) var(--r-sm); }
.picker.compact .panel[hidden] { display: none; }
.picker.compact details { border: 0; }
.picker.compact summary { display: none; }
.picker.compact .chip span { background: var(--paper); }

/* ---------- reading someone else's words ---------- */
.their {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 20px 18px 8px; margin: 14px 0 0;
  border: 1.5px solid var(--line);
}
.their h3 { margin: 0 0 4px; font: 600 1rem/1.3 var(--sans); }
.their dl { margin: 12px 0 0; }
.their dt { font-size: 0.85rem; color: var(--ink-2); margin-top: 14px; }
.their dd { margin: 3px 0 0; font: 400 1.12rem/1.5 var(--serif); white-space: pre-wrap; }
.their .reply { margin: 10px 0 4px; padding: 10px 12px; border-left: 3px solid var(--juniper); background: var(--juniper-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 0.95rem; }
.their form { margin: 10px 0 0; }
.their .actions { margin-top: 8px; }

/* ---------- lists ---------- */
ul.rows { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--line); }
ul.rows li { border-bottom: 1.5px solid var(--line); }
ul.rows a.row { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 14px 2px; text-decoration: none; }
ul.rows .main { flex: 1; min-width: 0; }
ul.rows .main .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.rows .main > .small { display: block; margin-top: 2px; }
ul.rows .meta { color: var(--ink-2); font-size: 0.85rem; white-space: nowrap; }
.empty-note { color: var(--ink-2); padding: 14px 0; border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }

/* ---------- message preview (composer + talk view) ---------- */
.message {
  margin: 8px 0 0; padding: 22px 20px; border-radius: var(--r-lg);
  background: var(--paper); border: 1.5px solid var(--line);
  font: 400 1.22rem/1.55 var(--serif);
}
.message .blank { color: var(--ink-2); font-style: italic; }
.tips { list-style: none; margin: 8px 0 0; padding: 0; }
.tips li { font-size: 0.9rem; padding: 8px 10px; margin-top: 6px; border-radius: var(--r-sm); background: var(--lamp-soft); }

/* ---------- segmented choice ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-block; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; }
.seg input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--snow); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- break screen: lamplight takes over ---------- */
.lampfield {
  margin: 16px calc(var(--gutter) * -1) 0; padding: 30px var(--gutter) 28px;
  background: var(--lamp-soft);
  border-top: 4px solid var(--lamp);
}
.clock {
  font: 400 clamp(3.4rem, 17vw, 5rem)/1 var(--serif);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 6px 0 4px;
}
.lampfield .topic { font: 400 1.15rem/1.45 var(--serif); margin-top: 12px; }
.calm { margin: 0; padding-left: 20px; }
.calm li { margin: 0 0 8px; }

/* ---------- prompt card ---------- */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 0.92rem; font-weight: 600; background: var(--paper); }
.cats a[aria-current=true] { background: var(--ink); color: var(--snow); border-color: var(--ink); }
.card {
  margin: 10px 0 0; padding: 30px 22px 22px; border-radius: var(--r-lg);
  background: var(--paper); border: 1.5px solid var(--line);
  min-height: 15rem; display: flex; flex-direction: column;
}
.card .q { font: 400 clamp(1.55rem, 6.2vw, 1.95rem)/1.3 var(--serif); margin: 0; text-wrap: pretty; flex: 1; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; color: var(--ink-2); font-size: 0.88rem; }
.card .foot form { margin: 0; }
.star { background: none; border: 0; cursor: pointer; color: var(--ink-2); font: 600 0.9rem/1 var(--sans); padding: 8px 4px; }
.star[aria-pressed=true] { color: var(--rose); }
.done-badge { color: var(--juniper); font-weight: 600; }

.tonight-q { margin: 6px 0 0; padding: 20px 18px; background: var(--paper); border-radius: var(--r-lg); border: 1.5px solid var(--line); }
.tonight-q p { font: 400 1.3rem/1.4 var(--serif); margin: 0 0 12px; }

/* ---------- bottom tabs ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1.5px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs ul { list-style: none; margin: 0 auto; padding: 0; max-width: 36rem; display: grid; grid-template-columns: repeat(4, 1fr); }
nav.tabs a {
  position: relative; height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; font-size: 0.78rem; font-weight: 600; color: var(--ink-2);
}
nav.tabs svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs a[aria-current=page] { color: var(--rose); }
nav.tabs .badge {
  position: absolute; top: 9px; left: calc(50% + 7px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--rose); color: var(--rose-ink); font-size: 0.72rem; line-height: 18px; text-align: center;
}
nav.tabs .badge[hidden] { display: none; }

/* ---------- login ---------- */
.login { max-width: 22rem; margin: 0 auto; padding: 12vh var(--gutter) 0; }
.login .say { font-size: 2.6rem; margin-bottom: 26px; }
.login label.field { margin-top: 14px; }

footer.page-foot { margin: 40px 0 0; color: var(--ink-2); font-size: 0.92rem; display: flex; gap: 20px; align-items: center; }
footer.page-foot .btn.quiet { min-height: 0; padding: 0; font-size: inherit; font-weight: 400; }

@media (prefers-reduced-motion: no-preference) {
  .hero .say { animation: rise 0.6s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (min-width: 640px) {
  body { font-size: 18px; }
  .lampfield { margin-left: 0; margin-right: 0; border-radius: var(--r-lg); border-top-width: 6px; }
}
