@font-face {
  font-family: "Cinzel";
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/cinzel.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-400.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-700.woff2") format("woff2");
}

:root {
  --bg: #07050c;
  --win-top: #0b2153;
  --win-bottom: #040c24;
  --rim: #9fdcff;
  --rim-soft: #5aa8ff66;
  --glow: #2f7fff66;
  --text: #e4f3ff;
  --dim: #9fc3e8;
  --hi: #bfeaff;
  --leaf: #b4e07c;
  --moss: #79a654;
  --gold: #f3d77a;
  --heart: #ff9aa6;
  --void: #c66bff;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html {
  cursor:
    url("/assets/cursor.svg") 3 2,
    auto;
}

body {
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  color: inherit;
}

a,
button {
  cursor:
    url("/assets/cursor-hit.svg") 3 2,
    pointer;
}

.win > .bar {
  touch-action: none;
  cursor:
    url("/assets/cursor-move.svg") 16 16,
    move;
}

.dragging,
.dragging * {
  cursor:
    url("/assets/cursor-move.svg") 16 16,
    move !important;
}

.world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.scene {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  image-rendering: pixelated;
  filter: saturate(0.92) brightness(0.86);
  pointer-events: none;
  -webkit-user-drag: none;
  transition: filter 2.5s ease;
  will-change: transform;
}

.awake .scene {
  filter: saturate(1.15) brightness(1);
}

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

.field {
  image-rendering: pixelated;
  width: auto;
  height: auto;
}

.sparks {
  position: fixed;
  z-index: 5;
}

.world::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 35%, #07050c99 80%, #07050cdd 100%);
}

.heart-spot {
  position: absolute;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  z-index: 1;
}

/* --- a System window --- */

.win {
  position: fixed;
  z-index: 3;
  background: linear-gradient(var(--win-top), var(--win-bottom));
  background-color: #08173c;
  box-shadow:
    0 0 0 1px var(--rim),
    0 0 18px var(--glow),
    0 18px 60px #000a;
  text-shadow: 0 0 6px #10356f;
}

.win::before,
.win::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #e6f7ff;
  pointer-events: none;
}

.win::before {
  left: -4px;
  bottom: -4px;
  border-right: 0;
  border-top: 0;
}

.win::after {
  right: -4px;
  top: -4px;
  border-left: 0;
  border-bottom: 0;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--rim-soft);
}

.bar-title {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 15px;
}

.bar-btn {
  position: relative;
  z-index: 3;
  width: 32px;
  height: 28px;
  border: 1px solid #5aa8ff88;
  background: #0a1e4a;
  border-radius: 2px;
  line-height: 1;
}

.bar-btn:hover,
.bar-btn:focus-visible {
  border-color: var(--hi);
  box-shadow: 0 0 10px #3a8aff66;
  outline: none;
}

#card {
  left: 50%;
  top: 50%;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: visible;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: rise 1.6s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

#card.folded {
  animation: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.96);
  transition:
    opacity 0.35s,
    transform 0.35s;
}

#card.unfolding {
  animation: none;
  opacity: 1;
  transition:
    opacity 0.35s,
    transform 0.35s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, -46%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.vines {
  position: absolute;
  left: -40px;
  top: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

.vines .stem {
  fill: none;
  stroke: #4f7f3a;
  stroke-width: 2.8;
  stroke-linecap: round;
}

.vines .leaf {
  transform-box: fill-box;
  transform-origin: 0% 50%;
  transform: scale(0);
  transition: transform 0.9s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.vines .leaf.out {
  transform: scale(1);
}

.vines .bloom {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: scale(0) rotate(-40deg);
  transition: transform 1.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.vines .bloom.out {
  transform: scale(1) rotate(0);
}

.body {
  padding: 22px 26px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow-y: auto;
  max-height: calc(100dvh - 90px);
}

.portrait {
  position: relative;
  width: 124px;
  height: 124px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  flex: none;
}

.portrait img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  box-shadow:
    0 0 0 1px var(--rim),
    0 0 26px #7a4dff66;
  animation: float 6s ease-in-out infinite;
}

.portrait .halo {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed #9fdcff77;
  animation: spin 40s linear infinite;
  pointer-events: none;
}

.portrait .halo::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid #b4e07c33;
}

.portrait.tapped img {
  box-shadow:
    0 0 0 1px var(--hi),
    0 0 40px #8fe3ffaa;
}

@keyframes float {
  50% {
    transform: translateY(-4px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.wordmark {
  margin: 16px 0 6px;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: clamp(40px, 11vw, 58px);
  line-height: 1;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #ffffff 10%, #cdeeff 45%, #8fd0ff 70%, #f3d77a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 14px #4aa3ff88);
}

.lede {
  margin: 4px 0 16px;
  max-width: 34em;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
  hyphens: auto;
}

.lede::first-letter {
  float: left;
  margin: 4px 3px 0 0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 2.9em;
  line-height: 0.8;
  color: var(--hi);
}

.rows {
  width: 100%;
  margin: 0 0 14px;
  border-top: 1px solid #5aa8ff33;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 2px;
  border-bottom: 1px solid #5aa8ff33;
  font-size: 15px;
}

.row dt {
  color: var(--dim);
}

.row dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
}

.gold {
  color: var(--gold);
}

.pips {
  display: inline-flex;
  gap: 2px;
}

.pips i {
  width: 8px;
  height: 10px;
  background: #1c3a6e;
  box-shadow: inset 0 0 0 1px #5aa8ff55;
}

.pips i.on {
  background: linear-gradient(#bfeaff, #5fb4ff);
  box-shadow: 0 0 6px #5fb4ffaa;
}

.pips i.tip {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--dim);
}

.hint-touch {
  display: none;
}

@media (hover: none) {
  .hint-desk {
    display: none;
  }
  .hint-touch {
    display: inline;
  }
}

kbd {
  font-family: ui-monospace, "Space Mono", monospace;
  font-size: 11px;
  color: var(--hi);
  border: 1px solid #bfeaff99;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
}

.foot {
  font-size: 13px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.foot a {
  color: var(--hi);
  text-decoration: none;
  border-bottom: 1px solid #bfeaff55;
}

.foot a:hover,
.foot a:focus-visible {
  color: #fff;
  border-color: var(--hi);
  outline: none;
}

.ghost {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 0;
  background: linear-gradient(var(--win-top), var(--win-bottom));
  box-shadow:
    0 0 0 1px var(--rim),
    0 0 16px var(--glow);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 14px;
  text-shadow: 0 0 6px #10356f;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    box-shadow:
      0 0 0 1px var(--hi),
      0 0 26px #3a8affaa;
  }
}

/* --- her status and the System's notes --- */

.status {
  left: 16px;
  top: 16px;
  width: 250px;
  animation: drop 0.5s ease-out;
}

.status .bar {
  padding: 7px 12px;
}

.status .bar-title {
  font-size: 13px;
}

.status .body {
  padding: 10px 14px 12px;
  align-items: stretch;
  text-align: left;
  gap: 6px;
  font-size: 14px;
}

.srow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.srow .k {
  color: var(--dim);
  flex: 1;
}

.srow b {
  text-align: right;
}

.srow .lv {
  color: var(--gold);
  font-weight: 700;
}

.srow .lv + .k {
  flex: none;
}

.xpbar {
  flex: 1;
  height: 8px;
  background: #1c3a6e;
  box-shadow: inset 0 0 0 1px #5aa8ff55;
  overflow: hidden;
}

.xpbar i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, #f3d77a 0 6px, #c9a94a 6px 7px);
  box-shadow: 0 0 8px #f3d77a88;
  transition: width 0.25s;
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.notes {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  width: min(520px, calc(100vw - 32px));
  pointer-events: none;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(90deg, #0b2153ee, #040c24ee);
  box-shadow:
    0 0 0 1px #9fdcffaa,
    0 0 16px var(--glow);
  border-left: 3px solid var(--hi);
  font-size: 14px;
  line-height: 1.4;
  text-shadow: 0 0 6px #10356f;
  animation: note-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition:
    opacity 0.6s,
    transform 0.6s;
}

.note b {
  color: var(--hi);
  white-space: nowrap;
}

.note.gold {
  border-left-color: var(--gold);
  color: var(--text);
}

.note.gold b {
  color: var(--gold);
}

.note.void {
  border-left-color: var(--void);
}

.note.void b {
  color: #e4b5ff;
}

.note.gone {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.ghost:not([hidden]) ~ .notes {
  bottom: 74px;
}

@media (max-width: 560px) {
  .body {
    padding: 18px 18px 14px;
  }
  .portrait {
    width: 100px;
    height: 100px;
  }
  .lede {
    font-size: 14.5px;
  }
  .row {
    font-size: 14px;
  }
  .status {
    left: 10px;
    top: 10px;
    width: 210px;
  }
  .status .body {
    font-size: 13px;
  }
}

@media (max-height: 640px) and (min-width: 561px) {
  .portrait {
    width: 84px;
    height: 84px;
  }
  .wordmark {
    margin-top: 8px;
    font-size: 42px;
  }
  .lede {
    margin-bottom: 10px;
  }
}

.abyss {
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #1a0a2a, var(--bg) 70%);
}

.lost {
  position: relative;
  width: min(420px, calc(100vw - 32px));
}

.lost .lede {
  margin-top: 0;
}

.home {
  color: var(--hi);
  text-decoration: none;
  border: 1px solid #5aa8ff88;
  background: #0a1e4a;
  padding: 8px 16px;
}

.home:hover,
.home:focus-visible {
  border-color: var(--hi);
  box-shadow: 0 0 10px #3a8aff66;
  outline: none;
}

@media (max-height: 520px) {
  #card {
    width: min(700px, calc(100vw - 32px));
  }
  #card .portrait {
    display: none;
  }
  .bar {
    padding: 6px 10px 6px 14px;
  }
  .body {
    padding: 10px 18px 10px;
    max-height: calc(100dvh - 60px);
  }
  .portrait {
    width: 60px;
    height: 60px;
  }
  .portrait .halo {
    inset: -6px;
  }
  .wordmark {
    margin: 8px 0 4px;
    font-size: 34px;
  }
  .lede {
    margin: 0 0 8px;
    font-size: 13.5px;
    line-height: 1.4;
  }
  .row {
    padding: 4px 2px;
    font-size: 13px;
  }
  .rows {
    margin-bottom: 8px;
  }
  .hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portrait img,
  .portrait .halo,
  .ghost {
    animation: none;
  }
}
