/* subinternal.com: one screen. The box icon in the middle, one line under it that types, and the address in pixels
   along the foot. Paper and graphite only; it follows the reader's light or dark setting. */
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F2F1EE;
  --ink: #141518;
  --ink-2: #4d4f56;
  --muted: #6b6d74;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141518; --ink: #F2F1EE; --ink-2: #c0c1c6; --muted: #8e9097; color-scheme: dark; }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The top: the icon in one corner, the address to write to in the other, on one line, clear of a phone's notch. */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
}
.corner { display: block; width: 28px; height: 28px; }
.corner .tile { fill: var(--ink); }
.corner .mark { fill: var(--bg); }
/* The address to write to: an envelope that opens into the address on a tap, copying it, and writes on the next tap. */
.mail {
  display: inline-flex;
  align-items: center;
  height: 32px;
  margin-right: -8px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  transition: color 200ms ease, background-color 300ms ease;
}
.mail:hover { color: var(--ink); }
.mail.open { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.mail:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.mail svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mail .addr {
  display: inline-block;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 520ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 320ms ease 120ms, margin 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mail.open .addr { max-width: 26ch; margin-left: 9px; opacity: 1; }

/* The middle: the icon and the name, and the line under them. Lifted a little above centre, clear of the pixels. */
main {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  height: 100%;
  padding: 0 16px 14vh;
}
.lockup { display: block; width: min(300px, 72vw); height: auto; }
.lockup .tile, .lockup .word { fill: var(--ink); }
.lockup .mark { fill: var(--bg); }
/* The underscore in the icon is the same cursor as the one under it: they blink together, and hold while it types. */
.on .lockup .blink, .on .cursor { animation: blink 1.06s steps(1) infinite; }
.typing .lockup .blink, .typing .cursor { animation: none; }

.line { margin: 0; display: flex; align-items: baseline; min-height: 1.5em; color: var(--ink-2); font-size: 15px; letter-spacing: 0.01em; white-space: pre; }
/* The cursor is the mark's own line: an underscore's weight, blinking while it waits, solid while it types. */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 0.1em;
  margin-left: 0.08em;
  background: currentColor;
}
@keyframes blink { 50% { opacity: 0; } }

/* The address, in pixels, across the foot. */
canvas.foot {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 46vh;
  pointer-events: none;
}

/* The one thing out in the open so far: mttr, with its own mark, under the line. */
.open { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.open a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; }
.open a b { font-weight: 500; border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); transition: border-color 200ms ease; }
.open a:hover b { border-color: var(--ink); }
.open a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 3px; }
.mttr-mark { display: block; width: 16px; height: 16px; }
.mttr-mark .f { fill: color-mix(in srgb, var(--ink) 16%, transparent); }

/* The first moment: the icon settles in, then the line begins. */
.lockup, .line, .open { opacity: 0; transform: translateY(6px) scale(0.985); filter: blur(6px); transition: opacity 900ms ease, transform 1100ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 900ms ease; }
.line { transition-delay: 260ms; }
.open { transition-delay: 620ms; }
.on .lockup, .on .line, .on .open { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  .lockup, .line, .open { opacity: 1; transform: none; filter: none; transition: none; }
  .mail .addr { transition: none; }
  .cursor, .lockup .blink { animation: none !important; }
}

/* The page for an address that isn't here: one quiet line, no motion. */
.nf { display: grid; place-content: center; height: 100%; color: var(--ink-2); font-size: 15px; }
.nf p { margin: 0; }
.nf a { color: var(--ink); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); }
