/* Meizinho: a light page, one sans (Geist), and one object drawn with care: the notebook, written in blue pen
   (Caveat), with the year's ruler under it. */
:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --paper: #fffdf6;
  --ink: #16181d;
  --soft: #5b616c;
  --mute: #8c919a;
  --line: #e5e1d6;
  --rule: #cfdff2;
  --margin: #e25c5c;
  --pen: #2346a8;
  --pencil: #9aa0aa;
  --ok: #1f8a4c;
  --warn: #c27a00;
  --bad: #c0352b;
  --r: 18px;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 12px; }
h1 { font-size: clamp(36px, 5.2vw, 58px); letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
h3 { font-size: 19px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }
.soft { color: var(--soft); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.hide { display: none !important; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 600 16px/1 var(--sans); padding: 15px 24px; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.btn:hover { background: #2b2f37; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 10px 16px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 6px 0; color: var(--soft); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

/* header and footer */
header.top { position: sticky; top: 0; z-index: 20; background: rgba(247,245,240,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.bar nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.bar nav a:not(.btn) { text-decoration: none; color: var(--soft); }
.bar nav a:not(.btn):hover { color: var(--ink); }
footer { border-top: 1px solid var(--line); margin-top: 40px; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px 48px; padding: 36px 0 40px; }
.foot p { max-width: 520px; margin-top: 12px; }
.foot .links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.foot .links a { color: var(--soft); text-decoration: none; }
.foot .tiny { grid-column: 1 / -1; margin: 0; }

/* fields */
.field { display: grid; gap: 6px; font-size: 14px; color: var(--soft); }
.field > span { font-weight: 500; }
input, select, textarea { font: 400 16px/1.3 var(--sans); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.err { color: var(--bad); font-size: 14px; min-height: 0; margin: 6px 0; }
.err:empty { display: none; }

/* ---------- the notebook ---------- */
.book { position: relative; background: var(--paper); border-radius: 6px 6px 14px 14px; box-shadow: 0 1px 0 #e9e3d3, 0 18px 40px -18px rgba(40,34,20,.28), 0 2px 6px rgba(40,34,20,.06); padding: 34px 22px 18px 64px; overflow: hidden; }
.book::before { /* the margin */ content: ''; position: absolute; left: 50px; top: 0; bottom: 0; width: 1.5px; background: var(--margin); opacity: .75; }
.book .rings { position: absolute; left: 0; right: 0; top: 10px; display: flex; justify-content: space-around; padding: 0 22px; pointer-events: none; }
.book .rings i { width: 11px; height: 11px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.lines { --lh: 38px; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--lh) - 1px), var(--rule) calc(var(--lh) - 1px), var(--rule) var(--lh)); background-position: 0 -1px; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; height: 38px; font-family: var(--hand); font-size: 30px; color: var(--pen); line-height: 38px; }
.page-head small { font-family: var(--sans); font-size: 12px; color: var(--mute); letter-spacing: .02em; }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 52px 1fr auto; align-items: end; gap: 10px; height: 38px; line-height: 38px; font-family: var(--hand); font-size: 25px; color: var(--pen); position: relative; }
.entry .d { font-size: 20px; color: var(--pen); opacity: .8; }
.entry .w { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .w em { font-style: normal; font-size: 16px; font-family: var(--sans); color: var(--mute); margin-left: 6px; letter-spacing: .01em; }
.entry .v { font-variant-numeric: tabular-nums; padding-right: 10px; }
.entry.ex { color: var(--pencil); }
.entry.ex .d { color: var(--pencil); }
.entry.new .ink { display: inline-block; clip-path: inset(0 100% 0 0); animation: write .9s cubic-bezier(.4,.1,.3,1) forwards; }
.entry.new .v .ink { animation-delay: .35s; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
button.entry { width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
button.entry:hover .w { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.say { display: flex; align-items: center; gap: 10px; height: 54px; margin-top: 2px; position: relative; }
.say::before { content: '✎'; position: absolute; left: -36px; top: 50%; transform: translateY(-50%); color: var(--margin); font-size: 18px; }
.say input { flex: 1; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; padding: 10px 2px; font: 400 18px/1.2 var(--sans); }
.say input::placeholder { color: var(--pencil); }
.say button { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
.say button:disabled { opacity: .4; }
.say button svg { width: 20px; height: 20px; }
.reply { font-size: 14px; color: var(--soft); min-height: 22px; margin: 8px 0 0; }
.reply b { color: var(--ink); font-weight: 600; }
.tries { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--mute); }
.tries button { background: none; border: 0; padding: 2px 0; color: var(--soft); font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }

/* the year's ruler */
.ruler { margin-top: 18px; }
.ruler .nums { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.ruler .big { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ruler .of { color: var(--soft); font-size: 15px; }
.ruler .track { position: relative; height: 62px; }
.ruler svg { width: 100%; height: 40px; display: block; overflow: visible; }
.ruler .track .fill { position: absolute; left: 0; top: 12px; height: 18px; border-radius: 9px; transition: width 1s cubic-bezier(.3,.7,.2,1), background .4s; }
.ruler .track .proj { position: absolute; top: 15px; height: 12px; border: 2px dashed; border-radius: 6px; transition: left 1s cubic-bezier(.3,.7,.2,1), width 1s cubic-bezier(.3,.7,.2,1), opacity .4s; }
.ruler .lab { position: absolute; top: 42px; font-size: 13px; white-space: nowrap; }
.ruler .lab.zero { left: 0; color: var(--mute); }
.ruler .lab.lim { transform: translateX(calc(-100% - 6px)); font-weight: 600; }
.ruler .lab.tol { transform: translateX(-50%); color: #a3651b; }
.ruler .say-pace { font-size: 15px; margin-top: 10px; color: var(--ink); }
.ruler .say-pace.warn { color: var(--warn); }
.ruler .say-pace.bad { color: var(--bad); }
.ruler .say-pace .soft { color: var(--soft); }

/* cards on the app and the landing */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.card h3 { margin-bottom: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

dialog { border: 0; border-radius: 20px; padding: 24px; width: min(440px, 100vw - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(22,24,29,.35); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }

@media (max-width: 760px) {
  .hide-s { display: none; }
  .foot { grid-template-columns: 1fr; }
  .book { padding: 30px 14px 14px 46px; }
  .book::before { left: 34px; }
  .say::before { left: -28px; }
  .entry { grid-template-columns: 40px 1fr auto; font-size: 22px; gap: 8px; }
  .entry .d { font-size: 17px; }
  .entry .w em { display: none; }
  .ruler .big { font-size: 26px; }
}
