/* Grimoire marketing site — matches Figma Landing Page 1639:1601 */

:root {
  --bg-top: #240b02;
  --bg-bottom: #000000;
  --brand: #f98f2e;
  --brand-deep: #f06838;
  --brand-hi: #fff1c9;
  --brand-mid: #ffc56e;
  --brand-lo: #e04e24;
  --brand-gradient: linear-gradient(
    165deg,
    var(--brand-hi) 0%,
    var(--brand-mid) 28%,
    var(--brand) 55%,
    var(--brand-deep) 82%,
    var(--brand-lo) 100%
  );
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.72);
  --glow: rgba(249, 143, 46, 0.55);
  --glow-soft: rgba(240, 104, 56, 0.35);
  --font-nav: "IBM Plex Mono", ui-monospace, monospace;
  --font-display: "Poetsen One", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --max: 720px;
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Glossy logo-matched fill for wordmarks / active nav */
.brand-shine {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(249, 143, 46, 0.35));
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 64px;
  padding: 40px 48px;
  position: relative;
  z-index: 2;
}

.nav a {
  font-family: var(--font-nav);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.0053px;
  line-height: 1;
  color: var(--text);
  transition: filter 160ms ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav a[aria-current="page"] {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(249, 143, 46, 0.45));
}

@media (max-width: 640px) {
  .nav {
    gap: 28px;
    padding: 28px 20px;
  }

  .nav a {
    font-size: 16px;
  }
}

/* —— Home hero —— */
.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 80px;
  text-align: center;
  position: relative;
}

.logo-stage {
  position: relative;
  width: min(300px, 70vw);
  height: min(300px, 70vw);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.logo-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(249, 143, 46, 0.45) 0%,
    rgba(240, 104, 56, 0.2) 40%,
    transparent 70%
  );
  filter: blur(18px);
  animation: pulse-glow 3.2s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.logo-bounce {
  position: relative;
  z-index: 1;
  width: 84%;
  height: auto;
  animation: gentle-bounce 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 18px var(--glow))
    drop-shadow(0 0 48px var(--glow-soft))
    drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
  will-change: transform;
  transition: filter 200ms ease;
}

/* —— Hover sparkles —— */
.sparkles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  background: var(--brand-hi);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  filter: drop-shadow(0 0 6px var(--brand-mid));
  transform: scale(0.2) rotate(0deg);
  transition: opacity 120ms ease;
}

.sparkle:nth-child(1) {
  top: 12%;
  left: 22%;
}
.sparkle:nth-child(2) {
  top: 8%;
  right: 18%;
  width: 14px;
  height: 14px;
}
.sparkle:nth-child(3) {
  top: 38%;
  left: 6%;
  width: 8px;
  height: 8px;
}
.sparkle:nth-child(4) {
  top: 42%;
  right: 4%;
}
.sparkle:nth-child(5) {
  bottom: 22%;
  left: 16%;
  width: 12px;
  height: 12px;
}
.sparkle:nth-child(6) {
  bottom: 18%;
  right: 14%;
}
.sparkle:nth-child(7) {
  top: 28%;
  left: 48%;
  width: 7px;
  height: 7px;
}
.sparkle:nth-child(8) {
  bottom: 32%;
  left: 58%;
  width: 9px;
  height: 9px;
}

.logo-stage:hover .sparkle,
.logo-stage:focus-within .sparkle {
  animation: sparkle-pop 900ms ease-in-out infinite;
}

.logo-stage:hover .sparkle:nth-child(1),
.logo-stage:focus-within .sparkle:nth-child(1) {
  animation-delay: 0ms;
}
.logo-stage:hover .sparkle:nth-child(2),
.logo-stage:focus-within .sparkle:nth-child(2) {
  animation-delay: 80ms;
}
.logo-stage:hover .sparkle:nth-child(3),
.logo-stage:focus-within .sparkle:nth-child(3) {
  animation-delay: 160ms;
}
.logo-stage:hover .sparkle:nth-child(4),
.logo-stage:focus-within .sparkle:nth-child(4) {
  animation-delay: 240ms;
}
.logo-stage:hover .sparkle:nth-child(5),
.logo-stage:focus-within .sparkle:nth-child(5) {
  animation-delay: 120ms;
}
.logo-stage:hover .sparkle:nth-child(6),
.logo-stage:focus-within .sparkle:nth-child(6) {
  animation-delay: 200ms;
}
.logo-stage:hover .sparkle:nth-child(7),
.logo-stage:focus-within .sparkle:nth-child(7) {
  animation-delay: 40ms;
}
.logo-stage:hover .sparkle:nth-child(8),
.logo-stage:focus-within .sparkle:nth-child(8) {
  animation-delay: 280ms;
}

.logo-stage:hover .logo-glow,
.logo-stage:focus-within .logo-glow {
  opacity: 1;
  transform: scale(1.12);
  background: radial-gradient(
    circle,
    rgba(255, 241, 201, 0.55) 0%,
    rgba(249, 143, 46, 0.4) 35%,
    rgba(240, 104, 56, 0.15) 55%,
    transparent 72%
  );
}

.logo-stage:hover .logo-bounce,
.logo-stage:focus-within .logo-bounce {
  filter: drop-shadow(0 0 22px rgba(255, 241, 201, 0.7))
    drop-shadow(0 0 40px var(--glow))
    drop-shadow(0 0 70px var(--glow-soft))
    drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.wordmark {
  margin: 28px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.25;
  font-weight: 400;
}

@keyframes gentle-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes sparkle-pop {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.15) rotate(0deg);
  }
  35% {
    opacity: 1;
    transform: scale(1.15) rotate(25deg);
  }
  65% {
    opacity: 0.85;
    transform: scale(0.9) rotate(55deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-bounce,
  .logo-glow,
  .logo-stage:hover .sparkle,
  .logo-stage:focus-within .sparkle {
    animation: none;
  }

  .logo-stage:hover .sparkle,
  .logo-stage:focus-within .sparkle {
    opacity: 0.9;
    transform: scale(1);
  }
}

/* —— Inner pages —— */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 24px 96px;
}

.page h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 400;
  margin: 0 0 16px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(249, 143, 46, 0.35));
}

.page h2 {
  font-family: var(--font-nav);
  font-size: 18px;
  font-weight: 500;
  margin: 32px 0 12px;
  color: var(--text);
}

.page p,
.page li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.page ul {
  padding-left: 1.2em;
  margin: 0 0 16px;
}

.page a.inline {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--brand);
}

.meta {
  font-family: var(--font-nav);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.cta {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 241, 201, 0.35);
  background: var(--brand-gradient);
  color: #1a0802 !important;
  -webkit-text-fill-color: #1a0802;
  font-family: var(--font-nav);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 0 24px rgba(249, 143, 46, 0.4),
    0 0 48px rgba(240, 104, 56, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.cta:hover,
.cta:focus-visible {
  filter: brightness(1.06);
  color: #1a0802 !important;
  -webkit-text-fill-color: #1a0802;
  box-shadow: 0 0 32px rgba(255, 197, 110, 0.55),
    0 0 64px rgba(249, 143, 46, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: center;
  padding: 32px 24px 48px;
  font-family: var(--font-nav);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-muted);
  transition: filter 160ms ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(249, 143, 46, 0.4));
}
