:root {
  color-scheme: dark;
  --background: #08080a;
  --primary: #f52f40;
  --dot-bright: #ff4854;
  --text: #faf2f2;
  --muted: #a89b9e;
  --focus: #ff8890;
  --font: Arial, Helvetica, sans-serif;
  font-family: var(--font);
  background: var(--background);
  color: var(--text);
  scrollbar-color: #5f3036 var(--background);
  scrollbar-width: thin;
  /* Work content becomes scrollable during the sphere morph. Reserve its
     gutter so that revealing it never resizes and clears the WebGL canvas. */
  scrollbar-gutter: stable;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }
button:enabled { cursor: pointer; }
button:focus-visible { outline: 2px solid var(--focus); outline-offset: 7px; }
::selection { background: #f52f4055; color: var(--text); }

.landing {
  position: relative;
  width: 100%;
  min-height: 100svh;
  height: 100dvh;
  isolation: isolate;
}

.landing.interactive { touch-action: pinch-zoom; }
.landing.is-departing { position: fixed; inset: 0; z-index: 2; pointer-events: none; }

.particle-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.identity {
  position: absolute;
  top: 46%;
  left: 50%;
  width: calc(100% - 40px);
  transform: translate(-50%, -50%);
  text-align: center;
}

.identity h1 {
  margin: 0;
  font-size: clamp(42px, 9vw, 126px);
  line-height: 1.1;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.identity p {
  margin: 25px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 25px);
  letter-spacing: 0.04em;
}

/* Keep semantic text available even when the visible letters are particles. */
.interactive .identity {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.reveal-button {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  padding: 12px 16px;
  border: 1px solid #78363e;
  border-radius: 3px;
  background: var(--background);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
}

.reveal-button:focus-visible { opacity: 1; pointer-events: auto; }
.reveal-button:hover { border-color: var(--dot-bright); }
.reveal-button:active { background: #221115; }
.landing:not(.interactive) .reveal-button { display: none; }

.hint {
  position: absolute;
  bottom: max(42px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  animation: hint-arrive 700ms ease both;
}

.hint[hidden] { display: none; }
.hint-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 2px;
  color: var(--muted);
  background: var(--background);
  font-size: 12px;
  letter-spacing: 0.025em;
  transition: color 160ms ease;
}

.hint-button:hover { color: var(--text); }
.hint-button:active { color: var(--dot-bright); }

.enter-button {
  position: absolute;
  top: calc(46% + clamp(70px, 9vw, 110px));
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--primary);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
  font-weight: 600;
}

/* The native button supplies semantics and a hit area; its visible surface is dots. */
.interactive .enter-button {
  transform: none;
  color: transparent;
  border-color: transparent;
  pointer-events: none;
}
.interactive .enter-button.is-revealed { pointer-events: auto; }
.enter-button:focus-visible { outline-offset: 8px; }
.landing[data-state="traveling"] .enter-button,
.landing[data-state="traveling"] .reveal-button { visibility: hidden; }

@keyframes hint-arrive {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .hint { bottom: max(28px, env(safe-area-inset-bottom)); }
  .identity p { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  .particle-field { display: none; }
  .identity { color: CanvasText; }
  .identity p { color: CanvasText; }
  .enter-button { color: ButtonText; border-color: ButtonText; }
  .back-button { color: LinkText; }
}
