:root {
  --bg: #0b0d10;
  --bg-elev: #0e1115;
  --ink: #e6e3da;
  --ink-soft: rgba(230, 227, 218, 0.52);
  --ink-faint: rgba(230, 227, 218, 0.20);
  --rule: rgba(230, 227, 218, 0.14);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 56px 32px 40px;
  position: relative;
  overflow-x: hidden;
}

/* Atmospheric layers ------------------------------------------------ */

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center,
      transparent 0%,
      transparent 45%,
      rgba(0, 0, 0, 0.35) 100%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 140px 140px;
  animation: grainShift 4s steps(4) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -2%); }
  75%  { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* Layout ------------------------------------------------------------ */

main, footer {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

/* Wordmark ---------------------------------------------------------- */

.wordmark {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 36px 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-transform: none;

  opacity: 0;
  transform: translateY(8px);
  animation: rise 900ms cubic-bezier(.2,.7,.2,1) 120ms forwards;
}

.wordmark .mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--ink);
  opacity: 0.94;
}

.wordmark span {
  display: inline-block;
  position: relative;
  padding-bottom: 1px;
}

/* Lede sentence ----------------------------------------------------- */

.lede {
  margin: 0;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 52ch;
  letter-spacing: 0.005em;

  opacity: 0;
  transform: translateY(8px);
  animation: rise 900ms cubic-bezier(.2,.7,.2,1) 280ms forwards;
}

/* Footer ------------------------------------------------------------ */

footer {
  padding-top: 56px;
  padding-bottom: 8px;
  font-size: 12px;
  color: var(--ink-soft);

  opacity: 0;
  animation: fadeIn 1200ms ease-out 600ms forwards;
}

.rule {
  width: 56px;
  height: 1px;
  background: var(--rule);
  margin-bottom: 20px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  letter-spacing: 0.02em;
}

.links .sep {
  color: var(--ink-faint);
  user-select: none;
}

.links .muted {
  color: var(--ink-faint);
  margin-left: 2px;
}

footer a {
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  transition: color 180ms ease;
}

footer a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms cubic-bezier(.2,.7,.2,1);
}

footer a:hover,
footer a:focus-visible {
  color: var(--ink);
  outline: none;
}

footer a:hover::after,
footer a:focus-visible::after {
  transform: scaleX(1);
}

/* Selection --------------------------------------------------------- */

::selection {
  background: var(--ink);
  color: var(--bg);
}

/* Animations -------------------------------------------------------- */

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark, .lede, footer { animation: none; opacity: 1; transform: none; }
  .grain { animation: none; }
}

/* Responsive -------------------------------------------------------- */

@media (max-width: 540px) {
  body { padding: 36px 24px 28px; }
  .wordmark { font-size: 14px; gap: 12px; margin-bottom: 28px; }
  .wordmark .mark { width: 26px; height: 26px; }
  .lede { font-size: 15px; }
  footer { padding-top: 40px; font-size: 11px; }
  .rule { width: 40px; margin-bottom: 16px; }
  .links { gap: 4px 10px; }
}

@media (max-width: 380px) {
  .links .sep:nth-of-type(odd) { display: none; }
  .links { flex-direction: column; align-items: flex-start; gap: 6px; }
}
