:root {
  --cream: #f6f0df;
  --cream-soft: rgba(246, 240, 223, 0.78);
  --ink: #14110c;
  --panel: rgba(20, 17, 12, 0.92);
  --panel-light: rgba(246, 240, 223, 0.92);
  --line: rgba(246, 240, 223, 0.22);
  --accent: #d7b56d;
  --code: #b9a06a;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  text-transform: lowercase;
}

body.is-entered .entry-gate {
  opacity: 0;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--ink);
  transition: opacity 700ms var(--ease);
}

.entry-gate img {
  position: absolute;
  inset: -2rem;
  width: calc(100% + 4rem);
  height: calc(100% + 4rem);
  object-fit: cover;
  image-rendering: pixelated;
  filter: blur(6px) saturate(0.82) brightness(0.78);
  transform: scale(1.025);
}

.entry-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(246, 240, 223, 0.04), transparent 22rem),
    rgba(20, 17, 12, 0.18);
}

.entry-button {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.5rem;
  min-width: 11rem;
  padding: 1rem 1.35rem;
  border: 1px solid rgba(246, 240, 223, 0.26);
  border-radius: 0.24rem;
  background: rgba(20, 17, 12, 0.48);
  color: var(--cream);
  font-family: var(--mono);
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.34);
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.entry-button span {
  color: var(--cream-soft);
  font-size: 0.86rem;
}

.entry-button strong {
  color: var(--cream);
  font-size: 1rem;
}

.entry-button:hover {
  border-color: rgba(246, 240, 223, 0.5);
  background: rgba(20, 17, 12, 0.64);
  transform: translateY(-2px);
}

.stage {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

.scene-stack,
.scene-image,
.scene-wash {
  position: absolute;
  inset: 0;
}

.scene-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
  opacity: 0;
  filter: saturate(0.86) contrast(0.96) brightness(0.94);
  transform: scale(1.025);
  transition: opacity 520ms var(--ease), transform 1500ms var(--ease), filter 520ms var(--ease);
}

.scene-image.is-active {
  opacity: 1;
  transform: scale(1);
}

.stage[data-active="manifesto"] .scene-image.is-active {
  filter: saturate(0.9) contrast(0.98) brightness(0.92);
}

.stage[data-active="lifedesignbox"] .scene-image.is-active {
  filter: saturate(0.78) contrast(1.02) brightness(0.82);
}

.stage[data-active="workwithme"] .scene-image.is-active {
  filter: saturate(0.82) contrast(1.04) brightness(0.78);
}

.scene-wash {
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20, 17, 12, 0.18), rgba(20, 17, 12, 0.04) 38%, rgba(20, 17, 12, 0.3)),
    radial-gradient(circle at 50% 45%, rgba(246, 240, 223, 0.08), transparent 24rem);
}

.pixel-field {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(246, 240, 223, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 240, 223, 0.28) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: soft-light;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.15rem;
  color: var(--cream-soft);
  font: 600 0.86rem/1 var(--mono);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.brand,
.toplinks a {
  border: 0;
  background: transparent;
  color: inherit;
  transition: color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
}

.brand:hover,
.toplinks a:hover {
  color: var(--cream);
  opacity: 1;
  transform: translateY(-1px);
}

.toplinks {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1vw, 0.72rem);
}

.toplinks a + a::before {
  content: "·";
  margin-right: clamp(0.45rem, 1vw, 0.72rem);
  opacity: 0.4;
  pointer-events: none;
}

.desktop {
  position: relative;
  z-index: 10;
  min-height: 100svh;
}

.hero-title {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 11;
  width: min(46rem, calc(100vw - 2rem));
  color: var(--cream);
  text-align: center;
  text-shadow: 0 0.2rem 1.6rem rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%);
}

.stage[data-active="home"] .hero-title {
  top: 52%;
}

.kicker,
.subline,
.hero-actions {
  margin: 0;
  color: var(--cream-soft);
  font: 500 clamp(0.76rem, 1.1vw, 0.95rem)/1.3 var(--mono);
}

.kicker,
.subline {
  display: table;
  margin-inline: auto;
  padding: 0.16rem 0.42rem;
  border: 1px solid rgba(246, 240, 223, 0.12);
  border-radius: 0.16rem;
  background: rgba(20, 17, 12, 0.34);
  color: rgba(246, 240, 223, 0.9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(6px);
}

.kicker::before {
  content: "<";
  color: var(--code);
}

.kicker::after {
  content: ">";
  color: var(--code);
}

.subline::before {
  content: "[";
  color: var(--code);
}

.subline::after {
  content: "]";
  color: var(--code);
}

.main-line {
  margin: 0.72rem 0 0;
  color: var(--cream);
  font: 500 clamp(3.4rem, 9.2vw, 8.8rem)/0.9 var(--sans);
  letter-spacing: -0.035em;
  text-shadow: 0 0.34rem 2.4rem rgba(0, 0, 0, 0.38);
  transition: color 180ms var(--ease), opacity 180ms var(--ease), transform 180ms var(--ease);
}

.main-line:hover {
  color: #fff8df;
  opacity: 0.9;
  transform: translateY(-2px);
}

.subline {
  margin-top: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1rem;
  min-height: 1.6rem;
  margin-top: 1rem;
}

.hero-actions:empty {
  display: none;
}

.text-action,
.modal-link,
.signup button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  font: 500 0.82rem/1.2 var(--mono);
  text-align: left;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.text-action:hover,
.modal-link:hover,
.signup button:hover {
  color: var(--code);
  opacity: 1;
  transform: translateY(-1px);
}

.map-nav,
.direction-nav {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.stage:not([data-active="home"]) .map-nav,
.stage[data-active="home"] .direction-nav {
  display: none;
}

.map-point {
  position: absolute;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(246, 240, 223, 0.22);
  border-radius: 0.22rem;
  background: rgba(20, 17, 12, 0.34);
  color: var(--cream-soft);
  font: 500 0.9rem/1 var(--mono);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(7px);
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
}

.map-point::before {
  content: "[";
  color: var(--code);
}

.map-point::after {
  content: "]";
  color: var(--code);
}

.map-point:hover,
.map-point.is-active {
  border-color: rgba(246, 240, 223, 0.48);
  background: rgba(20, 17, 12, 0.58);
  color: var(--cream);
  transform: translate(-50%, -50%) translateY(-2px);
}

.map-manifesto {
  left: 30%;
  top: 43.5%;
}

.map-box {
  left: 38.8%;
  top: 33.5%;
}

.map-work {
  left: 56.4%;
  top: 15.5%;
}

.direction-nav {
  display: block;
}

.dir-point {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid rgba(246, 240, 223, 0.2);
  border-radius: 0.22rem;
  background: rgba(20, 17, 12, 0.42);
  color: var(--cream-soft);
  font: 500 0.72rem/1 var(--mono);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease), opacity 160ms var(--ease);
}

.dir-point span {
  color: var(--code);
}

.dir-point[data-dir="top"] span::before {
  content: "^ ";
}

.dir-point[data-dir="left"] span::before {
  content: "< ";
}

.dir-point[data-dir="right"] span::before {
  content: "> ";
}

.dir-point[data-dir="bottom"] span::before {
  content: "v ";
}

.dir-point:hover,
.dir-point.is-active {
  border-color: rgba(246, 240, 223, 0.44);
  background: rgba(20, 17, 12, 0.62);
  color: var(--cream);
}

.dir-top:hover,
.dir-bottom:hover {
  transform: translateX(-50%) translateY(-1px);
}

.dir-left:hover,
.dir-right:hover {
  transform: translateY(-50%) translateY(-1px);
}

.dir-top {
  left: 50%;
  top: clamp(3.8rem, 9vh, 5.4rem);
  transform: translateX(-50%);
}

.dir-left {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.dir-right {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.dir-bottom {
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
}

.sound-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0 0.58rem;
  border: 1px solid rgba(246, 240, 223, 0.22);
  border-radius: 999px;
  background: rgba(20, 17, 12, 0.42);
  color: var(--cream-soft);
  font: 600 0.68rem/1 var(--mono);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.sound-toggle::before {
  content: "sound";
  color: var(--code);
}

.sound-toggle:hover,
.sound-toggle[aria-pressed="true"] {
  border-color: rgba(246, 240, 223, 0.44);
  background: rgba(20, 17, 12, 0.62);
  color: var(--cream);
  transform: translateY(-1px);
}

.os-window {
  border: 1px solid rgba(246, 240, 223, 0.28);
  background: var(--panel);
  color: var(--cream);
  box-shadow: 0 1.4rem 3.4rem rgba(0, 0, 0, 0.28);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid rgba(20, 17, 12, 0.12);
  background: var(--panel-light);
  color: rgba(20, 17, 12, 0.76);
  font: 600 0.74rem/1 var(--mono);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 17, 12, 0.08);
  pointer-events: auto;
}

.modal-layer[hidden] {
  display: none;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(34rem, calc(100vw - 1rem));
  max-height: min(38rem, calc(100svh - 1rem));
  overflow: hidden;
  border-radius: 0.35rem;
  transform: translate(-50%, -50%);
  user-select: none;
}

.modal-titlebar {
  cursor: grab;
}

.modal-titlebar:active {
  cursor: grabbing;
}

.modal-close {
  width: 1.4rem;
  height: 1.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(20, 17, 12, 0.76);
  font: 600 0.82rem/1 var(--mono);
}

.modal-close:hover {
  background: rgba(20, 17, 12, 0.08);
}

.modal-content {
  max-height: calc(min(38rem, calc(100svh - 1rem)) - 2rem);
  overflow: auto;
  padding: 1.1rem 1.15rem 1.35rem;
  background: var(--panel);
  color: var(--cream);
  font: 400 0.92rem/1.5 var(--mono);
  user-select: text;
}

.modal-content h2 {
  margin: 0 0 0.85rem;
  color: var(--cream);
  font: 600 1rem/1.25 var(--mono);
}

.modal-content h2::before {
  content: "<";
  color: var(--code);
}

.modal-content h2::after {
  content: ">";
  color: var(--code);
}

.modal-content p {
  margin: 0 0 0.78rem;
  color: rgba(246, 240, 223, 0.86);
}

.modal-content p::before {
  content: "> ";
  color: var(--accent);
}

.modal-link {
  display: inline-flex;
  margin-top: 0.35rem;
  color: var(--cream);
}

.signup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  margin-top: 1rem;
}

.signup label {
  grid-column: 1 / -1;
  color: var(--accent);
  font: 500 0.78rem/1 var(--mono);
}

.signup input {
  min-width: 0;
  min-height: 2.45rem;
  border: 1px solid rgba(246, 240, 223, 0.24);
  border-radius: 0.15rem;
  padding: 0 0.75rem;
  background: rgba(246, 240, 223, 0.06);
  color: var(--cream);
  outline: none;
}

.signup input:focus {
  border-color: var(--accent);
}

.signup button {
  min-width: 4.6rem;
  min-height: 2.45rem;
  padding: 0 0.8rem;
  color: var(--cream);
}

.swipe-hint {
  display: none;
}

@media (max-width: 760px) {
  .swipe-hint {
    display: block;
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    z-index: 22;
    transform: translateX(-50%);
    color: var(--cream-soft);
    font: 500 0.7rem/1 var(--mono);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
  }

  .swipe-hint.is-visible {
    animation: hint-fade 3.8s var(--ease) forwards;
  }
}

@keyframes hint-fade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(5px); }
  18%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  72%  { opacity: 1; }
  100% { opacity: 0; }
}

.typing-caret::after {
  content: "_";
  display: inline-block;
  margin-left: 0.12rem;
  color: var(--accent);
  animation: blink 700ms steps(1) infinite;
}

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

@media (max-width: 760px) {
  .entry-gate img,
  .scene-image[data-scene-panel="home"] {
    object-position: 47% center;
  }

  .scene-image[data-scene-panel="manifesto"] {
    object-position: 34% center;
  }

  .scene-image[data-scene-panel="lifedesignbox"] {
    object-position: 44% center;
  }

  .scene-image[data-scene-panel="workwithme"] {
    object-position: 14% center;
  }

  .topbar {
    padding: 0.85rem;
    font-size: 0.76rem;
  }

  .toplinks {
    gap: 0.38rem;
  }

  .toplinks a + a::before {
    margin-right: 0.38rem;
  }

  .hero-title {
    top: 50%;
  }

  .stage[data-active="home"] .hero-title {
    top: 51%;
  }

  .main-line {
    font-size: clamp(3.4rem, 18vw, 5.8rem);
    letter-spacing: -0.055em;
  }

  .map-point {
    padding: 0.34rem 0.5rem;
    font-size: 0.7rem;
  }

  .map-manifesto {
    left: 16%;
    top: 44%;
  }

  .map-box {
    left: 40%;
    top: 34%;
  }

  .map-work {
    left: 74%;
    top: 18%;
  }

  /* direction nav becomes a bottom arrow-row on mobile */
  .direction-nav {
    inset: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.75rem 1rem 4rem;
    background: linear-gradient(to top, rgba(20, 17, 12, 0.62) 0%, transparent 100%);
    pointer-events: none;
  }

  .dir-point {
    position: relative;
    inset: auto;
    transform: none;
    font-size: 0.7rem;
    padding: 0.36rem 0.6rem;
    gap: 0.3rem;
    pointer-events: auto;
  }

  /* swap code-style direction word for a unicode arrow */
  .dir-point span {
    font-size: 0;
  }

  .dir-point[data-dir="left"] span::before  { content: "←"; font-size: 0.7rem; color: var(--code); }
  .dir-point[data-dir="right"] span::before { content: "→"; font-size: 0.7rem; color: var(--code); }
  .dir-point[data-dir="top"] span::before   { content: "↑"; font-size: 0.7rem; color: var(--code); }
  .dir-point[data-dir="bottom"] span::before{ content: "↓"; font-size: 0.7rem; color: var(--code); }

  .dir-top:hover,
  .dir-bottom:hover,
  .dir-left:hover,
  .dir-right:hover {
    transform: translateY(-1px);
  }

  .signup {
    grid-template-columns: 1fr;
  }
}

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