/* marten.sh, Marten's own page. Laid out from the left edge: a header that scrolls away, one big line, two narrow
   columns, a band of chats over the painting, then the letter's rows under handwritten headings. Every control is glass. */
@font-face {
  font-family: "Reenie Beanie";
  src: url("/fonts/reenie.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #fff;
  --ink: #141414;
  --ink-2: rgb(20 20 20 / .66);
  --dim: rgb(20 20 20 / .42);
  --hair: rgb(20 20 20 / .08);
  --mine: #8a4b2a;
  --glass: rgb(20 20 20 / .05);
  --glass-hover: rgb(20 20 20 / .09);
  --pen: "Reenie Beanie", "Bradley Hand", cursive;
  --gutter: clamp(16px, 3.4vw, 48px);
  --ease: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --ink: rgb(255 255 255 / .94);
    --ink-2: rgb(255 255 255 / .66);
    --dim: rgb(255 255 255 / .42);
    --hair: rgb(255 255 255 / .07);
    --mine: #a35a34;
    --glass: rgb(255 255 255 / .08);
    --glass-hover: rgb(255 255 255 / .13);
  }
}

* { box-sizing: border-box; }
/* The page's own colours for the scrollbar and the overscroll behind it, light or dark. */
html {
  scroll-behavior: smooth; -webkit-text-size-adjust: 100%;
  background: var(--bg); scrollbar-color: var(--dim) var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
p, h1 { margin: 0; }
b { font-weight: 500; }
.dim { color: var(--dim); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main, .top, footer { animation: enter 1s cubic-bezier(.45, .05, .25, 1) both; }
@keyframes enter { from { opacity: 0; filter: blur(12px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } }

/* --- Glass: a frosted fill and nothing else, no border and no shadow. --- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
a.glass:hover, button.glass:hover { background: var(--glass-hover); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .25s var(--ease), opacity .2s, background .2s;
}
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: scale(.97); }
.pill.solid { background: var(--ink); color: var(--bg); box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), 0 6px 16px -8px rgb(0 0 0 / .4); }
.pill.solid:hover { opacity: .9; }
.plus { font-weight: 400; opacity: .6; }

/* --- The faces: the app's avatars, square tiles with 22% corners. --- */
.face { display: inline-block; width: 22px; height: 22px; flex: none; line-height: 0; vertical-align: -5px; }
.face svg { width: 100%; height: 100%; }

/* --- Header: scrolls away with the page. --- */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
}
.logo { display: block; line-height: 0; color: var(--ink); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.idle { display: block; width: 92px; margin: -6px 0 -6px -10px; }
.idle svg { width: 100%; height: auto; overflow: visible; }
.nav { position: absolute; left: 50%; transform: translateX(-50%); gap: 16px; height: 32px; padding: 0 14px; font-weight: 400; }
.nav:hover, .nav:active { transform: translateX(-50%); }
.nav a { text-decoration: none; font-size: 14px; transition: opacity .2s; }
.nav:hover a { opacity: .5; }
.nav a:hover { opacity: 1; }

/* --- The big line and the two columns. --- */
main { padding: 0 var(--gutter); }
.hero {
  max-width: 900px;
  margin-top: 64px;
  font-size: clamp(32px, 4.4vw, 52px); line-height: 1.02; font-weight: 500; letter-spacing: -.036em;
}
/* The name: handwritten alone, as if signed into the line. The old one's letters lift away and blur out one by one as
   the new one's rise in, and the word's width eases from one to the other. The pen is thin beside the sans, so it's
   drawn with a little stroke. */
.name {
  display: inline-grid; vertical-align: baseline; margin: 0 -.02em 0 .08em;
  font: 400 1.34em/0 var(--pen); letter-spacing: .015em;
  -webkit-text-stroke: .018em currentColor;
  transition: width .8s var(--ease);
}
.word { grid-area: 1 / 1; justify-self: start; white-space: pre; }
.word i { display: inline-block; font-style: normal; transition: transform .7s var(--ease), opacity .6s ease, filter .6s ease; transition-delay: calc(var(--i) * 35ms); }
.word.below i { transform: translateY(.32em); opacity: 0; filter: blur(8px); }
.word.above i { transform: translateY(-.32em); opacity: 0; filter: blur(8px); }
.intro { display: flex; gap: clamp(24px, 4vw, 56px); margin-top: 52px; }
.col { flex: none; }
.letter { width: 290px; }
.letter p + p { margin-top: 1.1em; }
.pitch { width: 360px; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.names { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--dim); font-size: 14px; }
.names .faces { display: inline-flex; }
.names .faces .face { width: 20px; height: 20px; margin-right: -4px; box-shadow: 0 0 0 2px var(--bg); border-radius: 5px; }

/* --- The band: chats drifting across the painting, frosted. --- */
.band {
  position: relative;
  margin: 72px calc(-1 * var(--gutter)) 0;
  height: 500px;
  overflow: hidden;
  display: flex; align-items: center;
}
.band-art, .band-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band-art img { transform: scale(1.04); }
.band::before, .band::after {
  content: ""; position: absolute; top: 0; bottom: 0; z-index: 1; width: 14%;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  pointer-events: none;
}
.band::before { left: 0; mask: linear-gradient(to right, #000, transparent); -webkit-mask: linear-gradient(to right, #000, transparent); }
.band::after { right: 0; mask: linear-gradient(to left, #000, transparent); -webkit-mask: linear-gradient(to left, #000, transparent); }
.track { position: relative; display: flex; gap: 20px; padding: 0 20px; width: max-content; animation: drift 70s linear infinite; }
.band:hover .track { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(-50%); } }
.chat {
  width: 330px; margin: 0; flex: none;
  border-radius: 24px; overflow: hidden;
  --glass: rgb(250 248 244 / .6);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5);
  color: #141414;
}
@media (prefers-color-scheme: dark) { .chat { --glass: rgb(26 24 22 / .5); color: rgb(255 255 255 / .94); } }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; font-size: 13px; }
.chat-head > span:last-child { opacity: .5; }
.chat-head .faces { display: inline-flex; }
.chat-head .faces > * { margin-right: -5px; border-radius: 6px; }
.chat-head .faces + b { margin-left: 6px; }
.person { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50% !important; background: #c9b19a; color: #fff; font-size: 11px; font-weight: 600; }
.person.p2 { background: #8ea2b8; }
.thread { display: flex; flex-direction: column; gap: 5px; padding: 4px 14px 14px; font-size: 13.5px; line-height: 1.38; min-height: 200px; }
.bubble { max-width: 84%; padding: 8px 12px; border-radius: 18px; }
.mine { align-self: flex-end; background: var(--mine); color: #fff; }
.theirs { align-self: flex-start; background: rgb(255 255 255 / .72); }
@media (prefers-color-scheme: dark) { .theirs { background: rgb(255 255 255 / .1); } }
.who { display: block; font-size: 11px; opacity: .5; margin-bottom: 1px; }
.task {
  align-self: flex-start; display: flex; align-items: center; gap: 8px;
  margin-top: 3px; padding: 6px 12px; border-radius: 12px; background: rgb(255 255 255 / .72);
}
@media (prefers-color-scheme: dark) { .task { background: rgb(255 255 255 / .1); } }
.task time { margin-left: 14px; opacity: .5; }
.ring { width: 12px; height: 12px; border: 1.5px solid currentColor; opacity: .45; border-radius: 50%; }
.sketch-icon { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, transparent 42%, var(--mine) 43% 57%, transparent 58%), rgb(0 0 0 / .06); }
.voice { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 18px; }
.voice time { font-size: 12px; opacity: .85; }
.play { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.wave { display: flex; align-items: center; gap: 2px; height: 18px; }
.wave i { width: 2px; border-radius: 1px; background: currentColor; opacity: .7; }
.chat figcaption { padding: 10px 16px 14px; font-size: 12px; opacity: .6; border-top: 1px solid rgb(127 127 127 / .14); }
.chat figcaption b { opacity: 1; }

/* --- The letter's rows, under handwritten words. --- */
.sheet { max-width: 560px; }
section { margin-top: 72px; }
h2 { margin: 0 0 12px; font: 400 28px/1 var(--pen); letter-spacing: .02em; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li, .opens button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hair);
}
.rows time, .rows .dim { flex: none; color: var(--dim); font-variant-numeric: tabular-nums; }
.day .face { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.opens > li { display: block; padding: 0; border: 0; }
.opens button {
  width: 100%; margin: 0; border-top: 0; border-left: 0; border-right: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.opens button:hover .dim, .opens button[aria-expanded="true"] .dim { color: var(--ink); }
.sign { position: relative; flex: none; width: 11px; height: 11px; align-self: center; color: var(--dim); transition: transform .35s var(--ease), color .2s; }
.sign::before, .sign::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; border-top: 1px solid currentColor; }
.sign::after { transform: rotate(90deg); transition: transform .35s var(--ease); }
.opens button:hover .sign { color: var(--ink); }
.opens button[aria-expanded="true"] .sign { transform: rotate(180deg); color: var(--ink); }
.opens button[aria-expanded="true"] .sign::after { transform: rotate(180deg); }
.answer { padding: 10px 0 14px 14px; color: var(--ink-2); border-bottom: 1px solid var(--hair); }
.answer p + p { margin-top: 6px; }
.answer:not([hidden]) { animation: rise .45s var(--ease) both; }
kbd { font: inherit; padding: 0 5px; border-radius: 6px; background: var(--hair); }
.note { margin-top: 14px; color: var(--dim); }

/* A word kept private: blurred, with a note on hover. */
.redacted { filter: blur(4px); cursor: default; user-select: none; outline: none; }
[data-tip] { cursor: default; }
.tip {
  position: fixed; left: 0; top: 0; z-index: 9; margin: 0;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.tip.on { opacity: 1; }

/* --- The shelf: the Martens as book spines; the one under the pointer opens to its cover. --- */
.shelf { display: flex; align-items: flex-end; gap: 3px; height: 214px; }
.spine {
  position: relative; flex: 0 0 34px; height: 100%;
  border: 0; padding: 0; margin: 0; cursor: pointer; overflow: hidden;
  border-radius: 3px 5px 5px 3px;
  background: var(--c); color: var(--tone);
  box-shadow: inset 3px 0 0 rgb(255 255 255 / .16), inset -4px 0 6px rgb(0 0 0 / .12), 0 4px 10px -4px rgb(0 0 0 / .35);
  transition: flex-basis .55s var(--ease), transform .3s var(--ease);
  font: inherit; text-align: left;
}
.spine:nth-child(3n) { height: 93%; }
.spine:nth-child(4n + 2) { height: 97%; }
.spine:not(.open):hover { transform: translateY(-4px); }
.spine.open { flex-basis: 164px; }
.spine:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.spine .title {
  position: absolute; left: 50%; top: 12px;
  transform: translateX(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-weight: 600; font-size: 13px; letter-spacing: .03em; white-space: nowrap;
  transition: opacity .25s;
}
.spine .spine-face { position: absolute; left: 50%; bottom: 10px; width: 18px; height: 18px; transform: translateX(-50%); transition: opacity .25s; }
.spine .cover {
  position: absolute; inset: 0; width: 164px; padding: 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; transition: opacity .25s;
}
.spine .cover .face { width: 64px; height: 64px; }
.spine .cover b { display: block; font-size: 22px; font-weight: 600; line-height: 1.1; }
.spine .cover span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; opacity: .85; }
.spine.open .title, .spine.open .spine-face { opacity: 0; }
.spine.open .cover { opacity: 1; transition-delay: .18s; }

/* --- Elsewhere: a glass pill for the email, and the signature. --- */
#get > p:first-of-type { margin-bottom: 18px; color: var(--ink-2); }
.field {
  display: flex; align-items: center; gap: 8px;
  max-width: 400px; height: 44px; padding: 0 6px 0 18px;
  border-radius: 999px;
  transition: background .25s;
}
.field:focus-within { background: var(--glass-hover); }
.field input[type="email"] { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: inherit; font: inherit; outline: none; }
.field input::placeholder { color: var(--dim); }
.field .pill span { display: inline-block; transition: transform .25s var(--ease); }
.field .pill:hover span { transform: translateX(3px); }
.field .pill:disabled { opacity: .5; }
.trap { position: absolute; left: -9999px; }
.invite-error { margin-top: 10px; font-size: 13px; color: #c4553a; }
.invite-sent { display: none; padding: 10px 0; }
.invite.sent form { display: none; }
.invite.sent .invite-sent, .invite-sent:target { display: block; }
.invite:has(.invite-sent:target) form { display: none; }

/* The signature: the running Marten (/marten.js) lands on the line and the words come clear under it. */
.signature { display: flex; flex-direction: column; align-items: flex-start; margin-top: 44px; }
.signer { position: relative; width: 120px; margin-left: -18px; line-height: 0; color: var(--ink); }
.signer::after {
  content: "";
  position: absolute; left: 12px; right: 48px; bottom: 8px;
  border-top: 1px solid var(--hair);
  transform: translateX(var(--run-x, 0px));
}
.signer svg { width: 100%; height: auto; }
.signer.waiting svg, .signer.waiting::after { visibility: hidden; }
.sign-line { margin: -2px 0 0 4px; font: 400 38px/1 var(--pen); white-space: nowrap; transition: opacity .6s ease, filter .6s ease; }
.signature.arriving .sign-line { opacity: .35; filter: blur(2px); }

footer { display: flex; gap: 18px; padding: 48px var(--gutter) max(28px, env(safe-area-inset-bottom)); font-size: 13px; color: var(--dim); }
footer span { margin-right: auto; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

/* --- The dock: a glass bar at the bottom once the intro has gone by. --- */
.dock {
  --glass: rgb(235 235 235 / .7);
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 8px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap;
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform .6s var(--ease), opacity .4s;
}
.dock.shown { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-color-scheme: dark) { .dock { --glass: rgb(60 60 60 / .6); } }
.dock .face { width: 28px; height: 28px; }
.dock-text span { color: var(--ink-2); }

@media (max-width: 760px) {
  .nav { display: none; }
  .hero { margin-top: 40px; }
  .intro { flex-direction: column; gap: 22px; margin-top: 32px; }
  .letter, .pitch { width: auto; max-width: 440px; }
  .band { height: 420px; margin-top: 48px; }
  .chat { width: 280px; }
  .shelf { overflow-x: auto; scrollbar-width: none; height: 196px; padding: 6px var(--gutter) 10px 0; margin-right: calc(-1 * var(--gutter)); }
  .shelf::-webkit-scrollbar { display: none; }
  .spine { flex-basis: 30px; }
  .rows > li, .opens button { gap: 14px; }
  .dock-text span { display: none; }
  section { margin-top: 56px; }
  .signature { margin-top: 32px; }
  .sign-line { font-size: 32px; }
  footer { padding-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main, .top, footer, .answer:not([hidden]) { animation: none; }
  .track { animation: none; }
  .band { overflow-x: auto; }
  .spine, .spine *, .tip, .pill, .dock { transition: none !important; }
}
