/* Tether — storybook design system
   Bree Serif display · Karla body · oatmeal paper · hand-inked lines */

:root {
  --ink: #35315e;
  --paper: #f6f1e7;
  --card: #fbf7ee;
  --line: #4a4573;
  --plum: #7a6fb8;
  --ochre: #e0a93e;
  --rose: #d98e9c;
  --sky: #7fb6d9;
  --sage: #8fbf9f;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Karla", system-ui, sans-serif;
  font-size: 16px;
  min-height: 100%;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .serif { font-family: "Bree Serif", serif; font-weight: 400; }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 22px; margin: 0 0 4px; }

.page {
  flex: 1;
  padding: 22px 20px calc(84px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--plum);
}

.muted { color: var(--ink); opacity: 0.65; font-size: 14px; line-height: 1.5; }
.small { font-size: 12.5px; }

/* ---------- storybook card ---------- */

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 22px 20px;
  position: relative;
  box-shadow: 3px 4px 0 rgba(74, 69, 115, 0.08);
}
.card::before, .card::after {
  content: "";
  position: absolute;
  left: 20px; right: 20px;
  height: 1px;
  background: var(--line);
  opacity: 0.15;
}
.card::before { top: 10px; }
.card::after { bottom: 10px; }

.question { font-family: "Bree Serif", serif; font-size: 20px; line-height: 1.45; margin: 10px 0 0; }

/* ---------- buttons + inputs ---------- */

button {
  font-family: "Karla", sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 18px;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.08s ease, background 0.3s;
  width: 100%;
}
button:active { transform: translateY(1px); }
button.secondary { background: transparent; color: var(--ink); }
button.quiet {
  background: none;
  border: none;
  width: auto;
  padding: 4px 0;
  font-family: "Bree Serif", serif;
  font-weight: 400;
  font-size: 14.5px;
  color: var(--ink);
}
button:disabled { opacity: 0.45; cursor: default; }

input, textarea, select {
  font-family: "Karla", sans-serif;
  font-size: 16px;
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--plum); }
textarea { resize: vertical; min-height: 84px; }
label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }

.field-row { display: flex; gap: 10px; }

.error {
  background: #f3dede;
  border: 1.5px solid var(--rose);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-top: 12px;
}
.notice {
  background: #efe7d3;
  border: 1.5px dashed var(--ochre);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 12px;
  word-break: break-all;
}

/* ---------- answers thread ---------- */

.answer { margin-top: 14px; }
.answer .who { font-size: 11.5px; font-weight: 700; opacity: 0.6; margin-bottom: 3px; }
.answer .bubble {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
}
.answer.mine .bubble { border-radius: 14px 4px 14px 14px; background: var(--card); }
.answer .bubble.locked {
  color: var(--ink);
  opacity: 0.55;
  font-style: italic;
  border-style: dashed;
}
.answer-actions {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 3px;
  opacity: 0.55;
  font-size: 12px;
}
.answer-actions button { font-size: 12.5px; padding: 2px 0; }

/* ---------- chips ---------- */

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  font-size: 11.5px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  padding: 3px 11px;
  background: #fff;
}
.chip.done { background: var(--sage); }

/* ---------- jar ---------- */

.jar-wrap { display: flex; justify-content: center; margin: 26px 0 10px; }
.stats { display: flex; gap: 26px; justify-content: center; margin-top: 18px; }
.stat { text-align: center; }
.stat .n { font-family: "Bree Serif", serif; font-size: 22px; }
.stat .l { font-size: 11.5px; font-weight: 700; opacity: 0.6; }

/* ---------- memory book ---------- */

.memory { margin-top: 12px; padding: 16px 18px; }
.memory::before { top: 7px; }
.memory::after { bottom: 7px; }
.mem-q { font-family: "Bree Serif", serif; font-size: 16px; line-height: 1.45; margin: 8px 0 2px; }
.mem-answer { font-size: 14px; line-height: 1.5; margin-top: 9px; }
.mem-who { display: block; font-size: 11px; font-weight: 700; opacity: 0.55; }

/* ---------- login illustration ---------- */

.login-art { display: flex; justify-content: center; margin-bottom: 8px; }
.login-art .kite { animation: kiteBob 4.5s ease-in-out infinite alternate; transform-origin: 170px 30px; }
@keyframes kiteBob {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-6px) rotate(2.5deg); }
}

@keyframes heavyDrop {
  0% { transform: translateY(-80px); opacity: 0; }
  55% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(-8px); }
  85% { transform: translateY(0); }
  93% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
.marble-drop { animation: heavyDrop 0.9s cubic-bezier(0.4, 0, 1, 1); }

/* ---------- mission cards ---------- */

.mission { margin-top: 14px; }
.mission .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mission h3 { font-size: 17px; margin: 0; }
.mission .ages { font-size: 10.5px; font-weight: 700; opacity: 0.55; white-space: nowrap; }
.mission p { font-size: 14px; line-height: 1.5; margin: 6px 0 4px; }
.mission .tip { font-size: 12.5px; font-style: italic; opacity: 0.65; line-height: 1.5; margin: 0 0 10px; }
.mission button { width: auto; padding: 9px 16px; font-size: 13px; }
.mission button.done-btn { background: var(--sage); color: var(--ink); }

/* ---------- member rows ---------- */

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  margin-top: 8px;
}
.member-row .name { font-weight: 700; font-size: 14.5px; flex: 1; }
.member-row .role { font-size: 11px; font-weight: 700; opacity: 0.55; text-transform: capitalize; }

/* ---------- bottom nav ---------- */

nav.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1.5px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabbar a {
  flex: 1;
  text-align: center;
  padding: 10px 0 12px;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.5;
  font-size: 10.5px;
  font-weight: 700;
}
nav.tabbar a.active { opacity: 1; }
nav.tabbar a svg { display: block; margin: 0 auto 3px; }

/* ---------- repair flow ---------- */

.progress { display: flex; gap: 6px; margin: 14px 0; }
.progress span { flex: 1; height: 6px; border-radius: 99px; background: rgba(74,69,115,0.15); }
.progress span.on { background: var(--ochre); }
.script {
  margin-top: 12px;
  background: rgba(224, 169, 62, 0.14);
  border-left: 4px solid var(--ochre);
  border-radius: 4px 10px 10px 4px;
  padding: 12px 14px;
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.center { text-align: center; align-items: center; justify-content: center; display: flex; flex-direction: column; flex: 1; }
.mt-auto { margin-top: auto; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }
