@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: block;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #060606;
  --fg: #f4f4f0;
  --mute: #8f8f88;
  --accent: #c8ff00;
  --pad: clamp(16px, 2.4vw, 32px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 400 13px/1.55 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: none;
}

#c {
  position: fixed;
  top: 0;
  left: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.ui {
  position: fixed;
  inset: 0;
  padding: var(--pad);
  padding-top: max(var(--pad), env(safe-area-inset-top));
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.corner {
  color: var(--mute);
  max-width: 50ch;
}
.tl { grid-column: 1; grid-row: 1; }
.tr { grid-column: 2; grid-row: 1; text-align: right; justify-self: end; }
.bl { grid-column: 1; grid-row: 3; align-self: end; }
.br { grid-column: 2; grid-row: 3; align-self: end; justify-self: end; }
.br { display: flex; flex-direction: column; gap: 4px; text-align: right; flex-shrink: 0; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  vertical-align: 0;
  background: var(--accent);
  animation: blink 1.6s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.say {
  position: fixed;
  left: 50%;
  bottom: max(var(--pad), env(safe-area-inset-bottom));
  transform: translateX(-50%);
  color: var(--fg);
  font: 400 13px/1.55 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: 0;
  transition: opacity 120ms;
  white-space: nowrap;
}
.say.on { opacity: 1; }

.bl strong {
  display: block;
  margin-top: 0.9em;
  color: var(--fg);
  font-weight: 600;
}

a {
  pointer-events: auto;
  cursor: none;
  color: var(--fg);
  text-decoration: none;
  padding: 2px 4px;
  margin: -2px -4px;
  outline: none;
}
a:hover, a:focus-visible {
  background: var(--accent);
  color: var(--bg);
}
a:active { background: var(--fg); }

body.rug #c, body.rug .ui {
  transform: translateY(110vh);
  transition: transform 450ms cubic-bezier(.7,0,1,1);
}
body.snap #c, body.snap .ui { transition: none; }

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

@media (max-width: 720px) {
  body { font-size: 13px; }
  .ui { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto auto; gap: 18px; }
  .say { position: static; transform: none; }
  .tl { grid-column: 1; grid-row: 1; }
  .tr { grid-column: 1; grid-row: 2; align-self: start; text-align: left; justify-self: start; }
  .bl { grid-column: 1; grid-row: 3; }
  .br { grid-column: 1; grid-row: 4; justify-self: start; }
  .bl { max-width: 100%; }
  .br { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
}

@media (hover: none) {
  body, a { cursor: auto; }
}

@media print {
  #c, .ui { display: none; }
  body { background: #fff; }
  body::before {
    content: "no.";
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    font: 48px "JetBrains Mono", monospace;
    color: #000;
  }
}
