/* YapBrain — ink on paper, pink spent in exactly one place (the mic / logo).
   Type: Fraunces (display, loaded in HTML) + system sans (body). */

:root {
  --paper: #FBFAF9;
  --ink: #18181C;
  --muted: #71717A;
  --line: #E9E7E4;
  --pink: #F2679C;
  --pink-deep: #D84B84;
  --pink-tint: #FDF0F5;
  --magenta: #B0286B;
  --radius: 14px;
  --display: "Fraunces", Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100dvh;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--pink-deep); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 4px; }

/* ---------- shared header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 680px; margin: 0 auto; padding: 18px 20px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 18px; font-size: 0.92rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

main { max-width: 680px; margin: 0 auto; padding: 8px 20px 110px; }

/* ---------- app tabs ---------- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: center; gap: 6px;
  padding: 8px max(12px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom));
}
.tabs button {
  font-family: var(--body); font-size: 0.9rem; color: var(--muted);
  background: none; border: none; padding: 10px 20px; border-radius: 999px; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--ink); background: #F0EEEB; font-weight: 600; }

.view { display: none; }
.view.active { display: block; }

/* ---------- capture ---------- */
.capture { text-align: center; padding-top: 6vh; }
.capture h1 {
  font-family: var(--display); font-weight: 550; font-size: clamp(1.7rem, 5vw, 2.2rem);
  letter-spacing: -0.02em; margin-bottom: 6px;
}
.capture .sub { color: var(--muted); font-size: 0.98rem; margin-bottom: 7vh; }

/* the one pink thing: a breathing mic */
.mic {
  width: 132px; height: 132px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--pink);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(242, 103, 156, 0.35);
  transition: transform 0.15s ease, background 0.2s ease;
  animation: breathe 4.5s ease-in-out infinite;
}
.mic:active { transform: scale(0.96); }
.mic svg { width: 46px; height: 46px; }
.mic.recording { background: var(--pink-deep); animation: none; }
.mic.recording::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--pink); animation: ring 1.6s ease-out infinite;
}
.mic { position: relative; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes ring { 0% { transform: scale(0.92); opacity: 0.8; } 100% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .mic, .mic.recording::after { animation: none; }
}

.mic-hint { margin-top: 18px; color: var(--muted); font-size: 0.9rem; min-height: 1.4em; }

/* live transcript: thoughts materializing */
.transcript {
  font-family: var(--display); font-weight: 480; font-size: 1.35rem; line-height: 1.45;
  letter-spacing: -0.01em; margin: 5vh auto 0; max-width: 32ch; min-height: 3em;
  text-wrap: balance;
}
.transcript .interim { color: var(--muted); }

/* text fallback */
.typebox { margin-top: 4vh; display: none; }
.typebox.show { display: block; }
.typebox textarea {
  width: 100%; min-height: 110px; padding: 14px; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; resize: vertical;
}
.typebox textarea:focus { border-color: var(--pink); outline: none; }
.typelink { background: none; border: none; color: var(--muted); font-size: 0.85rem; cursor: pointer; margin-top: 22px; text-decoration: underline; text-underline-offset: 3px; }

.btn {
  font: inherit; font-weight: 600; border: none; cursor: pointer;
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; border-radius: 999px; margin-top: 14px;
}
.btn.quiet { background: #F0EEEB; color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- feed ---------- */
.feed-head { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 6px; }
.feed-head h2 { font-family: var(--display); font-weight: 550; font-size: 1.4rem; }
.count { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.day-label {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 26px 0 8px;
}
.yap {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.yap p { font-size: 0.98rem; }
.yap .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.yap .del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; text-decoration: underline; text-underline-offset: 2px; }
.tagged { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 8vh 0; font-size: 0.95rem; }

.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px;
  font-size: 0.9rem; display: none; z-index: 50;
}
.toast.show { display: flex; gap: 14px; align-items: center; }
.toast button { background: none; border: none; color: var(--pink); font-weight: 600; cursor: pointer; }

/* crisis support card */
.support {
  border: 1px solid var(--line); border-left: 4px solid var(--pink);
  background: #fff; border-radius: var(--radius); padding: 16px 18px; margin: 14px 0;
  font-size: 0.95rem; display: none;
}
.support.show { display: block; }

/* ---------- brain ---------- */
.brainlock { text-align: center; padding: 6vh 0; }
.brainlock .progress { font-variant-numeric: tabular-nums; color: var(--muted); margin: 10px 0 20px; }
.bar { height: 6px; background: #EFEDEA; border-radius: 999px; overflow: hidden; max-width: 280px; margin: 0 auto 20px; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width 0.4s ease; }

.map-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-wrap svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.node { cursor: pointer; }
.node circle { fill: #F0EEEB; stroke: var(--ink); stroke-width: 1.4; transition: fill 0.15s ease; }
.node:hover circle, .node.sel circle { fill: var(--pink-tint); stroke: var(--pink-deep); }
.node text { font-family: var(--body); font-size: 12px; fill: var(--ink); pointer-events: none; }
.node.center circle { fill: var(--ink); }
.node.center text { fill: var(--paper); font-weight: 600; }
.edge { stroke: var(--ink); }

.cards { display: grid; gap: 10px; margin: 14px 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 1.02rem; margin-bottom: 6px; }
.card ul { padding-left: 18px; }
.card li { margin: 4px 0; font-size: 0.94rem; }
.card .k { color: var(--muted); font-size: 0.82rem; }

.gtd h3 { margin-top: 14px; }
.panel { border-top: 2px solid var(--ink); margin-top: 14px; padding-top: 10px; display: none; }
.panel.show { display: block; }
.panel h3 { font-family: var(--display); }
.panel .yap { margin-top: 10px; }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- blog & pages ---------- */
.prose { max-width: 620px; }
.prose h1 { font-family: var(--display); font-weight: 560; font-size: clamp(1.8rem, 5vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.18; margin: 24px 0 8px; }
.prose .byline { color: var(--muted); font-size: 0.88rem; margin-bottom: 26px; }
.prose h2 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin: 30px 0 8px; }
.prose p { margin: 14px 0; font-size: 1.02rem; }
.prose li { margin: 8px 0 8px 18px; font-size: 1.02rem; }
.prose blockquote { border-left: 3px solid var(--pink); padding-left: 14px; color: var(--muted); margin: 18px 0; }
.postlist { list-style: none; }
.postlist li { border-bottom: 1px solid var(--line); padding: 20px 0; margin: 0; }
.postlist a { font-family: var(--display); font-weight: 600; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.01em; }
.postlist p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }

footer {
  max-width: 680px; margin: 0 auto; padding: 26px 20px 120px;
  color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line);
}
footer a { color: var(--muted); }

@media (max-width: 480px) {
  .top nav { gap: 12px; font-size: 0.85rem; }
}

/* ---------- tasks ---------- */
.task-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-size: 0.97rem;
}
.task-item input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.task-item.done span { text-decoration: line-through; color: var(--muted); }
.task-item em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 0.8rem; }

/* ---------- quiz + chips ---------- */
.qscreen { text-align: left; }
.qcount { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.qtitle { font-family: var(--display); font-weight: 560; font-size: 1.4rem; letter-spacing: -0.015em; margin: 6px 0 16px; }
.qchips { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip {
  font: inherit; font-size: 0.92rem; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.qchip.on, .qchip:active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.qrow { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.qhelp { color: var(--muted); font-size: 0.88rem; margin: 14px 0 6px; }
.qinput { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; width: 100%; }

/* ---------- insight feedback ---------- */
.fbrow { display: block; margin-top: 4px; }
.fb { background: none; border: none; color: var(--muted); font-size: 0.78rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; margin-right: 10px; padding: 0; }

/* ---------- brand refresh (July 4) ---------- */
.brand span, .wordmark {
  background: linear-gradient(90deg, var(--pink), var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--pink-deep);
}
.tagline { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.06em; }

.capture-card {
  background: var(--pink-tint);
  border: 1px solid #F7D8E6;
  border-radius: 24px;
  padding: 30px 18px 26px;
  margin: 0 auto;
  max-width: 460px;
}

.short-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 460px; margin: 14px auto 0; }
.short-card {
  display: block; text-align: left; cursor: pointer; font: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px;
}
.short-card b { font-family: var(--display); font-weight: 600; display: block; font-size: 0.98rem; }
.short-card span { color: var(--muted); font-size: 0.82rem; }
.short-card .pending { color: var(--pink-deep); font-weight: 600; }
.recent-mini { max-width: 460px; margin: 6px auto 0; text-align: left; }

/* ---------- mobile brand refresh — real logo, record card, icon nav ---------- */
.brand img { width: 40px; height: 40px; }
.brandtext { display: flex; flex-direction: column; line-height: 1.08; }
.brandtext small { -webkit-text-fill-color: currentColor; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.02em; }

.sync-badge { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 7px 11px; }
.sync-badge .dot { width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sync-badge .dot svg { width: 12px; height: 12px; color: #16a34a; }
.sync-badge > span { display: flex; flex-direction: column; line-height: 1.15; }
.sync-badge b { font-size: 0.76rem; font-weight: 700; }
.sync-badge small { color: var(--muted); font-size: 0.7rem; }

/* big record button = the real brain-mic mark on the pink card */
.mic { width: 168px; height: 168px; background: radial-gradient(circle at 50% 44%, #fff 0%, rgba(255,255,255,0) 60%); box-shadow: none; padding: 0; }
.mic img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(176,40,107,0.28)); pointer-events: none; }
.mic.recording { background: radial-gradient(circle at 50% 44%, var(--pink-tint) 0%, rgba(253,240,245,0) 60%); }
.mic.recording::after { inset: 8px; border-color: var(--pink); }
.record-title { font-family: var(--display); font-weight: 600; font-size: 1.7rem; letter-spacing: -0.01em; margin: 4px 0 2px; background: linear-gradient(90deg, var(--pink), var(--magenta)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--pink-deep); }
.capture { padding-top: 10px; }
.capture-card .sub { margin: 0 auto 4px; max-width: 30ch; }

/* mockup-style section cards */
.short-cards { grid-template-columns: 1fr; }
.short-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.short-card .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--pink-tint); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.short-card .ic svg { width: 20px; height: 20px; color: var(--pink-deep); }
.short-card .txt { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: left; }
.short-card .txt b { color: var(--ink); }
.short-card .txt span { color: var(--muted); font-size: 0.82rem; }
.short-card .chev { color: var(--muted); flex: none; display: inline-flex; }
.short-card .chev svg { width: 18px; height: 18px; }

/* bottom nav: icon over label, prominent center record */
.tabs { gap: 4px; align-items: center; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 12px; font-size: 0.7rem; border-radius: 14px; }
.tabs button svg { width: 22px; height: 22px; }
.tabs button[aria-selected="true"] { background: transparent; color: var(--pink-deep); font-weight: 600; }
.tabs button.rec { background: none; padding: 6px 12px; color: var(--pink-deep); }
.tabs button.rec svg { box-sizing: border-box; width: 54px; height: 54px; padding: 15px; border-radius: 50%; background: var(--pink); color: #fff; margin-top: -24px; box-shadow: 0 10px 22px rgba(242,103,156,0.45); }
.tabs button.rec span { display: block; color: var(--pink-deep); font-weight: 600; }

/* ---------- home stacked cards (photo layout) ---------- */
.home-cards { display: flex; flex-direction: column; gap: 12px; max-width: 460px; margin: 16px auto 0; }
.home-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: left; }
.home-extra { max-width: 460px; margin: 18px auto 0; }

.notes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.notes-title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.notes-title .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--pink-tint); display: inline-flex; align-items: center; justify-content: center; }
.notes-title .ic svg { width: 16px; height: 16px; color: var(--pink-deep); }
.viewall { background: none; border: none; color: var(--pink-deep); font-weight: 600; font-size: 0.85rem; cursor: pointer; padding: 4px; }

.notes-list { display: flex; flex-direction: column; }
.note-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.note-row:first-child { border-top: none; padding-top: 4px; }
.note-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); margin-top: 6px; flex: none; }
.note-main { flex: 1; min-width: 0; background: none; border: none; text-align: left; cursor: pointer; font: inherit; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.note-main b { font-weight: 600; font-size: 0.95rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.note-main span { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.note-time { color: var(--muted); font-size: 0.76rem; white-space: nowrap; flex: none; margin-top: 2px; font-variant-numeric: tabular-nums; }
.note-kebab { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px; flex: none; }
.note-kebab svg { width: 18px; height: 18px; }
.notes-empty { color: var(--muted); font-size: 0.9rem; padding: 8px 0; }

/* brain map minimap decoration */
.short-card .minimap { flex: none; width: 62px; height: 40px; }
.short-card .minimap svg { width: 100%; height: 100%; }

/* ---------- relationships ---------- */
.back-link { background: none; border: none; color: var(--pink-deep); font-weight: 600; font-size: 0.9rem; cursor: pointer; padding: 6px 0; }
.rel-h { font-family: var(--display); font-weight: 550; font-size: 1.4rem; }
.rel-add { display: flex; gap: 8px; margin: 10px 0 16px; }
.rel-add input, .rel-add textarea { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; background: #fff; color: var(--ink); }
.rel-add textarea { resize: vertical; }
.rel-add input:focus, .rel-add textarea:focus { border-color: var(--pink); outline: none; }
.rel-add .btn { flex: none; }
.note-add { flex-direction: column; align-items: stretch; }
.note-add .btn { align-self: flex-end; }

.rel-list { display: flex; flex-direction: column; gap: 10px; }
.person-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--magenta)); color: #fff; font-family: var(--display); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 1.05rem; }
.avatar.big { width: 54px; height: 54px; font-size: 1.4rem; }
.person-card .txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.person-card .txt b { color: var(--ink); }
.person-card .txt span { color: var(--muted); font-size: 0.82rem; }
.person-card .chev { color: var(--muted); flex: none; display: inline-flex; }
.person-card .chev svg { width: 18px; height: 18px; }

.person-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.rel-notes { display: flex; flex-direction: column; gap: 10px; }
.note-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.note-item p { font-size: 0.96rem; white-space: pre-wrap; }
.note-item .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--muted); font-size: 0.8rem; }
.note-item .del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- compact "Tap to Record" hero to match mockup ---------- */
/* the empty transcript/hint reserved big blank space inside the pink card; collapse them when idle */
#mic-hint:empty { display: none; margin: 0; min-height: 0; }
#transcript:empty { display: none; margin: 0; min-height: 0; }
.capture-card { padding-bottom: 22px; }
/* the nudge-cadence toggle now lives at the bottom, not on the hero */
.home-extra .cadence-line { margin-top: 14px; text-align: center; }
.profile-top { display: flex; align-items: center; gap: 12px; max-width: 460px; margin: 6px auto 4px; }
.profile-top img { border-radius: 12px; flex: none; }
.profile-id { display: flex; flex-direction: column; min-width: 0; }
.profile-id b { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--ink); }
.profile-id span { color: var(--muted); font-size: 0.85rem; }
.profile-note { max-width: 460px; margin: 16px auto 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
