:root{
  --bg1:#04060b;
  --bg2:#0b1120;
  --text:#f8f3ea;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  width:100%;
  height:100%;
  overflow-x:hidden;
  overflow-y:auto;
  background:
    radial-gradient(circle at 70% 72%, rgba(255,235,180,.08), transparent 22%),
    radial-gradient(circle at 50% 24%, rgba(255,225,140,.10), transparent 24%),
    radial-gradient(circle at 50% 58%, rgba(90,120,255,.08), transparent 36%),
    linear-gradient(180deg,var(--bg2),var(--bg1));
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif;
  cursor:auto !important;
}

body{
  position:relative;
  cursor:auto !important;
}

body.revealed .intro,
body.revealed .name,
body.revealed .thanks,
body.revealed .text,
body.revealed .signature{
  animation-play-state:running;
}

.parallax-layer{
  position:fixed;
  inset:-3%;
  pointer-events:none;
  will-change:transform;
}

.bg-parallax{
  z-index:1;
  background:
    radial-gradient(circle at 72% 70%, rgba(255,230,170,.06), transparent 18%),
    radial-gradient(circle at 18% 22%, rgba(120,145,255,.05), transparent 20%);
  opacity:.9;
}

.light-accent{
  z-index:2;
  background:
    radial-gradient(circle at 70% 76%, rgba(255,244,210,.12), transparent 20%);
  mix-blend-mode:screen;
  opacity:.8;
}

.content-shell{
  position: relative;
  z-index: 5;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
  will-change: auto;
}

.content-shell.show{
  opacity: 1;
  pointer-events: auto;
}

.wrapper{
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 80px 24px 120px;
}

.message{
  position: relative;
  max-width:900px;
  min-height:100%;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  padding:20px 0 40px;
  will-change:transform;
}


.intro,
.name,
.thanks,
.text,
.signature{
  opacity:0;
  transform:translateY(18px);
  animation:fadeUp 1s forwards paused;
}

.intro{
  font-size:clamp(28px,4vw,46px);
  margin:0 0 12px;
  animation-delay:.25s;
}

.name{
  font-size:clamp(54px,8vw,102px);
  line-height:.92;
  font-weight:800;
  margin:0 0 42px;
  color:#fff8ec;
  text-shadow:
    0 0 14px rgba(255,252,235,.18),
    0 0 34px rgba(240,221,176,.16),
    0 0 60px rgba(255,240,190,.08);
  animation-delay:.85s;
}

.thanks{
  font-size:clamp(34px,4.4vw,56px);
  font-weight:800;
  margin:0 0 12px;
  animation-delay:1.55s;
}

.text{
  font-size:clamp(24px,3.1vw,40px);
  line-height:1.45;
  margin:0;
  font-weight:600;
}

.t1{ animation-delay:2.2s; }
.t2{ animation-delay:2.95s; }
.t3{ animation-delay:3.7s; }

.signature{
  margin-top:42px;
  animation-delay:4.45s;
}

.from{
  font-size:clamp(22px,3vw,34px);
  font-weight:750;
  margin:0;
}

.by{
  margin-top:8px;
  font-style:italic;
  font-size:clamp(16px,2vw,22px);
  color:#e7dbc3;
}

@keyframes fadeUp{
  to{
    opacity:1;
    transform:translateY(0);
  }
}

.actor-layer{
  position:fixed;
  inset:0;
  z-index:20;
  pointer-events:none;
}

/* Грунечка */
.bird{
  position:fixed;
  left:0;
  top:0;
  user-select:none;
  -webkit-user-drag:none;
  will-change:transform, opacity;
  pointer-events:none;
  width:clamp(82px, 8vw, 118px);
  opacity:0;
  z-index:22;
  transform-origin:center center;
  filter:
    drop-shadow(0 8px 10px rgba(0,0,0,.18))
    drop-shadow(0 16px 24px rgba(0,0,0,.16))
    drop-shadow(0 2px 3px rgba(255,255,255,.03));
}

/* Статус */
.status{
  position:fixed;
  bottom:14px;
  left:50%;
  transform:translateX(-50%);
  z-index:30;
  font-size:13px;
  color:rgba(245,239,228,.74);
  background:rgba(8,10,18,.32);
  border:1px solid rgba(255,255,255,.08);
  padding:8px 12px;
  border-radius:999px;
  backdrop-filter:blur(8px);
  transition:opacity .35s ease, transform .35s ease;
  pointer-events:none;
}

.status.hidden{
  opacity:0;
  transform:translateX(-50%) translateY(12px);
}

/* Скрыть старые фейковые курсоры, если где-то остались */
#cursorSprite,
#cursorActor,
.cursor-sprite,
.cursor-actor{
  display:none !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Скрытие системного курсора во время грызения */
.pecking-cursor-hidden,
.pecking-cursor-hidden *{
  cursor:none !important;
}

.intro,
.name,
.thanks,
.text,
.signature,
.from,
.by,
.message,
.wrapper,
#content{
  cursor:default;
  user-select:none;
  -webkit-user-select:none;
}

/* ===== BIRD UNDER FILM PREP ===== */
.bird.peeking{
  opacity:1 !important;
  transform:
    translate(var(--bird-x, 0px), var(--bird-y, 0px))
    scale(0.78)
    rotate(-6deg);
  transition:
    transform 0.45s ease,
    opacity 0.35s ease;
  z-index:21;
  filter:
    drop-shadow(0 8px 14px rgba(0,0,0,0.28))
    drop-shadow(0 0 12px rgba(255,244,210,0.08));
}

body.film-on .bird.peeking{
  opacity:0.88 !important;
}

/* ===== NOTE HINT LAYER (верхние лёгкие намёки) ===== */

.note-hint-layer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 24;
  overflow: hidden;
}

.note-staff{
  position: absolute;
  width: 170px;
  height: 90px;
  opacity: 0.32;
  filter: blur(0px);
}

.note-staff-left{
  left: 5%;
  top: 11%;
  transform: rotate(-16deg);
}

.note-staff-right{
  right: 5%;
  top: 11%;
  transform: rotate(16deg);
}

.note-hint-layer .staff-line{
  display:block;
  height:1px;
  margin:7px 0;
  background: linear-gradient(
    90deg,
    rgba(190,210,255,0),
    rgba(190,210,255,.55),
    rgba(190,210,255,0)
  );
  border-radius:999px;
}

.note-hint-layer .note{
  position:absolute;
  font-size:24px;
  line-height:1;
  color: rgba(210,225,255,.88);
  text-shadow:
    0 0 8px rgba(210,225,255,.25),
    0 0 18px rgba(180,205,255,.18);
  font-family:"Times New Roman", serif;
}

.note-staff-left .note:nth-child(6){
  left:18px;
  top:-2px;
}

.note-staff-left .note:nth-child(7){
  left:78px;
  top:14px;
}

.note-staff-right .note:nth-child(6){
  left:28px;
  top:2px;
}

.note-staff-right .note:nth-child(7){
  left:88px;
  top:16px;
}

/* ===== BACH FRAGMENT (нижний музыкальный автограф) ===== */

.bach-fragment{
  position: fixed;
  right: 2%;
  bottom: 8%;
  width: 280px;
  height: 150px;
  transform: rotate(-18deg);
  opacity: 0.62;
  pointer-events: none;
  z-index: 3;
}

.bach-fragment .staff{
  position: relative;
  width: 100%;
  height: 100%;
}

.bach-fragment .line{
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.2px;
  background: linear-gradient(
    90deg,
    rgba(210,225,255,0),
    rgba(210,225,255,0.92),
    rgba(210,225,255,0)
  );
  border-radius: 999px;
}

.bach-fragment .line:nth-child(1){ top: 42px; }
.bach-fragment .line:nth-child(2){ top: 57px; }
.bach-fragment .line:nth-child(3){ top: 72px; }
.bach-fragment .line:nth-child(4){ top: 87px; }
.bach-fragment .line:nth-child(5){ top: 102px; }

.bach-fragment .clef{
  position: absolute;
  left: 8px;
  top: 18px;
  font-size: 54px;
  line-height: 1;
  color: rgba(235,245,255,0.96);
  text-shadow:
    0 0 8px rgba(220,230,255,.38),
    0 0 22px rgba(200,210,255,.26);
  font-family: "Times New Roman", serif;
}

.bach-fragment .note{
  position: absolute;
  font-size: 28px;
  line-height: 1;
  color: rgba(235,245,255,0.95);
  filter: drop-shadow(0 0 6px rgba(200,220,255,0.6));
  text-shadow:
    0 0 10px rgba(220,230,255,.5),
    0 0 25px rgba(200,210,255,.35),
    0 0 50px rgba(180,200,255,.25);
  transform-origin: center center;
  animation: noteBreath 3.8s ease-in-out infinite;
  font-family: "Times New Roman", serif;
}

@keyframes noteBreath {
  0% {
    opacity: 0.45;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }
}

.bach-fragment .n1{
  left: 62px;
  top: 78px;
  animation-delay: 0s;
}

.bach-fragment .n2{
  left: 102px;
  top: 58px;
  animation-delay: 0.35s;
}

.bach-fragment .n3{
  left: 144px;
  top: 90px;
  animation-delay: 0.7s;
}

.bach-fragment .n4{
  left: 188px;
  top: 68px;
  animation-delay: 1.05s;
}

.bach-fragment .n5{
  left: 228px;
  top: 50px;
  animation-delay: 1.4s;
}

@media (max-width:700px){
  .bird{
    width:96px;
  }

  .intro{
    font-size:clamp(24px,6vw,34px);
  }

  .name{
    font-size:clamp(42px,11vw,72px);
    margin-bottom:28px;
  }

  .thanks{
    font-size:clamp(28px,7vw,42px);
  }

  .text{
    font-size:clamp(18px,5vw,28px);
  }

  .signature{
    margin-top:28px;
  }

  .note-staff{
    width:120px;
    height:64px;
    opacity:0.26;
  }

  .note-hint-layer .note{
    font-size:18px;
  }

  .note-hint-layer .staff-line{
    margin:5px 0;
  }

  .note-staff-left .note:nth-child(6){
    left:12px;
    top:-2px;
  }

  .note-staff-left .note:nth-child(7){
    left:52px;
    top:10px;
  }

  .note-staff-right .note:nth-child(6){
    left:18px;
    top:0;
  }

  .note-staff-right .note:nth-child(7){
    left:58px;
    top:11px;
  }

  .bach-fragment{
    width:180px;
    height:95px;
    opacity:0.54;
  }

  .bach-fragment .line:nth-child(1){ top: 26px; }
  .bach-fragment .line:nth-child(2){ top: 36px; }
  .bach-fragment .line:nth-child(3){ top: 46px; }
  .bach-fragment .line:nth-child(4){ top: 56px; }
  .bach-fragment .line:nth-child(5){ top: 66px; }

  .bach-fragment .clef{
    left:4px;
    top:10px;
    font-size:34px;
  }

  .bach-fragment .note{
    font-size:18px;
  }

  .bach-fragment .n1{
    left:40px;
    top:50px;
  }

  .bach-fragment .n2{
    left:66px;
    top:38px;
  }

  .bach-fragment .n3{
    left:92px;
    top:58px;
  }

  .bach-fragment .n4{
    left:118px;
    top:44px;
  }

  .bach-fragment .n5{
    left:144px;
    top:32px;
  }
}
/* ===== SOUND BUTTON ===== */

.sound-btn{
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 120;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;

  background: rgba(18,18,22,0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  color: rgba(255,255,255,0.92);
  font-size: 18px;
  line-height: 1;

  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;

  box-shadow:
    0 8px 24px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.08);

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.35s ease;
}

.sound-btn:hover{
  background: rgba(40,40,40,0.8);
  transform: scale(1.05);
}

.sound-btn:active{
  transform: scale(1);
}

@media (max-width: 680px){
  .sound-btn{
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 16px;
    border-radius: 12px;
  }
}
/* ===== FILM REVEAL BOOST ===== */

.reveal-flash{
  position: fixed;
  inset: 0;
  z-index: 98;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.20), transparent 28%),
    radial-gradient(circle at 50% 60%, rgba(255,244,210,0.10), transparent 42%);
  mix-blend-mode: screen;
}

.reveal-flash.show{
  animation: revealFlash 650ms ease-out forwards;
}

@keyframes revealFlash{
  0%{
    opacity: 0;
    transform: scale(1.02);
    filter: blur(10px);
  }
  25%{
    opacity: 0.95;
    transform: scale(1);
    filter: blur(4px);
  }
  100%{
    opacity: 0;
    transform: scale(1);
    filter: blur(0);
  }
}

body.reveal-boost #content{
  filter: blur(2px) brightness(1.04);
}

body.reveal-boost .bg-parallax,
body.reveal-boost .light-accent{
  filter: blur(3px) brightness(1.06);
  transition: filter 420ms ease, opacity 420ms ease;
}
body.film-on .sound-btn{
  opacity: 0;
  pointer-events: none;
}

body.revealed .sound-btn{
  opacity: 1;
  pointer-events: auto;
  transition: opacity .35s ease;
}
body.film-on .note-hint-layer,
body.film-on .bach-fragment{
  opacity: 0;
  pointer-events: none;
}

body.revealed .note-hint-layer,
body.revealed .bach-fragment{
  opacity: 1;
  transition: opacity .45s ease .15s;
}

/* ===== HIDE ALL SERPENTINE UNDER FILM ===== */

body.film-on .serpentine-back,
body.film-on .serpentine-front{
  opacity: 0 !important;
  pointer-events: none !important;
}

body.revealed .serpentine-back,
body.revealed .serpentine-front{
  opacity: 1 !important;
  transition: opacity .45s ease .12s;
}
.status{
  display: none !important;
}
.content-shell{
  position: relative !important;
}
body.revealed .film-stage{
  pointer-events: none;
}

body.film-on .sound-btn{
  opacity: 0;
  pointer-events: none;
}

body.revealed .sound-btn{
  opacity: 1;
  pointer-events: auto;
}