/* ============================================================
   Maddie Vosko — personal site
   Palette + type live in these variables; tweak freely.
   ============================================================ */
:root {
  --creme:        #f7f0df;
  --creme-deep:   #efe4cc;
  --ink:          #1c1a17;
  --rose-deep:    #7c0d1f;
  --rose-mid:     #b01f38;
  --blanket-hi:   #eac3b6;
  --blanket-mid:  #d99e90;
  --blanket-low:  #c98878;
  --blanket-under:#b9705f;
  --stitch:       #a35a4b;
  --font-script:  "Great Vibes", cursive;
  --font-hand:    "Caveat", cursive;
  --font-body:    "Quicksand", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--creme);
  font-family: var(--font-body);
  color: var(--ink);
  overflow: hidden;
}

/* ---------- scenes ---------- */
.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
#cover   { z-index: 10; background: var(--creme); }
#falling { z-index: 5;  background: var(--creme); }
#content { z-index: 20; background: var(--creme); }

/* ---------- the name ---------- */
.name {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--ink);
  text-align: center;
  margin: 0;
  line-height: 1.1;
}
/* pink neon sign: hot-pink tubes with layered glow */
#cover .name {
  position: absolute;
  top: 12vh;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: clamp(3.6rem, 12vw, 10rem);
  letter-spacing: 0.01em;
  color: #ff2f92;
  text-shadow:
    0 0 1px  #ffe6f2,
    0 0 6px  #ff8ec2,
    0 0 16px #ff4fa0,
    0 0 34px rgba(255, 47, 146, 0.75),
    0 0 60px rgba(240, 24, 127, 0.5);
  animation:
    name-in 1.6s cubic-bezier(.2,.7,.25,1) both,
    neon-flicker 6s linear 2.2s infinite;
}
.nl  { display: block; line-height: 0.95; }
.nl2 { transform: translateX(clamp(2.2rem, 15vw, 12rem)); }

@keyframes name-in {
  from { opacity: 0; transform: translateY(3vh); }
  to   { opacity: 1; transform: translateY(0); }
}
/* the occasional neon-tube stutter */
@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  7%  { opacity: 1; }  8%  { opacity: .72; }  9%  { opacity: 1; }
  42% { opacity: 1; }  43% { opacity: .58; }  44% { opacity: 1; }
  45% { opacity: .85; } 46% { opacity: 1; }
}

/* ---------- rose piles ---------- */
.rose-pile {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
#pile-cover {
  height: 32vh;
  /* dark base so gaps between roses read as shadow, not creme */
  background: linear-gradient(to top,
      #45060f 0%, #5c0917 34%, #7a1024 58%,
      rgba(122, 16, 36, 0) 82%);
}
#pile-content-back,
#pile-content-front  { height: 24vh; }
#pile-content-back   { z-index: 2; }
#pile-content-front  { z-index: 4; }

/* the big play pile — Tini lands between its two halves */
#mound-back, #mound-front {
  position: absolute;
  left: 50%;
  bottom: 1vh;
  pointer-events: none;
}
#mound-back  { z-index: 2; }
#mound-front { z-index: 4; }

.rose, .petal-bit {
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  will-change: transform;
}

/* soft red haze rising off the back of the cover pile (depth cue) */
#pile-cover::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 115%;
  background: linear-gradient(to top,
      rgba(90, 8, 22, 0.28) 0%,
      rgba(120, 14, 30, 0.10) 45%,
      rgba(120, 14, 30, 0) 75%);
  pointer-events: none;
}

/* ---------- drifting petals on the cover ---------- */
#drift-layer { position: absolute; inset: 0; pointer-events: none; }
.drift {
  position: absolute;
  top: -6vh;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  opacity: 0.85;
  background-size: contain;
  background-repeat: no-repeat;
  animation: drift-fall var(--dur) linear var(--delay) infinite;
}
@keyframes drift-fall {
  0%   { transform: translate(0, -8vh)       rotate(0deg); }
  50%  { transform: translate(var(--sway), 48vh) rotate(200deg); }
  100% { transform: translate(0, 108vh)      rotate(420deg); }
}

/* ---------- blanket edge under the pile ---------- */
#blanket-under {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6vh;
  z-index: 9; /* behind every rose — it peeks through the gaps */
  background: linear-gradient(to bottom, var(--blanket-low), var(--blanket-mid));
  pointer-events: none;
}

/* ---------- the liftable corner ---------- */
#blanket-corner {
  position: absolute;
  right: 0;
  bottom: 0;
  width:  clamp(150px, 22vw, 220px);
  height: clamp(150px, 22vw, 220px);
  z-index: 30;
  cursor: grab;
  touch-action: none;
  transform-origin: 100% 100%;
  animation: corner-bob 2.6s ease-in-out infinite;
  filter: drop-shadow(-6px -6px 10px rgba(60, 10, 18, 0.25));
}
#blanket-corner:focus-visible { outline: 3px dashed var(--stitch); outline-offset: 4px; }
#blanket-corner.grabbed  { animation: none; cursor: grabbing; }
#blanket-corner.spring   { animation: none; transition: transform .55s cubic-bezier(.2,1.4,.4,1); }
#blanket-corner.gone     { animation: none; opacity: 0; transition: opacity .3s; pointer-events: none; }

@keyframes corner-bob {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-5px, -9px); }
}

#blanket-corner svg { width: 100%; height: 100%; display: block; }
.cloth-base   { fill: var(--blanket-mid); }
.cloth-fold   { fill: var(--blanket-hi); }
.cloth-stitch { stroke: var(--stitch); stroke-width: 2.5; stroke-dasharray: 6 6; opacity: .7; }
.lift-label {
  font-family: var(--font-hand);
  font-size: 30px;
  font-weight: 700;
  fill: #7e4133;
  text-anchor: middle;
}
.lift-arrow {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  fill: #7e4133;
  text-anchor: middle;
  animation: arrow-nudge 1.3s ease-in-out infinite;
}
@keyframes arrow-nudge {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

/* shading that grows from the corner while peeling */
#peel-shade {
  position: absolute;
  inset: 0;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 94% 96%,
      rgba(70, 25, 20, 0.55), rgba(70, 25, 20, 0) 62%);
  transition: opacity .25s;
}

/* ---------- full-screen blanket sweep ---------- */
#blanket-cover {
  position: fixed;
  inset: -3vh -3vw;
  z-index: 60;
  pointer-events: none;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 14px, rgba(0,0,0,0) 14px 28px),
    repeating-linear-gradient(25deg,  rgba(120,50,45,.07) 0 3px, rgba(0,0,0,0) 3px 30px),
    linear-gradient(135deg, var(--blanket-hi), var(--blanket-mid) 55%, var(--blanket-low));
  clip-path: circle(0% at 93% 96%);
  transition: clip-path .85s cubic-bezier(.55,.06,.35,1);
}
#blanket-cover .hem {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  background: var(--blanket-under);
  border-top: 3px dashed rgba(255,255,255,.5);
}
body.covering #blanket-cover { clip-path: circle(165% at 93% 96%); }
body.lifting  #blanket-cover {
  transition: transform .95s cubic-bezier(.62,.04,.42,1);
  transform: translateY(-115%) rotate(-3deg);
}

/* ---------- falling scene ---------- */
#fall-canvas {
  display: block;
  width: 100%;
  height: 100%;
  transition: opacity .5s ease;
}
#fall-canvas.fade { opacity: 0; }

/* ---------- content page ---------- */
#content {
  transform: translateY(103%);
  visibility: hidden;
}
#content.ready  { visibility: visible; }
#content.landed {
  transform: translateY(0);
  transition: transform .85s cubic-bezier(.17,.74,.24,1);
}

.content-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  z-index: 3;
  /* keep the cards clear of the curtains */
  padding: 6vh max(6vw, calc(clamp(44px, 6vw, 96px) + 20px)) 36vh;
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rose-mid) transparent;
}
.content-inner { max-width: 720px; margin: 0 auto; }

.name-small {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  text-align: left;
  margin-bottom: 4vh;
}

.card {
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid rgba(124, 13, 31, 0.12);
  border-radius: 18px;
  padding: 1.4rem 1.8rem;
  margin-bottom: 1.6rem;
  box-shadow: 0 8px 24px rgba(124, 13, 31, 0.06);
  backdrop-filter: blur(2px);
}
.card h3 {
  margin: 0 0 .6rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.card p, .card li { line-height: 1.65; font-size: 1.02rem; }
.card ul { margin: 0; padding-left: 1.2rem; }
.card li { margin-bottom: .45rem; }
.card li::marker { color: var(--rose-mid); }
.card a {
  color: var(--rose-mid);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.card a:hover { color: var(--rose-deep); }

/* ---------- ground plane + horizon on the content page ---------- */
#ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26vh;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top,
      #e9d7b6 0%, #f0e5cb 55%, #f4ecd8 92%, #f6efdf 100%);
}
/* soft horizon line */
#ground::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -2px;
  height: 5px;
  background: rgba(140, 100, 55, 0.22);
  filter: blur(2px);
}

/* ---------- pink neon jeep sign (left side) ---------- */
#jeep-sign {
  position: absolute;
  left: calc(clamp(44px, 6vw, 96px) + 2.5vw);
  top: 48%;
  width: clamp(130px, 17vw, 230px);
  z-index: 2;
  pointer-events: none;
  transform: rotate(-4deg);
  filter:
    drop-shadow(0 0 3px rgba(255, 142, 194, 0.95))
    drop-shadow(0 0 12px rgba(255, 61, 154, 0.7))
    drop-shadow(0 0 28px rgba(240, 24, 127, 0.45));
  animation: neon-flicker 7s linear 1s infinite;
}
#jeep-sign svg { width: 100%; height: auto; display: block; }
#jeep-sign .tube-outer { stroke: #ff64ac; stroke-width: 6; }
#jeep-sign .tube-core  { stroke: #fff0f7; stroke-width: 2; }

/* ---------- the chandelier ---------- */
#chandelier {
  position: absolute;
  left: 76%;
  top: 0;
  width: clamp(96px, 13vw, 160px);
  z-index: 2;
  pointer-events: none;
  transform: translateY(-130%); /* parked above the page until it drops */
}
#chandelier.static { transform: translateY(0); }
#chandelier .chain {
  width: 7px;
  height: 14vh;
  margin: 0 auto;
  background: repeating-linear-gradient(to bottom,
      #8a1129 0 9px, rgba(0,0,0,0) 9px 15px);
  transform-origin: top center;
}
#chandelier .chain.snap { animation: chain-snap 1.1s ease-in-out forwards; }
@keyframes chain-snap {
  0%   { transform: rotate(0); }
  25%  { transform: rotate(20deg); }
  55%  { transform: rotate(-16deg); }
  80%  { transform: rotate(8deg); }
  100% { transform: rotate(0); }
}
#chandelier .chand-body svg { width: 100%; height: auto; display: block; overflow: visible; }
#chandelier .frame path.arm { fill: none; stroke: #b01f38; stroke-width: 6; stroke-linecap: round; }
#chandelier .frame rect,
#chandelier .frame ellipse,
#chandelier .frame path:not(.arm) { fill: #b01f38; }
#chandelier .cups ellipse { fill: #8a1129; }
#chandelier .flame {
  fill: #ffc86e;
  filter: drop-shadow(0 0 5px rgba(255, 190, 90, 0.95));
}
#chandelier .cr  { fill: none; stroke: #8a1129; stroke-width: 2; }
#chandelier .crd { fill: #e0526d; stroke: #8a1129; stroke-width: 1.5; }
/* lights die after the crash */
#chandelier .chand-body.dead .flame { fill: #d9a86c; opacity: .3; filter: none; }

/* impact shake when the chandelier hits the ground */
#content.quake { animation: content-quake .4s linear; }
@keyframes content-quake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(2px, 4px); }
  40% { transform: translate(-3px, 1px); }
  60% { transform: translate(2px, 3px); }
  80% { transform: translate(-2px, 1px); }
}

/* ---------- Tini's dog house (sits on the horizon) ---------- */
#doghouse {
  position: absolute;
  left: 63%;
  bottom: 23.5vh;
  width: clamp(80px, 11vw, 122px);
  z-index: 2;
  pointer-events: none;
  filter: brightness(0.94);
}
#doghouse svg { width: 100%; height: auto; display: block; }
.house-sign {
  font-family: var(--font-hand);
  font-size: 26px;
  font-weight: 700;
  fill: #7c1d2c;
  text-anchor: middle;
}
#doghouse .skirt-rose {
  position: absolute;
  aspect-ratio: 1;
  background-size: contain;
  background-repeat: no-repeat;
}

/* ---------- the dog ----------
   left/margin center it; `transform` is reserved for the
   house → play-spot run (scale + translate = depth). */
#dog {
  position: absolute;
  left: 50%;
  bottom: 5vh; /* riding a little high in the mound keeps her face clear */
  width: clamp(180px, 30vw, 260px);
  margin-left: calc(clamp(180px, 30vw, 260px) / -2);
  transform-origin: 50% 100%;
  z-index: 3;
  pointer-events: none;
  /* hidden while she sleeps inside the house */
  opacity: 0;
  transition: opacity .18s ease-out;
}
#dog.out { opacity: 1; }

/* once awake, the sleeping head in the doorway disappears */
#doghouse.awake #house-sleeper { display: none; }
#dog svg { width: 100%; height: auto; display: block; overflow: visible; }

.fur        { fill: #fdfaf4; stroke: #e3d5c2; stroke-width: 1.5; }
.fur-patch  { fill: #c9713f; }
.ear        { fill: #b55f33; }
.ear-tip    { fill: #2e211c; }
.ink        { fill: #2e211c; }
.glint      { fill: #ffffff; }
.ink-line   { fill: none; stroke: #2e211c; stroke-width: 3; stroke-linecap: round; }
.mouth      { fill: #4a2f28; }
.tongue     { fill: #e88a95; }
.dog-shadow { fill: rgba(70, 25, 25, 0.14); }
/* Tini's maroon hoodie (like the reference photo) */
.hoodie      { fill: #8e2438; }
.hoodie-dark { fill: #741c2e; }
.hoodie-trim { fill: none; stroke: #f5eee6; stroke-width: 4; stroke-linecap: round; opacity: .9; }
.leg         { fill: none; stroke: #fdfaf4; stroke-width: 12; stroke-linecap: round; }

/* sleeping: gentle breathing + floating z's */
#dog-play, #dog-run { display: none; }
#sleep-body {
  transform-origin: 142px 170px;
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.035); }
}
.zz {
  font-family: var(--font-hand);
  font-weight: 700;
  fill: #8a7863;
  animation: zz-float 3s ease-in-out infinite;
  opacity: 0;
}
.z1 { font-size: 22px; animation-delay: 0s; }
.z2 { font-size: 28px; animation-delay: .9s; }
.z3 { font-size: 34px; animation-delay: 1.8s; }
@keyframes zz-float {
  0%   { opacity: 0; transform: translate(0, 6px); }
  25%  { opacity: .9; }
  70%  { opacity: .35; }
  100% { opacity: 0; transform: translate(10px, -22px); }
}

/* waking: a quick full-body shake */
#dog.waking #dog-sleep { animation: wake-shake .7s ease-in-out; }
#dog.waking .zz        { animation: none; opacity: 0; transition: opacity .3s; }
@keyframes wake-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-2.5deg); }
  40% { transform: rotate(2.5deg); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(1.5deg); }
}

/* running: gallop from the house down to the play spot */
#dog.running #dog-sleep { display: none; }
#dog.running #dog-run   { display: block; }
#dog.running svg { animation: run-bob .32s ease-in-out infinite alternate; }
@keyframes run-bob {
  from { transform: translateY(0)    rotate(1.5deg); }
  to   { transform: translateY(-7px) rotate(-2deg); }
}
#dog.running #run-front,
#dog.running #run-rear { filter: drop-shadow(0 1px 1px rgba(90, 60, 40, .35)); }
#dog.running #run-front {
  transform-origin: 102px 118px;
  animation: gallop .32s ease-in-out infinite alternate;
}
#dog.running #run-rear {
  transform-origin: 184px 116px;
  animation: gallop .32s ease-in-out infinite alternate-reverse;
}
@keyframes gallop {
  from { transform: rotate(-22deg); }
  to   { transform: rotate(20deg); }
}
#dog.running #run-ear {
  transform-origin: 98px 72px;
  animation: ear-flap .32s ease-in-out infinite alternate;
}
@keyframes ear-flap {
  from { transform: rotate(-12deg); }
  to   { transform: rotate(14deg); }
}

/* playing: bounce, wag, head bob */
#dog.playing #dog-sleep { display: none; }
#dog.playing #dog-play  { display: block; animation: play-pop .45s cubic-bezier(.2,1.6,.4,1) both; }
#dog.playing #dog-play > * { animation-play-state: running; }
@keyframes play-pop {
  from { transform: scale(.7)  translateY(14px); }
  to   { transform: scale(1)   translateY(0); }
}
#dog.playing #dog-play { transform-origin: 50% 100%; }
#dog.playing svg { animation: dog-bounce .55s ease-in-out infinite; }
@keyframes dog-bounce {
  0%, 100% { transform: translateY(0)    scale(1, 1); }
  35%      { transform: translateY(-11px) scale(.98, 1.03); }
  70%      { transform: translateY(0)    scale(1.02, .97); }
}
#dog.playing #tail {
  transform-origin: 192px 102px;
  animation: tail-wag .35s ease-in-out infinite alternate;
}
@keyframes tail-wag {
  from { transform: rotate(-16deg); }
  to   { transform: rotate(18deg); }
}
#dog.playing #play-head {
  transform-origin: 72px 126px;
  animation: head-bob 1.1s ease-in-out infinite;
}
@keyframes head-bob {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(-5deg) translateY(2px); }
}

/* ---------- skinny theatre curtains ---------- */
.curtain {
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(44px, 6vw, 96px);
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(4px 0 10px rgba(60, 8, 18, 0.28));
}
.curtain svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 0;
  animation: curtain-sway 7s ease-in-out infinite alternate;
}
#curtain-l { left: 0; }
#curtain-r {
  right: 0;
  transform: scaleX(-1);
  filter: drop-shadow(-4px 0 10px rgba(60, 8, 18, 0.28));
}
@keyframes curtain-sway {
  from { transform: skewX(0deg); }
  to   { transform: skewX(0.8deg); }
}

/* ---------- petals tossed by the dog ---------- */
#play-petals {
  position: absolute;
  left: 50%;
  bottom: 8vh;
  width: 0;
  height: 0;
  z-index: 5;
  pointer-events: none;
}
.toss {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--s);
  height: var(--s);
  background-size: contain;
  background-repeat: no-repeat;
  animation: toss-arc var(--dur) cubic-bezier(.25,.6,.5,1) both;
}
@keyframes toss-arc {
  0%   { transform: translate(0, 0) rotate(0deg) scale(.8); opacity: 1; }
  45%  { transform: translate(calc(var(--tx) * .55), var(--ty)) rotate(calc(var(--r) * .5)) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), 14px) rotate(var(--r)) scale(1); opacity: 0; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #blanket-corner, .lift-arrow, .drift, .zz, .curtain svg,
  #sleep-body, #dog.playing svg { animation: none !important; }
}
