@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* Layout: one living sky. The message and the way to get in touch sit low on the left, the running total
   low on the right. Nothing explains the birds; they show it. */
:root {
  --fg: #1a1915; --soft: #4b4943; --line: rgba(26, 25, 21, 0.16); --lost: #a03c06; --blue: #3565bd;
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-night="true"] { --fg: #f2f4fa; --soft: #b7c0d6; --line: rgba(242, 244, 250, 0.2); --lost: #ffc46b; --blue: #9dbcf5; color-scheme: dark; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { position: relative; overflow: hidden; background: linear-gradient(#bccff5, #f6e9ec 60%, #ffe0d2); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; transition: color 0.2s; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#birds { touch-action: pinch-zoom; }
#birds:focus-visible { outline: 2px solid var(--blue); outline-offset: -6px; }
.edge { box-sizing: border-box; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }

.mark { position: absolute; z-index: 3; top: 22px; left: 0; display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; pointer-events: none; }
.mark svg { width: 36px; height: 36px; display: block; }

#words { position: absolute; z-index: 2; left: 0; right: 0; bottom: 41px; max-width: 820px; pointer-events: none; }
#words h1 { margin: 0; font-weight: 400; font-size: clamp(34px, 4.1vw, 60px); line-height: 1.04; letter-spacing: -0.042em; text-wrap: balance; }
#words p { margin: 14px 0 10px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.45; color: var(--soft); text-wrap: balance; transition: color 0.2s; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
/* The dashboard's icons: Lucide at 16px, all with the same line, each on its sharpest half pixel. */
.lucide { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* Three words become a place to type an email, and then a thank you. They all sit on the same
   line of text, so nothing else on the page moves. */
#contact { position: relative; display: flex; align-items: center; height: 40px; font-size: clamp(16px, 1.4vw, 19px); letter-spacing: -0.01em; }
#reach { display: inline-flex; align-items: center; gap: 10px; height: 40px; font-weight: 500; pointer-events: auto; transition: color 0.2s; }
#reach .lucide { transition: transform 0.45s var(--out); }
#reach:hover { color: var(--blue); }
#reach:hover .lucide { transform: translateX(4px); }
#talk { display: flex; align-items: center; max-width: 100%; pointer-events: auto; animation: rise 0.4s var(--out); }
/* Where the browser can, the box is as wide as what's typed, so Send stays right beside it. */
#email { box-sizing: border-box; width: 260px; min-width: 0; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 0; outline: none; background: none; color: inherit; caret-color: var(--blue); font: inherit; letter-spacing: inherit; }
@supports (field-sizing: content) { #email { field-sizing: content; width: auto; max-width: min(420px, calc(100vw - 92px)); } }
#email::placeholder { color: var(--soft); opacity: 1; }
/* The browser colours in a saved email. Its colour is kept from showing, so it stays on the sky. */
#email:autofill { -webkit-text-fill-color: var(--fg); caret-color: var(--blue); background-clip: text; -webkit-background-clip: text; transition: background-color 1s 100000s; }
/* Send is grey, as in the dashboard, until there is an email to send. */
#send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--soft); transition: color 0.2s; }
#send .lucide { translate: 0.5px 0; }
#talk:has(#email:valid) #send, #send:hover { color: var(--blue); }
#send[disabled] { opacity: 0.6; cursor: default; }
.unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#words #said { position: absolute; left: 0; top: 100%; margin: 0; font-size: 15px; line-height: 20px; color: var(--fg); }
#words .sent #said { position: static; font-size: inherit; line-height: 40px; font-weight: 500; animation: rise 0.4s var(--out); }

#total { position: absolute; z-index: 2; right: 0; bottom: 48px; text-align: right; pointer-events: none; opacity: 0; transition: opacity 0.8s; }
#total.on { opacity: 1; }
#total b { display: block; font-size: clamp(34px, 3.6vw, 52px); font-weight: 400; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
#total span { display: block; margin-top: 2px; font-size: 16px; line-height: 1.4; color: var(--soft); transition: color 0.2s; }

/* One ring and one short line: no owner, then a name, then what it saved. */
#tag { position: absolute; z-index: 1; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity 0.35s; pointer-events: none; will-change: transform; }
#tag.on { opacity: 1; }
/* The faint line and the fill are in the same picture, so they always grow together. */
#tag svg { position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; fill: none; overflow: visible; transition: opacity 0.4s; }
#tag.on:not(.done) svg { animation: call 2s ease-in-out infinite; will-change: transform; }
#tag circle { stroke: var(--lost); stroke-width: 2; }
#tag circle:first-child { stroke-opacity: 0.28; }
#tag circle:last-child { stroke-dasharray: 100; stroke-dashoffset: 100; }
@keyframes call { 50% { transform: scale(1.1); } }
#tag.done svg { opacity: 0; }
#tag b { position: absolute; left: 0; top: 0; width: max-content; will-change: transform; font-weight: 500; font-size: clamp(18px, 1.6vw, 23px); line-height: 1.25; letter-spacing: -0.02em; }
#tag b.turn { animation: rise 0.5s var(--out); }
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 720px) {
  .edge { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
  .mark { top: 14px; }
  #words p { margin: 12px 0 6px; }
  #total { top: 14px; bottom: auto; }
  #total b { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
  #total span { margin: 0; font-size: 14px; }
  #words { bottom: 48px; }
}
@media (prefers-reduced-motion: reduce) { #reach .lucide { transition: none; } #talk, #words .sent #said { animation: none; } #tag svg, #tag b.turn { animation: none !important; } }
