/* Couples Jar, the app.
 *
 * Same committed world as the website: cream paper, ink, one highlighter. No
 * dark variant, because the whole thing is a physical object and paper does not
 * have a dark mode. The slips are the app. Everything else gets out of the way.
 *
 * Phone first. The widest this ever needs to be is a tablet held in one hand.
 */

@font-face {
  font-family: Karla; src: url(fonts/karla.woff2) format('woff2-variations');
  font-weight: 200 800; font-display: swap;
}
@font-face {
  font-family: 'Bricolage Grotesque'; src: url(fonts/bricolage.woff2) format('woff2-variations');
  font-weight: 200 800; font-display: swap;
}
@font-face {
  font-family: Caveat; src: url(fonts/caveat.woff2) format('woff2');
  font-weight: 600; font-display: swap;
}

:root {
  --paper:    #F5F1E8;
  --card:     #FFFDF7;
  --ink:      #24221E;
  --ink-soft: #5D564C;
  --faint:    #8E8578;
  --hair:     #DAD3C4;
  --dark:     #2E2C29;
  --on-dark:  #F4EFE3;
  --mark:     #F2E06A;
  --shadow:   0 14px 28px rgba(40,34,22,0.18);
  --shadow-sm:0 6px 16px rgba(40,34,22,0.12);
  --tap: 46px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: Karla, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, .btn, .num { font-family: 'Bricolage Grotesque', Karla, sans-serif; letter-spacing: -0.02em; }
h1 { margin: 0; font-weight: 800; font-size: 30px; line-height: 1.08; text-wrap: balance; }
h2 { margin: 0; font-weight: 800; font-size: 22px; line-height: 1.12; }
h3 { margin: 0; font-weight: 700; font-size: 17px; }
p  { margin: 0; }
a  { color: inherit; }
:focus-visible { outline: 3px solid var(--dark); outline-offset: 3px; }
[hidden] { display: none !important; }

.hand { font-family: Caveat, 'Segoe Script', cursive; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--faint);
}
.soft { color: var(--ink-soft); }
.centre { text-align: center; }

/* ---------- frame ---------- */

.app { max-width: 620px; margin: 0 auto; padding: 0 18px 120px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 12px;
  border-bottom: 2px solid var(--ink);
}
.brand { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.purse { margin-left: auto; display: flex; align-items: baseline; gap: 6px; }
.purse .n { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 26px; line-height: 1; }
.purse .lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }

.icon {
  width: var(--tap); height: var(--tap); flex: none;
  display: grid; place-items: center;
  background: transparent; border: 0; cursor: pointer; color: var(--ink);
  margin-right: -12px;
}
.icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- buttons ---------- */

.btn {
  appearance: none; cursor: pointer; font-weight: 700; font-size: 16px;
  min-height: var(--tap); padding: 11px 20px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--on-dark);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled] { opacity: 0.42; cursor: default; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn.quiet { background: transparent; color: var(--ink-soft); border-color: var(--hair); box-shadow: none; font-weight: 500; }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.btn.danger { background: transparent; color: #8C2F22; border-color: #8C2F22; box-shadow: none; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 8px; }

/* ---------- the waiting stack ---------- */

.waiting { margin: 22px 0 8px; }
.waiting .eyebrow { margin-bottom: 10px; }

.todo {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--dark); color: var(--on-dark);
  border: 0; box-shadow: var(--shadow-sm);
  padding: 14px 16px; margin-bottom: 8px;
  font-family: inherit; font-size: 16px;
}
.todo:active { transform: translateY(1px); }
.todo .what { flex: 1; min-width: 0; }
.todo .verb { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; display: block; }
.todo .said {
  font-family: Caveat, cursive; font-size: 20px; line-height: 1.1;
  color: #CFC6B2; display: block; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.todo .arrow { font-size: 20px; opacity: 0.5; }
.todo.soft-todo { background: var(--card); color: var(--ink); border: 1px solid var(--hair); }
.todo.soft-todo .said { color: var(--ink-soft); }

/* ---------- lists ---------- */

.tabs { display: flex; gap: 0; margin: 26px 0 4px; border-bottom: 2px solid var(--ink); }
.tab {
  flex: 1; min-height: var(--tap); cursor: pointer;
  background: transparent; border: 0; border-bottom: 4px solid transparent;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 15px;
  color: var(--faint); padding: 10px 4px; margin-bottom: -2px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.list { margin: 22px 0 0; }
.list > .colhead {
  font-family: Caveat, cursive; font-size: 22px; line-height: 1.1;
  color: var(--faint); margin-bottom: 10px;
}

.slip {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
  padding: 13px 15px; margin-bottom: 9px; cursor: pointer;
  font-family: inherit; color: inherit;
}
.slip:active { transform: translateY(1px); }
.slip > span:first-child { flex: 1; min-width: 0; }
.slip .said { font-family: Caveat, cursive; font-size: 22px; line-height: 1.14; display: block; }
.slip .val {
  font-family: Karla, sans-serif; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  margin-top: 6px;
}
.slip .val .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.slip .note {
  display: block; font-family: Karla, sans-serif; font-size: 12px;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); margin-top: 5px;
}
.slip.mine { background: transparent; box-shadow: none; border-style: dashed; }
.slip.ready { border-color: var(--ink); border-width: 2px; }
.slip.ready .said { background: linear-gradient(transparent 62%, var(--mark) 62%); }

.empty {
  border: 2px dashed var(--hair); padding: 20px 18px; text-align: center;
  color: var(--ink-soft); font-size: 15px;
}

/* ---------- sheets ---------- */

.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(36,34,30,0.42);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto;
  background: var(--paper); border-top: 3px solid var(--ink);
  box-shadow: var(--shadow); padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  animation: rise 0.16s ease-out;
}
@keyframes rise { from { transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet > * + * { margin-top: 16px; }
.sheet .said-big { font-family: Caveat, cursive; font-size: 30px; line-height: 1.1; }

/* ---------- inputs ---------- */

label { display: block; }
label .eyebrow { margin-bottom: 7px; }

input[type=text], textarea, select {
  width: 100%; font-family: inherit; font-size: 17px; color: var(--ink);
  background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow-sm);
  padding: 12px 14px; min-height: var(--tap); border-radius: 0; appearance: none;
}
textarea { font-family: Caveat, cursive; font-size: 23px; line-height: 1.25; min-height: 150px; resize: vertical; }
input[type=text].saidline { font-family: Caveat, cursive; font-size: 24px; }
.counter { font-size: 12px; color: var(--faint); text-align: right; margin-top: 5px; }

.values { display: flex; flex-wrap: wrap; gap: 7px; }
.value {
  min-width: var(--tap); min-height: var(--tap); cursor: pointer;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 16px;
  background: var(--card); border: 1px solid var(--hair); color: var(--ink); padding: 8px 14px;
}
.value[aria-pressed="true"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.fixed-note { font-size: 14px; color: var(--ink-soft); }

.pick { display: flex; flex-wrap: wrap; gap: 7px; }
.pick .chip {
  cursor: pointer; text-align: left;
  font-family: Caveat, cursive; font-size: 21px; line-height: 1.1;
  background: var(--card); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
  padding: 9px 13px; color: inherit;
}

/* ---------- the keepsake ---------- */

.keep { margin-top: 34px; border-top: 2px solid var(--ink); padding-top: 18px; }
.jarmeter {
  height: 13px; background: var(--card); border: 1.5px solid var(--ink); margin: 12px 0 8px;
}
.jarmeter i { display: block; height: 100%; background: var(--mark); }
.note-read {
  background: var(--card); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
  padding: 18px 18px 20px;
}
.note-read .said-big { font-family: Caveat, cursive; font-size: 25px; line-height: 1.22; }
.note-read .who { margin-top: 12px; }

/* ---------- door ---------- */

.door { padding-top: 12vh; max-width: 420px; margin: 0 auto; }
.door > * + * { margin-top: 18px; }
.door h1 { font-size: 34px; }

/* ---------- misc ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  background: var(--dark); color: var(--on-dark); padding: 12px 18px;
  box-shadow: var(--shadow); font-size: 15px; max-width: 90vw;
}
.hr { border: 0; border-top: 2px solid var(--ink); margin: 26px 0; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; border: 1px solid var(--hair); padding: 4px 9px; color: var(--faint);
}

@media (min-width: 560px) {
  .app { padding-inline: 24px; }
  h1 { font-size: 36px; }
}
