/* The white of the lab: Chinese Room's title tone (scripts/screens/title.gd TONE). */
:root {
  --fog: #dee4ec;        /* 0.87 0.895 0.925 */
  --face: #f2f5f9;       /* 0.95 0.96 0.975 */
  --ink: #0a0f17;        /* 0.04 0.06 0.09 */
  --shade: #546680;      /* 0.33 0.4 0.5 */
  --glow: #b3ebff;       /* 0.7 0.92 1.0 */
  --line: rgba(40, 52, 70, 0.28);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fog);
  color: var(--ink);
  overflow: hidden;
}

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* Out of focus, as the eye glides over it. */
  filter: blur(0.7px);
}

main {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.name {
  margin: 0;
  width: min(560px, 78vw);
  line-height: 0;
}

.lettering {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.lettering use { mix-blend-mode: multiply; }

.cursor {
  width: 22px;
  height: 3px;
  margin-top: 34px;
  background: var(--ink);
  visibility: hidden;
}

.unseen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.games {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-top: clamp(40px, 9vh, 88px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.games.shown {
  opacity: 1;
  transform: none;
}

/* A pane of cold glass, as the game's dialogue: the scene behind shows through blurred, and one fine line
   along the top fades out at both ends. */
.game {
  position: relative;
  display: block;
  width: min(300px, 82vw);
  padding: 10px 10px 18px;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(to bottom, rgba(248, 250, 253, 0.72), rgba(248, 250, 253, 0.42));
  backdrop-filter: blur(12px) saturate(0.9);
  -webkit-backdrop-filter: blur(12px) saturate(0.9);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
  outline: none;
}

.game::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
  transition: background 0.5s ease;
}

.game img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: saturate(0.55) contrast(0.94) brightness(1.04);
  transition: filter 0.6s ease;
}

.game .lettering {
  width: 62%;
  margin: 16px auto 0;
}

/* Chosen: it lifts and lights, as a column of the field does. */
.game:hover,
.game:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -18px rgba(84, 102, 128, 0.45), 0 0 34px -6px rgba(179, 235, 255, 0.55);
}

.game:hover::before,
.game:focus-visible::before {
  background: linear-gradient(90deg, transparent, var(--glow) 18%, var(--glow) 82%, transparent);
}

.game:hover img,
.game:focus-visible img { filter: none; }

/* Lies over everything and shows it again as a monitor would: scan lines, grain, dark towards the edges. */
.monitor {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.05) 2px 4px),
    radial-gradient(ellipse 72% 90% at 50% 50%, rgba(84, 102, 128, 0) 30%, rgba(84, 102, 128, 0.38) 100%);
}

.monitor::after {
  content: "";
  position: absolute;
  inset: -50%;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(4) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-7%, 4%); }
  50% { transform: translate(5%, -6%); }
  75% { transform: translate(-3%, -2%); }
}

.curtain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--shade);
  opacity: 1;
  transition: opacity 2.2s cubic-bezier(0.45, 0, 0.55, 1);
}

.curtain.open { opacity: 0; }

.curtain.leaving {
  background: var(--face);
  opacity: 1;
  transition: opacity 0.6s ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .monitor::after { animation: none; }
  .curtain, .games, .game, .game img, .game::before { transition: none; }
}
