/* =========================================================
   21.11 — для Ності
   ========================================================= */

:root{
  --bg:            #080609;
  --bg-soft:       #100b11;
  --paper:         #f4ece5;
  --paper-dim:     #d3c5c6;
  --muted:         #9c8b95;
  --rose:          #e191a7;
  --rose-soft:     #f3bdca;
  --wine:          #7d2038;
  --wine-deep:     #430d1e;
  --gold:          #e8cda7;
  --gold-dim:      #b99b74;
  --line:          rgba(244, 236, 229, .14);
  --line-soft:     rgba(244, 236, 229, .07);

  --serif: "Cormorant Garamond", "Playfair Display", "Times New Roman", serif;
  --sans:  "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  --ease: cubic-bezier(.16, .84, .32, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
  --pad-x: clamp(1.25rem, 5vw, 4.5rem);
  --pad-top: clamp(4.5rem, 9vh, 6.5rem);
  --pad-bottom: clamp(1.6rem, 5vh, 3rem);
}

*,
*::before,
*::after{ box-sizing: border-box; }

html{
  height: 100%;
  background: var(--bg);
  color: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body{
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--sans);
  font-weight: 300;
  color: var(--paper);
  background:
    radial-gradient(120% 80% at 50% 115%, #1a0b13 0%, transparent 60%),
    radial-gradient(80% 60% at 15% 0%, #130c14 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after{
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

::selection{
  background: rgba(125, 32, 56, .85);
  color: #fff;
}

button,
input{
  font: inherit;
  color: inherit;
}

button{ -webkit-tap-highlight-color: transparent; }

h1, h2, p, ul{ margin-top: 0; }

h1:focus,
h2:focus{ outline: none; }

.sr-only{
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- noise ---------- */

.grain{
  position: fixed;
  inset: -10%;
  z-index: 58;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- topbar ---------- */

.topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding:
    max(.9rem, env(safe-area-inset-top))
    max(var(--pad-x), env(safe-area-inset-right))
    0
    max(var(--pad-x), env(safe-area-inset-left));
  pointer-events: none;
  transition: opacity .8s var(--ease);
}

.monogram{
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: .26em;
  color: var(--paper-dim);
  opacity: .75;
  user-select: none;
}

.monogram span{
  color: var(--rose);
  margin: 0 .18em;
  opacity: .8;
}

.sound{
  pointer-events: auto;
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .025);
  color: var(--paper-dim);
  cursor: pointer;
  transition: color .35s ease, border-color .35s ease, background .35s ease, transform .35s ease;
}

.sound svg{
  width: 1.05rem;
  height: 1.05rem;
}

.sound:hover{
  color: var(--paper);
  border-color: rgba(244, 236, 229, .32);
  background: rgba(255, 255, 255, .055);
}

.sound:active{ transform: scale(.94); }

.sound:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.sound__slash{ opacity: 1; transition: opacity .25s ease; }
.sound.is-on .sound__slash{ opacity: 0; }
.sound__wave{ opacity: 0; transition: opacity .25s ease; }
.sound.is-on .sound__wave{ opacity: 1; }

/* ---------- stage system ---------- */

.stage{
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding:
    calc(var(--pad-top) + env(safe-area-inset-top))
    max(var(--pad-x), env(safe-area-inset-right))
    calc(var(--pad-bottom) + env(safe-area-inset-bottom))
    max(var(--pad-x), env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.992);
  transition:
    opacity .9s var(--ease),
    transform 1.3s var(--ease),
    visibility 0s linear .9s;
  scrollbar-width: none;
}

.stage::-webkit-scrollbar{ width: 0; height: 0; }

.stage.is-active{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
  z-index: 3;
}

.stage > *{
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
}

.stage--gate::before,
.stage--virus::before,
.stage--rose::before,
.stage--ascii::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.stage--gate::before{
  background:
    radial-gradient(52% 44% at 50% 108%, rgba(125, 32, 56, .42) 0%, transparent 72%),
    radial-gradient(36% 36% at 82% -4%, rgba(232, 205, 167, .055) 0%, transparent 70%);
}

.stage--virus::before{
  background:
    radial-gradient(65% 55% at 50% 110%, rgba(132, 20, 38, .38) 0%, transparent 72%),
    radial-gradient(50% 42% at 50% 40%, rgba(90, 12, 27, .18) 0%, transparent 70%);
  transition: opacity 1.2s ease;
}

.stage--rose::before{
  background:
    radial-gradient(46% 55% at 34% 48%, rgba(125, 32, 56, .28) 0%, transparent 68%),
    radial-gradient(45% 45% at 85% 8%, rgba(232, 205, 167, .045) 0%, transparent 70%);
}

.stage--ascii::before{
  background:
    radial-gradient(55% 55% at 50% 52%, rgba(125, 32, 56, .22) 0%, transparent 70%),
    radial-gradient(48% 40% at 50% 108%, rgba(232, 205, 167, .06) 0%, transparent 70%);
}

.stage__warm{
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
  background:
    radial-gradient(62% 55% at 50% 100%, rgba(125, 32, 56, .34) 0%, transparent 72%),
    radial-gradient(45% 40% at 50% 20%, rgba(232, 205, 167, .075) 0%, transparent 70%);
}

.stage--virus.is-soft .stage__warm{ opacity: 1; }

/* ---------- shared type ---------- */

.display{
  font-family: var(--serif);
  font-weight: 400;
  line-height: .96;
  letter-spacing: -.015em;
}

.display em{
  font-style: italic;
  font-weight: 300;
  color: var(--rose-soft);
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .72em;
  margin: 0 0 clamp(1.2rem, 3vh, 1.9rem);
  font-family: var(--sans);
  font-size: .64rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.eyebrow__dot{
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 10px rgba(225, 145, 167, .9);
  flex: none;
}

/* ---------- buttons ---------- */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .85em;
  padding: .95em 1.6em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .17em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color .35s ease,
    background .45s ease,
    border-color .35s ease,
    transform .35s var(--ease),
    box-shadow .45s ease;
}

.btn__arrow{
  font-size: .95rem;
  line-height: 0;
  transform: translateY(-.5px);
  transition: transform .45s var(--ease);
}

.btn:hover .btn__arrow{ transform: translate(3px, -.5px); }

.btn:active{ transform: scale(.975); }

.btn:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.btn--solid{
  background: var(--paper);
  border-color: var(--paper);
  color: #150d11;
}

.btn--solid:hover{
  background: var(--gold);
  border-color: var(--gold);
  color: #150d11;
  box-shadow: 0 12px 36px rgba(232, 205, 167, .16);
  transform: translateY(-1px);
}

.btn--ghost{
  color: var(--paper-dim);
}

.btn--ghost:hover{
  color: var(--paper);
  border-color: rgba(244, 236, 229, .32);
  background: rgba(255, 255, 255, .035);
}

.btn--small{
  padding: .78em 1.25em;
  font-size: .62rem;
  letter-spacing: .14em;
}

/* =========================================================
   01 · GATE
   ========================================================= */

.stage--gate{ text-align: center; }

.gate-wrap{
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2.6rem, 9vh, 6rem);
}

.gate{
  position: relative;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(1rem, 3vw, 1.6rem);
  isolation: isolate;
}

.gate::before,
.gate::after{
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 47%;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.gate::before{
  width: min(680px, 128%);
  aspect-ratio: 1;
  border: 1px solid rgba(244, 236, 229, .055);
}

.gate::after{
  width: min(480px, 92%);
  aspect-ratio: 1;
  border: 1px dashed rgba(225, 145, 167, .075);
  animation: slowSpin 90s linear infinite;
}

@keyframes slowSpin{
  to{ transform: translate(-50%, -50%) rotate(360deg); }
}

.gate__title{
  margin-bottom: clamp(.9rem, 2.4vh, 1.25rem);
  font-size: clamp(3.7rem, 10.5vw, 7.2rem);
  font-weight: 400;
  letter-spacing: -.03em;
}

.gate__title em{
  position: relative;
  padding-right: .04em;
}

.gate__title em::after{
  content: "";
  position: absolute;
  left: 8%;
  right: 2%;
  bottom: .02em;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243, 189, 202, .55), transparent);
}

.gate__lede{
  max-width: 34ch;
  margin: 0 auto clamp(2.4rem, 6vh, 3.4rem);
  color: var(--muted);
  font-size: clamp(.8rem, 1.8vw, .92rem);
  line-height: 1.8;
  letter-spacing: .035em;
  text-wrap: balance;
  transition: color .5s ease;
}

.gate.is-unlocked .gate__lede{ color: var(--rose-soft); }

.gate-form{
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.1rem;
  width: min(470px, 100%);
  margin: 0 auto;
}

.gate-form.is-shake{
  animation: shake .5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake{
  10%, 90%{ transform: translateX(-1px); }
  20%, 80%{ transform: translateX(2px); }
  30%, 50%, 70%{ transform: translateX(-4px); }
  40%, 60%{ transform: translateX(4px); }
}

.field{
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.field__input{
  display: block;
  width: 100%;
  padding: .35rem 0 .8rem;
  border: 0;
  border-bottom: 1px solid rgba(244, 236, 229, .25);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 1.55rem);
  font-weight: 400;
  letter-spacing: .01em;
  outline: none;
  transition: border-color .4s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field__input::placeholder{
  color: rgba(244, 236, 229, .26);
  font-style: italic;
  font-weight: 300;
}

.field__input:focus{
  border-color: var(--gold);
}

.field__input:focus-visible{
  outline: none;
}

.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--paper);
  transition: background-color 9999s ease-out;
  caret-color: var(--paper);
}

.gate__hint{
  margin: clamp(1.3rem, 3vh, 1.8rem) 0 0;
  color: rgba(156, 139, 149, .75);
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.gate__error{
  min-height: 1.5em;
  margin: .75rem 0 0;
  color: var(--rose);
  font-size: .72rem;
  line-height: 1.5;
  letter-spacing: .07em;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .3s ease, transform .3s ease;
}

.gate__error.is-on{
  opacity: 1;
  transform: none;
}

/* gate entrance */

.stage.is-active .eyebrow,
.stage.is-active .gate__title,
.stage.is-active .gate__lede,
.stage.is-active .gate-form,
.stage.is-active .gate__hint{
  animation: riseIn 1.2s var(--ease) both;
}

.stage.is-active .gate__title{ animation-delay: .08s; }
.stage.is-active .gate__lede{ animation-delay: .2s; }
.stage.is-active .gate-form{ animation-delay: .32s; }
.stage.is-active .gate__hint{ animation-delay: .46s; }

@keyframes riseIn{
  from{
    opacity: 0;
    transform: translateY(18px);
    filter: blur(7px);
  }
  to{
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* =========================================================
   02 · VIRUS / JOKE
   ========================================================= */

.stage--virus{
  text-align: center;
}

.virus{
  position: relative;
  width: min(760px, 100%);
  min-height: min(580px, 70vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.terminal{
  position: relative;
  z-index: 2;
  width: min(620px, 100%);
  border: 1px solid rgba(244, 236, 229, .13);
  border-radius: 14px;
  background: rgba(10, 7, 9, .78);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color .5s ease, box-shadow .5s ease, opacity .7s ease, transform .9s var(--ease);
}

.virus.is-alarm .terminal{
  border-color: rgba(255, 94, 110, .45);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, .6),
    0 0 70px rgba(160, 20, 42, .28),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  animation: terminalTremble .22s linear 4;
}

.virus.is-joke .terminal{
  opacity: 0;
  transform: scale(.97);
  pointer-events: none;
}

@keyframes terminalTremble{
  0%, 100%{ transform: translate3d(0, 0, 0); }
  25%{ transform: translate3d(-2px, 1px, 0); }
  50%{ transform: translate3d(2px, -1px, 0); }
  75%{ transform: translate3d(-1px, 0, 0); }
}

.terminal__bar{
  display: flex;
  align-items: center;
  gap: .46rem;
  padding: .78rem 1rem;
  border-bottom: 1px solid rgba(244, 236, 229, .07);
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .04em;
  color: var(--muted);
}

.dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.dot--r{ background: #9e4247; }
.dot--y{ background: #9c8547; }
.dot--g{ background: #4a7c5b; }

.terminal__bar em{
  margin-left: .65rem;
  font-style: normal;
  opacity: .62;
}

.terminal__lock{
  margin-left: auto;
  color: #b66470;
  font-size: .66rem;
}

.terminal__body{
  padding: 1.35rem 1.4rem 1.9rem;
  min-height: 250px;
  font-family: var(--mono);
  font-size: clamp(.68rem, 1.5vw, .8rem);
  line-height: 1.65;
  text-align: left;
}

.terminal__log p{
  margin: 0 0 .5rem;
  color: #9fae9e;
  letter-spacing: .01em;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0;
  animation: logIn .3s ease forwards;
}

.terminal__log p:last-child{ margin-bottom: 0; }

.terminal__log .is-ok b{ color: #82c294; font-weight: 400; }
.terminal__log .is-warn{ color: #cdb08a; }
.terminal__log .is-warn b{ color: #e6b27d; font-weight: 400; }
.terminal__log .is-bad{ color: #f08a8a; }
.terminal__log .is-bad b{ color: #ff9c9c; font-weight: 500; }

@keyframes logIn{
  from{ opacity: 0; transform: translateY(3px); }
  to{ opacity: 1; transform: none; }
}

.terminal__progress{
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: 1.05rem;
  height: 2px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s ease;
}

.virus.is-alarm .terminal__progress{ opacity: 1; }

.terminal__progress i{
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #8c1d32, #ff7b85);
  box-shadow: 0 0 12px rgba(255, 80, 96, .45);
}

.virus.is-alarm .terminal__progress i{
  animation: progressFill 3.2s cubic-bezier(.45, .05, .2, 1) forwards;
}

@keyframes progressFill{
  to{ width: 100%; }
}

/* red punch overlay */

.virus__punch{
  position: absolute;
  inset: -1rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  background:
    radial-gradient(58% 52% at 50% 48%, rgba(18, 2, 6, .88) 0%, rgba(7, 2, 4, .78) 65%, rgba(7, 2, 4, .5) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
}

.virus.is-alarm .virus__punch{
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.virus.is-joke .virus__punch{
  opacity: 0;
  visibility: hidden;
}

.punch__tag{
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 clamp(1.2rem, 3vh, 2rem);
  color: rgba(255, 153, 153, .78);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .6s var(--ease);
}

.punch__dot{
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff5d6b;
  box-shadow: 0 0 14px rgba(255, 60, 80, .85);
}

.punch__small,
.punch__mid,
.punch__big{
  margin: 0;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .9s var(--ease);
}

.virus.is-alarm .punch__tag{ opacity: 1; transform: none; transition-delay: .05s; }
.virus.is-alarm .punch__small{ opacity: 1; transform: none; transition-delay: .32s; }
.virus.is-alarm .punch__mid{ opacity: 1; transform: none; transition-delay: .62s; }
.virus.is-alarm .punch__big{ opacity: 1; transform: none; transition-delay: .95s; }

.punch__small{
  font-family: var(--mono);
  font-size: clamp(.72rem, 1.6vw, .84rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 205, 205, .55);
}

.punch__mid{
  margin-top: .8rem;
  max-width: 24ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 3.2vw, 1.85rem);
  line-height: 1.3;
  color: #f3c7c7;
}

.punch__big{
  position: relative;
  margin-top: clamp(.4rem, 1.5vh, .9rem);
  font-family: var(--serif);
  font-size: clamp(3.8rem, 12vw, 8rem);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.02em;
  color: #ffecec;
  text-shadow:
    0 0 60px rgba(255, 46, 70, .35),
    0 0 18px rgba(255, 90, 110, .25);
}

.punch__big::before,
.punch__big::after{
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .45;
}

.punch__big::before{
  color: #ff4664;
  clip-path: inset(0 0 58% 0);
  transform: translate(-2px, -1px);
}

.punch__big::after{
  color: #77d8ff;
  clip-path: inset(55% 0 0 0);
  transform: translate(2px, 1px);
  opacity: .22;
}

/* joke */

.virus__joke{
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition:
    opacity 1s var(--ease),
    transform 1.2s var(--ease),
    visibility 0s linear 1s;
}

.virus.is-joke .virus__joke{
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.joke__hey{
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(4rem, 13vw, 8rem);
  line-height: 1;
  color: var(--rose-soft);
  text-shadow: 0 0 80px rgba(225, 145, 167, .35);
}

.joke__hey span{
  font-style: normal;
  font-size: .5em;
  vertical-align: .18em;
  filter: saturate(.2) brightness(1.25);
}

.joke__text{
  max-width: 34ch;
  margin: clamp(1.4rem, 4vh, 2.2rem) 0 clamp(2rem, 5vh, 2.8rem);
  color: var(--paper-dim);
  font-size: clamp(.86rem, 2vw, .98rem);
  line-height: 1.85;
  letter-spacing: .015em;
}

.skip{
  position: absolute;
  bottom: -1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  padding: .5rem;
  border: 0;
  background: none;
  color: rgba(244, 236, 229, .35);
  font-size: .58rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .5s ease, visibility 0s linear .5s, color .3s ease;
}

.skip.is-visible{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.skip:hover{ color: var(--paper-dim); }

.skip:focus-visible{
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.virus.is-joke .skip{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* alarm vignette */

.alarm{
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 42%, rgba(130, 8, 24, .5) 100%),
    linear-gradient(180deg, rgba(120, 8, 22, .18), transparent 25%, transparent 75%, rgba(120, 8, 22, .2));
  transition: opacity .6s ease;
}

body.is-alarm .alarm{
  opacity: 1;
  animation: alarmPulse 2.6s ease-in-out infinite;
}

@keyframes alarmPulse{
  0%, 100%{ opacity: .55; }
  50%{ opacity: 1; }
}

body.is-alarm .topbar{ opacity: .55; }

/* =========================================================
   03 · ROSE
   ========================================================= */

.rose-layout{
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3.5rem);
  width: min(1180px, 100%);
}

.rose-art{
  position: relative;
  height: clamp(400px, 74vh, 790px);
  min-width: 0;
}

.rose-art::before{
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: min(62%, 460px);
  height: 16%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, .55), transparent 70%);
  filter: blur(14px);
  pointer-events: none;
}

#rose-canvas{
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.rose-art__glow{
  position: absolute;
  left: 50%;
  top: 27%;
  width: min(60%, 440px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 145, 167, .14), transparent 66%);
  filter: blur(26px);
  pointer-events: none;
  animation: glowBreath 7s ease-in-out infinite;
}

@keyframes glowBreath{
  0%, 100%{ opacity: .7; transform: translate(-50%, -50%) scale(1); }
  50%{ opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

.rose-copy{
  max-width: 500px;
  padding-bottom: clamp(0rem, 2vh, 1rem);
}

.rose-copy__title{
  margin: 0 0 clamp(1.6rem, 4.5vh, 2.8rem);
  font-size: clamp(2.35rem, 4.4vw, 3.9rem);
}

.rose-lines{
  margin: 0 0 clamp(1.8rem, 5vh, 3rem);
  padding: 0;
  list-style: none;
}

.rose-lines li{
  position: relative;
  margin-bottom: clamp(.55rem, 1.4vh, .9rem);
  padding-left: 1.65rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.42;
  color: var(--paper-dim);
  opacity: 0;
  transform: translateY(18px);
  filter: blur(7px);
  transition:
    opacity 1.1s var(--ease-soft),
    transform 1.3s var(--ease),
    filter 1.2s var(--ease);
}

.rose-lines li::before{
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 7px;
  height: 9px;
  border: 1px solid rgba(225, 145, 167, .72);
  border-radius: 60% 0 60% 60%;
  transform: rotate(-45deg);
  opacity: .8;
}

.rose-lines li:first-child{
  color: var(--paper);
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-style: italic;
  line-height: 1.3;
}

.rose-lines li:last-child{
  color: var(--gold);
}

.rose-lines li.is-in{
  opacity: 1;
  transform: none;
  filter: none;
}

.rose-next{
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity .9s var(--ease),
    transform 1s var(--ease),
    color .35s ease,
    background .45s ease,
    border-color .35s ease;
}

.rose-next.is-visible{
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* =========================================================
   04 · ASCII FINALE
   ========================================================= */

.stage--ascii{ text-align: center; }

.finale{
  width: min(1000px, 100%);
}

.finale__title{
  margin: 0 0 clamp(1.5rem, 3.5vh, 2.4rem);
  font-size: clamp(2.5rem, 5.8vw, 5rem);
}

.ascii-frame{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-inline: auto;
  height: clamp(300px, 50vh, 530px);
  padding: clamp(.9rem, 2.6vw, 1.8rem);
  border: 1px solid rgba(232, 205, 167, .14);
  background:
    radial-gradient(65% 80% at 50% 42%, rgba(232, 205, 167, .055) 0%, transparent 66%),
    rgba(8, 6, 8, .5);
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, .55),
    0 34px 90px rgba(0, 0, 0, .35);
  overflow: hidden;
}

.ascii-frame::before,
.ascii-frame::after{
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border: solid var(--gold-dim);
  opacity: .55;
  pointer-events: none;
  z-index: 3;
}

.ascii-frame::before{
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
}

.ascii-frame::after{
  right: 10px;
  bottom: 10px;
  border-width: 0 1px 1px 0;
}

.ascii{
  position: relative;
  left: var(--ascii-shift, 0ch);
  z-index: 2;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--gold);
  white-space: pre;
  text-align: left;
  transform: translateX(-2px);
  text-shadow: 0 0 16px rgba(232, 205, 167, .18);
  filter: contrast(1.04);
  font-variant-ligatures: none;
  tab-size: 1;
  user-select: text;
}

.ascii-line{
  display: block;
  min-height: 1em;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .5s linear, transform .6s var(--ease);
}

.ascii.is-visible .ascii-line{
  opacity: 1;
  transform: none;
}

.ascii-frame__scan{
  position: absolute;
  left: 0;
  right: 0;
  top: -120px;
  height: 120px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(225, 145, 167, .11), transparent);
  border-bottom: 1px solid rgba(225, 145, 167, .2);
}

.ascii-frame.is-revealing .ascii-frame__scan{
  opacity: 1;
  animation: asciiScan 2.6s var(--ease) forwards;
}

@keyframes asciiScan{
  from{ transform: translateY(0); opacity: 0; }
  12%{ opacity: 1; }
  to{ transform: translateY(var(--scan-dist, 600px)); opacity: 0; }
}

.finale__note{
  max-width: 54ch;
  margin: clamp(1.4rem, 3.5vh, 2.1rem) auto 0;
  padding: 0 .5rem;
  color: var(--paper-dim);
  font-size: clamp(.8rem, 1.8vw, .92rem);
  line-height: 1.9;
  letter-spacing: .02em;
  text-wrap: balance;
}

.finale__actions{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.2rem, 4vw, 2.4rem);
  margin-top: clamp(1.3rem, 3.5vh, 2rem);
  flex-wrap: wrap;
}

.stage.is-active .finale__title,
.stage.is-active .ascii-frame,
.stage.is-active .finale__note,
.stage.is-active .finale__actions{
  animation: riseIn 1.3s var(--ease) both;
}

.stage.is-active .finale__title{ animation-delay: .1s; }
.stage.is-active .ascii-frame{ animation-delay: .4s; }
.stage.is-active .finale__note{ animation-delay: 1.4s; }
.stage.is-active .finale__actions{ animation-delay: 1.65s; }

/* Desktop: the photo gets its own tall "gallery wall" column. */
@media (min-width: 960px) and (min-height: 700px){
  .stage--ascii{ text-align: left; }

  .finale{
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    column-gap: clamp(2.2rem, 4.5vw, 4.5rem);
    align-items: center;
    width: min(1160px, 100%);
  }

  .finale__title{
    grid-column: 1;
    margin-bottom: clamp(1.1rem, 2.6vh, 1.6rem);
    font-size: clamp(2.7rem, 3.9vw, 4rem);
  }

  .ascii-frame{
    grid-column: 2;
    grid-row: 1 / span 3;
    justify-self: center;
    width: 100%;
    height: min(72vh, 660px);
  }

  .finale__note{
    grid-column: 1;
    margin: 0;
    max-width: 42ch;
    font-size: .88rem;
    text-align: left;
  }

  .finale__actions{
    grid-column: 1;
    justify-content: flex-start;
    margin-top: clamp(1.2rem, 3vh, 1.8rem);
  }
}

/* =========================================================
   petals + flash
   ========================================================= */

.petal-layer{
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .8s ease;
}

body[data-stage="virus"] .petal-layer,
body[data-stage="rose"] .petal-layer{ opacity: 0; }

.petal{
  position: absolute;
  top: -8vh;
  display: block;
  border-radius: 68% 0 68% 68%;
  background: linear-gradient(135deg, rgba(225, 145, 167, .55), rgba(125, 32, 56, .08));
  box-shadow: 0 0 10px rgba(225, 145, 167, .08);
  animation-name: petalFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

@keyframes petalFall{
  0%{ transform: translate3d(0, 0, 0) rotate(0deg); }
  50%{ transform: translate3d(var(--dx, 40px), 60vh, 0) rotate(360deg); }
  100%{ transform: translate3d(calc(var(--dx, 40px) * -.6), 116vh, 0) rotate(720deg); }
}

.veil{
  position: fixed;
  inset: 0;
  z-index: 47;
  pointer-events: none;
  background: var(--bg);
  opacity: 0;
  transition: opacity .5s ease;
}

.veil.is-on{
  opacity: 1;
  pointer-events: auto;
}

.flash{
  position: fixed;
  inset: 0;
  z-index: 56;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 248, 236, .82) 0%, rgba(243, 189, 202, .22) 34%, transparent 68%);
  mix-blend-mode: screen;
}

.flash.is-on{
  animation: flashOut 1.05s ease-out forwards;
}

@keyframes flashOut{
  0%{ opacity: 0; }
  10%{ opacity: 1; }
  100%{ opacity: 0; }
}

/* =========================================================
   responsive
   ========================================================= */

@media (max-width: 980px){
  .rose-layout{
    grid-template-columns: 1fr;
    gap: .2rem;
    max-width: 560px;
    text-align: center;
    padding-top: .5rem;
  }

  .rose-art{
    height: clamp(280px, 41dvh, 430px);
  }

  .rose-art__glow{
    top: 34%;
  }

  .rose-copy{
    max-width: 100%;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .rose-copy__title{
    font-size: clamp(1.9rem, 6.8vw, 2.9rem);
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
  }

  .rose-lines{
    margin-bottom: clamp(1.3rem, 3.5vh, 2rem);
  }

  .rose-lines li{
    padding-left: 0;
    font-size: clamp(1.08rem, 3.6vw, 1.28rem);
    margin-bottom: .3rem;
  }

  .rose-lines li::before{ display: none; }

  .rose-lines li:first-child{
    font-size: clamp(1.3rem, 4.8vw, 1.65rem);
  }
}

@media (max-width: 760px){
  :root{
    --pad-top: 4.6rem;
    --pad-bottom: 1.8rem;
  }

  .stage--gate .gate-wrap{
    margin-top: clamp(1rem, 6vh, 4rem);
    margin-bottom: auto;
    gap: 2rem;
  }

  .gate{
    padding-top: 0;
  }

  .gate::before{ width: 120%; }
  .gate::after{ width: 88%; }

  .gate__title{
    font-size: clamp(3.4rem, 17vw, 5.4rem);
  }

  .gate__lede{
    margin-bottom: 2.2rem;
  }

  .gate__hint{
    font-size: .58rem;
    letter-spacing: .18em;
  }

  .virus{
    min-height: 66vh;
  }

  .terminal__body{
    min-height: 210px;
    padding: 1.1rem 1.1rem 1.6rem;
  }

  .terminal__progress{
    left: 1.1rem;
    right: 1.1rem;
  }

  .skip{
    bottom: -2.2rem;
    font-size: .54rem;
  }

  .joke__text{
    font-size: .84rem;
  }

  .ascii-frame{
    height: clamp(270px, 44dvh, 420px);
    padding: .75rem .6rem;
  }

  .finale__title{
    font-size: clamp(2.35rem, 10.5vw, 3.3rem);
    margin-bottom: 1.3rem;
  }

  .finale__note{
    font-size: .8rem;
    line-height: 1.8;
  }

  .finale__actions{
    margin-top: 1.2rem;
  }

  .topbar{
    padding-top: max(.75rem, env(safe-area-inset-top));
  }
}

@media (max-width: 520px){
  .gate-form{
    flex-direction: column;
    align-items: stretch;
    gap: 1.35rem;
    width: min(360px, 100%);
  }

  .gate-form .btn{
    width: 100%;
    height: 3.35rem;
  }

  .field__input{
    font-size: 1.35rem;
    text-align: center;
  }

  .punch__mid{
    max-width: 21ch;
  }

  .joke__hey span{
    font-size: .55em;
  }
}

@media (max-height: 640px) and (orientation: landscape){
  :root{
    --pad-top: 3.6rem;
    --pad-bottom: 1rem;
  }

  .stage--gate .gate-wrap{ gap: 1.5rem; }
  .gate__title{ font-size: clamp(2.8rem, 9vh, 4rem); }
  .gate__lede{ margin-bottom: 1.4rem; }
  .gate__hint{ display: none; }

  .rose-art{ height: 54vh; }
  .rose-copy__title{ margin-bottom: 1rem; }
  .rose-lines li{ font-size: 1rem; }

  .ascii-frame{ height: 42vh; }
}

/* =========================================================
   reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .gate::after,
  .petal-layer,
  .rose-art__glow{ animation: none; }

  .rose-lines li{
    opacity: 1;
    transform: none;
    filter: none;
  }

  .rose-next{
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .ascii-line{
    opacity: 1;
    transform: none;
  }

  .stage.is-active .eyebrow,
  .stage.is-active .gate__title,
  .stage.is-active .gate__lede,
  .stage.is-active .gate-form,
  .stage.is-active .gate__hint,
  .stage.is-active .finale__title,
  .stage.is-active .ascii-frame,
  .stage.is-active .finale__note,
  .stage.is-active .finale__actions{
    animation: none;
  }
}
