:root { color-scheme: light; --paper: #e4e9e7; --ink: #353d3d; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; }
body { background: #171c1c; color: var(--ink); font-family: "Courier New", Courier, monospace; }
[hidden] { display: none !important; }
.transmission { position: relative; isolation: isolate; min-height: 100svh; overflow: hidden; background: var(--paper); opacity: 0; }
body[data-phase="portrait"] .transmission,
body[data-phase="identity"] .transmission,
body[data-phase="message"] .transmission,
body[data-phase="coordinates"] .transmission { opacity: 1; }
body[data-phase="portrait"] .transmission { opacity: 1; }
.portrait { position: absolute; inset: 0 auto 0 0; width: 61%; overflow: hidden; mask-image: linear-gradient(90deg, #000 0%, #000 76%, transparent 100%); }
.portrait img, .echo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% 44%; filter: saturate(.32) contrast(.91); mix-blend-mode: multiply; }
.portrait img { opacity: .96; transform: scale(1.35); transform-origin: 88% 65%; }
.echo { background: url("avery-backlund.png") 88% 65% / 135% 135%; opacity: 0; pointer-events: none; }
.echo-one { clip-path: inset(20% 0 70% 0); }
.echo-two { clip-path: inset(53% 0 43% 0); }
.echo-three { clip-path: inset(83% 0 12% 0); }
body.interference .echo-one { animation: slip-one 640ms steps(1) both; }
body.interference .echo-two { animation: slip-two 530ms steps(1) both; }
body.interference .echo-three { animation: slip-one 710ms steps(1) reverse both; }
.paper { position: absolute; inset: 0; z-index: 2; background: url("paper-grain.svg") center / 760px 760px; mix-blend-mode: multiply; opacity: .28; pointer-events: none; }
.wear { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: url("frame-wear.svg") center / 100% 100%; opacity: .48; mix-blend-mode: multiply; }
.tracking { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .065; background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, #52605b 3px, transparent 4px); }
body.interference .tracking { animation: track 720ms steps(1); }
.edge-marks { position: absolute; right: 0; inset-block: 0; width: 14px; z-index: 6; opacity: .8; pointer-events: none; background: linear-gradient(0deg,transparent 0 11%,#262a29 11% 15%,transparent 15% 32%,#262a29 32% 36%,transparent 36% 57%,#262a29 57% 61%,transparent 61% 77%,#262a29 77% 83%,transparent 83%); }
.signal { position: absolute; z-index: 3; left: 59%; right: 6%; top: 45%; transform: translateY(-50%); }
form { display: flex; align-items: center; gap: 18px; font-size: clamp(19px, 1.6vw, 25px); }
label { flex-shrink: 0; white-space: nowrap; }
.entry { display: flex; flex: 1; min-width: 0; border: 1px solid #7d8780; background: rgba(214,221,215,.22); }
input { width: 100%; min-width: 0; border: 0; border-radius: 0; outline: none; background: transparent; color: var(--ink); font: inherit; padding: 8px 4px; caret-color: #353d3d; }
button { border: 0; border-radius: 0; background: transparent; color: #454e49; font: inherit; cursor: pointer; padding: 7px 8px; }
button:hover, button:focus-visible { color: #131b19; background: #cdd4cf; }
.entry:focus-within { border-color: #454f48; }
.message, .coordinates { margin: 0; font-size: clamp(16px, 1.3vw, 21px); line-height: 1.9; letter-spacing: .015em; font-weight: 400; }
.coordinates { white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .coordinates.arrive .coordinate-lock {
    display: inline-block;
    animation: coordinate-lock 420ms 620ms steps(3, end) both;
  }
  .coordinates.arrive .coordinate-lock ~ .coordinate-lock { animation-delay: 1040ms; }
}
@keyframes coordinate-lock {
  0% { opacity: 0; transform: translateY(2px); }
  65% { opacity: 1; transform: none; text-shadow: 0 0 6px currentColor; }
  100% { opacity: 1; transform: none; }
}
.coordinate-label { display: block; margin-bottom: 10px; font-size: 1em; letter-spacing: inherit; }
.arrive { animation: resolve 1.35s steps(1) both; }
.depart { animation: lose 850ms steps(1) both; }
.reject { animation: reject 700ms steps(1); }
@keyframes acquire {
  0%, 9%, 13% { opacity: 0; }
  10%, 14% { opacity: .24; }
  20% { opacity: .73; transform: translateX(-3px); }
  23% { opacity: .12; transform: none; }
  28%, 32% { opacity: .88; }
  30% { opacity: .45; transform: translateY(2px); }
  36% { opacity: .94; transform: none; }
  47% { opacity: .62; }
  49%, 100% { opacity: 1; }
}
@keyframes resolve {
  0%, 8%, 19%, 30% { opacity: 0; }
  6%, 14% { opacity: .5; transform: translateX(3px); }
  24% { opacity: .85; transform: translateX(-2px); }
  34% { opacity: .36; transform: none; }
  40%, 55%, 100% { opacity: 1; transform: none; }
  53% { opacity: .65; transform: translateX(1px); }
}
@keyframes lose {
  0%, 20% { opacity: 1; }
  12%, 30% { opacity: .15; transform: translateX(-3px); }
  36% { opacity: .8; transform: none; }
  43%, 62% { opacity: 0; }
  50% { opacity: .45; }
  70%, 100% { opacity: 0; }
}
@keyframes reject {
  0%, 20%, 100% { opacity: 1; transform: none; }
  10%, 35%, 60% { opacity: .25; transform: translateX(-3px); }
  45%, 75% { opacity: .8; transform: translateX(3px); }
}
@keyframes slip-one {
  0%, 19%, 43%, 100% { opacity: 0; transform: none; }
  12%, 35% { opacity: .7; transform: translateX(11px); }
  28%, 57% { opacity: .4; transform: translateX(-6px); }
}
@keyframes slip-two {
  0%, 25%, 60%, 100% { opacity: 0; }
  15%, 48% { opacity: .8; transform: translateX(-14px); }
  40% { opacity: .5; transform: translateX(7px); }
}
@keyframes track {
  0%, 100% { opacity: .065; transform: none; }
  20%, 45% { opacity: .3; transform: translateY(5px); }
  25%, 55% { opacity: .08; transform: translateY(-3px); }
}
@media (max-width: 700px) {
  .portrait { width: 100%; height: 76svh; mask-image: linear-gradient(0deg, transparent, #000 24%, #000 100%); }
  .portrait img, .echo { object-position: 52% 36%; }
  .portrait img { transform: scale(1.12); transform-origin: 65% 55%; }
  .echo { background-position: 52% 36%; }
  .signal { top: auto; bottom: 12svh; left: 9%; right: 9%; transform: none; }
  form { font-size: 20px; gap: 15px; }
  .message, .coordinates { font-size: clamp(17px, 4.5vw, 20px); line-height: 1.75; color: #252d2b; }
  .edge-marks { width: 8px; }
}
@media (max-height: 500px) and (min-width: 701px) {
  .signal { left: 57%; right: 5%; }
  form { font-size: 18px; gap: 12px; }

}

/* ARG ORIGINAL: the grant page breaks apart into Avery's insertion. */
.grant-residue { position: fixed; inset: 0; z-index: 10; background: #fff; pointer-events: none; }
.grant-residue iframe { display: block; width: 100%; height: 100%; border: 0; }
body.takeover .grant-residue { animation: grant-loss 1.4s steps(1) both; }
body.takeover .transmission { animation: none; opacity: 1; }
@keyframes grant-loss {
  0% { opacity: 1; transform: none; }
  24% { opacity: 1; transform: translateX(-4px); }
  40% { opacity: .92; transform: translateX(7px); clip-path: inset(0); }
  58% { opacity: .8; transform: translateX(-9px); clip-path: inset(12% 0 20%); }
  74% { opacity: .45; transform: translateX(4px); clip-path: inset(38% 0 32%); }
  100% { opacity: 0; transform: none; clip-path: inset(50% 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  body.takeover .grant-residue { opacity: 0; transition: opacity 200ms linear; }
}

/* A single clear portrait glimpse precedes the page takeover. */
body.premonition .grant-residue { opacity: 0; }
body.premonition .transmission { opacity: 1; animation: none; }

/* Never retain grant content once the identity flow is active. */
body[data-phase="identity"] .grant-residue,
body[data-phase="message"] .grant-residue,
body[data-phase="coordinates"] .grant-residue { display: none !important; }

/* ARG ORIGINAL: a barely visible white DHARMA trace accompanies the burial message. */
.dharma-glimpse { position: absolute; left: 50%; top: 50%; width: min(48vw, 560px); transform: translate(-50%, -50%); z-index: 11; display: grid; place-items: center; pointer-events: none; background: transparent; opacity: 0; }
.dharma-glimpse img { width: 100%; opacity: .28; filter: brightness(0) invert(1); clip-path: inset(7% 0 13%); transform: translate(-3px, 2px) rotate(-2deg); }
body[data-phase="message"].dharma-trace .dharma-glimpse { opacity: .88; }
@media (max-width: 700px) {
  .dharma-glimpse { width: 86vw; }
}
@media (prefers-reduced-motion: reduce) {
  .dharma-glimpse { display: none; }
}

/* ARG ORIGINAL: Avery's accusation briefly interrupts the successful identity reveal. */
.accusation { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7svh; isolation: isolate; overflow: hidden; background: #141918; color: #d4d9d3; pointer-events: none; }
.accusation::before {
  content: "";
  position: absolute;
  inset: -1%;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 18%, #a9977840 18.1%, transparent 18.3%, transparent 73%, #a9977833 73.1%, transparent 73.4%),
    radial-gradient(ellipse, transparent 25%, #100e0ccc),
    url("liars-film.webp") center / cover no-repeat;
  filter: saturate(.48) contrast(1.2) brightness(.6);
}
@media (prefers-reduced-motion: no-preference) {
  .accusation::before { animation: accusation-film 2100ms steps(1, end); }
}
@keyframes accusation-film {
  14%, 65% { opacity: .86; transform: translate(1px, -2px); }
  33%, 80% { opacity: .97; transform: translate(-1px, 1px); }
  49%, 100% { opacity: 1; transform: translate(0); }
}
.accusation-logos { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 7vw, 100px); width: 84%; opacity: .63; }
.accusation-logos img { width: 40%; max-width: 300px; height: 90px; object-fit: contain; filter: grayscale(1); }
.accusation-logos .accusation-hanso { filter: grayscale(1) invert(1); }
.accusation > span { font-size: clamp(58px, 15vw, 150px); font-weight: 700; letter-spacing: .12em; padding-left: .12em; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .accusation { display: none; } }
