@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5eee7;
  --ink: #263548;
  --muted: #566878;
  --line: #d9cfc5;
  --accent: #2c6e79;
  --shadow: #2c6e79;
  --accent-ink: #f5eee7;
  --noise: .035;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131a22;
    --ink: #f0e8df;
    --muted: #9aa8b6;
    --line: #2a333d;
    --accent: #8fd2dd;
    --shadow: #4f96a2;
    --accent-ink: #131a22;
    --noise: .05;
  }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

/* Paper grain sits behind the content, not over the text. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--noise);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

.copy-fallback {
  position: fixed;
  top: -1000px;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 20;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--paper);
  font: 400 12px/1 var(--mono);
  letter-spacing: .08em;
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
  transition: transform .18s var(--ease);
}

.skip-link:focus {
  transform: none;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: max(clamp(22px, 4vh, 42px), env(safe-area-inset-top));
  padding-right: max(clamp(20px, 5vw, 56px), env(safe-area-inset-right));
  padding-bottom: max(clamp(26px, 5vh, 46px), env(safe-area-inset-bottom));
  padding-left: max(clamp(20px, 5vw, 56px), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.corner {
  position: absolute;
  color: var(--muted);
  font: 400 13px/1 var(--mono);
  user-select: none;
  pointer-events: none;
}

.corner.tl { top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
.corner.tr { top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.corner.bl { bottom: max(8px, env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left)); }
.corner.br { bottom: max(8px, env(safe-area-inset-bottom)); right: max(12px, env(safe-area-inset-right)); }

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .12em;
}

.motto {
  margin-left: auto;
  text-align: right;
}

.hero {
  padding: clamp(26px, 5vh, 45px) 0 clamp(30px, 6vh, 54px);
  text-align: center;
}

h1 {
  max-width: 100%;
  font-size: clamp(3rem, 14vw, 9.5rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
  text-shadow: .04em .04em 0 var(--shadow);
}

h1 .one {
  color: var(--accent);
  font-weight: 800;
  text-shadow: .04em .04em 0 var(--ink);
}

.contact { width: 100%; }

.rows {
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.rows li { list-style: none; }

.row {
  position: relative;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 3.2vw, 32px);
  padding: clamp(16px, 3.4vh, 22px) 6px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.row:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.row:focus-visible::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid var(--paper);
  pointer-events: none;
}

.row:active {
  background: var(--ink);
  color: var(--paper);
}

.idx {
  flex: none;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  transition: color .16s var(--ease), opacity .16s var(--ease);
}

.row:focus-visible .idx,
.row:active .idx {
  color: var(--paper);
  opacity: .62;
}

.key-wrap {
  position: relative;
  flex: none;
  display: block;
}

.key {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .18em;
}

.copy-hint {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  min-width: 44px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .12em;
  color: var(--muted);
  opacity: 0;
  white-space: nowrap;
  transition: opacity .16s var(--ease), color .16s var(--ease);
}

.row:focus-visible .copy-hint {
  color: var(--paper);
  opacity: .72;
}

.row:focus-visible .arrow,
.row:active .arrow {
  color: var(--paper);
}

.row:active .copy-hint {
  color: var(--paper);
  opacity: .72;
}

.email[data-copied="true"] .copy-hint {
  color: inherit;
  opacity: .85;
}

.val {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  white-space: nowrap;
}

.email-mask {
  display: block;
  flex: none;
  width: 111px;
  max-width: 100%;
  aspect-ratio: 666 / 103;
  background-color: currentColor;
  transition: background-color .16s var(--ease);
  -webkit-mask-image: url("email-mask.png");
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("email-mask.png");
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
}

.arrow {
  width: 13px;
  height: 13px;
  flex: none;
  margin-left: 1px;
  color: var(--accent);
  transition: color .16s var(--ease);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.corner { animation: fade .55s var(--ease) .18s both; }
.topbar { animation: rise .55s var(--ease) .02s both; }
.hero { animation: rise .6s var(--ease) .08s both; }
.rows { animation: rise .6s var(--ease) .14s both; }

footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .1em;
  animation: rise .55s var(--ease) .2s both;
}

#main:focus { outline: none; }

@media (hover: hover) and (pointer: fine) {
  .row:hover {
    background: var(--ink);
    color: var(--paper);
  }

  .row:hover .idx {
    color: var(--paper);
    opacity: .62;
  }

  .row:hover .copy-hint {
    color: var(--paper);
    opacity: .72;
  }

  .row:hover .arrow {
    color: var(--paper);
  }

  .email[data-copied="true"]:hover .copy-hint {
    color: inherit;
    opacity: .85;
  }
}

@media (hover: none), (pointer: coarse) {
  .copy-hint { opacity: 1; }
}

@media (max-width: 300px) {
  .row { padding-inline: 4px; gap: 6px; }
  .topbar { letter-spacing: .08em; }
  .copy-hint { min-width: 40px; }
  .val { font-size: 14px; }
  .key { letter-spacing: .08em; }
  .email-mask { width: calc(111px * 14 / 15); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .frame {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .hero { padding: 16px 0 20px; }

  h1 { font-size: clamp(2.75rem, 20vh, 7rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #3f5265;
    --line: #b9ada1;
    --noise: 0;
  }

  h1, h1 .one { text-shadow: none; }
  h1 .one { text-decoration: underline; text-underline-offset: .07em; text-decoration-thickness: .035em; }
  .row { border-top-width: 2px; }
  .rows { border-bottom-width: 2px; }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --muted: #c3ced9;
    --line: #4a5764;
  }
}

@media (forced-colors: active) {
  body::before { display: none; }
  .corner { display: none; }

  h1, h1 .one { text-shadow: none; }
  h1 .one { text-decoration: underline; text-underline-offset: .07em; }

  .row { border-color: CanvasText; }
  .rows { border-bottom-color: CanvasText; }

  .row:focus-visible { outline-color: Highlight; }

  .email-mask { display: none; }
  .email .sr-only {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }

  .copy-hint { color: CanvasText; }
}
