/* synset.xyz — everything is one screen, so everything is here. */

:root {
  --bg: #07080a;
  --ink: #c9d6da;
  --ink-dim: #55666d;
  --accent: #ff3b1f;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
  --pad: clamp(14px, 3.2vw, 34px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  /* The canvas is the interaction surface; stop mobile from hijacking drags
     as scroll/zoom so a finger draws ripples instead. */
  overscroll-behavior: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* --- decoration ------------------------------------------------------- */

.scanlines,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.vignette {
  background:
    radial-gradient(
      ellipse 120% 100% at 50% 50%,
      rgba(7, 8, 10, 0) 42%,
      rgba(7, 8, 10, 0.72) 100%
    ),
    /* faint cold cast from the top, so the field isn't uniformly flat */
      linear-gradient(to bottom, rgba(30, 60, 70, 0.1), rgba(7, 8, 10, 0) 40%);
}

/* --- chrome ----------------------------------------------------------- */

.chrome {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--pad);
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
  pointer-events: none; /* only the links take clicks */
}

.chrome__top,
.chrome__bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.wordmark {
  pointer-events: auto;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* letter-spacing pads the right edge; balance it */
  color: #eef5f7;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(120, 200, 220, 0.28);
  position: relative;
}

.wordmark__tld {
  color: var(--accent);
  letter-spacing: 0.16em;
}

.wordmark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.42em;
  bottom: -0.5em;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wordmark:hover::after,
.wordmark:focus-visible::after {
  transform: scaleX(1);
}

.status,
.hint {
  margin: 0;
  font-size: clamp(0.62rem, 1.5vw, 0.74rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* The blinking caret only exists while the status line is still typing. */
.status[data-typing="1"]::after {
  content: "▌";
  margin-left: 0.35em;
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

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

.links {
  pointer-events: auto;
  display: flex;
  gap: clamp(0.9rem, 3vw, 2rem);
  font-size: clamp(0.72rem, 1.7vw, 0.85rem);
  letter-spacing: 0.12em;
}

.links a {
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 0.25em;
  transition: color 0.2s ease;
}

.links a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.links a:hover,
.links a:focus-visible {
  color: #fff;
}

.links a:hover::before,
.links a:focus-visible::before {
  transform: scaleX(1);
  transform-origin: left;
  background: var(--accent);
}

.hint {
  opacity: 0;
  transition: opacity 1.2s ease 0.4s;
}

body[data-ready="1"] .hint {
  opacity: 0.85;
}

/* Coarse pointers have no cursor to move — say the true thing instead. */
@media (pointer: coarse) {
  .hint::after {
    content: " (touch)";
  }
}

@media (max-width: 520px) {
  .hint {
    display: none;
  }
  .chrome__top {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* --- no javascript ---------------------------------------------------- */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 1.5rem;
  background: var(--bg);
  text-align: center;
  padding: 1rem;
}

.noscript pre {
  margin: 0;
  font-size: min(1.6vw, 9px);
  line-height: 1;
  color: var(--ink);
  overflow: hidden;
}

.noscript p {
  letter-spacing: 0.4em;
  color: var(--ink-dim);
}
