/* Our Page — styles.
   Two people, two colours: teal and rose. Big type, big buttons,
   Atkinson Hyperlegible for reading, Shantell Sans for warmth. */

:root {
  --paper: #faf6ee;
  --card: #ffffff;
  --ink: #2b2722;
  --ink-soft: #6b6258;
  --line: #e7dfd2;
  --teal: #115b54;
  --teal-soft: #e1efed;
  --rose: #9c4a4a;
  --rose-soft: #f6e7e3;
  --sun: #f2c49b;
  --sun-soft: #fbeedd;
  --danger: #8f3030;
  --radius: 16px;
  --display: "Shantell Sans", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 20px; }

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

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0.75rem calc(5.5rem + env(safe-area-inset-bottom));
}

h1, h2, .brand, .brand-big { font-family: var(--display); font-weight: 700; }
h2 { font-size: 1.3rem; margin: 1.25rem 0 0.75rem; }

.muted { color: var(--ink-soft); }
.center { text-align: center; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- full-screen states ---------- */

.screen-center {
  min-height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

.brand-big { font-size: 2.2rem; margin: 0; color: var(--teal); }
.login-blurb { margin-top: 0; }

#login-form { display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
#login-form label { font-weight: 700; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.25rem;
  background: linear-gradient(var(--paper) 85%, transparent);
}

.brand { font-size: 1.35rem; color: var(--teal); }

/* ---------- buttons & inputs ---------- */

.btn {
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  min-height: 48px;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
}

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:active { transform: translateY(1px); }
.btn-quiet { border-color: var(--line); }
.btn-wave { background: var(--sun-soft); border-color: var(--sun); }
.btn-big { font-size: 1.05rem; }
.btn-small { min-height: 40px; padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.btn-link {
  background: none; border: none; padding: 0.25rem;
  color: var(--ink-soft); text-decoration: underline;
  font: inherit; font-size: 0.85rem; cursor: pointer;
}

:is(button, input, textarea, a, .tab):focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

input, textarea {
  font: inherit;
  color: var(--ink);
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: var(--card);
  min-height: 48px;
}

textarea { resize: vertical; }

label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }

.field-row { display: flex; gap: 0.6rem; }
.field-row > div { flex: 1; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.composer-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.composer-actions .btn-primary { margin-left: auto; flex: 0 0 auto; }
.composer-actions .btn-quiet { display: inline-flex; align-items: center; }

.pending-media img { max-width: 100%; border-radius: 12px; display: block; }
.pending-media { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.pending-media audio { width: 100%; }

.recording-bar {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--rose-soft);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
}

.rec-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.25; } }

.status { min-height: 1.2rem; margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.status.is-error { color: var(--danger); }

/* ---------- feed ---------- */

.feed, .events { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }

.post {
  background: var(--card);
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
}

.post.from-teal { border-left-color: var(--teal); }
.post.from-rose { border-left-color: var(--rose); }

.post-head {
  display: flex; align-items: baseline; gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.post-author { font-family: var(--display); font-weight: 700; font-size: 0.95rem; }
.from-teal .post-author { color: var(--teal); }
.from-rose .post-author { color: var(--rose); }

.post-time { font-size: 0.8rem; color: var(--ink-soft); }
.post-remove { margin-left: auto; }

.post-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-body img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  margin-top: 0.3rem;
}
.post-body audio { width: 100%; margin-top: 0.3rem; }

.answer-tag {
  display: inline-block;
  font-size: 0.78rem;
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-bottom: 0.35rem;
}

.post-wave {
  border: none;
  background: var(--sun-soft);
  text-align: center;
  font-family: var(--display);
  border-radius: 999px;
  padding: 0.7rem 1rem;
}
.post-wave .post-time { display: block; font-family: var(--body); }

/* ---------- events ---------- */

.event {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.event-when {
  font-family: var(--display);
  font-weight: 700;
  color: var(--teal);
  min-width: 5.2rem;
  text-align: center;
  line-height: 1.25;
}
.event-when small { display: block; font-weight: 500; color: var(--ink-soft); }

.event-what { flex: 1; }
.event-what p { margin: 0; }
.event-what .muted { font-size: 0.85rem; }

/* ---------- question ---------- */

.q-prompt { font-family: var(--display); font-size: 1.25rem; margin: 0; }
.q-answer { border-top: 1px dashed var(--line); padding-top: 0.6rem; }
.q-answer p { margin: 0.2rem 0 0; white-space: pre-wrap; }
.q-who { font-family: var(--display); font-weight: 700; }
.q-who.from-teal { color: var(--teal); }
.q-who.from-rose { color: var(--rose); }

/* ---------- tabs ---------- */

.tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem calc(0.45rem + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
}

.tab {
  font-family: var(--display);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  flex: 1;
  max-width: 150px;
  min-height: 56px;
  border: none;
  border-radius: 14px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.tab span { font-size: 1.2rem; }
.tab.is-active { background: var(--teal-soft); color: var(--teal); font-weight: 700; }

.appfoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 1.2rem 0.25rem 0.5rem;
}

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