:root {
  color-scheme: dark;
  --ink: #050608;
  --ash: #121217;
  --orange: #ff5e00;
  --amber: #ffb000;
  --cream: #fff8ef;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--ink); }

body { font-family: Arial, Helvetica, sans-serif; color: white; }

.demo-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 42px);
  background: radial-gradient(circle at 70% 12%, #1e1110 0, #08090c 42%, #030406 100%);
}

.krakatoa-volcano {
  position: relative;
  isolation: isolate;
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: clamp(22px, 3vw, 42px);
  background:
    radial-gradient(circle at 70% 35%, rgba(255,87,0,.18), transparent 26%),
    linear-gradient(145deg, #09090c 0%, #100807 58%, #050508 100%);
  box-shadow: 0 40px 100px rgba(0,0,0,.55), inset 0 0 100px rgba(0,0,0,.4);
}

.volcano-particles, .volcano-sky, .volcano-landscape, .volcano-vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.volcano-particles { z-index: 4; }
.volcano-sky { z-index: 1; }
.volcano-landscape { z-index: 2; }
.volcano-vignette { z-index: 5; pointer-events: none; }

.eruption-flash {
  position: absolute;
  left: 68%; top: 38%;
  width: 22%; aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: #ff7a00;
  filter: blur(42px);
  opacity: .3;
  animation: pulse 2.4s ease-in-out infinite;
}

.ash-cloud {
  position: absolute;
  left: 68%; top: 34%;
  width: 150px; height: 90px;
  translate: -50% -50%;
  border-radius: 50%;
  background: rgba(50,43,42,.92);
  filter: blur(10px);
  box-shadow: -70px 15px 35px #272327, 65px 12px 30px #3b3030, 5px -55px 38px #221f24;
  opacity: .78;
  animation: ash-rise 7s ease-in-out infinite;
}

.ash-cloud--two { scale: .72; animation-delay: -2.4s; }
.ash-cloud--three { scale: .52; animation-delay: -4.8s; }

.volcano-mountain {
  position: absolute;
  left: 68%; bottom: 0;
  width: 66%; height: 54%;
  translate: -50% 0;
  filter: drop-shadow(0 -20px 45px rgba(255,68,0,.08));
}

.mountain-face { position: absolute; bottom: 0; width: 54%; height: 100%; }
.mountain-face--left {
  left: 0;
  clip-path: polygon(0 100%, 83% 0, 100% 8%, 100% 100%);
  background: linear-gradient(110deg, #09090a 10%, #242026 72%, #120f12);
}
.mountain-face--right {
  right: 0;
  clip-path: polygon(0 8%, 17% 0, 100% 100%, 0 100%);
  background: linear-gradient(245deg, #070709 15%, #191419 66%, #302226);
}

.crater {
  position: absolute;
  left: 50%; top: -3%;
  width: 20%; height: 7%;
  translate: -50% 0;
  border-radius: 50%;
  background: #ff7900;
  box-shadow: 0 0 12px #fff1a3, 0 0 36px #ff4d00, 0 -18px 55px #ff5e00;
  animation: crater 1.4s ease-in-out infinite alternate;
}

.lava-flow {
  position: absolute;
  top: 4%;
  width: 2.1%;
  transform-origin: top;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff3500, #ffd151 48%, #ff4700);
  box-shadow: 0 0 12px #ff4d00;
  animation: lava 2.2s ease-in-out infinite alternate;
}
.lava-flow--left { left: 43%; height: 58%; rotate: 11deg; }
.lava-flow--centre { left: 49%; height: 82%; width: 2.8%; animation-delay: -.8s; }
.lava-flow--right { left: 55%; height: 48%; rotate: -13deg; animation-delay: -1.4s; }

.ground-glow {
  position: absolute;
  left: 68%; bottom: -12%;
  width: 72%; height: 32%;
  translate: -50% 0;
  border-radius: 50%;
  background: rgba(255,70,0,.34);
  filter: blur(55px);
}

.foreground { position: absolute; bottom: -2px; width: 46%; height: 18%; background: #030305; }
.foreground--left { left: -4%; clip-path: polygon(0 37%, 18% 17%, 42% 48%, 64% 19%, 100% 68%, 100% 100%, 0 100%); }
.foreground--right { right: -3%; clip-path: polygon(0 67%, 27% 31%, 48% 54%, 72% 14%, 100% 38%, 100% 100%, 0 100%); }

.volcano-vignette {
  background: linear-gradient(90deg, rgba(2,3,5,.94) 0%, rgba(2,3,5,.62) 35%, transparent 65%), radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.55) 100%);
}

.volcano-copy {
  position: relative;
  z-index: 6;
  width: min(620px, 62%);
  padding: clamp(36px, 7vw, 92px);
}

.volcano-kicker {
  display: inline-block;
  margin-bottom: 28px;
  padding: 9px 18px;
  border: 1px solid rgba(255,94,0,.55);
  border-radius: 999px;
  color: #ffc08f;
  background: rgba(255,94,0,.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(52px, 7.4vw, 98px);
  line-height: .87;
  letter-spacing: -.065em;
  text-transform: uppercase;
}

h1 em { color: var(--orange); font-style: normal; text-shadow: 0 0 30px rgba(255,94,0,.36); }
.volcano-copy p { max-width: 500px; margin: 30px 0; color: rgba(255,255,255,.72); font-size: clamp(16px, 1.6vw, 21px); line-height: 1.5; }

.volcano-cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 15px 22px;
  border-radius: 10px;
  color: #111;
  background: var(--orange);
  font-weight: 800;
  text-decoration: none;
  transition: translate .2s ease, box-shadow .2s ease, background .2s ease;
}
.volcano-cta:hover { translate: 0 -2px; background: #ff7a22; box-shadow: 0 12px 30px rgba(255,94,0,.3); }
.volcano-cta:focus-visible, .motion-toggle:focus-visible { outline: 3px solid white; outline-offset: 4px; }

.motion-toggle {
  position: absolute;
  z-index: 7;
  right: 24px; bottom: 24px;
  width: 46px; height: 46px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  color: white;
  background: rgba(4,4,6,.66);
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.motion-toggle__play { display: none; }
.is-paused .motion-toggle__pause { display: none; }
.is-paused .motion-toggle__play { display: inline; }
.is-paused *, .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }

@keyframes pulse { 50% { scale: 1.28; opacity: .52; } }
@keyframes crater { to { scale: 1.09 .82; filter: brightness(1.5); } }
@keyframes lava { to { scale: 1.15 1; filter: brightness(1.3); } }
@keyframes ash-rise {
  0% { translate: -50% 8%; scale: .28; opacity: 0; }
  22% { opacity: .72; }
  100% { translate: -50% -190%; scale: 1.5; opacity: 0; }
}

@media (max-width: 720px) {
  .krakatoa-volcano { min-height: 760px; }
  .volcano-copy { width: 100%; padding: 38px 28px; }
  h1 { font-size: clamp(48px, 15vw, 76px); }
  .volcano-vignette { background: linear-gradient(180deg, rgba(2,3,5,.88) 0%, rgba(2,3,5,.35) 58%, rgba(2,3,5,.22) 100%), radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.55)); }
  .volcano-mountain { left: 58%; width: 120%; height: 46%; }
  .eruption-flash, .ash-cloud { left: 58%; top: 59%; }
}

@media (prefers-reduced-motion: reduce) {
  .krakatoa-volcano *, .krakatoa-volcano *::before, .krakatoa-volcano *::after { animation: none !important; }
  .motion-toggle { display: none; }
}
