/* KloudKIT — landing page. Palette: Catppuccin Frappé. */

:root {
  /* Frappé */
  --crust: #232634;
  --mantle: #292c3f;
  --base: #303446;
  --surface0: #414559;
  --surface1: #51576d;
  --surface2: #626880;
  --overlay0: #737994;
  --overlay1: #838ba7;
  --overlay2: #949cbb;
  --subtext0: #a5adce;
  --subtext1: #b5bfe2;
  --text: #c6d0f5;

  --rosewater: #f2d5cf;
  --flamingo: #eebebe;
  --pink: #f4b8e4;
  --mauve: #ca9ee6;
  --red: #e78284;
  --maroon: #ea999c;
  --peach: #ef9f76;
  --yellow: #e5c890;
  --green: #a6d189;
  --teal: #81c8be;
  --sky: #99d1db;
  --sapphire: #85c1dc;
  --blue: #8caaee;
  --lavender: #babbf1;

  --font-sans: "Fira Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: min(680px, 100% - 2.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  /* Flat, full-screen, no scroll. */
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);

  background-color: var(--base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Backdrop ─────────────────────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: var(--base);
}

/* Soft colour blooms, slowly kneading. */
.backdrop__bloom {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(38% 42% at 14% 20%, rgba(202, 158, 230, 0.3), transparent 70%),
    radial-gradient(34% 38% at 86% 16%, rgba(140, 170, 238, 0.28), transparent 70%),
    radial-gradient(40% 40% at 88% 84%, rgba(129, 200, 190, 0.26), transparent 70%),
    radial-gradient(34% 36% at 12% 86%, rgba(239, 159, 118, 0.22), transparent 70%),
    radial-gradient(30% 30% at 62% 92%, rgba(244, 184, 228, 0.18), transparent 70%),
    radial-gradient(26% 26% at 40% 6%, rgba(229, 200, 144, 0.16), transparent 70%);
  filter: blur(44px);
  animation: bloom 22s ease-in-out infinite alternate;
}

@keyframes bloom {
  0% {
    transform: scale(1) rotate(0deg) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(1.12) rotate(4deg) translate3d(-2%, 2%, 0);
  }
  100% {
    transform: scale(1.06) rotate(-3deg) translate3d(2.5%, -1.5%, 0);
  }
}

/* Fine dot lattice, panning. */
.backdrop::before {
  content: "";
  position: absolute;
  inset: -10%;
  background-image: radial-gradient(circle, rgba(198, 208, 245, 0.14) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(78% 62% at 50% 45%, #000 18%, transparent 76%);
  mask-image: radial-gradient(78% 62% at 50% 45%, #000 18%, transparent 76%);
  opacity: 0.5;
  animation: lattice 34s linear infinite;
}

@keyframes lattice {
  to {
    background-position: 340px -340px;
  }
}

/* Sink the corners toward crust so the blooms read as glow, not wash. */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(115% 100% at 50% 48%, transparent 22%, rgba(35, 38, 52, 0.96) 92%);
}

.backdrop__shapes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.backdrop__shapes path,
.backdrop__shapes rect,
.backdrop__shapes ellipse,
.backdrop__shapes circle {
  vector-effect: non-scaling-stroke;
}

/* Flowing current. Every line shifts by exactly one 360px period, so any
   duration loops seamlessly; varying the durations keeps them from locking
   into step with each other. */
.flow {
  animation: flow 18s linear infinite;
  will-change: transform;
}

.flow--2 {
  animation-duration: 14s;
  animation-direction: reverse;
}

.flow--3 {
  animation-duration: 26s;
}

.flow--4 {
  animation-duration: 17s;
  animation-direction: reverse;
}

.flow--5 {
  animation-duration: 22s;
}

.flow--6 {
  animation-duration: 13s;
  animation-direction: reverse;
}

.flow--7 {
  animation-duration: 28s;
}

@keyframes flow {
  to {
    transform: translate3d(360px, 0, 0);
  }
}

/* Each shape wanders on its own clock, so the field never repeats. */
.float {
  transform-box: view-box;
  transform-origin: center;
  animation: float 15s ease-in-out infinite alternate;
  will-change: transform;
}

.float--b {
  animation-duration: 19s;
  animation-delay: -12s;
}

.float--c {
  animation-duration: 12s;
  animation-delay: -7s;
}

.float--d {
  animation-duration: 21s;
  animation-delay: -20s;
}

.float--e {
  animation-duration: 16s;
  animation-delay: -3s;
}

.float--f {
  animation-duration: 18s;
  animation-delay: -16s;
}

.float--g {
  animation-duration: 11s;
  animation-delay: -9s;
}

.float--h {
  animation-duration: 20s;
  animation-delay: -25s;
}

@keyframes float {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(6%, -8%, 0) rotate(7deg);
  }
  100% {
    transform: translate3d(-5%, 6.5%, 0) rotate(-6deg);
  }
}

/* Streaks travel across, then fade out and start over. */
.streak {
  opacity: 0;
  animation: streak 14s linear infinite;
}

.streak--2 {
  animation-duration: 19s;
  animation-delay: -6s;
}

.streak--3 {
  animation-duration: 24s;
  animation-delay: -13s;
}

@keyframes streak {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  12% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(1360px, -370px, 0);
  }
}

/* ── Stage ────────────────────────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 1;
  width: var(--shell);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0;
}

/* Logo medallion with a colour halo behind it. */
.medallion {
  position: relative;
  display: grid;
  place-items: center;
}

.medallion::before {
  content: "";
  position: absolute;
  width: 260%;
  height: 260%;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    rgba(202, 158, 230, 0.85),
    rgba(140, 170, 238, 0.8),
    rgba(129, 200, 190, 0.7),
    rgba(244, 184, 228, 0.8),
    rgba(202, 158, 230, 0.85)
  );
  /* Screen keeps the hues luminous instead of muddying into grey. */
  mix-blend-mode: screen;
  filter: blur(34px);
  opacity: 0.5;
  animation: halo 14s linear infinite;
}

@keyframes halo {
  to {
    transform: rotate(360deg);
  }
}

.mark {
  position: relative;
  width: clamp(87px, 15vmin, 124px);
  height: auto;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(198, 208, 245, 0.18),
    0 18px 45px -12px rgba(35, 38, 52, 0.9);
}

.wordmark {
  margin: clamp(1.4rem, 4vmin, 2.2rem) 0 0;
  font-size: clamp(2.6rem, 8.5vmin, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
}

.wordmark span {
  font-weight: 300;
  letter-spacing: 0.005em;
  color: var(--lavender);
}

.tagline {
  margin: clamp(0.7rem, 2.2vmin, 1.1rem) 0 0;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.3vmin, 1.05rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(100deg, var(--lavender), var(--sky) 45%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blurb {
  margin: clamp(0.9rem, 2.6vmin, 1.35rem) 0 0;
  max-width: 46ch;
  font-size: clamp(0.94rem, 2.2vmin, 1.05rem);
  color: var(--overlay2);
  text-wrap: balance;
}

/* ── Links ────────────────────────────────────────────────────────────── */

.links {
  margin-top: clamp(1.7rem, 5vmin, 2.6rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
}

.btn--primary {
  background-image: linear-gradient(135deg, var(--lavender), var(--pink));
  color: var(--crust);
  box-shadow: 0 12px 30px -14px rgba(186, 187, 241, 0.9);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -14px rgba(244, 184, 228, 0.95);
}

.btn--ghost {
  border-color: var(--surface1);
  background-color: rgba(65, 69, 89, 0.4);
  color: var(--subtext1);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--teal);
  background-color: rgba(81, 87, 109, 0.55);
  color: var(--text);
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer {
  position: fixed;
  z-index: 1;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--surface2);
}

/* Short viewports: drop the footer rather than let the stage overflow. */
@media (max-height: 560px) {
  .footer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .float,
  .flow,
  .streak,
  .backdrop::before,
  .backdrop__bloom,
  .medallion::before {
    animation: none;
  }

  .streak {
    opacity: 0.9;
  }

  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}
