/* ---------- Theme tokens ---------- */

:root {
  --bg: #f3f6fb;
  --bg-2: #e6edf9;
  --text: #0e1a2b;
  --muted: #5b6b86;
  --accent: #3a6df0;
  --accent-2: #7f9cf0;
  --logo-from: #14223a;
  --logo-to: #3a5bc7;
  --blob-1: rgba(122, 156, 240, 0.45);
  --blob-2: rgba(160, 190, 255, 0.40);
  --blob-3: rgba(186, 170, 255, 0.28);
  --shadow: rgba(40, 70, 160, 0.28);
  --button-bg: rgba(255, 255, 255, 0.6);
  --button-border: rgba(30, 60, 140, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b111c;
    --bg-2: #101a2c;
    --text: #e6edf8;
    --muted: #8d9cb8;
    --accent: #7aa2ff;
    --accent-2: #9db6ff;
    --logo-from: #f2f6ff;
    --logo-to: #8fadff;
    --blob-1: rgba(70, 110, 230, 0.30);
    --blob-2: rgba(60, 130, 255, 0.18);
    --blob-3: rgba(120, 100, 255, 0.18);
    --shadow: rgba(0, 0, 0, 0.55);
    --button-bg: rgba(20, 30, 50, 0.6);
    --button-border: rgba(160, 190, 255, 0.14);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b111c;
  --bg-2: #101a2c;
  --text: #e6edf8;
  --muted: #8d9cb8;
  --accent: #7aa2ff;
  --accent-2: #9db6ff;
  --logo-from: #f2f6ff;
  --logo-to: #8fadff;
  --blob-1: rgba(70, 110, 230, 0.30);
  --blob-2: rgba(60, 130, 255, 0.18);
  --blob-3: rgba(120, 100, 255, 0.18);
  --shadow: rgba(0, 0, 0, 0.55);
  --button-bg: rgba(20, 30, 50, 0.6);
  --button-border: rgba(160, 190, 255, 0.14);
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-2), var(--bg) 70%) fixed, var(--bg);
  color: var(--text);
  font-family: "Quicksand", "Nunito", ui-rounded, system-ui, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ---------- Background glow ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  animation: drift 22s ease-in-out infinite alternate;
}

.blob-1 {
  width: 55vmax;
  height: 55vmax;
  top: -18vmax;
  left: -14vmax;
  background: var(--blob-1);
}

.blob-2 {
  width: 45vmax;
  height: 45vmax;
  bottom: -20vmax;
  right: -12vmax;
  background: var(--blob-2);
  animation-duration: 28s;
  animation-direction: alternate-reverse;
}

.blob-3 {
  width: 30vmax;
  height: 30vmax;
  top: 40%;
  left: 55%;
  background: var(--blob-3);
  animation-duration: 34s;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); }
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 10;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--button-border);
  border-radius: 50%;
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, background-color 0.4s ease;
}

.theme-toggle:hover {
  transform: scale(1.06);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

/* Light: show the moon (switch to dark). Dark: show the sun. */
.icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.icon-moon { opacity: 1; transform: none; }

:root[data-theme="dark"] .icon-sun  { opacity: 1; transform: none; }
:root[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
}

/* ---------- Layout ---------- */

.stage {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(72px, 12vh, 120px) 20px clamp(16px, 4vh, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 3vh, 32px);
  text-align: center;
}

.intro {
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ---------- Logo ---------- */

.logo {
  margin: 0;
  /* Comfortaa: stem runs tangent into a circular bowl, like the favicon "b" */
  font-family: "Comfortaa", "Quicksand", ui-rounded, system-ui, sans-serif;
  font-size: clamp(3.5rem, 22vw, 10rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: var(--logo-from);
  background: linear-gradient(135deg, var(--logo-from) 30%, var(--logo-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* background-clip: text only paints inside the padding box, so leave room
     for the "g" descender and pull the tagline back up to compensate. */
  padding: 0.04em 0.04em 0.24em;
  margin-bottom: -0.14em;
}

/* ---------- Coming soon ---------- */

.soon {
  margin: clamp(4px, 1.2vh, 12px) 0 0;
  font-size: clamp(1.15rem, 3.6vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  animation: rise 0.9s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dots {
  display: inline-flex;
  width: 1.2em;
  justify-content: flex-start;
}

.dots span {
  display: inline-block;
  animation: dot 1.4s ease-in-out infinite;
}

.dots span:nth-child(2) { animation-delay: 0.18s; }
.dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dot {
  0%, 60%, 100% { opacity: 1;    transform: translateY(0); }
  30%           { opacity: 0.35; transform: translateY(-0.22em); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  margin: 0;
  width: min(520px, 82vw, 52svh);
  animation: rise 1s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero picture {
  display: block;
  position: relative;
  z-index: 1;
  animation: float 6s ease-in-out infinite;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 24px 40px rgba(58, 109, 240, 0.18));
}

.hero-shadow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 4%;
  height: 7%;
  border-radius: 50%;
  background: var(--shadow);
  filter: blur(14px);
  animation: shadow 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@keyframes shadow {
  0%, 100% { transform: scaleX(1);    opacity: 1; }
  50%      { transform: scaleX(0.88); opacity: 0.7; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Footer ---------- */

.footer {
  padding: 16px 20px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  animation: rise 0.9s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ---------- Wide landscape: two columns ---------- */

@media (min-width: 960px) and (orientation: landscape) {
  .stage {
    flex-direction: row;
    justify-content: space-between;
    gap: 48px;
    padding-left: 48px;
    padding-right: 48px;
    text-align: left;
  }

  .intro {
    --logo-size: clamp(5.5rem, 9vw, 9rem);
  }

  .logo {
    font-size: var(--logo-size);
  }

  /* Line up the ink of "c" with the stem of "b": logo padding (0.04em) plus
     the "b" side bearing (~0.09em), minus the "c" side bearing (~0.045em). */
  .soon {
    padding-left: calc(var(--logo-size) * 0.13 - 0.045em);
  }

  .hero {
    width: min(540px, 42vw, 72svh);
    flex-shrink: 0;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .dots span {
    opacity: 1;
  }
}
