:root {
  --sea-top: #67c9ef;
  --sea-mid: #2f8fce;
  --sea-deep: #1a5ca5;
  --sea-abyss: #123f7d;
  --ui-ink: #2f2416;
  --ui-ink-soft: #5a4320;
  --ui-parchment-top: rgba(247, 230, 188, 0.92);
  --ui-parchment-bottom: rgba(223, 194, 136, 0.92);
  --ui-border: rgba(138, 100, 47, 0.72);
  --ui-border-soft: rgba(177, 137, 79, 0.52);
  --ui-panel-shadow: 0 12px 26px rgba(7, 23, 56, 0.28);
  --ui-heading-font: "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --ui-body-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui-ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ui-dur-fast: 170ms;
  --ui-dur-med: 230ms;
  --ui-dur-slow: 320ms;
  --ui-focus-ring: 0 0 0 3px rgba(95, 167, 222, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  font-family: var(--ui-body-font);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(
    180deg,
    var(--sea-top) 0%,
    var(--sea-mid) 36%,
    var(--sea-deep) 70%,
    var(--sea-abyss) 100%
  );
  animation: pageFadeIn 420ms ease-in-out both;
}

a,
button,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring);
}

body.home-page {
  overflow: hidden;
  --enter-shift-x: 0px;
  --enter-shift-y: 0px;
  --enter-origin-x: 50%;
  --enter-origin-y: 50%;
}

body.home-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120% 95% at 50% 45%, rgba(11, 24, 45, 0.08) 0%, rgba(7, 16, 32, 0.44) 100%);
  transition: opacity var(--ui-dur-slow) var(--ui-ease-standard);
}

/* Subtle medieval edge ornaments for homepage */
.home-medieval-frame {
  position: fixed;
  inset: 0;
  z-index: 17;
  pointer-events: none;
  --frame-edge: 6px;
}

.home-medieval-frame::before,
.home-medieval-frame::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 10px;
}

.home-medieval-frame::before {
  border: 1px solid rgba(246, 224, 165, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(128, 83, 25, 0.16),
    0 0 0 1px rgba(255, 247, 218, 0.06);
}

.home-medieval-frame::after {
  inset: 10px;
  border: 1px dashed rgba(137, 92, 37, 0.32);
  border-radius: 8px;
}

/* Extra visible medieval line layers */
.home-medieval-frame::before,
.home-medieval-frame::after {
  pointer-events: none;
}

.home-medieval-frame {
  /* extra borders inside frame so it is visibly richer */
}

.home-medieval-frame > .frame-conduit {
  z-index: 1;
}

.home-medieval-frame::before {
  box-shadow:
    inset 0 0 0 1px rgba(128, 83, 25, 0.2),
    inset 0 0 0 6px rgba(255, 224, 162, 0.07),
    0 0 0 1px rgba(255, 247, 218, 0.1);
}

/* Electric conduit current running through frame lines */
.frame-conduit {
  position: absolute;
  inset: 4px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 0;
  background:
    /* top current */
    linear-gradient(
      90deg,
      rgba(255, 236, 176, 0) 0%,
      rgba(255, 234, 158, 0.12) 18%,
      rgba(255, 247, 213, 0.82) 50%,
      rgba(255, 220, 136, 0.22) 76%,
      rgba(255, 236, 176, 0) 100%
    ) top / 180% 2px no-repeat,
    /* right current */
    linear-gradient(
      180deg,
      rgba(255, 236, 176, 0) 0%,
      rgba(255, 234, 158, 0.12) 18%,
      rgba(255, 247, 213, 0.82) 50%,
      rgba(255, 220, 136, 0.22) 76%,
      rgba(255, 236, 176, 0) 100%
    ) right / 2px 180% no-repeat,
    /* bottom current */
    linear-gradient(
      90deg,
      rgba(255, 236, 176, 0) 0%,
      rgba(255, 234, 158, 0.12) 18%,
      rgba(255, 247, 213, 0.82) 50%,
      rgba(255, 220, 136, 0.22) 76%,
      rgba(255, 236, 176, 0) 100%
    ) bottom / 180% 2px no-repeat,
    /* left current */
    linear-gradient(
      180deg,
      rgba(255, 236, 176, 0) 0%,
      rgba(255, 234, 158, 0.12) 18%,
      rgba(255, 247, 213, 0.82) 50%,
      rgba(255, 220, 136, 0.22) 76%,
      rgba(255, 236, 176, 0) 100%
    ) left / 2px 180% no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 225, 142, 0.68)) drop-shadow(0 0 14px rgba(255, 196, 95, 0.42));
  mix-blend-mode: screen;
  animation: conduitFlow 4.8s linear infinite, conduitFlicker 1.65s ease-in-out infinite;
}

/* Extra conduit lines + curved medieval motifs */
.frame-conduit::before,
.frame-conduit::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.frame-conduit::before {
  background:
    /* secondary top line */
    linear-gradient(90deg, rgba(255, 235, 170, 0) 0%, rgba(255, 246, 211, 0.55) 52%, rgba(255, 235, 170, 0) 100%)
      top 5px left 0 / 170% 1px no-repeat,
    /* secondary right line */
    linear-gradient(180deg, rgba(255, 235, 170, 0) 0%, rgba(255, 246, 211, 0.55) 52%, rgba(255, 235, 170, 0) 100%)
      top 0 right 5px / 1px 170% no-repeat,
    /* secondary bottom line */
    linear-gradient(90deg, rgba(255, 235, 170, 0) 0%, rgba(255, 246, 211, 0.55) 52%, rgba(255, 235, 170, 0) 100%)
      bottom 5px left 0 / 170% 1px no-repeat,
    /* secondary left line */
    linear-gradient(180deg, rgba(255, 235, 170, 0) 0%, rgba(255, 246, 211, 0.55) 52%, rgba(255, 235, 170, 0) 100%)
      top 0 left 5px / 1px 170% no-repeat;
  filter: drop-shadow(0 0 5px rgba(255, 214, 120, 0.48));
  opacity: 0.94;
  animation: conduitFlowSecondary 7.2s linear infinite reverse, conduitFlicker 2.1s ease-in-out infinite;
}

.frame-conduit::after {
  background:
    /* top curved motifs */
    radial-gradient(14px 8px at 12% 6px, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(14px 8px at 50% 6px, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(14px 8px at 88% 6px, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    /* bottom curved motifs */
    radial-gradient(14px 8px at 12% calc(100% - 6px), rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(14px 8px at 50% calc(100% - 6px), rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(14px 8px at 88% calc(100% - 6px), rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    /* left curved motifs */
    radial-gradient(8px 14px at 6px 18%, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(8px 14px at 6px 50%, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(8px 14px at 6px 82%, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    /* right curved motifs */
    radial-gradient(8px 14px at calc(100% - 6px) 18%, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(8px 14px at calc(100% - 6px) 50%, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%),
    radial-gradient(8px 14px at calc(100% - 6px) 82%, rgba(255, 231, 170, 0.65) 24%, rgba(255, 231, 170, 0) 70%);
  opacity: 0.92;
  filter: blur(0.15px);
  animation: conduitMotifPulse 3.4s ease-in-out infinite;
}

.frame-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 243, 210, 0.95) 0%, rgba(221, 179, 102, 0.92) 55%, rgba(131, 87, 32, 0.9) 100%);
  box-shadow:
    0 0 8px rgba(255, 210, 122, 0.35),
    0 0 0 1px rgba(79, 49, 17, 0.46);
}

.frame-dot.tl { top: 6px; left: 6px; }
.frame-dot.tr { top: 6px; right: 6px; }
.frame-dot.bl { bottom: 6px; left: 6px; }
.frame-dot.br { bottom: 6px; right: 6px; }


/* Corner ornament curls */
.home-medieval-frame .frame-dot::before,
.home-medieval-frame .frame-dot::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(226, 190, 120, 0.58);
  border-color: rgba(226, 190, 120, 0.58) transparent transparent rgba(226, 190, 120, 0.58);
  border-radius: 80% 0 0 0;
  opacity: 0.86;
}

.frame-dot.tl::before { top: -10px; left: -12px; transform: rotate(-8deg); }
.frame-dot.tl::after  { top: -2px; left: -20px; transform: rotate(-28deg) scale(0.84); }

.frame-dot.tr::before { top: -10px; right: -12px; transform: scaleX(-1) rotate(-8deg); }
.frame-dot.tr::after  { top: -2px; right: -20px; transform: scaleX(-1) rotate(-28deg) scale(0.84); }

.frame-dot.bl::before { bottom: -10px; left: -12px; transform: scaleY(-1) rotate(-8deg); }
.frame-dot.bl::after  { bottom: -2px; left: -20px; transform: scaleY(-1) rotate(-28deg) scale(0.84); }

.frame-dot.br::before { bottom: -10px; right: -12px; transform: scale(-1, -1) rotate(-8deg); }
.frame-dot.br::after  { bottom: -2px; right: -20px; transform: scale(-1, -1) rotate(-28deg) scale(0.84); }

/* Mid-edge medieval ornaments */
.frame-mid {
  position: absolute;
  width: 30px;
  height: 14px;
  border-top: 1px solid rgba(224, 187, 114, 0.56);
  border-bottom: 1px solid rgba(224, 187, 114, 0.42);
  border-radius: 999px;
  opacity: 0.9;
  background: linear-gradient(
    180deg,
    rgba(255, 233, 178, 0.1) 0%,
    rgba(255, 233, 178, 0.2) 50%,
    rgba(255, 233, 178, 0.08) 100%
  );
}

.frame-mid::before,
.frame-mid::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(224, 187, 114, 0.56);
  border-color: rgba(224, 187, 114, 0.56) transparent transparent rgba(224, 187, 114, 0.56);
  border-radius: 80% 0 0 0;
}

.frame-mid.top {
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
}
.frame-mid.top::before { top: 1px; left: -10px; transform: rotate(-10deg); }
.frame-mid.top::after  { top: 1px; right: -10px; transform: scaleX(-1) rotate(-10deg); }

.frame-mid.bottom {
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
}
.frame-mid.bottom::before { top: 1px; left: -10px; transform: rotate(-10deg); }
.frame-mid.bottom::after  { top: 1px; right: -10px; transform: scaleX(-1) rotate(-10deg); }

.frame-mid.left {
  left: 2px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}
.frame-mid.left::before { top: 1px; left: -10px; transform: rotate(-10deg); }
.frame-mid.left::after  { top: 1px; right: -10px; transform: scaleX(-1) rotate(-10deg); }

.frame-mid.right {
  right: 2px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}
.frame-mid.right::before { top: 1px; left: -10px; transform: rotate(-10deg); }
.frame-mid.right::after  { top: 1px; right: -10px; transform: scaleX(-1) rotate(-10deg); }

@keyframes conduitFlow {
  0% {
    background-position:
      -140% 0,
      100% -140%,
      140% 100%,
      0 140%;
  }
  100% {
    background-position:
      140% 0,
      100% 140%,
      -140% 100%,
      0 -140%;
  }
}

@keyframes conduitFlowSecondary {
  0% {
    background-position:
      -120% 5px,
      calc(100% - 5px) -120%,
      120% calc(100% - 5px),
      5px 120%;
  }
  100% {
    background-position:
      120% 5px,
      calc(100% - 5px) 120%,
      -120% calc(100% - 5px),
      5px -120%;
  }
}

@keyframes conduitFlicker {
  0%, 100% {
    opacity: 0.68;
    filter: drop-shadow(0 0 4px rgba(255, 219, 126, 0.42)) drop-shadow(0 0 9px rgba(255, 196, 95, 0.24));
  }
  25% {
    opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(255, 233, 166, 0.64)) drop-shadow(0 0 12px rgba(255, 201, 105, 0.38));
  }
  52% {
    opacity: 0.72;
  }
  76% {
    opacity: 0.96;
    filter: drop-shadow(0 0 7px rgba(255, 238, 180, 0.7)) drop-shadow(0 0 14px rgba(255, 205, 115, 0.42));
  }
}

@keyframes conduitMotifPulse {
  0%, 100% {
    opacity: 0.82;
    filter: blur(0.12px) brightness(1);
  }
  50% {
    opacity: 0.98;
    filter: blur(0.2px) brightness(1.08);
  }
}


body.home-page .ocean-bg,
body.home-page .seagull-layer,
body.home-page .stage,
body.home-page .island-wrap,
body.home-page .mobile-home-topbar,
body.home-page .mobile-home-nav,
body.home-page .mobile-open-scroll,
body.home-page .mobile-open-scroll__inner {
  transition: transform 420ms ease-in-out, filter 420ms ease-in-out, opacity 420ms ease-in-out;
}

body.home-page.entering-location .ocean-bg,
body.home-page.entering-location .seagull-layer {
  filter: blur(2.5px) brightness(0.82) saturate(0.92);
  opacity: 0.55;
}

body.home-page.entering-location .stage {
  transform: scale(1.04);
}

body.home-page.entering-location .island-wrap {
  transform-origin: var(--enter-origin-x) var(--enter-origin-y);
  transform: scale(1.3);
}

body.home-page.entering-location .mobile-home-nav {
  transform: scale(1.03);
}

body.home-page.entering-location .mobile-open-scroll {
  transform-origin: var(--enter-origin-x) var(--enter-origin-y);
  transform: scale(1.05);
}

body.home-page.entering-location .mobile-open-scroll__inner {
  filter: blur(1.2px) brightness(0.9);
}

body.home-page.entering-location::after {
  opacity: 1;
}

body.home-page.entering-location .island-castle-wrap,
body.home-page.entering-location .island-houses-wrap,
body.home-page.entering-location .island-lighthouse-wrap,
body.home-page.entering-location .island-boat-wrap {
  pointer-events: none;
}

body.home-page.entering-location .entering-target {
  z-index: 12 !important;
  filter: drop-shadow(0 0 16px rgba(242, 246, 255, 0.62)) !important;
}

body.home-page.entering-location .island-castle-wrap.entering-target,
body.home-page.entering-location .island-houses-wrap.entering-target,
body.home-page.entering-location .island-lighthouse-wrap.entering-target {
  transform: translate(-50%, -50%) scale(1.12) !important;
}

body.home-page.entering-location .island-boat-wrap.entering-target {
  transform: scale(1.1) !important;
}

body.home-page.entering-location .mobile-scroll-link.entering-target {
  transform: scale(1.03) !important;
  filter: brightness(1.07);
  box-shadow: 0 0 0 1px rgba(254, 238, 194, 0.56), 0 10px 20px rgba(52, 35, 16, 0.22);
}

body.home-page .click-feedback {
  animation: clickGlowPulse 260ms ease-out 1;
}

@keyframes pageFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes clickGlowPulse {
  0% {
    filter: drop-shadow(0 0 0 rgba(233, 248, 255, 0));
  }
  45% {
    filter: drop-shadow(0 0 12px rgba(233, 248, 255, 0.62));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(233, 248, 255, 0));
  }
}

.ocean-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(150% 76% at 14% -10%, rgba(186, 241, 255, 0.22) 0%, transparent 62%),
    radial-gradient(120% 72% at 88% 8%, rgba(120, 211, 248, 0.17) 0%, transparent 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(8, 46, 96, 0.14) 100%);
}

.glow {
  position: absolute;
  top: -20vmin;
  right: -16vmin;
  width: 58vmin;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(3px);
  background: radial-gradient(circle, rgba(190, 238, 255, 0.2) 0%, rgba(145, 220, 250, 0.08) 45%, transparent 78%);
}

/* Seagulls */
.seagull-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.seagull-flock {
  position: absolute;
  left: -20%;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.6vw, 28px);
  opacity: 0.78;
  animation: gullFlyAcross 34s linear infinite;
}

.flock-a {
  top: 34%;
  animation-duration: 28s;
  animation-delay: -6.2s;
}

.flock-b {
  top: 46%;
  animation-duration: 50s;
  animation-delay: -17.4s;
  opacity: 0.68;
}

.flock-c {
  top: 22%;
  left: 110%;
  animation-name: gullFlyAcrossReverse;
  animation-duration: 42s;
  animation-delay: -12.8s;
  opacity: 0.72;
}

.flock-d {
  top: 56%;
  left: 110%;
  animation-name: gullFlyAcrossReverse;
  animation-duration: 66s;
  animation-delay: -24.6s;
  opacity: 0.62;
}

.flock-e {
  top: 20%;
  animation-duration: 34s;
  animation-delay: -10.5s;
  opacity: 0.74;
}

.flock-f {
  top: 62%;
  left: 110%;
  animation-name: gullFlyAcrossReverse;
  animation-duration: 56s;
  animation-delay: -21.7s;
  opacity: 0.66;
}

.v-formation {
  display: block;
  width: 64px;
  height: 34px;
}

.v-formation .seagull {
  position: absolute;
}

.v-formation .v-top-left {
  left: 8px;
  top: 2px;
}

.v-formation .v-top-right {
  left: 36px;
  top: 2px;
}

.v-formation .v-bottom {
  left: 22px;
  top: 18px;
}

.seagull {
  position: relative;
  width: 24px;
  height: 12px;
  transform-origin: center;
  animation: gullBodyBob 1.65s cubic-bezier(0.38, 0.02, 0.24, 1) infinite;
  /* tiny center dip highlight to read as a curved "M" */
  background: radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.92) 0 1.2px, transparent 1.25px);
}

.seagull::before,
.seagull::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 12px;
  height: 8px;
  background: transparent;
  border-top: 2.6px solid rgba(255, 255, 255, 0.97);
  border-radius: 120% 120% 0 0;
  transform-origin: 100% 50%;
  animation: gullFlapLeft 1.52s cubic-bezier(0.38, 0.02, 0.24, 1) infinite;
  filter: drop-shadow(0 1px 1px rgba(25, 65, 90, 0.35));
}

.seagull::before {
  left: 0;
  transform: rotate(-20deg);
}

.seagull::after {
  right: 0;
  transform-origin: 0% 50%;
  transform: rotate(20deg);
  animation-name: gullFlapRight;
  animation-duration: 1.6s;
  animation-delay: -0.08s;
}

/* Per-bird phase variance for less robotic synchronized flapping */
.seagull-flock .seagull:nth-child(1) { animation-duration: 1.6s; animation-delay: -0.12s; }
.seagull-flock .seagull:nth-child(2) { animation-duration: 1.72s; animation-delay: -0.42s; }
.seagull-flock .seagull:nth-child(3) { animation-duration: 1.84s; animation-delay: -0.23s; }

.seagull-flock .seagull:nth-child(1)::before { animation-duration: 1.46s; animation-delay: -0.08s; }
.seagull-flock .seagull:nth-child(1)::after { animation-duration: 1.58s; animation-delay: -0.15s; }
.seagull-flock .seagull:nth-child(2)::before { animation-duration: 1.62s; animation-delay: -0.28s; }
.seagull-flock .seagull:nth-child(2)::after { animation-duration: 1.74s; animation-delay: -0.36s; }
.seagull-flock .seagull:nth-child(3)::before { animation-duration: 1.54s; animation-delay: -0.18s; }
.seagull-flock .seagull:nth-child(3)::after { animation-duration: 1.68s; animation-delay: -0.26s; }

/* 8 flowing wave layers */
.ocean-wave-layer {
  position: absolute;
  left: -10%;
  width: 120%;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
  --size: 260px;
  --h: 106%;
  --show: 1;
  --tail: 110%;
  --c1: #75d1f2;
  --c2: #4ca5ce;
}

.ocean-wave-track {
  position: absolute;
  left: 0;
  top: 0;
  width: 200%;
  height: 100%;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  will-change: transform, top, margin-top;
}

.ocean-wave-track::before,
.ocean-wave-track::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50.6%;
  height: 100%;
  border-radius: 0;
  transform: none;
  animation: crestPhaseA 14.1s ease-in-out infinite;
  background-repeat: repeat-x, no-repeat;
  background-size: var(--size) 118%, 100% 100%;
  background-position: 0 100%, 0 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 100' preserveAspectRatio='none'%3E%3Cpath d='M0 78 C 14 70 28 60 42 62 C 58 64 74 84 92 82 C 112 79 126 54 146 56 C 166 58 182 84 200 82 C 216 80 226 70 240 78 L240 100 L0 100 Z' fill='rgba(236,252,255,0.82)'/%3E%3Cpath d='M0 84 C 16 79 30 72 44 74 C 60 76 76 88 94 87 C 114 85 128 67 148 68 C 168 69 184 88 202 87 C 218 86 228 79 240 84 L240 100 L0 100 Z' fill='rgba(191,238,248,0.56)'/%3E%3Cpath d='M0 94 C 22 92 44 91 66 91 C 98 91 130 92 162 92 C 192 92 216 91 240 94 L240 100 L0 100 Z' fill='rgba(12,67,128,0.34)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--c1) 0%, var(--c2) 100%);
}

.ocean-wave-track::before { left: 0; }
.ocean-wave-track::after { left: 49.4%; }

/* Layer positions and appearance */
.layer-1 { top: 0%; height: 12.5%; opacity: 0.30; filter: blur(0.8px) saturate(0.9); --size: 420px; --h: 122%; --show: 0.9; --tail: 107%; --c1: #91e2fc; --c2: #6bc8ea; }
.layer-2 { top: 12.5%; height: 12.5%; opacity: 0.35; filter: blur(0.6px) saturate(0.94); --size: 360px; --h: 118%; --show: 0.96; --tail: 108%; --c1: #88dbf8; --c2: #63bfe3; }
.layer-3 { top: 25%; height: 12.5%; opacity: 0.42; filter: saturate(1.0); --size: 310px; --h: 112%; --show: 1.02; --tail: 109%; --c1: #7ad3f2; --c2: #55afda; }
.layer-4 { top: 37.5%; height: 12.5%; opacity: 0.48; filter: saturate(1.04); --size: 275px; --h: 110%; --show: 1.08; --tail: 110%; --c1: #70c9eb; --c2: #4ca2cf; }
.layer-5 { top: 50%; height: 12.5%; opacity: 0.54; filter: saturate(1.08) contrast(1.03); --size: 245px; --h: 108%; --show: 1.12; --tail: 111%; --c1: #65bee4; --c2: #4597c4; }
.layer-6 { top: 62.5%; height: 12.5%; opacity: 0.58; filter: saturate(1.12) contrast(1.06); --size: 220px; --h: 106%; --show: 1.16; --tail: 112%; --c1: #5ab2dc; --c2: #3f8db8; }
.layer-7 { top: 75%; height: 12.5%; opacity: 0.62; filter: saturate(1.14) contrast(1.08); --size: 200px; --h: 104%; --show: 1.2; --tail: 113%; --c1: #52a9d5; --c2: #387fab; }
.layer-8 { top: 87.5%; height: 12.5%; opacity: 0.66; filter: saturate(1.16) contrast(1.1); --size: 185px; --h: 102%; --show: 1.24; --tail: 114%; --c1: #4aa1cd; --c2: #3276a1; }

/* Drift + vertical sway (left -> right) */
.layer-1 .wave-a { animation-name: driftA, liftA; animation-duration: 46s, 12.7s; animation-delay: -20.1s, -5.3s; animation-timing-function: cubic-bezier(0.44, 0.09, 0.31, 0.97), ease-in-out; }
.layer-1 .wave-b { animation-name: driftB, liftB; animation-duration: 54.2s, 14.8s; animation-delay: -37.6s, -9.2s; animation-timing-function: cubic-bezier(0.42, 0.12, 0.28, 0.96), ease-in-out; opacity: 0.5; }
.layer-2 .wave-a { animation-name: driftB, liftA; animation-duration: 40.5s, 11.6s; animation-delay: -16.8s, -6.8s; animation-timing-function: cubic-bezier(0.45, 0.08, 0.31, 0.97), ease-in-out; }
.layer-2 .wave-b { animation-name: driftC, liftB; animation-duration: 47.1s, 13.2s; animation-delay: -28.3s, -10.1s; animation-timing-function: cubic-bezier(0.43, 0.11, 0.29, 0.97), ease-in-out; opacity: 0.52; }
.layer-3 .wave-a { animation-name: driftC, liftB; animation-duration: 34.2s, 10.1s; animation-delay: -12.5s, -4.4s; animation-timing-function: cubic-bezier(0.44, 0.1, 0.31, 0.97), ease-in-out; }
.layer-3 .wave-b { animation-name: driftA, liftC; animation-duration: 40.1s, 11.3s; animation-delay: -24.9s, -7.7s; animation-timing-function: cubic-bezier(0.43, 0.11, 0.29, 0.97), ease-in-out; opacity: 0.56; }
.layer-4 .wave-a { animation-name: driftD, liftB; animation-duration: 30.1s, 8.9s; animation-delay: -10.4s, -3.6s; animation-timing-function: cubic-bezier(0.46, 0.08, 0.32, 0.98), ease-in-out; }
.layer-4 .wave-b { animation-name: driftB, liftC; animation-duration: 35.8s, 10.2s; animation-delay: -20.8s, -6.8s; animation-timing-function: cubic-bezier(0.44, 0.1, 0.33, 0.98), ease-in-out; opacity: 0.6; }
.layer-5 .wave-a { animation-name: driftB, liftA; animation-duration: 27.3s, 8.2s; animation-delay: -9.7s, -3.2s; animation-timing-function: cubic-bezier(0.44, 0.09, 0.31, 0.97), ease-in-out; }
.layer-5 .wave-b { animation-name: driftC, liftC; animation-duration: 33.2s, 9.6s; animation-delay: -19.4s, -6.6s; animation-timing-function: cubic-bezier(0.43, 0.11, 0.29, 0.97), ease-in-out; opacity: 0.62; }
.layer-6 .wave-a { animation-name: driftD, liftC; animation-duration: 23.9s, 7.2s; animation-delay: -7.4s, -2.9s; animation-timing-function: cubic-bezier(0.47, 0.06, 0.33, 0.98), ease-in-out; }
.layer-6 .wave-b { animation-name: driftA, liftB; animation-duration: 29.4s, 8.5s; animation-delay: -16.2s, -5.1s; animation-timing-function: cubic-bezier(0.45, 0.08, 0.32, 0.98), ease-in-out; opacity: 0.64; }
.layer-7 .wave-a { animation-name: driftC, liftD; animation-duration: 20.7s, 6.4s; animation-delay: -5.3s, -2.1s; animation-timing-function: cubic-bezier(0.47, 0.06, 0.33, 0.98), ease-in-out; }
.layer-7 .wave-b { animation-name: driftD, liftB; animation-duration: 25.4s, 7.4s; animation-delay: -14.2s, -5.3s; animation-timing-function: cubic-bezier(0.45, 0.08, 0.32, 0.98), ease-in-out; opacity: 0.66; }
.layer-8 .wave-a { animation-name: driftB, liftD; animation-duration: 18.9s, 5.9s; animation-delay: -4.1s, -1.8s; animation-timing-function: cubic-bezier(0.47, 0.06, 0.33, 0.98), ease-in-out; }
.layer-8 .wave-b { animation-name: driftC, liftA; animation-duration: 22.6s, 6.6s; animation-delay: -12.7s, -4.2s; animation-timing-function: cubic-bezier(0.45, 0.08, 0.32, 0.98), ease-in-out; opacity: 0.68; }

/* Crest phase desync */
.layer-1 .wave-a::before, .layer-1 .wave-a::after { animation-duration: 17.1s; animation-delay: -6.4s; }
.layer-1 .wave-b::before, .layer-1 .wave-b::after { animation-name: crestPhaseB; animation-duration: 19.3s; animation-delay: -12.8s; }
.layer-2 .wave-a::before, .layer-2 .wave-a::after { animation-name: crestPhaseB; animation-duration: 15.4s; animation-delay: -8.1s; }
.layer-2 .wave-b::before, .layer-2 .wave-b::after { animation-duration: 17.9s; animation-delay: -4.6s; }
.layer-3 .wave-a::before, .layer-3 .wave-a::after { animation-duration: 14.2s; animation-delay: -3.5s; }
.layer-3 .wave-b::before, .layer-3 .wave-b::after { animation-name: crestPhaseB; animation-duration: 16.5s; animation-delay: -10.2s; }
.layer-4 .wave-a::before, .layer-4 .wave-a::after { animation-name: crestPhaseB; animation-duration: 12.8s; animation-delay: -4.1s; }
.layer-4 .wave-b::before, .layer-4 .wave-b::after { animation-duration: 15.2s; animation-delay: -9.1s; }
.layer-5 .wave-a::before, .layer-5 .wave-a::after { animation-duration: 13.6s; animation-delay: -6.0s; }
.layer-5 .wave-b::before, .layer-5 .wave-b::after { animation-name: crestPhaseB; animation-duration: 16.3s; animation-delay: -10.4s; }
.layer-6 .wave-a::before, .layer-6 .wave-a::after { animation-name: crestPhaseB; animation-duration: 12.1s; animation-delay: -3.0s; }
.layer-6 .wave-b::before, .layer-6 .wave-b::after { animation-duration: 14.6s; animation-delay: -8.8s; }
.layer-7 .wave-a::before, .layer-7 .wave-a::after { animation-duration: 11.2s; animation-delay: -3.4s; }
.layer-7 .wave-b::before, .layer-7 .wave-b::after { animation-name: crestPhaseB; animation-duration: 13.8s; animation-delay: -9.7s; }
.layer-8 .wave-a::before, .layer-8 .wave-a::after { animation-name: crestPhaseB; animation-duration: 10.6s; animation-delay: -4.2s; }
.layer-8 .wave-b::before, .layer-8 .wave-b::after { animation-duration: 12.9s; animation-delay: -10.9s; }

@keyframes driftA {
  0% { transform: translate3d(-50%, 0, 0); }
  20% { transform: translate3d(-41%, 0, 0); }
  46% { transform: translate3d(-26%, 0, 0); }
  74% { transform: translate3d(-11%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes gullFlyAcross {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(145vw);
  }
}

@keyframes gullFlyAcrossReverse {
  0% {
    transform: translateX(0) scaleX(-1);
  }
  100% {
    transform: translateX(-145vw) scaleX(-1);
  }
}

@keyframes gullBodyBob {
  0%, 100% {
    transform: translateY(0);
  }
  22% {
    transform: translateY(-0.45px);
  }
  46% {
    transform: translateY(-0.85px);
  }
  63% {
    transform: translateY(-1.05px);
  }
  79% {
    transform: translateY(-0.72px);
  }
}

@keyframes gullFlapLeft {
  0%, 100% {
    transform: rotate(-22deg) scaleX(1);
  }
  16% {
    transform: rotate(-25deg) scaleX(0.995);
  }
  34% {
    transform: rotate(-29deg) scaleX(0.985);
  }
  48%, 60% {
    transform: rotate(-33deg) scaleX(0.97);
  }
  74% {
    transform: rotate(-36deg) scaleX(0.955);
  }
  88% {
    transform: rotate(-28deg) scaleX(0.982);
  }
}

@keyframes gullFlapRight {
  0%, 100% {
    transform: rotate(22deg) scaleX(1);
  }
  17% {
    transform: rotate(25deg) scaleX(0.995);
  }
  35% {
    transform: rotate(29deg) scaleX(0.985);
  }
  49%, 62% {
    transform: rotate(33deg) scaleX(0.97);
  }
  76% {
    transform: rotate(36deg) scaleX(0.955);
  }
  89% {
    transform: rotate(28deg) scaleX(0.982);
  }
}

/* Random subset: stronger flight flaps (higher and lower) */
.flock-a .seagull:nth-child(2)::before,
.flock-a .seagull:nth-child(2)::after,
.flock-c .seagull:nth-child(1)::before,
.flock-c .seagull:nth-child(1)::after,
.flock-d .seagull:nth-child(2)::before,
.flock-d .seagull:nth-child(2)::after,
.flock-e .seagull:nth-child(3)::before,
.flock-e .seagull:nth-child(3)::after,
.flock-f .seagull:nth-child(1)::before,
.flock-f .seagull:nth-child(1)::after {
  animation-name: gullFlapHighLeft;
}

.flock-a .seagull:nth-child(2)::after,
.flock-c .seagull:nth-child(1)::after,
.flock-d .seagull:nth-child(2)::after,
.flock-e .seagull:nth-child(3)::after,
.flock-f .seagull:nth-child(1)::after {
  animation-name: gullFlapHighRight;
}

@keyframes gullFlapHighLeft {
  0%, 100% {
    transform: rotate(-18deg) scaleX(1);
  }
  16% {
    transform: rotate(-24deg) scaleX(0.995);
  }
  34% {
    transform: rotate(-33deg) scaleX(0.985);
  }
  50%, 62% {
    transform: rotate(-40deg) scaleX(0.965);
  }
  76% {
    transform: rotate(-52deg) scaleX(0.94);
  }
  90% {
    transform: rotate(-28deg) scaleX(0.98);
  }
}

@keyframes gullFlapHighRight {
  0%, 100% {
    transform: rotate(18deg) scaleX(1);
  }
  16% {
    transform: rotate(24deg) scaleX(0.995);
  }
  34% {
    transform: rotate(33deg) scaleX(0.985);
  }
  50%, 62% {
    transform: rotate(40deg) scaleX(0.965);
  }
  76% {
    transform: rotate(52deg) scaleX(0.94);
  }
  90% {
    transform: rotate(28deg) scaleX(0.98);
  }
}

@keyframes driftB {
  0% { transform: translate3d(-50%, 0, 0); }
  17% { transform: translate3d(-43%, 0, 0); }
  41% { transform: translate3d(-28%, 0, 0); }
  67% { transform: translate3d(-14%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes driftC {
  0% { transform: translate3d(-50%, 0, 0); }
  23% { transform: translate3d(-39%, 0, 0); }
  52% { transform: translate3d(-23%, 0, 0); }
  79% { transform: translate3d(-9%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes driftD {
  0% { transform: translate3d(-50%, 0, 0); }
  15% { transform: translate3d(-42%, 0, 0); }
  38% { transform: translate3d(-27%, 0, 0); }
  63% { transform: translate3d(-13%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes liftA {
  0%, 100% { top: 0; margin-top: 0; }
  24% { top: -2px; margin-top: -1px; }
  49% { top: -4px; margin-top: -2px; }
  73% { top: -3px; margin-top: -1px; }
}

@keyframes liftB {
  0%, 100% { top: 0; margin-top: 0; }
  19% { top: -3px; margin-top: -1px; }
  44% { top: -5px; margin-top: -2px; }
  68% { top: -3px; margin-top: -1px; }
  87% { top: -4px; margin-top: -2px; }
}

@keyframes liftC {
  0%, 100% { top: 0; margin-top: 0; }
  17% { top: -4px; margin-top: -2px; }
  41% { top: -6px; margin-top: -3px; }
  62% { top: -4px; margin-top: -2px; }
  84% { top: -5px; margin-top: -2px; }
}

@keyframes liftD {
  0%, 100% { top: 0; margin-top: 0; }
  15% { top: -5px; margin-top: -2px; }
  36% { top: -7px; margin-top: -3px; }
  58% { top: -5px; margin-top: -2px; }
  81% { top: -6px; margin-top: -3px; }
}

@keyframes crestPhaseA {
  0%, 100% { background-position-x: 0px, 0px; }
  21% { background-position-x: 9px, -6px; }
  43% { background-position-x: -7px, 5px; }
  67% { background-position-x: 13px, -9px; }
  84% { background-position-x: 4px, -3px; }
}

@keyframes crestPhaseB {
  0%, 100% { background-position-x: 0px, 0px; }
  18% { background-position-x: -10px, 7px; }
  39% { background-position-x: 6px, -5px; }
  63% { background-position-x: -14px, 10px; }
  82% { background-position-x: -4px, 3px; }
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  pointer-events: none;
  background: radial-gradient(160% 100% at 50% 130%, rgba(8, 50, 102, 0.26) 0%, transparent 55%);
}

.site-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
  padding: 7px;
  border-radius: 999px;
  background: rgba(14, 46, 89, 0.52);
  border: 1px solid rgba(201, 228, 244, 0.32);
  backdrop-filter: blur(6px);
}

.site-nav-link {
  text-decoration: none;
  color: #e8f6ff;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(48, 111, 170, 0.42);
  border: 1px solid transparent;
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), background-color var(--ui-dur-fast) var(--ui-ease-standard), border-color var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard);
}

.site-nav-link:hover {
  transform: translateY(-1px);
  background: rgba(82, 153, 214, 0.5);
  border-color: rgba(231, 245, 255, 0.56);
  filter: brightness(1.03);
}

.site-nav-link.is-active {
  background: rgba(101, 181, 235, 0.58);
  color: #083155;
}

.corner-menu {
  position: absolute;
  top: 25px;
  left: 17px;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.dragon-trigger {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 1px solid rgba(141, 107, 56, 0.72);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 240, 0.42) 0%, rgba(255, 251, 240, 0) 64%),
    linear-gradient(180deg, rgba(247, 230, 188, 0.92) 0%, rgba(223, 194, 136, 0.92) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  box-shadow: 0 8px 14px rgba(11, 22, 42, 0.24), inset 0 0 0 1px rgba(255, 243, 212, 0.5);
  text-decoration: none;
  position: relative;
  overflow: visible;
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
  isolation: isolate;
}

.dragon-trigger img {
  position: relative;
  z-index: 3;
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter:
    drop-shadow(0 2px 3px rgba(23, 16, 8, 0.28))
    drop-shadow(0 6px 8px rgba(14, 9, 4, 0.38))
    drop-shadow(0 0 12px rgba(255, 235, 130, 0.86))
    drop-shadow(0 0 20px rgba(255, 94, 38, 0.78))
    drop-shadow(0 0 28px rgba(255, 62, 18, 0.58));
  transform-origin: center;
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
  animation: dragonFloat 2.8s ease-in-out infinite, dragonIdleGlow 2.2s ease-in-out infinite;
}

.dragon-trigger::before,
.dragon-trigger::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.72;
  transition: opacity var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard), box-shadow var(--ui-dur-fast) var(--ui-ease-standard);
}

.dragon-trigger::before {
  left: 50%;
  top: 63%;
  width: 46px;
  height: 22px;
  border-radius: 55% 55% 48% 48%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 245, 176, 0.92) 0%,
    rgba(255, 188, 92, 0.86) 45%,
    rgba(255, 106, 56, 0.7) 78%,
    rgba(255, 82, 42, 0) 100%
  );
  filter: blur(0.9px);
  box-shadow: 0 8px 12px rgba(21, 10, 5, 0.28);
  transform: translate(-50%, -50%) scale(0.9);
  animation: dragonFireCore 420ms ease-in-out infinite alternate;
}

.dragon-trigger::after {
  left: 50%;
  top: 44%;
  width: 52px;
  height: 62px;
  border-radius: 46% 44% 58% 56% / 58% 56% 44% 42%;
  background:
    radial-gradient(36% 40% at 30% 56%, rgba(255, 173, 83, 0.78) 0%, rgba(255, 110, 55, 0) 100%),
    radial-gradient(36% 40% at 70% 56%, rgba(255, 165, 78, 0.76) 0%, rgba(255, 106, 51, 0) 100%),
    radial-gradient(30% 48% at 50% 20%, rgba(255, 248, 201, 0.9) 0%, rgba(255, 200, 94, 0.76) 52%, rgba(255, 110, 58, 0) 100%),
    radial-gradient(60% 58% at 50% 82%, rgba(255, 176, 84, 0.74) 0%, rgba(255, 102, 50, 0.5) 60%, rgba(255, 82, 42, 0) 100%);
  filter: blur(1.6px);
  box-shadow: 0 10px 16px rgba(19, 8, 4, 0.22);
  transform: translate(-50%, -50%) scale(0.84);
  animation: dragonFireAura 620ms ease-in-out infinite alternate;
}

.dragon-trigger:hover {
  transform: translateY(-1px) scale(1.03);
  filter: drop-shadow(0 0 12px rgba(255, 174, 84, 0.68));
}

.dragon-trigger:hover img {
  transform: scale(1.22);
  filter:
    drop-shadow(0 0 10px rgba(255, 209, 117, 0.7))
    drop-shadow(0 0 18px rgba(255, 123, 62, 0.5));
}

.dragon-trigger:hover::before,
.dragon-trigger:hover::after {
  opacity: 1;
  animation: dragonFire 360ms ease-in-out infinite alternate;
}

.dragon-trigger:hover::after {
  animation-duration: 480ms;
}

.dragon-trigger:hover::before {
  filter: blur(0.35px) brightness(1.2) saturate(1.16);
}

.dragon-trigger:hover::after {
  filter: blur(2.6px) brightness(1.26) saturate(1.14);
}

@keyframes dragonFire {
  0% {
    transform: translate(-50%, -50%) scale(0.88) rotate(-1.5deg);
    filter: blur(1.4px) brightness(1.06) saturate(1.1);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.08) rotate(1.5deg);
    filter: blur(1.95px) brightness(1.3) saturate(1.16);
  }
}

@keyframes dragonFireCore {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    filter: blur(1px) brightness(1.02) saturate(1.08);
    opacity: 0.68;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.06);
    filter: blur(0.75px) brightness(1.18) saturate(1.14);
    opacity: 0.9;
  }
}

@keyframes dragonFireAura {
  0% {
    transform: translate(-50%, -50%) scale(0.84) rotate(-1.6deg);
    filter: blur(1.6px) brightness(0.98) saturate(1.04);
    opacity: 0.52;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.08) rotate(1.6deg);
    filter: blur(2.05px) brightness(1.16) saturate(1.12);
    opacity: 0.82;
  }
}

@keyframes dragonIdleGlow {
  0%, 100% {
    filter:
      drop-shadow(0 2px 3px rgba(23, 16, 8, 0.28))
      drop-shadow(0 0 12px rgba(255, 235, 130, 0.86))
      drop-shadow(0 0 20px rgba(255, 94, 38, 0.78))
      drop-shadow(0 0 28px rgba(255, 62, 18, 0.58));
  }
  50% {
    filter:
      drop-shadow(0 2px 3px rgba(23, 16, 8, 0.28))
      drop-shadow(0 0 16px rgba(255, 244, 162, 0.98))
      drop-shadow(0 0 26px rgba(255, 106, 46, 0.92))
      drop-shadow(0 0 34px rgba(255, 68, 20, 0.72));
  }
}

@keyframes dragonFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-2px) rotate(-1.2deg);
  }
  50% {
    transform: translateY(-3px) rotate(0.9deg);
  }
  75% {
    transform: translateY(-1px) rotate(-0.6deg);
  }
}

.corner-menu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(80vw, 560px);
  padding: 7px;
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 240, 0.38) 0%, rgba(255, 251, 240, 0) 64%),
    linear-gradient(180deg, rgba(247, 230, 188, 0.9) 0%, rgba(223, 194, 136, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid rgba(141, 107, 56, 0.68);
  box-shadow: 0 10px 16px rgba(11, 22, 42, 0.22), inset 0 0 0 1px rgba(255, 243, 212, 0.44);
  opacity: 0;
  transform-origin: left center;
  transform: translateX(-8px) translateY(2px) scaleX(0.18);
  filter: blur(0.6px);
  pointer-events: none;
  transition: opacity var(--ui-dur-med) var(--ui-ease-standard), transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
}

.corner-menu:hover .corner-menu-links,
.dragon-trigger:hover + .corner-menu-links,
.corner-menu-links:hover,
.corner-menu:focus-within .corner-menu-links {
  opacity: 1;
  transform: translateX(0) translateY(0) scaleX(1);
  filter: blur(0);
  animation: menuUnroll 280ms ease-out both;
  pointer-events: auto;
}

.corner-menu-links .mobile-only-link {
  display: none;
}

@media (hover: none), (pointer: coarse) {
  .corner-menu.is-open .corner-menu-links {
    opacity: 1;
    transform: translateX(0) translateY(0) scaleX(1);
    filter: blur(0);
    animation: menuUnroll 280ms ease-out both;
    pointer-events: auto;
  }

  .corner-menu-links .mobile-only-link {
    display: inline-flex;
  }
}

@keyframes menuUnroll {
  0% {
    transform: translateX(-10px) translateY(2px) scaleX(0.14) skewX(-4deg);
    opacity: 0;
    filter: blur(0.8px);
  }
  55% {
    transform: translateX(0) translateY(0) scaleX(1.03) skewX(0.6deg);
    opacity: 1;
    filter: blur(0.2px);
  }
  100% {
    transform: translateX(0) translateY(0) scaleX(1) skewX(0deg);
    opacity: 1;
    filter: blur(0);
  }
}

.paper-scroll-corner {
  position: fixed;
  left: 5px; /* move right */
  top: 5px; /* move off the top edge */
  width: 170px;
  height: 280px;
  z-index: 60;
  pointer-events: auto;
  --scroll1-h: 120px;
  --scroll2-tight: -14px; /* negative = closer to scroll 1 */
  --paper-h: 182px;
  --hover-lift: 0px;
  --scroll-pop-scale: 1;
  --scroll-pop-rot: 0deg;
}

.paper-scroll-corner:hover {
  --hover-lift: -3px;
  --scroll-pop-scale: 1.03;
  --scroll-pop-rot: -0.6deg;
}

.door-split-layer {
  position: fixed;
  inset: 0;
  z-index: 950;
  pointer-events: auto;
  overflow: hidden;
  background: #000;
  --door-half-width: 76vw;
  --door-center-overlap: 2px;
  opacity: 1;
  transition: background-color 420ms ease-out, opacity 420ms ease-out 860ms;
}

.door-split-left,
.door-split-right {
  position: absolute;
  top: -12vh;
  width: var(--door-half-width);
  height: 126vh;
  object-fit: cover;
  will-change: transform;
  transition: transform 980ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.door-split-left {
  left: calc(50vw - var(--door-half-width) + var(--door-center-overlap));
  object-position: left center;
}

.door-split-right {
  right: calc(50vw - var(--door-half-width) + var(--door-center-overlap));
  object-position: right center;
}

.door-start-btn {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 960;
  pointer-events: auto;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard), opacity 220ms ease-in-out;
}

.door-start-btn img {
  display: block;
  width: min(300px, 38vw);
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.door-start-btn:active {
  transform: translate(-50%, -50%) scale(0.96);
  filter: brightness(0.84);
}

body.door-open .door-split-left {
  transform: translateX(-108%) rotate(-0.8deg);
}

body.door-open .door-split-right {
  transform: translateX(108%) rotate(0.8deg);
  transition-delay: 36ms;
}

body.door-open .door-split-layer {
  pointer-events: none;
  background: transparent;
  opacity: 0;
}

body.door-open .door-start-btn {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.95);
  transition: transform 220ms ease-out, opacity 180ms ease-out;
}

body.door-skip .door-split-layer,
body.door-skip .door-start-btn {
  display: none !important;
}

.paper-scroll-corner::after {
  content: "Legend";
  position: absolute;
  left: 50%;
  top: calc((var(--scroll1-h) / 2) + 5px);
  transform: translate(-50%, -50%);
  font-family: var(--ui-heading-font);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: rgba(186, 146, 92, 0.96);
  text-shadow:
    0 1px 0 rgba(64, 39, 16, 0.9),
    0 0 8px rgba(255, 214, 140, 0.48),
    0 0 16px rgba(187, 129, 67, 0.36);
  pointer-events: none;
  z-index: 12;
  opacity: 1;
  animation: legendFloat 2.8s ease-in-out infinite;
  transition: opacity var(--ui-dur-fast) var(--ui-ease-standard);
}

.ambient-toggle {
  position: fixed;
  left: 182px;
  top: 18px;
  z-index: 61;
  border: 1px solid rgba(131, 93, 43, 0.64);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2a2113;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(244, 224, 180, 0.94) 0%, rgba(219, 188, 129, 0.94) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  box-shadow: 0 6px 12px rgba(34, 25, 13, 0.18);
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard), opacity var(--ui-dur-fast) var(--ui-ease-standard);
  overflow: hidden;
}

.ambient-toggle:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.ambient-toggle.is-off {
  opacity: 0.78;
}

.ambient-toggle.is-off::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 140%;
  background: rgba(125, 34, 22, 0.9);
  transform: rotate(-42deg);
  box-shadow: 0 0 0 1px rgba(255, 233, 200, 0.35);
}

.ambient-toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.paper-scroll-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto; /* only the scroll-1 area should be clickable */
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  z-index: 10; /* always in front of the paper */
}

.paper-scroll-btn img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 90%;
  transform: translateY(var(--hover-lift)) scale(var(--scroll-pop-scale)) rotate(var(--scroll-pop-rot));
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
}

.paper-scroll-btn img {
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.0));
}

.paper-scroll-corner:hover .paper-scroll-btn img {
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.22));
}

.paper-scroll-img--under {
  position: absolute;
  left: 0;
  top: calc(var(--scroll1-h) + var(--scroll2-tight)); /* directly below scroll 1 */
  width: 100%;
  height: auto;
  z-index: 1; /* behind paper reveal */
  transform: translateY(var(--hover-lift)) scale(var(--scroll-pop-scale)) rotate(var(--scroll-pop-rot));
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.0));
  opacity: 1;
  /* Top edge blends with paper bottom (starts at ~85% opacity). */
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, #000 26%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, #000 26%, #000 100%);
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 650ms var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
  will-change: transform;
}

.paper-scroll-corner:hover .paper-scroll-img--under {
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.22));
}

.paper-reveal {
  position: absolute;
  left: 0;
  top: calc(var(--scroll1-h) + var(--scroll2-tight)); /* align with scroll 2 */
  width: 100%;
  height: 182px;
  overflow: hidden;
  z-index: 5; /* above scroll 2 so paper is readable */
  border-radius: 14px;
  clip-path: inset(0 0 100% 0 round 14px); /* hidden */
  transition: clip-path 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.paper-legend {
  position: absolute;
  left: 28px;
  top: 22px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2;
  pointer-events: none;
}

.paper-stars {
  position: absolute;
  inset: 0;
  z-index: 1; /* behind icons and text */
  pointer-events: none;
  overflow: hidden;
}

.paper-star {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  background: #ffe36a;
  clip-path: polygon(50% 0%, 61% 37%, 98% 37%, 67% 58%, 79% 95%, 50% 72%, 21% 95%, 33% 58%, 2% 37%, 39% 37%);
  box-shadow: 0 0 7px rgba(255, 221, 103, 0.7), 0 0 12px rgba(255, 197, 79, 0.45);
}

.paper-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.paper-legend-icon {
  width: 28px;
  height: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  transform-origin: center;
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard);
  filter:
    brightness(1.1)
    saturate(1.12)
    drop-shadow(0 0 6px rgba(255, 224, 130, 0.7))
    drop-shadow(0 0 12px rgba(255, 194, 98, 0.5))
    drop-shadow(0 3px 7px rgba(0, 0, 0, 0.2));
}

.paper-legend-text {
  position: relative;
  display: inline-block;
  font-family: var(--ui-heading-font);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: rgba(47, 36, 22, 0.95);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}

.paper-scroll-img--paper {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: top center;
  transform: translateY(-18px) scale(0.96, 0.98) rotate(-0.8deg);
  opacity: 0;
  /* Keep paper full at top, fade bottom to ~92% opacity */
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.92) 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.92) 100%);
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 700ms ease;
  will-change: transform, opacity;
}

/* Open state: scroll 2 drops down, paper unfolds into view */
.paper-scroll-corner--open .paper-scroll-img--under {
  /* Move it to the bottom of the paper area (keep it visible). */
  /* Move it up ~10% of paper height (paper-h is 182px => ~18px). */
  transform: translateY(calc(var(--paper-h) - 12px + var(--hover-lift) - 9px)) scale(var(--scroll-pop-scale))
    rotate(var(--scroll-pop-rot));
  opacity: 1;
}

.paper-scroll-corner--open .paper-reveal {
  clip-path: inset(0 0 0 0 round 14px);
}

.paper-scroll-corner--open .paper-scroll-img--paper {
  transform: translateY(0) scale(0.96, 1) rotate(0deg);
  opacity: 1;
}

/* Keep scroll 1 and 2 static while paper is open */
.paper-scroll-corner--open,
.paper-scroll-corner--open:hover {
  --hover-lift: 0px;
  --scroll-pop-scale: 1;
  --scroll-pop-rot: 0deg;
}

.paper-scroll-corner--open::after {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .paper-scroll-btn img,
  .paper-scroll-img--under,
  .paper-reveal,
  .paper-scroll-img--paper {
    transition: none !important;
  }

  /* If reduced motion: show the final opened state immediately */
  .paper-scroll-img--under {
    transform: translateY(calc(var(--paper-h) - 12px - 9px)) scale(1) rotate(0deg);
    opacity: 1;
  }
  .paper-reveal {
    clip-path: inset(0 0 0 0 round 14px);
  }
  .paper-scroll-img--paper {
    transform: translateY(0) scale(0.96, 1) rotate(0deg);
    opacity: 1;
  }
}

/* Ensure scroll 2 pops when hovering directly over it */
.paper-scroll-img--under:hover {
  --hover-lift: -3px;
  --scroll-pop-scale: 1.03;
  --scroll-pop-rot: -0.6deg;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.22));
}

.paper-scroll-corner--open .paper-scroll-img--under:hover,
.paper-scroll-corner--open .paper-scroll-btn:hover img,
.paper-scroll-corner--open:hover .paper-scroll-btn img,
.paper-scroll-corner--open:hover .paper-scroll-img--under {
  --hover-lift: 0px;
  --scroll-pop-scale: 1;
  --scroll-pop-rot: 0deg;
  filter: none;
}

@keyframes legendFloat {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-4px);
  }
}

.island-wrap {
  position: relative;
  width: min(78vw, 980px);
  max-width: 92vw;
}

.island-wrap::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -4%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(8, 44, 92, 0.62) 0%, rgba(8, 44, 92, 0.28) 42%, transparent 80%);
  filter: blur(5px);
  z-index: 0;
}

/* Stronger, clearer shore wave ring just outside island edge (~a few px) */
.island-wrap::after {
  content: "";
  position: absolute;
  inset: -0.7%;
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0) 58%,
    rgba(190, 240, 255, 0.34) 60%,
    rgba(120, 200, 240, 0.2) 63%,
    rgba(120, 200, 240, 0) 70%
  );
  filter: blur(1.2px);
  animation: none;
}

.island-shore-back,
.island-shore-mid,
.island-shore-front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.island-shore-back {
  z-index: 1;
  transform: scale(1.016);
  opacity: 0.34;
  filter:
    blur(2.2px)
    brightness(1.22)
    saturate(1.28)
    hue-rotate(-8deg);
  mix-blend-mode: screen;
  mask-image:
    radial-gradient(18% 14% at 10% 82%, #000 0 58%, transparent 78%),
    radial-gradient(22% 16% at 28% 86%, #000 0 60%, transparent 80%),
    radial-gradient(24% 17% at 50% 88%, #000 0 62%, transparent 82%),
    radial-gradient(21% 16% at 72% 86%, #000 0 60%, transparent 80%),
    radial-gradient(18% 14% at 90% 82%, #000 0 58%, transparent 78%),
    linear-gradient(180deg, transparent 0%, transparent 62%, rgba(0, 0, 0, 0.45) 76%, #000 92%);
  -webkit-mask-image:
    radial-gradient(18% 14% at 10% 82%, #000 0 58%, transparent 78%),
    radial-gradient(22% 16% at 28% 86%, #000 0 60%, transparent 80%),
    radial-gradient(24% 17% at 50% 88%, #000 0 62%, transparent 82%),
    radial-gradient(21% 16% at 72% 86%, #000 0 60%, transparent 80%),
    radial-gradient(18% 14% at 90% 82%, #000 0 58%, transparent 78%),
    linear-gradient(180deg, transparent 0%, transparent 62%, rgba(0, 0, 0, 0.45) 76%, #000 92%);
  animation: shoreEdgeDrift 8.2s ease-in-out infinite;
}

.island-shore-mid {
  z-index: 2;
  transform: scale(1.01);
  opacity: 0.3;
  filter:
    blur(1.6px)
    brightness(1.18)
    saturate(1.26)
    hue-rotate(-16deg);
  mix-blend-mode: screen;
  mask-image:
    radial-gradient(14% 10% at 10% 84%, #000 0 58%, transparent 78%),
    radial-gradient(18% 12% at 27% 88%, #000 0 60%, transparent 80%),
    radial-gradient(20% 13% at 47% 90%, #000 0 62%, transparent 82%),
    radial-gradient(18% 12% at 68% 88%, #000 0 60%, transparent 80%),
    radial-gradient(14% 10% at 89% 84%, #000 0 58%, transparent 78%),
    linear-gradient(180deg, transparent 0%, transparent 66%, rgba(0, 0, 0, 0.3) 80%, #000 95%);
  -webkit-mask-image:
    radial-gradient(14% 10% at 10% 84%, #000 0 58%, transparent 78%),
    radial-gradient(18% 12% at 27% 88%, #000 0 60%, transparent 80%),
    radial-gradient(20% 13% at 47% 90%, #000 0 62%, transparent 82%),
    radial-gradient(18% 12% at 68% 88%, #000 0 60%, transparent 80%),
    radial-gradient(14% 10% at 89% 84%, #000 0 58%, transparent 78%),
    linear-gradient(180deg, transparent 0%, transparent 66%, rgba(0, 0, 0, 0.3) 80%, #000 95%);
  animation: shoreMidPulse 7.2s ease-in-out infinite;
}

.island-shore-front {
  z-index: 3;
  transform: scale(1.012);
  opacity: 0.22;
  filter:
    blur(1px)
    brightness(1.32)
    saturate(1.38)
    hue-rotate(-10deg)
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.16));
  mix-blend-mode: screen;
  /* Irregular shoreline-only foam; nothing on top edge */
  mask-image:
    radial-gradient(16% 12% at 8% 84%, #000 0 58%, transparent 78%),
    radial-gradient(20% 14% at 23% 88%, #000 0 60%, transparent 80%),
    radial-gradient(22% 15% at 41% 90%, #000 0 62%, transparent 82%),
    radial-gradient(24% 16% at 58% 91%, #000 0 64%, transparent 84%),
    radial-gradient(20% 14% at 76% 88%, #000 0 60%, transparent 80%),
    radial-gradient(16% 12% at 92% 84%, #000 0 58%, transparent 78%),
    linear-gradient(180deg, transparent 0%, transparent 68%, rgba(0, 0, 0, 0.36) 80%, #000 94%);
  -webkit-mask-image:
    radial-gradient(16% 12% at 8% 84%, #000 0 58%, transparent 78%),
    radial-gradient(20% 14% at 23% 88%, #000 0 60%, transparent 80%),
    radial-gradient(22% 15% at 41% 90%, #000 0 62%, transparent 82%),
    radial-gradient(24% 16% at 58% 91%, #000 0 64%, transparent 84%),
    radial-gradient(20% 14% at 76% 88%, #000 0 60%, transparent 80%),
    radial-gradient(16% 12% at 92% 84%, #000 0 58%, transparent 78%),
    linear-gradient(180deg, transparent 0%, transparent 68%, rgba(0, 0, 0, 0.36) 80%, #000 94%);
  animation: none;
}


.island {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.2));
}

.island-castle-wrap {
  position: absolute;
  left: 32%;
  top: 32%;
  width: 10.2%;
  z-index: 2;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
}

.island-castle-wrap:hover {
  transform: translate(-50%, calc(-50% - 2px)) scale(1.045);
  filter: drop-shadow(0 0 10px rgba(240, 248, 255, 0.5));
  animation: castleHoverGlow 1.8s ease-in-out infinite;
}

.island-castle-wrap:active {
  transform: translate(-50%, calc(-50% - 1px)) scale(0.985);
}

.island-castle-wrap::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%) translateY(3px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #153754;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(246, 228, 175, 0.95);
  border: 1px solid rgba(179, 145, 77, 0.72);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 8;
}

.island-castle-wrap:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.island-houses-wrap {
  position: absolute;
  left: 60%;
  top: calc(40% + 20px);
  width: 18%;
  height: 16%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: auto;
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
}

.island-houses-wrap:hover {
  transform: translate(-50%, calc(-50% - 2px)) scale(1.042);
  filter: drop-shadow(0 0 10px rgba(238, 247, 255, 0.44));
  animation: villageHoverWiggle 1.2s ease-in-out infinite;
}

.island-houses-wrap:active {
  transform: translate(-50%, calc(-50% - 1px)) scale(0.985);
}

.island-houses-wrap::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: -20px;
  transform: translateX(-50%) translateY(3px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #153754;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(246, 228, 175, 0.95);
  border: 1px solid rgba(179, 145, 77, 0.72);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 8;
}

.island-houses-wrap:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.island-house {
  position: absolute;
  width: 30.6%;
  height: auto;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
  pointer-events: auto;
  transition: filter var(--ui-dur-med) var(--ui-ease-standard);
}

.island-house.h1 {
  left: 24%;
  top: 20%;
  transform: translate(-50%, -50%);
}

.island-house.h2 {
  left: 76%;
  top: 20%;
  transform: translate(-50%, -50%);
}

.island-house.h3 {
  left: 50%;
  top: 66%;
  transform: translate(-50%, -50%);
}

.island-lighthouse-wrap {
  position: absolute;
  left: calc(50% + 40% + 10px);
  top: calc(50% + 10% + 30px);
  width: 6.96%;
  height: 20%;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: auto;
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
}

.island-lighthouse-wrap:hover {
  transform: translate(-50%, calc(-50% - 2px)) scale(1.042);
  filter: drop-shadow(0 0 11px rgba(203, 239, 255, 0.54));
}

.island-lighthouse-wrap:active {
  transform: translate(-50%, calc(-50% - 1px)) scale(0.985);
}

.island-lighthouse-wrap:hover .lighthouse-glow {
  animation: lighthouseHoverFlicker 1.35s ease-in-out infinite;
}

.island-lighthouse-wrap::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%) translateY(3px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #153754;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(246, 228, 175, 0.95);
  border: 1px solid rgba(179, 145, 77, 0.72);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 8;
}

.island-lighthouse-wrap:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.island-lighthouse {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: auto;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.34));
  transition: filter var(--ui-dur-med) var(--ui-ease-standard);
}

.lighthouse-beam {
  position: absolute;
  left: 50%;
  bottom: 60%;
  width: 182%;
  height: 244%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  clip-path: polygon(47.4% 100%, 52.6% 100%, 92% 0%, 8% 0%);
  background:
    linear-gradient(
      180deg,
      rgba(238, 250, 255, 0.42) 0%,
      rgba(208, 240, 255, 0.28) 34%,
      rgba(176, 226, 248, 0.11) 67%,
      rgba(158, 221, 248, 0) 100%
    );
  filter: blur(4.4px) saturate(1.04) brightness(0.98);
  mix-blend-mode: screen;
  opacity: 0.56;
  z-index: 1;
  animation: lighthouseSweep 20s linear infinite, lighthouseBeamGlow 10.6s ease-in-out infinite;
}

.lighthouse-beam::before {
  content: "";
  position: absolute;
  inset: -11% -20% -10% -20%;
  clip-path: polygon(48.8% 100%, 51.2% 100%, 88% 0%, 12% 0%);
  background: linear-gradient(
    180deg,
    rgba(218, 245, 255, 0.31) 0%,
    rgba(184, 232, 250, 0.18) 38%,
    rgba(162, 221, 246, 0.05) 70%,
    rgba(171, 225, 249, 0) 100%
  );
  filter: blur(10px);
  opacity: 0.5;
  mix-blend-mode: screen;
  pointer-events: none;
}

.lighthouse-beam::after {
  content: "";
  position: absolute;
  inset: -4% -10% -1% -10%;
  clip-path: polygon(49.25% 100%, 50.75% 100%, 82% 0%, 18% 0%);
  background: linear-gradient(
    180deg,
    rgba(250, 253, 255, 0.26) 0%,
    rgba(211, 242, 255, 0.16) 33%,
    rgba(193, 234, 255, 0.06) 62%,
    rgba(201, 238, 255, 0) 100%
  );
  filter: blur(5.4px);
  opacity: 0.44;
  mix-blend-mode: screen;
  pointer-events: none;
}

.lighthouse-glow {
  position: absolute;
  left: 50%;
  bottom: 58%;
  width: 45%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 249, 255, 0.72) 0%, rgba(199, 238, 255, 0.36) 42%, rgba(199, 238, 255, 0) 75%);
  filter: blur(1.6px);
  opacity: 0.75;
  mix-blend-mode: screen;
  z-index: 1;
}

.island-boat-wrap {
  position: absolute;
  left: calc(-8% + 20px);
  top: 67%;
  width: 9.62%;
  height: 12%;
  z-index: 5;
  pointer-events: auto;
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
}

.island-boat-wrap:hover {
  transform: translateY(-2px) scale(1.035);
  filter: drop-shadow(0 0 10px rgba(196, 232, 255, 0.42));
}

.island-boat-wrap:active {
  transform: translateY(-1px) scale(0.985);
}

.island-boat-wrap:hover .island-boat {
  animation: boatTeleport 2s cubic-bezier(0.28, 0.08, 0.22, 1) infinite;
}

.island-boat-wrap:hover .boat-wave-occlude {
  animation: boatWaveTeleport 2s cubic-bezier(0.28, 0.08, 0.22, 1) infinite;
}

.island-boat-wrap::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: -20px;
  transform: translateX(-50%) translateY(3px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #153754;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(246, 228, 175, 0.95);
  border: 1px solid rgba(179, 145, 77, 0.72);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 8;
}

.island-boat-wrap:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Unified RPG parchment tooltip skin for all interactive island hotspots */
.island-castle-wrap::before,
.island-houses-wrap::before,
.island-lighthouse-wrap::before,
.island-boat-wrap::before {
  top: -24px;
  padding: 5px 10px;
  font-size: clamp(0.68rem, 0.8vw, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3a2b16;
  border-radius: 10px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 240, 0.52) 0%, rgba(255, 251, 240, 0) 62%),
    linear-gradient(180deg, rgba(248, 232, 195, 0.98) 0%, rgba(227, 202, 149, 0.96) 100%);
  border: 1px solid rgba(129, 93, 45, 0.74);
  box-shadow:
    0 6px 12px rgba(22, 18, 10, 0.2),
    inset 0 0 0 1px rgba(255, 242, 210, 0.58);
  transform: translateX(-50%) translateY(5px);
  opacity: 0;
  transition: opacity 240ms ease-in-out, transform 240ms ease-in-out;
}

.island-castle-wrap:hover::before,
.island-houses-wrap:hover::before,
.island-lighthouse-wrap:hover::before,
.island-boat-wrap:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Hide names over island icons on hover */
.island-castle-wrap::before,
.island-houses-wrap::before,
.island-lighthouse-wrap::before,
.island-boat-wrap::before {
  content: none !important;
  display: none !important;
}

.island-boat {
  position: absolute;
  left: 50%;
  bottom: 10%;
  width: 100%;
  height: auto;
  transform: translateX(-50%);
  transform-origin: 50% 70%;
  pointer-events: auto;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.28));
  animation: boatIdle 4.6s ease-in-out infinite;
  transition: filter var(--ui-dur-med) var(--ui-ease-standard);
}

.boat-wave-occlude {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: 0;
  height: 30%;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(117, 209, 242, 0.1) 0%, rgba(54, 132, 185, 0.34) 100%),
    radial-gradient(85% 100% at 50% 100%, rgba(34, 107, 166, 0.52) 0%, rgba(34, 107, 166, 0.14) 62%, transparent 100%);
  mix-blend-mode: screen;
  opacity: 0.82;
  transform: translateY(2px);
  animation: boatWavePass 2.7s ease-in-out infinite;
}

.island-houses-wrap:hover .island-house.h1 {
  animation: houseSwapA 3.6s ease-in-out infinite;
}

.island-houses-wrap:hover .island-house {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3)) brightness(1.08) saturate(1.06);
}

.island-lighthouse-wrap:hover .island-lighthouse {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.34)) brightness(1.1) saturate(1.08);
}

.island-boat-wrap:hover .island-boat {
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.28)) brightness(1.08) saturate(1.06);
}

.island-houses-wrap:hover .island-house.h2 {
  animation: houseSwapB 3.6s ease-in-out infinite;
}

.island-houses-wrap:hover .island-house.h3 {
  animation: houseSwapC 3.6s ease-in-out infinite;
}

@keyframes houseSwapA {
  0%, 100% { left: 24%; top: 20%; }
  33% { left: 76%; top: 20%; }
  66% { left: 50%; top: 66%; }
}

@keyframes houseSwapB {
  0%, 100% { left: 76%; top: 20%; }
  33% { left: 50%; top: 66%; }
  66% { left: 24%; top: 20%; }
}

@keyframes houseSwapC {
  0%, 100% { left: 50%; top: 66%; }
  33% { left: 24%; top: 20%; }
  66% { left: 76%; top: 20%; }
}

@keyframes boatFloat {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-4px); }
  50% { transform: translateY(-7px); }
  75% { transform: translateY(-3px); }
}

@keyframes boatTilt {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  20% { transform: translateX(-50%) rotate(-1.8deg); }
  48% { transform: translateX(-50%) rotate(1.5deg); }
  72% { transform: translateX(-50%) rotate(-1deg); }
}

@keyframes boatIdle {
  0%, 100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
  20% {
    transform: translateX(-50%) translateY(-4px) rotate(-1.8deg);
  }
  48% {
    transform: translateX(-50%) translateY(-7px) rotate(1.5deg);
  }
  72% {
    transform: translateX(-50%) translateY(-3px) rotate(-1deg);
  }
}

@keyframes castleHoverGlow {
  0%, 100% { filter: drop-shadow(0 0 9px rgba(208, 239, 255, 0.36)); }
  50% { filter: drop-shadow(0 0 12px rgba(220, 246, 255, 0.5)); }
}

@keyframes villageHoverWiggle {
  0%, 100% { transform: translate(-50%, calc(-50% - 2px)) scale(1.055) rotate(0deg); }
  25% { transform: translate(-50%, calc(-50% - 2px)) scale(1.055) rotate(-1.2deg); }
  75% { transform: translate(-50%, calc(-50% - 2px)) scale(1.055) rotate(1.2deg); }
}

@keyframes lighthouseHoverFlicker {
  0%, 100% { opacity: 0.72; filter: blur(1.6px) brightness(1); }
  30% { opacity: 0.84; filter: blur(1.8px) brightness(1.06); }
  65% { opacity: 0.68; filter: blur(1.5px) brightness(0.94); }
}


@keyframes boatWavePass {
  0%, 100% { opacity: 0.74; transform: translateY(2px) scaleX(1); }
  50% { opacity: 0.92; transform: translateY(-1px) scaleX(1.04); }
}

@keyframes lighthouseSweep {
  0% {
    transform: translateX(-50%) rotate(-160deg);
    opacity: 0.46;
  }
  20% {
    transform: translateX(-50%) rotate(-96deg);
    opacity: 0.58;
  }
  40% {
    transform: translateX(-50%) rotate(-24deg);
    opacity: 0.68;
  }
  60% {
    transform: translateX(-50%) rotate(52deg);
    opacity: 0.7;
  }
  80% {
    transform: translateX(-50%) rotate(124deg);
    opacity: 0.6;
  }
  100% {
    transform: translateX(-50%) rotate(196deg);
    opacity: 0.45;
  }
}

@keyframes lighthouseBeamGlow {
  0%, 100% {
    filter: blur(4.8px) saturate(1.02) brightness(0.94);
  }
  25% {
    filter: blur(4.45px) saturate(1.04) brightness(0.98);
  }
  50% {
    filter: blur(4.15px) saturate(1.07) brightness(1.02);
  }
  75% {
    filter: blur(4.55px) saturate(1.03) brightness(0.96);
  }
}

@keyframes boatTeleport {
  0% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
    opacity: 1;
  }
  28% {
    transform: translateX(calc(-50% - 130vw)) translateY(-2px) rotate(-3deg);
    opacity: 1;
  }
  29% {
    transform: translateX(calc(-50% - 130vw)) translateY(-2px) rotate(-3deg);
    opacity: 0;
  }
  30% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
    opacity: 0;
  }
  40% {
    transform: translateX(-50%) translateY(-3px) rotate(1.5deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
    opacity: 1;
  }
}

@keyframes boatWaveTeleport {
  0% {
    opacity: 0.82;
    transform: translateY(2px) scaleX(1);
  }
  28% {
    opacity: 0;
    transform: translateX(-120vw) translateY(1px) scaleX(1);
  }
  30% {
    opacity: 0;
    transform: translateY(2px) scaleX(1);
  }
  40% {
    opacity: 0.92;
    transform: translateY(-1px) scaleX(1.03);
  }
  100% {
    opacity: 0.82;
    transform: translateY(2px) scaleX(1);
  }
}

.island-castle {
  width: 100%;
  height: auto;
  display: block;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.32));
}

.castle-firework {
  position: absolute;
  top: -18%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: rgba(255, 244, 194, 0.98);
  opacity: 0;
  transform: translateY(4px) scale(0.6);
  pointer-events: none;
  z-index: 4;
  --fw-duration: 0.92s;
  --fw-delay: 0s;
  box-shadow:
    0 0 0 0 rgba(255, 246, 200, 0.9),
    0 0 0 0 rgba(255, 170, 110, 0.8),
    0 0 0 0 rgba(174, 236, 255, 0.78),
    0 0 0 0 rgba(255, 213, 130, 0.78),
    0 0 0 0 rgba(255, 255, 255, 0.9);
}

.castle-firework.f1 { top: -20%; left: 44%; }
.castle-firework.f2 { top: -28%; left: 50%; }
.castle-firework.f3 { top: -21%; left: 58%; }
.castle-firework.f4 { top: -26%; left: 40%; }
.castle-firework.f5 { top: -31%; left: 55%; }
.castle-firework.f6 { top: -19%; left: 49%; }
.castle-firework.f7 { top: -24%; left: 61%; }
/* Side clusters: left and right, slightly lower than the main top cluster */
.castle-firework.f8 { top: -13%; left: 30%; }
.castle-firework.f9 { top: -17%; left: 24%; }
.castle-firework.f10 { top: -15%; left: 36%; }
.castle-firework.f11 { top: -13%; left: 70%; }
.castle-firework.f12 { top: -17%; left: 76%; }
.castle-firework.f13 { top: -15%; left: 64%; }

.island-castle-wrap:hover .castle-firework {
  animation:
    castleFireworkBurst var(--fw-duration) ease-out var(--fw-delay) infinite,
    castleSparkleFlicker calc(var(--fw-duration) * 0.62) ease-in-out calc(var(--fw-delay) * 0.5) infinite;
}

.island-castle-wrap:hover .castle-firework.f1 { --fw-duration: 0.86s; --fw-delay: 0.03s; animation-name: castleFireworkBurst, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f2 { --fw-duration: 1.04s; --fw-delay: 0.17s; animation-name: castleFireworkBurstB, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f3 { --fw-duration: 0.92s; --fw-delay: 0.11s; animation-name: castleFireworkBurstC, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f4 { --fw-duration: 1.12s; --fw-delay: 0.24s; animation-name: castleFireworkBurstB, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f5 { --fw-duration: 0.81s; --fw-delay: 0.06s; animation-name: castleFireworkBurst, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f6 { --fw-duration: 0.98s; --fw-delay: 0.2s; animation-name: castleFireworkBurstC, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f7 { --fw-duration: 0.89s; --fw-delay: 0.3s; animation-name: castleFireworkBurst, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f8 { --fw-duration: 1.08s; --fw-delay: 0.14s; animation-name: castleFireworkBurstB, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f9 { --fw-duration: 0.84s; --fw-delay: 0.26s; animation-name: castleFireworkBurstC, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f10 { --fw-duration: 0.96s; --fw-delay: 0.08s; animation-name: castleFireworkBurst, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f11 { --fw-duration: 1.01s; --fw-delay: 0.21s; animation-name: castleFireworkBurstB, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f12 { --fw-duration: 0.87s; --fw-delay: 0.12s; animation-name: castleFireworkBurstC, castleSparkleFlicker; }
.island-castle-wrap:hover .castle-firework.f13 { --fw-duration: 0.94s; --fw-delay: 0.31s; animation-name: castleFireworkBurst, castleSparkleFlicker; }
}

@keyframes castleSparkleFlicker {
  0%, 100% { filter: brightness(0.95) saturate(1); }
  35% { filter: brightness(1.24) saturate(1.22); }
  66% { filter: brightness(0.84) saturate(0.88); }
}

@keyframes castleFireworkBurst {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.45);
    box-shadow:
      0 0 0 0 rgba(255, 246, 200, 0.9),
      0 0 0 0 rgba(255, 170, 110, 0.8),
      0 0 0 0 rgba(174, 236, 255, 0.78),
      0 0 0 0 rgba(255, 213, 130, 0.78),
      0 0 0 0 rgba(255, 255, 255, 0.9);
  }
  22% {
    opacity: 1;
    transform: translateY(-1px) scale(0.8);
    box-shadow:
      0 -9px 0 0 rgba(255, 246, 200, 0.88),
      7px 5px 0 0 rgba(255, 170, 110, 0.78),
      -7px 5px 0 0 rgba(174, 236, 255, 0.74),
      6px -5px 0 0 rgba(255, 213, 130, 0.74),
      -6px -5px 0 0 rgba(255, 255, 255, 0.85);
  }
  50% {
    opacity: 0.96;
    transform: translateY(-4px) scale(1.04);
    box-shadow:
      0 -15px 0 0 rgba(255, 246, 200, 0.8),
      12px 8px 0 0 rgba(255, 170, 110, 0.68),
      -12px 8px 0 0 rgba(174, 236, 255, 0.64),
      11px -8px 0 0 rgba(255, 213, 130, 0.64),
      -11px -8px 0 0 rgba(255, 255, 255, 0.76);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(1.16);
    box-shadow:
      0 -20px 0 0 rgba(255, 246, 200, 0),
      15px 11px 0 0 rgba(255, 170, 110, 0),
      -15px 11px 0 0 rgba(174, 236, 255, 0),
      14px -10px 0 0 rgba(255, 213, 130, 0),
      -14px -10px 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes castleFireworkBurstB {
  0% {
    opacity: 0;
    transform: translateY(5px) scale(0.42);
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, 0.95),
      0 0 0 0 rgba(255, 183, 128, 0.82),
      0 0 0 0 rgba(165, 236, 255, 0.8),
      0 0 0 0 rgba(255, 233, 160, 0.84),
      0 0 0 0 rgba(255, 152, 108, 0.74);
  }
  30% {
    opacity: 0.98;
    transform: translateY(-2px) scale(0.92);
    box-shadow:
      0 -8px 0 0 rgba(255, 255, 255, 0.9),
      8px 2px 0 0 rgba(255, 183, 128, 0.76),
      -8px 2px 0 0 rgba(165, 236, 255, 0.74),
      3px -8px 0 0 rgba(255, 233, 160, 0.78),
      -3px -8px 0 0 rgba(255, 152, 108, 0.68);
  }
  58% {
    opacity: 0.86;
    transform: translateY(-5px) scale(1.08);
    box-shadow:
      0 -14px 0 0 rgba(255, 255, 255, 0.75),
      13px 5px 0 0 rgba(255, 183, 128, 0.62),
      -13px 5px 0 0 rgba(165, 236, 255, 0.6),
      6px -12px 0 0 rgba(255, 233, 160, 0.64),
      -6px -12px 0 0 rgba(255, 152, 108, 0.54);
  }
  100% {
    opacity: 0;
    transform: translateY(-7px) scale(1.2);
    box-shadow:
      0 -18px 0 0 rgba(255, 255, 255, 0),
      16px 8px 0 0 rgba(255, 183, 128, 0),
      -16px 8px 0 0 rgba(165, 236, 255, 0),
      8px -15px 0 0 rgba(255, 233, 160, 0),
      -8px -15px 0 0 rgba(255, 152, 108, 0);
  }
}

@keyframes castleFireworkBurstC {
  0% {
    opacity: 0;
    transform: translateY(7px) scale(0.4);
    box-shadow:
      0 0 0 0 rgba(255, 232, 150, 0.9),
      0 0 0 0 rgba(255, 255, 255, 0.9),
      0 0 0 0 rgba(175, 237, 255, 0.8),
      0 0 0 0 rgba(255, 176, 104, 0.74),
      0 0 0 0 rgba(255, 218, 136, 0.8);
  }
  18% {
    opacity: 1;
    transform: translateY(-1px) scale(0.78);
    box-shadow:
      0 -8px 0 0 rgba(255, 232, 150, 0.86),
      9px 1px 0 0 rgba(255, 255, 255, 0.84),
      -9px 1px 0 0 rgba(175, 237, 255, 0.76),
      5px -6px 0 0 rgba(255, 176, 104, 0.7),
      -5px -6px 0 0 rgba(255, 218, 136, 0.76);
  }
  46% {
    opacity: 0.92;
    transform: translateY(-5px) scale(1.02);
    box-shadow:
      0 -14px 0 0 rgba(255, 232, 150, 0.74),
      13px 3px 0 0 rgba(255, 255, 255, 0.66),
      -13px 3px 0 0 rgba(175, 237, 255, 0.62),
      8px -11px 0 0 rgba(255, 176, 104, 0.58),
      -8px -11px 0 0 rgba(255, 218, 136, 0.62);
  }
  70% {
    opacity: 0.72;
    transform: translateY(-6px) scale(1.1);
    box-shadow:
      0 -17px 0 0 rgba(255, 232, 150, 0.55),
      15px 5px 0 0 rgba(255, 255, 255, 0.5),
      -15px 5px 0 0 rgba(175, 237, 255, 0.48),
      11px -13px 0 0 rgba(255, 176, 104, 0.42),
      -11px -13px 0 0 rgba(255, 218, 136, 0.46);
  }
  100% {
    opacity: 0;
    transform: translateY(-9px) scale(1.22);
    box-shadow:
      0 -21px 0 0 rgba(255, 232, 150, 0),
      17px 7px 0 0 rgba(255, 255, 255, 0),
      -17px 7px 0 0 rgba(175, 237, 255, 0),
      13px -16px 0 0 rgba(255, 176, 104, 0),
      -13px -16px 0 0 rgba(255, 218, 136, 0);
  }
}

.island-castle-wrap:hover .island-castle {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.32)) brightness(1.08) saturate(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .island-castle-wrap:hover .castle-firework {
    animation: none !important;
    opacity: 1;
    transform: none;
    box-shadow: none;
  }
  .island-houses-wrap:hover .island-house {
    animation: none !important;
  }
  .island-boat-wrap,
  .island-boat,
  .boat-wave-occlude {
    animation: none !important;
  }
  .lighthouse-beam {
    animation: none !important;
    transform: translateX(-50%) rotate(24deg);
    opacity: 0.6;
  }

  .island-wrap::after {
    animation: none !important;
    opacity: 0 !important;
  }

  .island-shore-front {
    animation: none !important;
  }

}

@keyframes shoreEdgeDrift {
  0%, 100% { transform: scale(1.016) translateX(0); opacity: 0.32; }
  34% { transform: scale(1.017) translateX(0.45%); opacity: 0.38; }
  68% { transform: scale(1.015) translateX(-0.4%); opacity: 0.34; }
}

@keyframes shoreFoamPulse {
  0%, 100% { transform: scale(1.015) translateX(0); opacity: 0.34; }
  36% { transform: scale(1.018) translateX(0.75%); opacity: 0.44; }
  70% { transform: scale(1.016) translateX(-0.6%); opacity: 0.38; }
}

/* Smaller 3D-ish foam waves close to shoreline */
@keyframes shoreFront3DPulse {
  0%, 100% {
    transform: scale(1.012) translateX(0);
    opacity: 0.22;
  }
  32% {
    transform: scale(1.014) translateX(0.45%);
    opacity: 0.28;
  }
  64% {
    transform: scale(1.013) translateX(-0.35%);
    opacity: 0.24;
  }
}

@keyframes shoreMidPulse {
  0%, 100% { transform: scale(1.01) translateX(0); opacity: 0.26; }
  34% { transform: scale(1.012) translateX(0.45%); opacity: 0.34; }
  68% { transform: scale(1.011) translateX(-0.4%); opacity: 0.3; }
}

@keyframes shoreRingWaves {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 0.42;
    filter: blur(1.15px);
  }
  40% {
    transform: translateX(-0.35%) scale(1.01);
    opacity: 0.58;
    filter: blur(0.95px);
  }
  70% {
    transform: translateX(0.35%) scale(0.995);
    opacity: 0.48;
    filter: blur(1.05px);
  }
}


@media (max-width: 700px) {
  .island-wrap {
    width: min(88vw, 980px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ocean-wave-track,
  .ocean-wave-track::before,
  .ocean-wave-track::after {
    animation: none !important;
  }
  .seagull-flock,
  .seagull,
  .seagull::before,
  .seagull::after {
    animation: none !important;
  }
  .island-shore-back,
  .island-shore-mid,
  .island-shore-front {
    animation: none !important;
  }
  body.home-page .ocean-bg,
  body.home-page .seagull-layer,
  body.home-page .stage,
  body.home-page .island-wrap {
    transition: none !important;
  }
  body {
    animation: none !important;
  }
  body.home-page::after {
    transition: none !important;
  }

}

body.projects-page {
  overflow-y: auto;
  color: #f4f7fb;
  background:
    radial-gradient(120% 100% at 50% -10%, rgba(255, 205, 110, 0.16) 0%, rgba(255, 205, 110, 0) 60%),
    linear-gradient(180deg, rgba(24, 27, 35, 0.78) 0%, rgba(20, 22, 30, 0.82) 100%),
    url("./assets/background/background.jpg") center / cover no-repeat fixed;
}

body.projects-page .ocean-bg {
  display: none;
}

body.projects-page .site-nav {
  background:
    linear-gradient(180deg, rgba(14, 35, 68, 0.72) 0%, rgba(10, 31, 58, 0.76) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.projects-page .corner-menu-links {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 240, 0.38) 0%, rgba(255, 251, 240, 0) 64%),
    linear-gradient(180deg, rgba(247, 230, 188, 0.9) 0%, rgba(223, 194, 136, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.projects-page .site-nav-link {
  background:
    linear-gradient(180deg, rgba(236, 219, 174, 0.88) 0%, rgba(208, 181, 123, 0.88) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #2e2416;
  border-color: rgba(134, 96, 45, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 241, 207, 0.45);
}

body.projects-page .site-nav-link.is-active {
  background:
    linear-gradient(180deg, rgba(250, 234, 193, 0.96) 0%, rgba(227, 194, 132, 0.94) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #221c11;
}

body.about-page {
  overflow-y: auto;
  color: #f4f7fb;
  background:
    radial-gradient(120% 100% at 18% -6%, rgba(201, 164, 108, 0.18) 0%, rgba(201, 164, 108, 0) 62%),
    linear-gradient(180deg, rgba(58, 43, 28, 0.7) 0%, rgba(42, 32, 22, 0.74) 100%),
    url("./assets/background/background.jpg") center / cover no-repeat fixed;
}

body.about-page .ocean-bg {
  display: none;
}

body.about-page .site-nav {
  background:
    linear-gradient(180deg, rgba(14, 35, 68, 0.72) 0%, rgba(10, 31, 58, 0.76) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.about-page .corner-menu-links {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 240, 0.38) 0%, rgba(255, 251, 240, 0) 64%),
    linear-gradient(180deg, rgba(247, 230, 188, 0.9) 0%, rgba(223, 194, 136, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.about-page .site-nav-link {
  background:
    linear-gradient(180deg, rgba(236, 219, 174, 0.88) 0%, rgba(208, 181, 123, 0.88) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #2e2416;
  border-color: rgba(134, 96, 45, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 241, 207, 0.45);
}

body.about-page .site-nav-link.is-active {
  background:
    linear-gradient(180deg, rgba(250, 234, 193, 0.96) 0%, rgba(227, 194, 132, 0.94) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #221c11;
}

body.skills-page {
  overflow-y: auto;
  color: #f4f7fb;
  background:
    radial-gradient(130% 100% at 84% 0%, rgba(171, 231, 255, 0.2) 0%, rgba(171, 231, 255, 0) 60%),
    linear-gradient(180deg, rgba(24, 43, 68, 0.72) 0%, rgba(18, 34, 56, 0.76) 100%),
    url("./assets/background/background.jpg") center / cover no-repeat fixed;
}

body.skills-page .ocean-bg {
  display: none;
}

body.skills-page .site-nav {
  background:
    linear-gradient(180deg, rgba(14, 35, 68, 0.72) 0%, rgba(10, 31, 58, 0.76) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.skills-page .corner-menu-links {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 240, 0.38) 0%, rgba(255, 251, 240, 0) 64%),
    linear-gradient(180deg, rgba(247, 230, 188, 0.9) 0%, rgba(223, 194, 136, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.skills-page .site-nav-link {
  background:
    linear-gradient(180deg, rgba(236, 219, 174, 0.88) 0%, rgba(208, 181, 123, 0.88) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #2e2416;
  border-color: rgba(134, 96, 45, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 241, 207, 0.45);
}

body.skills-page .site-nav-link.is-active {
  background:
    linear-gradient(180deg, rgba(250, 234, 193, 0.96) 0%, rgba(227, 194, 132, 0.94) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #221c11;
}

body.contact-page {
  overflow-y: auto;
  color: #f4f7fb;
  background:
    radial-gradient(130% 100% at 12% -8%, rgba(124, 214, 245, 0.2) 0%, rgba(124, 214, 245, 0) 58%),
    linear-gradient(180deg, rgba(16, 58, 86, 0.72) 0%, rgba(10, 42, 69, 0.78) 100%),
    url("./assets/background/background.jpg") center / cover no-repeat fixed;
}

body.contact-page .ocean-bg {
  display: none;
}

body.contact-page .site-nav {
  background:
    linear-gradient(180deg, rgba(14, 35, 68, 0.72) 0%, rgba(10, 31, 58, 0.76) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.contact-page .corner-menu-links {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 240, 0.38) 0%, rgba(255, 251, 240, 0) 64%),
    linear-gradient(180deg, rgba(247, 230, 188, 0.9) 0%, rgba(223, 194, 136, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
}

body.contact-page .site-nav-link {
  background:
    linear-gradient(180deg, rgba(236, 219, 174, 0.88) 0%, rgba(208, 181, 123, 0.88) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #2e2416;
  border-color: rgba(134, 96, 45, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 241, 207, 0.45);
}

body.contact-page .site-nav-link.is-active {
  background:
    linear-gradient(180deg, rgba(250, 234, 193, 0.96) 0%, rgba(227, 194, 132, 0.94) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  color: #221c11;
}

/* Global polish: cleaner and smoother RPG UI feel */
.site-nav-link,
.corner-menu-links,
.dragon-trigger,
.contact-submit,
.social-link {
  transition-timing-function: var(--ui-ease-standard);
}

.quests-header,
.about-panel,
.skills-header,
.contact-panel {
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(7, 23, 56, 0.26), inset 0 0 0 1px rgba(255, 243, 212, 0.55);
}

.project-card,
.skills-card {
  transition: transform 220ms var(--ui-ease-standard), box-shadow 220ms var(--ui-ease-standard), filter 220ms var(--ui-ease-standard);
}

.project-card:hover,
.skills-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(8, 25, 56, 0.24), inset 0 0 0 1px rgba(255, 243, 212, 0.5);
  filter: saturate(1.02);
}

.about-panel:hover,
.contact-panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(7, 23, 56, 0.3), inset 0 0 0 1px rgba(255, 243, 212, 0.55);
}

.about-panel,
.contact-panel,
.quests-header,
.skills-header {
  transition: transform var(--ui-dur-med) var(--ui-ease-standard), box-shadow var(--ui-dur-med) var(--ui-ease-standard);
}

.contact-form input,
.contact-form textarea {
  transition: border-color var(--ui-dur-fast) var(--ui-ease-standard), box-shadow var(--ui-dur-fast) var(--ui-ease-standard), background-color var(--ui-dur-fast) var(--ui-ease-standard);
}

.contact-submit {
  box-shadow: 0 6px 14px rgba(34, 25, 13, 0.2);
}

.contact-submit:hover {
  box-shadow: 0 9px 16px rgba(34, 25, 13, 0.24);
}

.social-link {
  box-shadow: 0 4px 10px rgba(34, 25, 13, 0.16);
}

.social-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 12px rgba(34, 25, 13, 0.2);
}

/* Consistent inner-page rhythm */
:root {
  --ui-shell-margin-top: 96px;
  --ui-shell-margin-bottom: 54px;
  --ui-shell-pad: 14px 20px 34px;
  --ui-panel-pad: 24px 22px;
  --ui-grid-gap: 16px;
  --ui-card-pad: 16px;
  --ui-heading-gap: 10px;
  --ui-body-gap: 12px;
}

.projects-shell {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: var(--ui-shell-margin-top) auto var(--ui-shell-margin-bottom);
  padding: var(--ui-shell-pad);
}

.quests-header {
  margin: 0 auto 24px;
  text-align: center;
  max-width: 760px;
  padding: var(--ui-panel-pad);
  border-radius: 16px;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 249, 235, 0.42) 0%, rgba(255, 249, 235, 0) 64%),
    linear-gradient(180deg, var(--ui-parchment-top) 0%, var(--ui-parchment-bottom) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-panel-shadow), inset 0 0 0 1px rgba(255, 243, 212, 0.55);
  color: var(--ui-ink);
}

.quests-kicker {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f4f23;
}

.quests-header h1 {
  margin: 0 0 var(--ui-heading-gap);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  font-family: var(--ui-heading-font);
  letter-spacing: 0.02em;
}

.quests-header p {
  margin: 0;
  line-height: 1.55;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--ui-grid-gap);
}

.project-card {
  padding: var(--ui-card-pad);
  border-radius: 14px;
  background:
    radial-gradient(125% 95% at 50% 0%, rgba(255, 249, 235, 0.34) 0%, rgba(255, 249, 235, 0) 62%),
    linear-gradient(180deg, var(--ui-parchment-top) 0%, var(--ui-parchment-bottom) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid var(--ui-border-soft);
  box-shadow: 0 10px 20px rgba(8, 25, 56, 0.22), inset 0 0 0 1px rgba(255, 243, 212, 0.45);
  color: var(--ui-ink);
}

.project-card h2 {
  margin: 12px 0 8px;
  font-size: 1.08rem;
  line-height: 1.3;
  font-family: var(--ui-heading-font);
  letter-spacing: 0.01em;
}

.project-card p {
  margin: 0 0 var(--ui-body-gap);
  line-height: 1.5;
}

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

.project-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #294160;
  border: 1px dashed rgba(60, 95, 132, 0.6);
  background:
    linear-gradient(180deg, rgba(221, 242, 255, 0.85) 0%, rgba(176, 211, 235, 0.74) 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 8px, rgba(255, 255, 255, 0.03) 8px 16px);
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(79, 49, 17, 0.28);
  box-shadow: 0 6px 14px rgba(15, 20, 34, 0.24);
  display: block;
}

.project-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 auto 18px;
  max-width: 980px;
  padding: 0;
  border-radius: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.project-jump-nav a {
  text-decoration: none;
  color: #2d2416;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(126, 89, 39, 0.52);
  background:
    linear-gradient(180deg, rgba(248, 231, 192, 0.95) 0%, rgba(226, 196, 138, 0.93) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard), box-shadow var(--ui-dur-fast) var(--ui-ease-standard);
}

.project-jump-nav a:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.project-jump-nav--section {
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin: 0 0 12px;
  max-width: none;
  padding: 7px;
}

.project-jump-nav--section a {
  font-size: 0.84rem;
  padding: 7px 10px;
}

.project-jump-nav--between {
  margin: -10px auto -2px;
}

.project-sections {
  display: grid;
  gap: 72px;
}

.project-section {
  display: grid;
  grid-template-columns: minmax(320px, 44%) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: var(--ui-card-pad);
  border-radius: 14px;
  background:
    radial-gradient(125% 95% at 50% 0%, rgba(255, 249, 235, 0.34) 0%, rgba(255, 249, 235, 0) 62%),
    linear-gradient(180deg, var(--ui-parchment-top) 0%, var(--ui-parchment-bottom) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid var(--ui-border-soft);
  box-shadow: 0 10px 20px rgba(8, 25, 56, 0.22), inset 0 0 0 1px rgba(255, 243, 212, 0.45);
  color: var(--ui-ink);
  scroll-margin-top: 208px;
  transition: box-shadow var(--ui-dur-med) var(--ui-ease-standard), filter var(--ui-dur-med) var(--ui-ease-standard);
}

.project-media {
  width: 100%;
}

.project-media .project-placeholder,
.project-media .project-image {
  margin: 0;
}

.project-content h2 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  line-height: 1.28;
  font-family: var(--ui-heading-font);
}

.project-tagline {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 0.98rem;
  color: rgba(78, 57, 29, 0.95);
}

.project-subheading {
  margin: 0 0 8px;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(111, 79, 35, 0.92);
  font-family: var(--ui-heading-font);
}

.project-content p {
  margin: 0 0 10px;
  line-height: 1.55;
}

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

.project-meta {
  margin: 12px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(136, 98, 45, 0.36);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 249, 235, 0.24) 0%, rgba(255, 249, 235, 0) 64%),
    linear-gradient(180deg, rgba(240, 220, 177, 0.62) 0%, rgba(220, 188, 126, 0.58) 100%);
}

.project-meta p {
  margin: 0 0 6px;
  line-height: 1.45;
}

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

.project-skill-list {
  margin: 0 0 10px;
  padding-left: 18px;
}

.project-skill-list li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.project-skill-list li:last-child {
  margin-bottom: 0;
}

.project-section-nav {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.project-nav-btn {
  text-decoration: none;
  color: #2d2416;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(126, 89, 39, 0.52);
  background:
    linear-gradient(180deg, rgba(248, 231, 192, 0.95) 0%, rgba(226, 196, 138, 0.93) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  box-shadow: 0 4px 10px rgba(34, 25, 13, 0.16);
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard), box-shadow var(--ui-dur-fast) var(--ui-ease-standard);
}

.project-nav-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 7px 12px rgba(34, 25, 13, 0.2);
}

@media (max-width: 700px) {
  .projects-page .project-section {
    grid-template-columns: 1fr;
  }

  .projects-shell {
    margin-top: 84px;
    padding: 10px 14px 28px;
  }
}

.about-shell {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: var(--ui-shell-margin-top) auto var(--ui-shell-margin-bottom);
  padding: var(--ui-shell-pad);
}

.about-panel {
  border-radius: 16px;
  padding: var(--ui-panel-pad);
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 249, 235, 0.42) 0%, rgba(255, 249, 235, 0) 64%),
    linear-gradient(180deg, var(--ui-parchment-top) 0%, var(--ui-parchment-bottom) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-panel-shadow), inset 0 0 0 1px rgba(255, 243, 212, 0.55);
  color: var(--ui-ink);
}

.about-panel h1 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  font-family: var(--ui-heading-font);
  letter-spacing: 0.02em;
  text-align: left;
}

.about-panel p {
  margin: 0 0 var(--ui-body-gap);
  line-height: 1.65;
  font-size: 1.01rem;
}

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

.about-prose {
  max-width: 72ch;
}

.about-prose p {
  text-wrap: pretty;
}

.about-subsection + .about-subsection {
  margin-top: 18px;
}

.about-subsection h2 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  color: rgba(82, 59, 28, 0.9);
  font-family: var(--ui-heading-font);
}

.about-learning .learning-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.learning-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(132, 96, 43, 0.52);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 249, 232, 0.44) 0%, rgba(255, 249, 232, 0) 66%),
    linear-gradient(180deg, rgba(241, 221, 176, 0.92) 0%, rgba(219, 189, 128, 0.9) 100%);
  color: rgba(47, 36, 22, 0.94);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 241, 206, 0.4);
}

@media (max-width: 700px) {
  .about-shell {
    margin-top: 84px;
    padding: 10px 14px 28px;
  }
}

.skills-shell {
  position: relative;
  z-index: 2;
  max-width: 1020px;
  margin: var(--ui-shell-margin-top) auto var(--ui-shell-margin-bottom);
  padding: var(--ui-shell-pad);
}

.skills-header {
  margin: 0 auto 20px;
  text-align: center;
  max-width: 760px;
  padding: var(--ui-panel-pad);
  border-radius: 16px;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 249, 235, 0.42) 0%, rgba(255, 249, 235, 0) 64%),
    linear-gradient(180deg, var(--ui-parchment-top) 0%, var(--ui-parchment-bottom) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-panel-shadow), inset 0 0 0 1px rgba(255, 243, 212, 0.55);
  color: var(--ui-ink);
}

.skills-header h1 {
  margin: 0 0 var(--ui-heading-gap);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  font-family: var(--ui-heading-font);
  letter-spacing: 0.02em;
}

.skills-header p {
  margin: 0;
  line-height: 1.55;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
}

.skills-card {
  padding: var(--ui-card-pad);
  border-radius: 14px;
  background:
    radial-gradient(125% 95% at 50% 0%, rgba(255, 249, 235, 0.34) 0%, rgba(255, 249, 235, 0) 62%),
    linear-gradient(180deg, var(--ui-parchment-top) 0%, var(--ui-parchment-bottom) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid var(--ui-border-soft);
  box-shadow: 0 10px 20px rgba(8, 25, 56, 0.22), inset 0 0 0 1px rgba(255, 243, 212, 0.45);
  color: var(--ui-ink);
}

.skills-card h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  line-height: 1.3;
  font-family: var(--ui-heading-font);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skills-cat-icon {
  width: 1.4em;
  height: 1.4em;
  display: inline-grid;
  place-items: center;
  font-size: 0.95em;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 242, 204, 0.95) 0%, rgba(235, 206, 146, 0.9) 100%);
  border: 1px solid rgba(128, 90, 41, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 224, 0.32);
}

.skills-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.skills-list li:last-child {
  margin-bottom: 0;
}

.skill-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 241, 255, 0.95) 0%, rgba(99, 167, 207, 0.9) 100%);
  border: 1px solid rgba(42, 91, 124, 0.66);
  flex: 0 0 auto;
  margin-top: 0.34em;
}

.skills-outro {
  margin: 18px auto 0;
  max-width: 860px;
  text-align: center;
  padding: 14px 16px;
  border-radius: 14px;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 249, 235, 0.3) 0%, rgba(255, 249, 235, 0) 66%),
    linear-gradient(180deg, rgba(236, 215, 171, 0.92) 0%, rgba(216, 185, 124, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid rgba(134, 96, 45, 0.56);
  color: #2d2315;
  line-height: 1.58;
  box-shadow: 0 8px 16px rgba(8, 25, 56, 0.2), inset 0 0 0 1px rgba(255, 243, 212, 0.42);
}

.skills-card {
  transition: transform 180ms var(--ui-ease-standard), box-shadow 180ms var(--ui-ease-standard), filter 180ms var(--ui-ease-standard);
}

.skills-card:hover {
  transform: translateY(-1px);
  filter: saturate(1.02);
  box-shadow: 0 12px 20px rgba(8, 25, 56, 0.22), inset 0 0 0 1px rgba(255, 243, 212, 0.48);
}

@media (max-width: 700px) {
  .skills-shell {
    margin-top: 84px;
    padding: 10px 14px 28px;
  }
}

.contact-shell {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: var(--ui-shell-margin-top) auto var(--ui-shell-margin-bottom);
  padding: var(--ui-shell-pad);
}

.contact-panel {
  border-radius: 16px;
  padding: var(--ui-panel-pad);
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 249, 235, 0.42) 0%, rgba(255, 249, 235, 0) 64%),
    linear-gradient(180deg, var(--ui-parchment-top) 0%, var(--ui-parchment-bottom) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-panel-shadow), inset 0 0 0 1px rgba(255, 243, 212, 0.55);
  color: var(--ui-ink);
}

.contact-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  font-family: var(--ui-heading-font);
  letter-spacing: 0.02em;
}

.contact-intro {
  margin: 0 0 var(--ui-body-gap);
  line-height: 1.6;
}

.contact-social-intro {
  margin: 0;
  font-weight: 600;
  color: #3a2a16;
  white-space: nowrap;
}

.contact-social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 16px;
  flex-wrap: wrap;
}

.contact-form {
  display: grid;
  gap: var(--ui-body-gap);
}

.contact-form label {
  font-weight: 700;
  color: #342816;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(124, 88, 40, 0.62);
  background: rgba(255, 249, 236, 0.92);
  color: #2a2012;
  padding: 10px 12px;
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(72, 140, 194, 0.5);
  outline-offset: 1px;
}

.contact-submit {
  margin-top: 4px;
  border: 1px solid rgba(131, 93, 43, 0.64);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  color: #2a2113;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(244, 224, 180, 0.94) 0%, rgba(219, 188, 129, 0.94) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard), box-shadow var(--ui-dur-fast) var(--ui-ease-standard);
}

.contact-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.contact-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
}

.social-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 600;
  color: #2e2416;
  border: 1px solid rgba(131, 93, 43, 0.6);
  background:
    linear-gradient(180deg, rgba(244, 224, 180, 0.9) 0%, rgba(219, 188, 129, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  transition: transform var(--ui-dur-fast) var(--ui-ease-standard), filter var(--ui-dur-fast) var(--ui-ease-standard), box-shadow var(--ui-dur-fast) var(--ui-ease-standard);
}

.social-link:hover {
  filter: brightness(1.05);
}

.social-link--disabled {
  opacity: 0.88;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 700px) {
  .contact-shell {
    margin-top: 84px;
    padding: 10px 14px 28px;
  }
}

/* Hybrid page text system (Projects/About/Skills/Contact) */
.projects-page .project-content p,
.about-page .about-panel p,
.skills-page .skills-list li,
.contact-page .contact-intro,
.contact-page .contact-form label {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
}

.projects-page .project-content p,
.projects-page .project-meta p,
.projects-page .project-skill-list li {
  color: rgba(238, 247, 255, 0.97);
  text-shadow: 0 1px 2px rgba(7, 20, 40, 0.72);
}

.projects-page .project-content h2,
.projects-page .project-tagline,
.projects-page .project-subheading {
  color: rgba(186, 146, 92, 0.96);
  text-shadow: 0 1px 2px rgba(20, 12, 6, 0.48);
}

/* Projects: no heavy boxes, separator-led layout */
.projects-page .project-section {
  padding: 14px 0 0;
  border-radius: 0;
  background: none;
  border: 0;
  border-top: 1px solid rgba(235, 246, 255, 0.34);
  box-shadow: none;
}

.projects-page .project-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.projects-page .project-content {
  padding-right: 4px;
}

.projects-page .project-meta {
  background: rgba(238, 250, 255, 0.12);
  border: 1px solid rgba(174, 213, 235, 0.32);
  box-shadow: none;
}

/* About/Lore: long-form parchment haze instead of hard card */
.about-page .about-panel {
  background:
    radial-gradient(145% 100% at 50% 0%, rgba(255, 248, 229, 0.24) 0%, rgba(255, 248, 229, 0.05) 60%, rgba(255, 248, 229, 0) 100%),
    linear-gradient(180deg, rgba(245, 231, 198, 0.24) 0%, rgba(219, 195, 145, 0.18) 100%);
  border: 1px solid rgba(248, 228, 183, 0.28);
  box-shadow: 0 10px 20px rgba(8, 25, 56, 0.16);
  backdrop-filter: blur(1.2px);
}

.about-page .about-prose {
  max-width: 74ch;
}

.about-page .about-panel p {
  color: rgba(245, 251, 255, 0.98);
  text-shadow: 0 1px 2px rgba(10, 24, 45, 0.74);
}

/* Skills: compact chip-like lists with light category cards */
.skills-page .skills-card {
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 249, 235, 0.2) 0%, rgba(255, 249, 235, 0) 66%),
    linear-gradient(180deg, rgba(240, 220, 176, 0.34) 0%, rgba(220, 191, 136, 0.28) 100%);
  border: 1px solid rgba(240, 221, 184, 0.34);
  box-shadow: 0 8px 16px rgba(8, 25, 56, 0.16);
}

.skills-page .skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills-page .skills-list li {
  align-items: center;
  margin-bottom: 0;
  padding: 6px 10px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(130, 95, 44, 0.48);
  background:
    linear-gradient(180deg, rgba(248, 232, 197, 0.92) 0%, rgba(227, 198, 142, 0.9) 100%),
    url("./assets/background/button.jpg") center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 244, 215, 0.34);
  overflow-wrap: anywhere;
}

.skills-page .skill-mark {
  margin-top: 0;
}

.skills-page .skills-outro {
  background: rgba(235, 246, 255, 0.16);
  border: 1px solid rgba(177, 213, 235, 0.36);
  box-shadow: none;
}

/* Contact: keep structure strong, but visually aligned with hybrid style */
.contact-page .contact-panel {
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 249, 235, 0.34) 0%, rgba(255, 249, 235, 0.08) 66%, rgba(255, 249, 235, 0) 100%),
    linear-gradient(180deg, rgba(242, 225, 186, 0.58) 0%, rgba(223, 194, 138, 0.5) 100%);
  border: 1px solid rgba(147, 109, 56, 0.52);
  box-shadow: 0 12px 24px rgba(8, 25, 56, 0.2), inset 0 0 0 1px rgba(255, 241, 206, 0.44);
}

/* Responsive pass: mobile + tablet readability and layout */
@media (max-width: 1100px) {
  .stage {
    padding: 1.4rem 1rem;
  }

  .island-wrap {
    width: min(78vw, 980px);
    max-width: 92vw;
  }

  .project-sections {
    gap: 56px;
  }

  .project-section {
    grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 900px) {
  .corner-menu {
    top: 14px;
    left: 12px;
    gap: 8px;
  }

  .dragon-trigger {
    width: 50px;
    height: 50px;
  }

  .dragon-trigger img {
    width: 36px;
    height: 36px;
  }

  .corner-menu-links {
    max-width: min(84vw, 420px);
  }

  .paper-scroll-corner {
    left: 4px;
    top: 8px;
    width: 148px;
    height: 244px;
  }

  .paper-legend {
    left: 22px;
    top: 18px;
    right: 16px;
    gap: 9px;
  }

  .paper-legend-icon {
    width: 23px;
  }

  .paper-legend-text {
    font-size: 12px;
  }

  .stage {
    min-height: 100dvh;
  }

  .island-wrap {
    width: min(82vw, 980px);
    max-width: 92vw;
  }

  .island-castle-wrap::before,
  .island-houses-wrap::before,
  .island-lighthouse-wrap::before,
  .island-boat-wrap::before {
    font-size: 0.66rem;
    padding: 4px 8px;
  }

  .projects-shell,
  .about-shell,
  .skills-shell,
  .contact-shell {
    margin-top: 86px;
    padding: 12px 14px 28px;
  }

  .project-jump-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  html {
    font-size: 15px;
  }

  .stage {
    align-items: flex-end;
    padding: 0.75rem 0.5rem 1.2rem;
  }

  .island-wrap {
    width: min(88vw, 980px);
    max-width: 92vw;
  }

  .island {
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2));
  }

  .paper-scroll-corner {
    transform: scale(0.88);
    transform-origin: top left;
  }

  .corner-menu-links {
    max-width: min(88vw, 320px);
    gap: 6px;
    padding: 6px;
  }

  .site-nav-link,
  .corner-menu-links .site-nav-link {
    font-size: 0.8rem;
    padding: 7px 10px;
  }

  .project-sections {
    gap: 40px;
  }

  .project-section {
    gap: 14px;
    scroll-margin-top: 132px;
  }

  .project-content h2 {
    font-size: 1.05rem;
  }

  .project-content p,
  .about-panel p,
  .skills-header p,
  .skills-list li,
  .contact-intro {
    line-height: 1.6;
  }

  .project-section-nav {
    flex-wrap: wrap;
  }

  .project-nav-btn {
    width: 100%;
    text-align: center;
  }

  .contact-socials {
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .corner-menu {
    top: 10px;
    left: 8px;
  }

  .dragon-trigger {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }

  .dragon-trigger img {
    width: 32px;
    height: 32px;
  }

  .paper-scroll-corner {
    transform: scale(0.82);
  }

  .quests-header,
  .about-panel,
  .skills-header,
  .contact-panel,
  .project-section,
  .skills-card,
  .project-card {
    border-radius: 12px;
  }

  .projects-shell,
  .about-shell,
  .skills-shell,
  .contact-shell {
    margin-top: 80px;
    padding: 10px 10px 24px;
  }

  .project-jump-nav a {
    font-size: 0.8rem;
    padding: 7px 10px;
  }

  .social-link {
    padding: 6px 10px;
    font-size: 0.86rem;
  }
}

/* Mobile homepage alternative (no island map) */
.mobile-home-topbar,
.mobile-home-nav {
  display: none;
}

/* Touch devices (mobile/tablet): island icons are decorative (not linked) */
@media (max-width: 1024px) and (hover: none), (max-width: 1024px) and (pointer: coarse) {
  body.home-page .island-castle-wrap,
  body.home-page .island-houses-wrap,
  body.home-page .island-lighthouse-wrap,
  body.home-page .island-boat-wrap {
    pointer-events: none;
    cursor: default;
  }

  /* Keep only castle + lighthouse linked on mobile/tablet */
  body.home-page .island-castle-wrap,
  body.home-page .island-lighthouse-wrap {
    pointer-events: auto;
    cursor: pointer;
  }
}

/* Desktop and fine-pointer devices: preserve original interactive behavior */
@media (hover: hover) and (pointer: fine) {
  body.home-page .island-castle-wrap,
  body.home-page .island-houses-wrap,
  body.home-page .island-lighthouse-wrap,
  body.home-page .island-boat-wrap {
    pointer-events: auto;
    cursor: pointer;
  }
}

@media (max-width: 767px) {
  body.home-page {
    overflow-y: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
      radial-gradient(120% 100% at 50% -10%, rgba(255, 221, 151, 0.12) 0%, rgba(255, 221, 151, 0) 56%),
      linear-gradient(180deg, rgba(18, 57, 107, 0.94) 0%, rgba(13, 43, 84, 0.96) 100%);
  }

  body.home-page .home-medieval-frame,
  body.home-page .ocean-bg,
  body.home-page .seagull-layer,
  body.home-page .paper-scroll-corner,
  body.home-page .ambient-toggle {
    display: none;
  }

  body.home-page .stage {
    display: none;
  }

  .mobile-home-topbar {
    display: none;
  }

  .mobile-home-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px calc(22px + env(safe-area-inset-bottom, 0px));
    transition:
      opacity var(--ui-dur-med) var(--ui-ease-standard),
      transform var(--ui-dur-med) var(--ui-ease-standard);
  }

  .mobile-open-scroll {
    width: min(92vw, 370px);
    height: min(82dvh, 470px);
    position: relative;
    --mobile-paper-top: 116px;
    --mobile-paper-height: 286px;
    transform-origin: 50% 0%;
    animation: mobileScrollUnroll 820ms cubic-bezier(0.24, 0.84, 0.33, 1) both;
  }

  .mobile-open-scroll__inner {
    position: relative;
    width: 100%;
    height: 100%;
    animation: mobileScrollIdle 6.8s ease-in-out 980ms infinite;
  }

  .mobile-open-scroll__welcome {
    position: absolute;
    top: calc(var(--mobile-paper-top) - 138px);
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 5;
    display: grid;
    justify-items: center;
    gap: 2px;
    font-family: "Uncial Antiqua", "Cinzel Decorative", "Cinzel", var(--ui-heading-font);
    font-size: clamp(2.56rem, 11.8vw, 3.9rem);
    line-height: 0.95;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: capitalize;
    color: #f9e6b1;
    font-weight: 700;
    text-shadow:
      0 1px 0 rgba(58, 34, 14, 0.98),
      0 0 10px rgba(254, 223, 152, 0.42),
      0 0 22px rgba(188, 133, 62, 0.34);
    pointer-events: none;
    animation: mobileWelcomeFloat 4.8s ease-in-out 1.05s infinite;
  }

  .mobile-open-scroll__welcome span {
    display: block;
  }

  .mobile-open-scroll__s1,
  .mobile-open-scroll__s2,
  .mobile-open-scroll__paper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    height: auto;
    max-width: 100%;
    pointer-events: none;
  }

  .mobile-open-scroll__s1 {
    top: calc(var(--mobile-paper-top) - 61px);
    width: min(96%, 352px);
    z-index: 4;
    filter: drop-shadow(0 8px 10px rgba(41, 26, 11, 0.3));
  }

  .mobile-open-scroll__s2 {
    top: calc(var(--mobile-paper-top) + var(--mobile-paper-height) - 18px);
    width: min(86%, 318px);
    z-index: 4;
    filter: drop-shadow(0 10px 14px rgba(29, 18, 8, 0.26));
  }

  .mobile-open-scroll__paper {
    top: var(--mobile-paper-top);
    width: min(84%, 310px);
    z-index: 2;
    filter: drop-shadow(0 16px 18px rgba(25, 16, 8, 0.24));
  }

  .mobile-open-scroll__links {
    position: absolute;
    top: var(--mobile-paper-top);
    left: 50%;
    transform: translateX(-50%);
    height: var(--mobile-paper-height);
    width: min(68vw, 250px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    z-index: 3;
  }

  .mobile-scroll-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    text-align: center;
    text-decoration: none;
    color: #2f2416;
    padding: 12px 13px;
    border-radius: 13px;
    border: 1px solid rgba(136, 98, 45, 0.52);
    background:
      radial-gradient(120% 100% at 50% 0%, rgba(255, 250, 238, 0.48) 0%, rgba(255, 250, 238, 0.06) 68%),
      linear-gradient(180deg, rgba(248, 233, 196, 0.94) 0%, rgba(228, 199, 143, 0.92) 100%);
    box-shadow: 0 8px 15px rgba(53, 34, 17, 0.18), inset 0 0 0 1px rgba(255, 247, 226, 0.45);
    transition:
      transform var(--ui-dur-fast) var(--ui-ease-standard),
      filter var(--ui-dur-fast) var(--ui-ease-standard),
      box-shadow var(--ui-dur-fast) var(--ui-ease-standard),
      background-color var(--ui-dur-fast) var(--ui-ease-standard);
    opacity: 0;
    transform: translateY(9px);
    animation: mobileScrollLinkReveal 480ms var(--ui-ease-standard) forwards;
  }

  .mobile-scroll-link:nth-child(1) {
    animation-delay: 340ms;
  }

  .mobile-scroll-link:nth-child(2) {
    animation-delay: 430ms;
  }

  .mobile-scroll-link:nth-child(3) {
    animation-delay: 520ms;
  }

  .mobile-scroll-link:nth-child(4) {
    animation-delay: 610ms;
  }

  .mobile-scroll-link img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter:
      drop-shadow(0 2px 4px rgba(30, 18, 8, 0.2))
      drop-shadow(0 0 5px rgba(255, 212, 122, 0.28));
    flex: 0 0 auto;
  }

  .mobile-scroll-link span {
    font-family: var(--ui-heading-font);
    font-size: 1.08rem;
    letter-spacing: 0.03em;
  }

  .mobile-scroll-link:hover,
  .mobile-scroll-link:focus-visible {
    transform: translateY(-1px) scale(1.01);
    filter: brightness(1.03);
    box-shadow: 0 11px 18px rgba(56, 36, 18, 0.22), inset 0 0 0 1px rgba(255, 244, 215, 0.54);
  }

  .mobile-scroll-link:active {
    transform: scale(0.98);
    filter: brightness(1.08);
  }

  body.home-page.entering-location .mobile-scroll-link {
    pointer-events: none;
  }
}

@keyframes mobileScrollUnroll {
  0% {
    opacity: 0;
    transform: translateY(-10px) scaleY(0.08) scaleX(0.98);
    filter: blur(1.8px);
  }
  70% {
    opacity: 1;
    transform: translateY(0) scaleY(1.03) scaleX(1);
    filter: blur(0.18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1) scaleX(1);
    filter: blur(0);
  }
}

@keyframes mobileScrollIdle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-1.5px) rotate(0.16deg);
  }
}

@keyframes mobileScrollLinkReveal {
  0% {
    opacity: 0;
    transform: translateY(9px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mobileWelcomeFloat {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .mobile-open-scroll,
  .mobile-open-scroll__inner,
  .mobile-scroll-link,
  .mobile-open-scroll__welcome {
    animation: none !important;
  }
  .mobile-scroll-link {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Skills page cleanup: calmer, less visual noise */
.skills-page .skills-header {
  text-align: left;
  background: rgba(11, 29, 47, 0.44);
  border: 1px solid rgba(166, 205, 230, 0.2);
  box-shadow: none;
  color: #eef6ff;
  max-width: 940px;
  margin-bottom: 16px;
}

.skills-page .skills-header .quests-kicker,
.skills-page .skills-header h1 {
  text-align: center;
}

.skills-page .skills-header p {
  color: #d9eaff;
  text-shadow: none;
  line-height: 1.62;
}

.skills-page .skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  max-width: 940px;
}

.skills-page .skills-card {
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(8, 26, 44, 0.42);
  border: 1px solid rgba(166, 205, 230, 0.18);
  box-shadow: none;
  color: #e7f3ff;
  transform: none !important;
  filter: none !important;
}

.skills-page .skills-card:hover {
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.skills-page .skills-card h2 {
  margin-bottom: 8px;
  font-size: 1rem;
  color: #f4fbff;
}

.skills-page .skills-cat-icon {
  width: auto;
  height: auto;
  border: 0;
  background: none;
  box-shadow: none;
  opacity: 0.78;
}

.skills-page .skills-list {
  display: block;
  margin: 0;
  padding: 0;
}

.skills-page .skills-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #d7e9ff;
  text-shadow: none;
  line-height: 1.48;
}

.skills-page .skills-list li:last-child {
  margin-bottom: 0;
}

.skills-page .skill-mark {
  width: 6px;
  height: 6px;
  margin-top: 0.52em;
  border: 0;
  background: #9ac4e8;
}

.skills-page .skills-outro {
  margin-top: 14px;
  max-width: 940px;
  background: rgba(11, 29, 47, 0.4);
  border: 1px solid rgba(166, 205, 230, 0.18);
  box-shadow: none;
  color: #ddecff;
  text-shadow: none;
  line-height: 1.6;
}

/* Performance: skip rendering offscreen project sections until needed */
.projects-page .project-section {
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}

/* Mobile browsers handle fixed backgrounds poorly; avoid repaint jank */
@media (hover: none), (pointer: coarse) {
  .projects-page,
  .about-page,
  .skills-page,
  .contact-page {
    background-attachment: scroll;
  }
}
