/* Mailwell's homepage, next rev. A white page, the system's own type (SF Pro
   on a Mac), ink and one gray, and big two-tone statements: the ink half is
   what's said, the gray half what follows. The app is drawn in the page at
   its own size and works. Built on next.css for the app's pieces; this file
   is the page around them. */

:root {
  --bg: #fff; --ink: #151515; --ink-hover: #262626; --ink-2: #858582; --lo: #a6a6a3;
  --line: rgb(0 0 0 / .08); --line-2: rgb(0 0 0 / .18); --soft: #f4f4f3; --soft-2: #ececea;
  --gutter: max(clamp(24px, 6vw, 128px), env(safe-area-inset-left), env(safe-area-inset-right));
  --max: 1440px; --side: max(var(--gutter), 50% - var(--max) / 2);
  --sans: system-ui, -apple-system, "Geist", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* next.css's names, for the app's pieces */
  --ground: #fff; --card: #f4f4f3; --bubble: #fbfbfa; --raised: #fff; --pill: #ececea; --pill-hover: #e2e2e0;
  --sub: #6f6f6c; --faint: #a6a6a3; --gray: #a6a6a3; --hair: rgb(0 0 0 / .10); --ring: rgb(0 0 0 / .07);
  --black: #151515; --black-ink: #fff; --indigo: #4D61C4;
  /* a lift on a plain page: a close contact shadow and a tighter one under it, never a smudge */
  --lift: 0 0 0 .5px rgb(0 0 0 / .10), 0 1px 2px rgb(0 0 0 / .05), 0 18px 34px -18px rgb(20 24 60 / .22);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e; --ink: #ececea; --ink-hover: #dbdbd9; --ink-2: #7d7d79; --lo: #585855;
    --line: rgb(255 255 255 / .09); --line-2: rgb(255 255 255 / .22); --soft: #191918; --soft-2: #222221;
    --ground: #0e0e0e; --card: #191918; --bubble: #232322; --raised: #1d1d1c; --pill: #262625; --pill-hover: #303030;
    --sub: #9a9a96; --faint: #6c6c68; --gray: #585855; --hair: rgb(255 255 255 / .10); --ring: rgb(255 255 255 / .08);
    --black: #ececea; --black-ink: #0e0e0e; --indigo: #8C9DF0;
    --lift: 0 0 0 .5px rgb(255 255 255 / .12), 0 18px 34px -18px rgb(0 0 0 / .7);
  }
}

body.h { background: var(--bg); color: var(--ink-2); font: 400 13.5px/1.62 var(--sans); overflow-x: clip; }
.h main { overflow-x: clip; }
.h a { color: var(--ink); text-decoration: none; }
.h ::selection { background: var(--ink); color: var(--bg); }
.h .wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.h .kbd, .h .pal input, .h textarea, .h button { font-family: var(--sans); }
.lo { color: var(--lo); }

/* buttons: an ink one lifted off the page, a soft one beside it */
.h .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 23px;
  border: 1px solid var(--line-2); border-radius: 99px; font: 600 14.5px/1 var(--sans); letter-spacing: -.005em; color: var(--ink); white-space: nowrap;
  transition: border-color .2s, background-color .2s, color .2s, transform .2s var(--ease);
}
.h .btn:active { transform: scale(.97); }
.h .btn .ic { width: 15px; height: 15px; stroke-width: 2.2; margin-left: -3px; }
.h .btn--ink { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: 0 13px 24px -6px rgb(0 0 0 / .17), 0 5px 10px -4px rgb(0 0 0 / .16); }
@media (hover: hover) { .h .btn--ink:hover { background: var(--ink-hover); border-color: var(--ink-hover); } }
.h .btn--soft { background: var(--soft); border-color: transparent; }
.h .btn--soft:hover { background: var(--soft-2); }
.h .btn--sm { height: 33px; padding: 0 15px; font-size: 13.5px; }
.h .btn--ink.btn--sm { box-shadow: 0 10px 18px -5px rgb(0 0 0 / .17), 0 4px 8px -4px rgb(0 0 0 / .16); }
.h .btn--sm .ic { width: 13px; height: 13px; }
.h .btn .pro { margin-left: 4px; padding: .32em .7em .34em; border-radius: 99px; background: var(--bg); font: 600 11px/1 var(--sans); color: var(--ink-2); }
/* a button says a second thing under the pointer: the first label leaves to the left as the second comes in from the right */
.swap { position: relative; }
.lbl { display: inline-grid; position: relative; }
.lbl > span, .swap > .ic { transition: opacity .3s var(--ease), filter .3s var(--ease), translate .4s var(--ease); }
.lbl-b { position: absolute; inset: 0 -40px; display: grid; place-items: center; opacity: 0; filter: blur(3px); translate: 10px 0; }
.swap > .ic + .lbl .lbl-b { inset: 0 -40px 0 -62px; }
@media (hover: hover) {
  .swap:hover .lbl-a, .swap:hover > .ic { opacity: 0; filter: blur(3px); translate: -10px 0; }
  .swap:hover .lbl-b { opacity: 1; filter: none; translate: none; }
}
.duo { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.fine { margin: 20px 0 0; color: var(--ink-2); }

/* the bar: the mark at the left, the links at the right; past the claim's buttons, the download takes their place */
.mini { position: fixed; z-index: 30; top: 18px; left: var(--side); height: 33px; display: flex; align-items: center; gap: 8px; font: 600 16px/1 var(--sans); letter-spacing: -.02em; }
.mini i { width: 19px; height: 19px; background: var(--indigo); -webkit-mask: url("seal.svg") center / contain no-repeat; mask: url("seal.svg") center / contain no-repeat; transition: rotate .6s var(--ease); }
.mini:hover i { rotate: 45deg; }
.controls { position: fixed; z-index: 30; top: 18px; right: calc(var(--side) - 6px); display: flex; align-items: center; gap: 12px; line-height: 1; }
.controls > a:not(.btn) { padding: 8px 6px; color: var(--ink-2); transition: color .2s, opacity .3s .12s, translate .45s var(--ease), visibility 0s; }
.controls > a:not(.btn):hover { color: var(--ink); }
.controls .ver { margin-left: 5px; padding: 3px 5px 2px; border: 1px solid var(--line-2); border-radius: 5px; font-size: 10.5px; font-weight: 500; letter-spacing: .01em; vertical-align: 1px; }
.controls > .btn { margin: 0 6px; transition: background-color .2s, opacity .3s .12s, translate .45s var(--ease), transform .2s var(--ease), visibility 0s; }
.is-past-cta .controls > a { opacity: 0; visibility: hidden; translate: -8px 0; transition: opacity .15s, translate .3s var(--ease), visibility 0s .15s; }
.get { position: absolute; right: 6px; top: 50%; translate: 0 -50%; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.get .btn { pointer-events: auto; opacity: 0; visibility: hidden; transform: translateX(8px); transition: opacity .25s, transform .45s var(--ease), visibility 0s .45s; }
.is-past-cta .get .btn { opacity: 1; visibility: visible; transform: none; transition: opacity .3s .12s, transform .45s var(--ease); }
@media (max-width: 640px) { .controls > a:not(.btn) { display: none; } }
/* what scrolls under the bar goes soft: eight bands, each blurring twice the last */
.edge { position: fixed; z-index: 15; inset: 0 0 auto; height: 76px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.is-float .edge { opacity: 1; }
.edge i { position: absolute; inset: 0; -webkit-backdrop-filter: blur(var(--b)); backdrop-filter: blur(var(--b));
  --m: linear-gradient(to top, #0000 calc(var(--n) * 12.5%), #000 calc((var(--n) + 1) * 12.5%) calc((var(--n) + 2) * 12.5%), #0000 calc((var(--n) + 3) * 12.5%));
  -webkit-mask: var(--m); mask: var(--m); }
.edge i:nth-child(1) { --n: 0; --b: .4px; } .edge i:nth-child(2) { --n: 1; --b: .8px; } .edge i:nth-child(3) { --n: 2; --b: 1.5px; } .edge i:nth-child(4) { --n: 3; --b: 3px; }
.edge i:nth-child(5) { --n: 4; --b: 6px; } .edge i:nth-child(6) { --n: 5; --b: 12px; } .edge i:nth-child(7) { --n: 6; --b: 18px; } .edge i:nth-child(8) { --n: 7; --b: 27px; }

/* type: a statement in ink, and its quiet half */
.h .say { max-width: 21em; margin: 0; font-weight: 500; font-size: clamp(28px, 3.25vw, 52px); line-height: 1.08; letter-spacing: -.022em; color: var(--ink); text-wrap: pretty; }
.h .say .lo, .h .say span.lo { color: var(--lo); }
.h .say + .say { margin-top: .42em; }
.block { margin-top: clamp(120px, 14vw, 212px); }
.block .duo { margin-top: 34px; }

/* the claim: the icon, two lines, the buttons */
.hello { padding-top: clamp(124px, 19vh, 230px); }
.h .appicon { display: block; margin: 0 0 22px -6px; }
.h .appicon img { display: block; width: 76px; height: 76px; filter: drop-shadow(0 10px 16px rgb(30 40 110 / .14)); }
.claim { margin: 0; font-weight: 600; font-size: clamp(34px, 4.1vw, 62px); line-height: 1.06; letter-spacing: -.028em; color: var(--ink); }
.turn { display: grid; }
.turn > span { grid-area: 1 / 1; opacity: 0; filter: blur(8px); translate: 14px 0; transition: opacity .5s var(--ease), filter .5s var(--ease), translate .6s var(--ease); }
.turn > .on { opacity: 1; filter: none; translate: none; }
.turn > .was { translate: -14px 0; }
.hello .duo { margin-top: clamp(26px, 2.4vw, 36px); }

/* the desk: the window at its own size, rising under the claim */
.desk { position: relative; margin-top: clamp(56px, 7vw, 104px); padding-inline: var(--side); }
.desk::before { content: ""; position: absolute; inset: 6% 8% 0; z-index: 0; filter: blur(80px); opacity: .5; pointer-events: none;
  background: radial-gradient(40% 50% at 20% 40%, #d3daf8, #0000 70%), radial-gradient(36% 46% at 80% 30%, #f6ddd3, #0000 70%), radial-gradient(40% 50% at 55% 85%, #dcefdf, #0000 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .desk::before { opacity: .16; } }
.win { position: relative; z-index: 1; display: grid; grid-template-columns: 372px minmax(0, 1fr); width: 100%; max-width: 1180px; margin-inline: auto;
  --card: #f3f3f2; --bubble: #fcfcfb; --pill: #e6e6e4; --frost: rgb(255 255 255 / .82);
  background: #ededec; border-radius: 18px; text-align: left; font-size: 14px; line-height: 1.38; color: var(--ink);
  box-shadow: 0 0 0 .5px rgb(0 0 0 / .16), 0 2px 4px rgb(0 0 0 / .04), 0 44px 80px -36px rgb(20 26 70 / .34), 0 16px 30px -18px rgb(0 0 0 / .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .win { --card: #1d1d1c; --bubble: #2a2a29; --pill: #303030; --frost: rgb(52 52 50 / .82); background: #1b1b1a; box-shadow: 0 0 0 .5px rgb(255 255 255 / .14), 0 44px 80px -36px #000; } }
.win .col { position: relative; padding: 0 0 86px; min-height: 640px; border-radius: 18px 0 0 18px; overflow: hidden; }
.win .chrome { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 18px; }
.win .chrome i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; } .win .chrome i:nth-child(2) { background: #febc2e; } .win .chrome i:nth-child(3) { background: #28c840; }
.win .chrome .ic { margin-left: auto; color: var(--sub); width: 17px; height: 17px; }
.win h3 { margin: 0; padding: 6px 20px 10px; font-weight: 700; font-size: 26px; letter-spacing: -.035em; display: flex; align-items: center; gap: 8px; }
.win h3 .ic { width: 14px; height: 14px; color: var(--sub); stroke-width: 2.2; }
.win .day { margin: 0; padding: 6px 20px 6px; font-size: 13px; color: var(--sub); }
.win .rows { margin: 0; padding: 0; }
.win .r { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 11px 14px; margin: 0 8px; border-radius: 16px; max-height: 160px; cursor: default; }
.win .r::after { left: 66px; right: 6px; }
.win .r.sel { background: var(--bubble); box-shadow: 0 0 0 .5px var(--ring), 0 1px 2px rgb(0 0 0 / .04); }
.win .r .av { width: 40px; height: 40px; font-size: 14px; }
.win .r .who { font-size: 14px; letter-spacing: -.005em; }
.win .r .when { font-size: 12.5px; }
.win .r .subj { font-size: 14px; margin-top: 0; }
.win .r .prev { font-size: 13.5px; margin-top: 0; }
.win .r .pills { margin-top: 7px; gap: 6px; }
.win .r .p { height: 26px; padding: 0 10px; font-size: 12.5px; }
.win .r .accepted { font-size: 12.5px; }
.win .acts { right: 10px; top: 8px; }
.win .acts button { width: 28px; height: 28px; } .win .acts .ic { width: 15px; height: 15px; }
.win .rows .done { padding: 60px 20px; font-size: 14px; }
.win .dock { bottom: 18px; }
.win .dock .place, .win .dock .new { width: 38px; height: 38px; } .win .dock .ic { width: 18px; height: 18px; }
.win .dock .badge { box-shadow: 0 0 0 2px #ededec; }
.win .toast { bottom: 76px; font-size: 13.5px; }
.pane { position: relative; margin: 8px 8px 8px 0; border-radius: 12px; background: var(--bubble); box-shadow: 0 0 0 .5px var(--ring); padding: 0 36px; min-height: 624px; overflow: hidden; }
.pane .tools { height: 46px; display: flex; justify-content: flex-end; align-items: center; gap: 18px; color: var(--sub); margin-right: -16px; }
.pane .tools .ic { width: 17px; height: 17px; } .pane .tools .ic.gold { color: var(--marigold); }
.pane .open { display: none; }
.pane.has .open { display: block; } .pane.has .field { display: flex; } .pane.has .none { display: none; }
.pane .open.arrive { animation: arrive .5s var(--ease) both; }
@keyframes arrive { from { opacity: .15; transform: translateY(6px); filter: blur(4px); } }
.pane h2 { margin: 4px 0 20px; font-weight: 700; font-size: 24px; letter-spacing: -.03em; line-height: 1.2; color: var(--ink); }
.pane .from { display: flex; align-items: center; gap: 12px; }
.pane .from .av { width: 36px; height: 36px; font-size: 13px; }
.pane .from b { font-weight: 600; } .pane .from small { display: block; color: var(--sub); font-size: 12.5px; }
.pane .from small .chev { display: inline-block; width: 11px; height: 11px; margin: 0 7px 0 4px; vertical-align: -1px; stroke-width: 2.2; }
.pane .from small .acct { display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; background: var(--indigo); -webkit-mask: url("seal.svg") center / contain no-repeat; mask: url("seal.svg") center / contain no-repeat; }
.pane .from time { margin-left: auto; color: var(--sub); font-size: 12.5px; }
.pane .body { margin: 20px 0 0 48px; max-width: 48ch; font-size: 15px; line-height: 1.6; }
.pane .body p { margin: 0; } .pane .body p + p { margin-top: 12px; }
.pane .field { display: none; position: absolute; left: 22px; right: 22px; bottom: 20px; height: 46px; border-radius: 999px; background: var(--raised); box-shadow: 0 0 0 .5px var(--hair), 0 8px 20px -12px rgb(0 0 0 / .2); display: flex; align-items: center; padding: 0 18px; color: var(--faint); font-size: 14.5px; }
.pane .field .ic { margin-left: auto; width: 16px; height: 16px; color: var(--sub); } .pane .field .ic + .ic { margin-left: 14px; }
.pane .none { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; }
.pane .none b { font-weight: 700; font-size: 26px; letter-spacing: -.035em; } .pane .none span { color: var(--sub); }
.desk .try { margin: 22px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.desk .try .kbd { min-width: 20px; height: 20px; font-size: 11.5px; }
@media (max-width: 900px) { .win { grid-template-columns: 1fr; } .pane { display: none; } .win .col { min-height: 0; border-radius: 18px; } }

/* words at the left, the piece at the right */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 48px clamp(40px, 6vw, 120px); align-items: center; margin-top: clamp(120px, 14vw, 212px); }
.pair .say { max-width: 13em; }
.piece { zoom: .86; justify-self: end; width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; }
.piece > * { width: 100%; max-width: 640px; }
.piece .sheet { box-shadow: var(--lift); }
.piece .settings { box-shadow: var(--lift); }
@media (max-width: 900px) { .pair { grid-template-columns: 1fr; } .pair .say { max-width: 21em; } .piece { zoom: 1; justify-items: start; } }

/* questions: lines only between them, a drawn plus that turns into a cross */
.h .faq { max-width: 780px; margin-top: clamp(32px, 3vw, 44px); padding: 0; }
.h .faq details { border: 0; }
.h .faq details + details { border-top: 1px solid var(--line); }
.h .faq details::before { display: none; }
.h .faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; color: var(--ink); font-size: clamp(18px, 1.5vw, 23px); font-weight: 400; line-height: 1.4; letter-spacing: -.012em; cursor: pointer; list-style: none; }
.h .faq summary::-webkit-details-marker { display: none; }
.h .faq summary::after { content: ""; flex: none; align-self: flex-start; width: 14px; height: 14px; margin-top: calc((1.4em - 14px) / 2); color: var(--ink-2);
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat; transition: rotate .3s var(--ease); }
.h .faq details[open] summary::after { rotate: 45deg; }
.h .faq details p { max-width: 60ch; margin: 0; padding: 0 0 20px; font-size: clamp(15px, 1.05vw, 16.5px); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.h .faq a, .colophon .by a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .2s; }
.h .faq a:hover, .colophon .by a:hover { text-decoration-color: currentColor; }

/* the ending: one statement, centred, the crowd behind it */
.ending { position: relative; min-height: 92svh; margin-top: clamp(80px, 9vw, 140px); display: grid; place-items: center; overflow: hidden; text-align: center; padding: 0 var(--gutter); }
.ending .inner { position: relative; z-index: 2; display: grid; justify-items: center; }
.ending .appicon { margin: 0 0 20px; } .ending .appicon img { width: 88px; height: 88px; }
.ending .duo { justify-content: center; margin-top: 30px; }
.ending::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; z-index: 1; pointer-events: none; background: linear-gradient(#0000, var(--bg)); }

/* the foot: who built it, and the links, on one line */
.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; padding: 22px var(--side) clamp(40px, 6vw - 16px, 80px); color: var(--ink-2); }
.colophon p { margin: 0; }
.colophon nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.colophon nav a { color: var(--ink-2); transition: color .2s; } .colophon nav a:hover { color: var(--ink); }

/* arrivals: out of a blur, once */
.js .h .rise { opacity: 0; filter: blur(10px); transform: translateY(14px); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .9s var(--ease); }
.js .h .rise.in { opacity: 1; filter: none; transform: none; }
@media (prefers-reduced-motion: reduce) { .h .rise { opacity: 1; filter: none; transform: none; transition: none; } .turn > span { transition: none; } }

/* a phone: the bar keeps the mark and one button */
@media (max-width: 640px) { .get .btn--soft { display: none; } .desk { padding-inline: 16px; } .pair, .block { margin-top: 96px; } }

/* a statement says itself: its words sharpen in one after another */
.words .w { display: inline-block; opacity: 0; filter: blur(8px); transition: opacity .55s var(--ease), filter .55s var(--ease); transition-delay: calc(var(--i) * 38ms); }
.words.in .w, .in .words .w, .ending .words .w { opacity: 1; filter: none; }
.js .h .say.rise.words { opacity: 1; filter: none; transform: none; }
.js .claim .turn { opacity: 0; transition: opacity .6s .35s var(--ease); } .js .claim.in .turn, .js .ending .claim .turn { opacity: 1; }
/* the opening's own pieces follow the claim in */
.js .hello .appicon, .js .hello .duo, .js .hello .fine { opacity: 0; filter: blur(8px); transform: translateY(8px); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .9s var(--ease); }
.hello .duo { transition-delay: .45s; } .hello .fine { transition-delay: .55s; }
.js .hello .in { opacity: 1; filter: none; transform: none; }
/* the window rises under them, and comes a little closer as you scroll to it */
.desk .win { transform: translateY(calc((1 - var(--p, 0)) * 28px)) scale(calc(.955 + var(--p, 0) * .045)); transform-origin: 50% 0; transition: opacity .9s .5s var(--ease); will-change: transform; }
.js .desk .win { opacity: 0; }
.js .desk.in .win { opacity: 1; }
.desk::before { opacity: calc(.2 + var(--p, 0) * .4); }
/* in the window the row's buttons are for the row under the pointer, and the time makes way for them */
.win .r.sel .acts { opacity: 0; transform: scale(.94); pointer-events: none; }
.win .r:hover .acts { opacity: 1; transform: none; pointer-events: auto; }
.win .r:hover .when { opacity: 0; }
.win .r:hover .subj { -webkit-mask: linear-gradient(90deg, #000 52%, #0000 68%); mask: linear-gradient(90deg, #000 52%, #0000 68%); }
@media (prefers-reduced-motion: reduce) {
  .words .w, .claim .turn, .hello .appicon, .hello .duo, .hello .fine, .desk .win { opacity: 1; filter: none; transform: none; transition: none; }
}

/* a word keeps the tone of the half it's in */
.h .say .w, .h .claim .w { color: inherit; }

/* without scripts nothing waits to be revealed */
html:not(.js) .h .rise { opacity: 1; filter: none; transform: none; }

/* ── What makes it ours: the icon's own materials, on the page ──
   The icon is a white envelope closed with ink-blue wax: matte, a fine
   grain, a pale light above and a warm one at the foot. The page takes
   the same three things: the grain, the wax, and the envelope's folds. */

/* the grain: one fine film over the whole page, as on the icon's paper */
body.h::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .36; mix-blend-mode: multiply;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .12  0 0 0 0 .14  0 0 0 0 .3  0 0 0 .16 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.h::after { mix-blend-mode: screen; opacity: .35; } }

/* wax: the main buttons are pressed from the seal's ink, with its two lights and its grain */
.h .btn--wax {
  position: relative; isolation: isolate; overflow: hidden; color: #fff; border: 0;
  background:
    radial-gradient(70% 120% at 22% 0%, rgb(143 178 255 / .75), #0000 62%),
    radial-gradient(46% 90% at 74% 118%, rgb(255 208 178 / .6), #0000 70%),
    linear-gradient(#5b70d6, #4456b6 55%, #313e90);
  box-shadow: inset 0 0 0 .5px rgb(31 40 102 / .55), inset 0 1px 0 rgb(255 255 255 / .38), inset 0 -1px 0 rgb(31 40 102 / .35),
    0 1px 1px rgb(31 40 102 / .5), 0 12px 22px -8px rgb(49 62 144 / .5);
  text-shadow: 0 1px 0 rgb(31 40 102 / .35);
  transition: filter .2s, transform .2s var(--ease), box-shadow .2s;
}
.h .btn--wax::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; mix-blend-mode: overlay; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 -.25'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }
@media (hover: hover) { .h .btn--wax:hover { filter: brightness(1.06) saturate(1.05); } }
.h .btn--wax.btn--sm { box-shadow: inset 0 0 0 .5px rgb(31 40 102 / .55), inset 0 1px 0 rgb(255 255 255 / .38), 0 1px 1px rgb(31 40 102 / .5), 0 8px 16px -7px rgb(49 62 144 / .5); }

/* the light behind the window is the wax's: ink, its pale blue, and the warm foot */
.desk::before { inset: 4% 6% -4%; filter: blur(90px);
  background: radial-gradient(42% 52% at 22% 34%, rgb(91 112 214 / .55), #0000 70%), radial-gradient(34% 44% at 62% 20%, rgb(143 178 255 / .6), #0000 70%), radial-gradient(40% 50% at 78% 86%, rgb(255 208 178 / .9), #0000 70%); }

/* the ending is the back of the envelope: the flap comes down to a point, and the seal sits on it */
.ending { min-height: 100svh; margin-top: clamp(96px, 11vw, 170px); place-items: start center; background: linear-gradient(#f6f7fa, #eceef4); }
.ending::after { display: none; }
.ending .flap { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ending .flap path { vector-effect: non-scaling-stroke; }
.ending .flap .lower { fill: #f9fafc; stroke: rgb(27 34 89 / .12); stroke-width: 1; }
.ending .flap .upper { fill: #fff; stroke: rgb(27 34 89 / .10); stroke-width: 1; filter: drop-shadow(0 10px 14px rgb(27 34 89 / .13)); }
.ending .inner { margin-top: calc(44svh - 62px); }
.ending .appicon { margin: 0 0 26px; } .ending .appicon img { width: 124px; height: 124px; filter: drop-shadow(0 2px 2px rgb(27 34 89 / .25)) drop-shadow(0 14px 18px rgb(27 34 89 / .16)); }
.colophon { background: #eceef4; margin: 0; padding-top: 40px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ending { background: linear-gradient(#17181b, #121316); }
  :root:not([data-theme="light"]) .ending .flap .lower { fill: #1a1b1f; stroke: rgb(255 255 255 / .07); }
  :root:not([data-theme="light"]) .ending .flap .upper { fill: #222327; stroke: rgb(255 255 255 / .08); filter: drop-shadow(0 10px 14px rgb(0 0 0 / .5)); }
  :root:not([data-theme="light"]) .colophon { background: #121316; }
}

/* the seal itself on the flap's point, pressed on, not floating */
.ending .wax { display: block; margin: 0 0 22px; }
.ending .wax img { display: block; width: 150px; height: 150px; transition: rotate 1.2s var(--ease), scale .5s var(--ease); }
.ending .inner { margin-top: calc(44svh - 75px); }
.ending .wax:hover img { rotate: 45deg; }

/* the showcase inbox: real faces, a count, labels, and a photo in the mail */
.av.ph { background: none; padding: 0; overflow: hidden; position: relative; }
.av.ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.av.ph.duo { overflow: visible; }
.av.ph.duo img { position: absolute; width: 64%; height: 64%; box-shadow: 0 0 0 1.5px var(--card); }
.av.ph.duo img:first-child { left: 0; top: 0; } .av.ph.duo img:last-child { right: 0; bottom: 0; }
.win .r .who .n { margin-left: 6px; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--sub); }
.win .r .subj { display: flex; align-items: center; gap: 8px; overflow: visible; }
.win .r .subj span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab { flex: none; display: inline-flex; align-items: center; height: 19px; padding: 0 8px; border-radius: 999px; background: var(--pill); color: var(--sub); font: 500 11.5px/1 var(--sans); font-style: normal; }
.win .r:hover .lab { opacity: 0; }
.pane .lab.top { position: absolute; left: 18px; top: 13px; height: 22px; padding: 0 9px; font-size: 12px; }
.pane .lab.top[hidden] { display: none; }
.pane .body img { display: block; width: min(100%, 420px); aspect-ratio: 3 / 2; object-fit: cover; margin-top: 14px; border-radius: 12px; }
.pane .body img + p { margin-top: 14px; }

/* ── calmer: one quiet light on the buttons, and less color behind things ── */
.h .btn--wax {
  background: linear-gradient(#5669d0, #4a5cc0);
  box-shadow: inset 0 0 0 .5px rgb(31 40 102 / .4), inset 0 1px 0 rgb(255 255 255 / .2), 0 6px 14px -9px rgb(49 62 144 / .5);
  text-shadow: none;
}
.h .btn--wax::after { opacity: .28; }
.h .btn--wax.btn--sm { box-shadow: inset 0 0 0 .5px rgb(31 40 102 / .4), inset 0 1px 0 rgb(255 255 255 / .2), 0 4px 10px -7px rgb(49 62 144 / .5); }
@media (hover: hover) { .h .btn--wax:hover { filter: brightness(1.05); } }
.desk::before { opacity: calc(.1 + var(--p, 0) * .2); }

/* the open row keeps its time, as in the app; a bundle's tile; a label with its own color */
.win .r.sel .when { opacity: 1; } .win .r.sel:hover .when { opacity: 0; }
.av.tile { border-radius: 12px; background: var(--pill); color: var(--sub); position: relative; }
.av.tile .ic { width: 18px; height: 18px; }
.av.tile b { position: absolute; right: -4px; top: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 10px/16px var(--sans); text-align: center; box-shadow: 0 0 0 1.5px var(--card); }
.lab .ic { width: 11px; height: 11px; margin-right: 4px; stroke-width: 2.2; }
.lab.weekend { background: #fbe7dd; color: #c4552c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lab.weekend { background: #3a251c; color: #f0906a; } }

/* ── the app's own face and tones, so the pieces read as the app ──
   Mailwell is set in Geist (bundled with the app), on its own grays. */
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
.win, .pal, .reply, .sheet.reader, .settings, .piece .toast,
.win button, .win input, .pal input, .pal button, .reply textarea, .reply button, .settings button {
  font-family: "Geist", system-ui, -apple-system, sans-serif;
}
.win {
  --card: #ECECEB; --bubble: #F8F8F7; --raised: #fff; --ink: #000;
  --sub: rgb(0 0 0 / .56); --faint: rgb(0 0 0 / .44); --pill: rgb(0 0 0 / .07); --hair: rgb(0 0 0 / .06);
  background: #ECECEB; border-radius: 20px;
}
.win .col { border-radius: 20px 0 0 20px; }
.win .dock .badge { box-shadow: 0 0 0 2px #ECECEB; }
.pane { border-radius: 15px; margin: 6px 6px 6px 0; min-height: 628px; box-shadow: 0 0 0 .5px rgb(0 0 0 / .05); }
.win h3 { letter-spacing: -.03em; }
#pane-subj { letter-spacing: -.03em; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .win {
    --card: #1C1C1D; --bubble: #29292A; --raised: #363637; --ink: #fff;
    --sub: rgb(255 255 255 / .54); --faint: rgb(255 255 255 / .42); --pill: rgb(255 255 255 / .10); --hair: rgb(255 255 255 / .10);
    background: #1C1C1D;
  }
  :root:not([data-theme="light"]) .win .dock .badge { box-shadow: 0 0 0 2px #1C1C1D; }
  :root:not([data-theme="light"]) .pane { box-shadow: 0 0 0 .5px rgb(255 255 255 / .08); }
}

/* ── the app's own measures (taken from the app at this window size) ── */
.win .r { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 10px 14px 11px 16px; margin: 0 6px; border-radius: 18px; }
.win .r::after { left: 72px; right: 8px; }
.win .r .av { width: 44px; height: 44px; font-size: 15px; }
.win .r .who { font-size: 15px; letter-spacing: -.01em; }
.win .r:not(.read) .who { font-weight: 600; }
.win .r .when { font-size: 13px; }
.win .r .subj { font-size: 14.5px; }
.win .r .prev { font-size: 14px; }
.win .r .who .n { font-size: 13px; }
.win h3 { padding: 6px 24px 10px; font-size: 27px; }
.win .day { padding: 6px 24px 6px; }
.lab { height: 20px; font-size: 12px; }
.pane { padding: 0 24px; }
.pane .tools { margin-right: -6px; gap: 20px; }
.pane .tools .ic { width: 18px; height: 18px; }
.pane h2 { margin: 2px 0 22px; font-size: 26px; }
.pane .from b { font-size: 16px; }
.pane .from b + em { margin-left: 8px; font-style: normal; font-size: 13.5px; color: var(--sub); }
.pane .from small { font-size: 14px; margin-top: 1px; }
.pane .from time { font-size: 13px; align-self: flex-start; margin-top: 3px; }
.pane .body { margin: 22px 0 0 48px; max-width: 462px; font-size: 16.5px; line-height: 23.5px; }
.pane .body p + p { margin-top: 14px; }
.pane .body img { width: min(100%, 460px); aspect-ratio: 780 / 474; margin-top: 18px; }
.pane .field { left: 10px; right: 10px; bottom: 10px; height: 44px; font-size: 14px; }
.pane .lab.top { left: 16px; top: 12px; height: 24px; font-size: 13px; }
@media (max-width: 900px) { .pane .from b + em { display: none; } }
