:root {
  color-scheme: dark;
  --background: #061124;
  --background-2: #0a1d3f;
  --ink: #f8fafc;
  --muted: #c7d2fe;
  --soft: rgba(255, 255, 255, 0.72);
  --card: rgba(8, 22, 52, 0.72);
  --card-light: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.16);
  --primary: #7dd3fc;
  --accent: #facc15;
  --accent-2: #38bdf8;
  --success: #34d399;
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.28), transparent 26rem),
    radial-gradient(circle at 90% 10%, rgba(250, 204, 21, 0.18), transparent 24rem),
    radial-gradient(circle at 75% 82%, rgba(99, 102, 241, 0.22), transparent 30rem),
    linear-gradient(135deg, var(--background) 0%, var(--background-2) 52%, #081126 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body::after {
  content: "π  x²  √  ∑  θ  ≈  ÷  %";
  position: fixed;
  left: 50%;
  top: 50%;
  width: 120vw;
  transform: translate(-50%, -50%) rotate(-13deg);
  color: rgba(255, 255, 255, 0.035);
  font-size: clamp(4rem, 13vw, 13rem);
  font-weight: 900;
  letter-spacing: 0.13em;
  white-space: nowrap;
  pointer-events: none;
}

.background-grid,
.orb {
  position: fixed;
  pointer-events: none;
}

.orb {
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.34;
  animation: float 12s ease-in-out infinite;
}

.orb-one {
  right: -8rem;
  top: 4rem;
  background: #38bdf8;
}

.orb-two {
  left: -10rem;
  bottom: -6rem;
  background: #facc15;
  animation-delay: -5s;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
}

.hero {
  width: min(1180px, 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.035em;
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.42rem);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  color: #082f49;
  background: linear-gradient(135deg, var(--accent), #fef08a 48%, var(--primary));
  box-shadow: 0 16px 40px rgba(56, 189, 248, 0.24);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  font-size: 0.9rem;
  font-weight: 800;
}

.hero-layout {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.75fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 38px;
  padding: clamp(30px, 6vw, 76px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-layout::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 37px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.hero-copy,
.math-card,
.feature-grid,
footer {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: #fef3c7;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.14);
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7.65rem);
  line-height: 0.88;
  letter-spacing: -0.085em;
}

.intro {
  max-width: 690px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1vw + 0.92rem, 1.38rem);
  line-height: 1.68;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: #082f49;
  background: linear-gradient(135deg, var(--accent), #fde68a);
  box-shadow: 0 18px 44px rgba(250, 204, 21, 0.22);
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.status-panel {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  margin-top: 26px;
  padding: 14px 18px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 18px;
  color: #dff7ff;
  background: rgba(14, 116, 144, 0.22);
  font-weight: 800;
}

.pulse {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 rgba(52, 211, 153, 0.54);
  animation: pulse 1.8s infinite;
}

.math-card {
  min-height: 470px;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 24px;
  background:
    radial-gradient(circle at 70% 16%, rgba(250, 204, 21, 0.18), transparent 10rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 28px 72px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.card-glow {
  position: absolute;
  inset: auto -30% -28% 5%;
  height: 55%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.5), rgba(250, 204, 21, 0.42));
  filter: blur(34px);
  opacity: 0.76;
}

.mini-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.mini-toolbar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.equation-display {
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.44);
}

.equation-display span {
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 900;
}

.equation-display strong {
  color: var(--accent);
  font-size: clamp(1.8rem, 4vw, 3.55rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.graph {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 14%;
  height: 46%;
  border-left: 2px solid rgba(255, 255, 255, 0.34);
  border-bottom: 2px solid rgba(255, 255, 255, 0.34);
}

.axis::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(255, 255, 255, 0.5);
  border-right: 2px solid rgba(255, 255, 255, 0.5);
}

.x-axis::after {
  right: -2px;
  bottom: -5px;
  transform: rotate(45deg);
}

.y-axis::after {
  left: -5px;
  top: -2px;
  transform: rotate(-45deg);
}

.curve {
  position: absolute;
  left: 7%;
  bottom: 12%;
  width: 84%;
  height: 66%;
  border: 0 solid transparent;
  border-top: 5px solid var(--accent);
  border-radius: 48% 52% 0 0;
  transform: rotate(-8deg);
  filter: drop-shadow(0 10px 20px rgba(250, 204, 21, 0.24));
}

.plot-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 3px solid #082f49;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 7px rgba(125, 211, 252, 0.16);
}

.dot-one { left: 17%; bottom: 31%; }
.dot-two { left: 48%; bottom: 61%; }
.dot-three { right: 13%; bottom: 38%; }

.formula-cloud span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.35rem;
  font-weight: 900;
  backdrop-filter: blur(16px);
  animation: bob 5s ease-in-out infinite;
}

.formula-cloud span:nth-child(1) { right: 14%; top: 21%; }
.formula-cloud span:nth-child(2) { right: 8%; top: 47%; animation-delay: -1.2s; }
.formula-cloud span:nth-child(3) { left: 10%; top: 47%; animation-delay: -2.4s; }
.formula-cloud span:nth-child(4) { left: 42%; bottom: 8%; animation-delay: -3.1s; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.feature-grid article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(18px);
  transition: transform 180ms ease, background 180ms ease;
}

.feature-grid article:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.105);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 14px;
  color: #082f49;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-size: 0.86rem;
  font-weight: 1000;
}

.feature-grid h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.56;
}

footer {
  margin-top: 24px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.95rem;
  text-align: center;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -24px, 0) scale(1.06); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

@media (max-width: 920px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .math-card {
    min-height: 360px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page-shell {
    place-items: start center;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-layout {
    border-radius: 28px;
    padding: 26px;
  }

  .hero-layout::before {
    border-radius: 27px;
  }

  h1 {
    font-size: clamp(3rem, 18vw, 5.25rem);
  }

  .button {
    width: 100%;
  }

  .status-panel {
    align-items: flex-start;
  }

  .math-card {
    min-height: 310px;
    border-radius: 26px;
  }

  .equation-display strong {
    font-size: 2.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
