/* Gravity — a full-screen generative piece. Just the background + a title that pops in and fades. */
:root { --bg: #0f1729; }
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  overflow: hidden;
  cursor: default;
  touch-action: none;              /* two fingers is a control → no pinch-zoom / pan */
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

/* the title: big, modern, high-contrast, NO glow — it must read cleanly over the animation */
.intro {
  position: fixed;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  /* light, wide-tracked, uppercase — a calm gallery-style title (no external font, no glow) */
  font-family: system-ui, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  text-indent: 0.42em;            /* compensate the trailing tracking so it stays centred */
  font-size: clamp(1.6rem, 11vw, 9rem);
  line-height: 1;
  white-space: nowrap;
  color: rgba(234, 240, 252, 0.9);
  animation: intro 4.8s cubic-bezier(.2, .7, .2, 1) forwards;
}

@keyframes intro {
  0%   { opacity: 0; transform: scale(1.06); }
  18%  { opacity: 1; transform: scale(1); }
  62%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.99); }
}

@media (prefers-reduced-motion: reduce) {
  .intro { animation: none; opacity: 0; }
}

/* centred, white, animated how-to — plays where the title was; cycles the gesture (no words on the effect) */
.hint {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f2f6ff;
  opacity: 0;
  transition: opacity .9s ease;
}
.hint.show { opacity: 1; }
.hint.hide { opacity: 0 !important; transition: opacity .4s ease; }
.demo-stage { display: flex; flex-direction: column; align-items: center; gap: 26px; animation: stageFade .6s ease; }
@keyframes stageFade { 0% { opacity: 0; transform: scale(.94); } 45% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }

/* touch: 1 then 2 white dots, each rippling */
.demo-dots { display: flex; gap: .8em; font-size: clamp(1.5rem, 7vw, 3.2rem); }
.demo-dot {
  position: relative;
  width: 1em; height: 1em;
  border-radius: 50%;
  background: #f2f6ff;
  box-shadow: 0 2px 24px rgba(20, 30, 60, .55);
  animation: demoPop .45s ease-out;
}
.demo-dot::after {
  content: "";
  position: absolute; inset: -.55em;
  border-radius: 50%;
  border: .08em solid rgba(242, 246, 255, .5);
  animation: demoRipple 1.9s ease-out infinite;
}

/* desktop: a small white cursor that presses, with a click ripple from its tip */
.demo-cursor { position: relative; display: inline-block; font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 0; }
.demo-cursor svg {
  display: block;
  filter: drop-shadow(0 3px 16px rgba(10, 18, 40, .5));
  animation: demoPress 2.4s ease-in-out infinite;
}
.demo-cursor::after {
  content: "";
  position: absolute;
  left: .17em; top: .08em;
  width: .5em; height: .5em;
  margin: -.25em 0 0 -.25em;
  border-radius: 50%;
  border: .07em solid rgba(242, 246, 255, .75);
  animation: demoClick 2.4s ease-out infinite;
}
@keyframes demoPress { 0%, 10%, 60%, 100% { transform: translate(0, 0); } 16% { transform: translate(.05em, .08em); } 24% { transform: translate(0, 0); } }
@keyframes demoClick { 0%, 12% { transform: scale(.3); opacity: 0; } 17% { opacity: .75; } 46%, 100% { transform: scale(1.7); opacity: 0; } }
.demo-cap {
  font-family: system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(.78rem, 1.9vw, 1.05rem);
  text-transform: uppercase;
  letter-spacing: .24em;
  text-indent: .24em;
  color: rgba(238, 244, 255, .9);
  min-height: 1.2em;
}
@keyframes demoRipple { 0% { transform: scale(.5); opacity: .55; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes demoPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .demo-dot::after, .demo-cursor::after { animation: none; } }

/* shared "particles freed" counter — discreet, bottom-centre */
.counter {
  position: fixed;
  left: 50%;
  /* keep clear of the mobile browser toolbar / iOS home indicator (viewport-fit=cover) */
  bottom: calc(clamp(18px, 4vh, 44px) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-family: system-ui, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  color: rgba(228, 236, 251, 0.92);
  text-shadow: 0 1px 18px rgba(10, 18, 40, 0.6);
}
.counter-num {
  font-size: clamp(1.7rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.counter-label {
  font-size: clamp(0.6rem, 1.4vw, 0.8rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: rgba(170, 190, 225, 0.75);
}
/* narrow phones: tighter, smaller — the wide tracking reads as broken at this size */
@media (max-width: 480px) {
  .counter { gap: 2px; }
  .counter-num { font-size: 1.35rem; font-weight: 400; }
  .counter-label { font-size: 0.55rem; letter-spacing: 0.22em; text-indent: 0.22em; }
}

/* negative → the war is lost: red */
.counter { transition: color .5s ease; }
.counter.neg { color: #ff5a5a; text-shadow: 0 1px 22px rgba(120, 12, 20, .6); }
.counter.neg .counter-num { color: #ff5a5a; }
.counter.neg .counter-label { color: rgba(255, 140, 140, .8); }
