/* PocketLog blog. Colours and shapes follow the app (styles.css). */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f5; --border: #e3e6ea;
  --text: #15191e; --muted: #5f6b78;
  --brand: #0f766e; --brand-2: #14b8a6; --brand-soft: #e6f6f4; --on-brand: #ffffff;
  --income: #15803d; --income-soft: #e8f6ec;
  --expense: #c2410c; --expense-soft: #fdf0e8;
  --danger: #b91c1c; --gold: #a16207; --gold-soft: #fdf6e3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1215; --surface: #161b20; --surface-2: #1d242a; --border: #2a333b;
    --text: #e8edf1; --muted: #93a1ae;
    --brand: #2dd4bf; --brand-soft: #12302d; --on-brand: #04201d;
    --income: #4ade80; --income-soft: #143022;
    --expense: #fb923c; --expense-soft: #3a2214;
    --danger: #f87171; --gold: #facc15; --gold-soft: #33290d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { letter-spacing: -.015em; line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.spacer { flex: 1; }
.meta { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* buttons, chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background-color .15s, filter .15s, transform .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand); filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px;
  font-size: 13px; font-weight: 650; text-decoration: none; background: var(--surface-2); color: var(--muted);
}
.t-brand { background: var(--brand-soft); color: var(--brand); }
.t-income { background: var(--income-soft); color: var(--income); }
.t-expense { background: var(--expense-soft); color: var(--expense); }
.t-gold { background: var(--gold-soft); color: var(--gold); }
.btn.lg { padding: 12px 20px; font-size: 16px; border-radius: 12px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.topbar-inner { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-weight: 600; }
.site-nav { display: flex; gap: 2px; margin-left: 14px; }
.site-nav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current] { background: var(--brand-soft); color: var(--brand); }
.who { max-width: 150px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 6px; }
  .site-nav { order: 5; width: 100%; margin: 0 -6px; overflow-x: auto; scrollbar-width: none; }
  .write-link { display: none; }
  .topbar .btn { padding: 7px 11px; font-size: 14px; }
}

/* hero */
.hero { padding: 56px 0 30px; max-width: 720px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); letter-spacing: -.03em; line-height: 1.05; }
.lead { color: var(--muted); font-size: 18px; margin-top: 14px; max-width: 60ch; text-wrap: pretty; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.filters .chip { padding: 7px 14px; font-size: 14px; border: 1px solid transparent; }
.filters .chip.all { background: var(--surface); border-color: var(--border); color: var(--text); }
.filters .chip[aria-current] { border-color: currentColor; }

/* post cards */
.post-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: inherit; text-decoration: none;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), border-color .2s;
}
@media (hover: hover) { .post-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); } }
.art { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 8; font-size: 44px; object-fit: cover; }
.post-card-text { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 18px; flex: 1; }
.post-card h3 { font-size: 19px; }
.post-card p:not(.meta) { color: var(--muted); font-size: 15px; }
.post-card .meta { margin-top: auto; padding-top: 6px; }
.post-card.featured { flex-direction: row; margin-bottom: 20px; }
.post-card.featured .art { width: 46%; aspect-ratio: auto; min-height: 280px; font-size: 76px; }
.post-card.featured .post-card-text { padding: 30px; justify-content: center; gap: 12px; }
.post-card.featured h2 { font-size: clamp(24px, 3.2vw, 32px); }
.post-card.featured p:not(.meta) { font-size: 17px; }
.post-card.featured .meta { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
@media (max-width: 720px) {
  .post-card.featured { flex-direction: column; }
  .post-card.featured .art { width: 100%; min-height: 0; aspect-ratio: 16 / 8; font-size: 56px; }
  .post-card.featured .post-card-text { padding: 20px; }
}
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }
.empty { text-align: center; padding: 48px 16px 64px; display: grid; justify-items: center; gap: 12px; }
.empty .art { width: 84px; height: 84px; aspect-ratio: 1; border-radius: 24px; font-size: 38px; }
.empty h1, .empty h2 { font-size: 26px; }
.empty p { color: var(--muted); margin-bottom: 6px; }

/* app prompt (the app's quick-add box) */
.promo {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; margin: 56px 0 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 34px; box-shadow: var(--shadow);
}
.promo h2 { font-size: clamp(22px, 3vw, 28px); }
.promo p { color: var(--muted); margin: 12px 0 20px; max-width: 46ch; }
.quick { border: 2px solid var(--brand-2); border-radius: 18px; padding: 16px; background: var(--bg); }
.quick-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); font-size: 18px; }
.quick-row b { background: var(--brand); color: var(--on-brand); border-radius: 10px; padding: 8px 16px; font-size: 15px; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.quick-tags i { font-style: normal; font-size: 14px; color: var(--muted); border: 1px dashed var(--border); border-radius: 999px; padding: 4px 12px; }
@media (max-width: 720px) { .promo { grid-template-columns: 1fr; padding: 22px; gap: 22px; } }

/* a post */
.post { max-width: 720px; margin: 0 auto; padding-top: 36px; }
.post-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.back { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.back:hover { color: var(--brand); }
.post-head h1 { font-size: clamp(30px, 5.4vw, 44px); letter-spacing: -.025em; line-height: 1.1; }
.post-head .lead { margin: 0; font-size: 19px; }
.post-meta { display: flex; align-items: center; gap: 12px; }
.cover { display: block; width: 100%; border-radius: var(--radius); margin-top: 26px; }
.draft-note { background: var(--gold-soft); color: var(--gold); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.prose { font-size: 18px; line-height: 1.7; margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--border); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 26px; margin-top: 1.8em; }
.prose h3 { font-size: 21px; margin-top: 1.6em; }
.prose h4 { font-size: 18px; margin: 1.5em 0 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose a { text-underline-offset: 3px; }
.prose img { display: block; border-radius: var(--radius); margin-left: auto; margin-right: auto; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 14px 18px; border-left: 4px solid var(--brand-2); background: var(--brand-soft); border-radius: 0 12px 12px 0; font-weight: 550; }
.prose code { font: .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 6px; padding: 2px 6px; }
.prose pre { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { font-size: 13px; color: var(--muted); font-weight: 650; }
.prose tr:last-child td { border-bottom: 0; }
.prose .num { text-align: right; }
.more { margin-top: 56px; }
.more h2 { font-size: 22px; margin-bottom: 18px; }

/* footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); padding: 28px 0 44px; color: var(--muted); font-size: 14px; }
.site-footer p { max-width: 70ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }
.site-footer a { color: var(--muted); }

/* editor (/blog/write) */
.write { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; padding-top: 28px; align-items: start; }
.write-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.write-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.write-list h2 { font-size: 16px; }
.side-list { display: grid; gap: 4px; }
.side-list button { display: grid; gap: 4px; justify-items: start; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 14.5px; color: var(--text); }
.side-list button:hover { background: var(--surface-2); }
.side-list button[aria-current] { background: var(--brand-soft); }
.side-list b { font-weight: 600; line-height: 1.3; }
.state { font-size: 12px; font-weight: 700; color: var(--gold); }
.state.published { color: var(--income); }
.editor { display: grid; gap: 14px; }
.editor label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.editor label .meta { font-weight: 400; }
.editor .row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.input { width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; padding: 10px 12px; outline: none; font-weight: 400; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.title { font-size: 26px; font-weight: 750; letter-spacing: -.015em; padding: 12px 14px; }
textarea.input { resize: vertical; line-height: 1.6; }
.input.body { font: 15.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 380px; }
.tabs { display: flex; align-items: center; gap: 4px; margin-bottom: -6px; }
.tabs button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.preview { margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-height: 380px; }
.editor code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 5px; padding: 1px 5px; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--border); }
#status.error { color: var(--danger); }
@media (max-width: 860px) {
  .write { grid-template-columns: minmax(0, 1fr); }
  .editor .row { grid-template-columns: 1fr; }
}

.admin-tabs { display: flex; gap: 4px; padding-top: 22px; overflow-x: auto; }
.admin-tabs button { border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.admin-tabs button[aria-selected="true"] { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.write[hidden] { display: none; }
.write { padding-top: 18px; }
.editor .row.narrow { grid-template-columns: 120px 1fr; }
.editor .pair { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.editor label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* home */
.home-hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 48px 0 40px; }
.home-hero h1 { font-size: clamp(44px, 8vw, 76px); letter-spacing: -.04em; line-height: .98; }
.home-hero .lead { font-size: 19px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 12px; }
.phone { margin: 0 auto; width: min(100%, 290px); border-radius: 34px; padding: 8px; background: #0e1215; border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(15, 118, 110, .22), var(--shadow); }
.phone img { display: block; width: 100%; height: auto; border-radius: 27px; }
.section { margin-top: 64px; }
.section > h2, .section-head h2, .shots h2 { font-size: clamp(24px, 3.4vw, 32px); }
.section > h2 { margin-bottom: 22px; max-width: 22ch; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.section .filters { margin: 14px 0 22px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; color: inherit; text-decoration: none; display: block; }
a.feature:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); font-size: 22px; margin-bottom: 14px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15px; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.shots .lead { margin-bottom: 20px; }
.shot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.shot-row .phone { border-radius: 26px; padding: 6px; }
.shot-row .phone img { border-radius: 20px; }
.shot-row .phone:last-child { margin-top: 36px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.plan.pro { border-color: var(--brand-2); border-width: 2px; }
.plan h3 { font-size: 16px; color: var(--muted); }
.plan .price { font-size: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan .price span { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan p:not(.price) { color: var(--muted); margin-bottom: 10px; flex: 1; }
@media (max-width: 760px) {
  .home-hero, .shots, .plans { grid-template-columns: 1fr; }
  .home-hero { padding-top: 32px; }
}

/* about, contact, login */
.about { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
.about .prose { margin-top: 0; }
.about-side { display: grid; gap: 18px; justify-items: center; position: sticky; top: 84px; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .about-side { position: static; } }
.details th { width: 130px; font-size: 14px; }
.details table { border-collapse: collapse; width: 100%; }
.details th, .details td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.details tr:last-child :is(th, td) { border-bottom: 0; }
.details th { color: var(--muted); font-weight: 600; }
.details + .meta { margin-top: 12px; }
.login-card { max-width: 420px; margin: 56px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 24px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-card h1 { font-size: 26px; }
.login-card .lead { font-size: 16px; margin: 0; }
.login-card .cta-row { margin: 6px 0 0; }
.error { color: var(--danger); }
.ask { margin-top: 36px; padding: 16px 18px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: 15.5px; }

/* offers */
.offer-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--gold-soft); color: var(--gold); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.offer-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 20px 0; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border)); color: var(--text); text-decoration: none; }
.offer-banner .go { margin-left: auto; color: var(--brand); font-weight: 600; white-space: nowrap; }
.offer-banner code, .code-box code { font: 700 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }
.offer-banner code { border: 1px dashed var(--border); border-radius: 8px; padding: 3px 9px; }
.offer-list { display: grid; gap: 20px; }
.offer-card { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--gold); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.offer-card h2 { font-size: clamp(24px, 3.4vw, 32px); }
.offer-card .prose { margin: 0; padding: 0; border: 0; font-size: 17px; max-width: 64ch; }
.offer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.code-box { display: inline-flex; align-items: center; gap: 10px; border: 1.5px dashed var(--border); border-radius: 12px; padding: 7px 8px 7px 14px; background: var(--bg); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 4px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; margin-bottom: 8px; }
.steps span { color: var(--muted); font-size: 15px; }
.refer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.refer > div { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; }
.refer h2 { font-size: 21px; margin-bottom: 8px; }
.refer p { color: var(--muted); margin-bottom: 16px; }
@media (max-width: 720px) { .refer { grid-template-columns: 1fr; } }
.offer-pop { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: min(360px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--gold); border-radius: 18px; padding: 20px; box-shadow: 0 20px 50px rgba(16, 24, 40, .22); display: grid; gap: 8px; justify-items: start; animation: pop-in .35s cubic-bezier(.2, .8, .2, 1); }
.offer-pop h2 { font-size: 19px; padding-right: 20px; }
.offer-pop p { color: var(--muted); font-size: 14.5px; }
.offer-pop .code-box { padding: 4px 5px 4px 11px; }
.pop-close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 9px; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.pop-close:hover { background: var(--surface-2); color: var(--text); }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px); } }
@media (max-width: 520px) { .offer-pop { right: 16px; bottom: 16px; } }

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