:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --header-bg: rgba(247, 246, 242, 0.78);
  --ink: #16202a;
  --ink-soft: #4d5560;
  --muted: #6c737c;
  --faint: #979da5;
  --line: #e1ded6;
  --line-soft: #ebe8e1;
  --accent: #3555e8;
  --accent-strong: #2743cc;
  --accent-2: #6f56e8;
  --accent-tint: rgba(53, 85, 232, 0.09);
  --grid: rgba(22, 32, 42, 0.05);
  --dot: rgba(22, 32, 42, 0.07);
  --glow: rgba(111, 86, 232, 0.16);
  --watermark: 0.05;
  --shadow-soft: 0 1px 2px rgba(20, 25, 32, 0.04),
    0 10px 26px -14px rgba(20, 25, 32, 0.14);
  --shadow-card: 0 1px 2px rgba(20, 25, 32, 0.05),
    0 28px 60px -22px rgba(20, 25, 32, 0.3);
  --shadow-accent: 0 1px 2px rgba(24, 40, 120, 0.24),
    0 12px 26px -12px rgba(53, 85, 232, 0.55);

  color: var(--ink);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #12161c;
    --header-bg: rgba(14, 17, 22, 0.76);
    --ink: #eef1f5;
    --ink-soft: #b4bcc7;
    --muted: #98a1ac;
    --faint: #767f8b;
    --line: #262c35;
    --line-soft: #21262e;
    --accent: #8397ff;
    --accent-strong: #9dabff;
    --accent-2: #9b86ff;
    --accent-tint: rgba(131, 151, 255, 0.14);
    --grid: rgba(198, 214, 255, 0.045);
    --dot: rgba(198, 214, 255, 0.07);
    --glow: rgba(111, 86, 232, 0.24);
    --watermark: 0.03;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5),
      0 30px 60px -24px rgba(0, 0, 0, 0.8);
    --shadow-accent: 0 10px 24px -12px rgba(90, 110, 255, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

/* Soft graph-paper grid and a single accent bloom behind the page. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

body::before {
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(115% 65% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(115% 65% at 50% 0%, #000 0%, transparent 78%);
}

body::after {
  top: -320px;
  right: -200px;
  width: 780px;
  height: 780px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--glow) 0%, transparent 62%);
}

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

a:focus-visible,
.symbol-grid li:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell,
.home,
.legal-page {
  width: min(100% - 40px, 1080px);
  margin: 0 auto;
    padding-bottom: 20px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line-soft);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  box-shadow: var(--shadow-accent);
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.04);
}

.top-nav,
.footer-links {
  display: flex;
  gap: 26px;
  align-items: center;
}

.top-nav a,
.footer-links a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.18s ease;
}

.top-nav a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.top-nav a:hover,
.footer-links a:hover,
.text-link:hover {
  color: var(--accent);
}

.top-nav a:hover::after {
  transform: scaleX(1);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(48px, 7vw, 88px);
  align-items: center;
  padding: clamp(60px, 8vw, 96px) 0 clamp(64px, 8vw, 96px);
}

.eyebrow {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 22px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(44px, 5.6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.042em;
  line-height: 1.02;
}

h1 .accent {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.lede {
  max-width: 46ch;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.68;
}

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

.button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.button-primary {
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 130%);
  box-shadow: var(--shadow-accent);
  color: #fff;
}

.button-primary:hover {
  box-shadow: var(--shadow-accent), 0 0 0 4px var(--accent-tint);
  transform: translateY(-1px);
}

.button-disabled {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
}

.button-disabled::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

.text-link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
}

.text-link span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  color: var(--faint);
  font-size: 13px;
}

.hero-meta li {
  display: flex;
  gap: 18px;
  align-items: center;
}

.hero-meta li + li::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

/* Equation card */

.hero-visual {
  position: relative;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% -6% -12%;
  z-index: -1;
  border-radius: 40px;
  background: radial-gradient(
    60% 60% at 50% 50%,
    var(--glow) 0%,
    transparent 70%
  );
}

.equation-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(var(--surface), var(--surface-2));
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.window-dots i:first-child {
  background: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.latex-input {
  padding: 26px 28px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.latex-input > span {
  display: block;
  margin-bottom: 14px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.latex-input code {
  color: var(--accent);
  font-family: "SFMono-Regular", ui-monospace, Consolas, monospace;
  font-size: 15px;
  line-height: 1.5;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  border-radius: 1px;
  background: var(--accent);
  vertical-align: -0.18em;
  animation: blink 1.15s steps(2, jump-none) infinite;
}

.equation-output {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 186px;
  padding: 34px 28px;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 16px 16px;
}

.equation-image {
  width: min(72%, 292px);
  height: auto;
}

@media (prefers-color-scheme: light) {
  /* The export is dark ink on transparency; flip it for the dark canvas. */
  .equation-image {
    filter: invert(1) hue-rotate(180deg);
  }
}

.card-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 13px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--faint);
  font-size: 11px;
}

.card-foot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34b27b;
  box-shadow: 0 0 0 3px rgba(52, 178, 123, 0.18);
}

/* Sections */

.section-head {
  max-width: 46ch;
  margin-bottom: 30px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: "SFMono-Regular", ui-monospace, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}

/* Features */

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

.features article {
  padding: 26px 26px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.features article:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.features article > span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-tint);
  color: var(--accent);
  font-family: "SFMono-Regular", ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
}

.features h2 {
  margin: 20px 0 7px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Symbol palette */

.symbols {
  padding: clamp(72px, 9vw, 104px) 0 0;
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.symbol-grid li {
  padding: 18px 8px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.symbol-grid li:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.symbol-grid b {
  display: block;
  margin-bottom: 9px;
  font-family: ui-serif, "New York", Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  transition: color 0.2s ease;
}

.symbol-grid li:hover b {
  color: var(--accent);
}

.symbol-grid code {
  color: var(--faint);
  font-family: "SFMono-Regular", ui-monospace, Consolas, monospace;
  font-size: 11px;
}

/* Closing panel */

.cta {
  position: relative;
  overflow: hidden;
  margin: clamp(72px, 9vw, 104px) 0 clamp(80px, 10vw, 112px);
  padding: clamp(40px, 6vw, 60px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(150deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.cta::before,
.cta::after {
  position: absolute;
  top: 50%;
  color: var(--ink);
  font-family: ui-serif, "New York", Georgia, serif;
  line-height: 0;
  opacity: var(--watermark);
}

.cta::before {
  content: "∫";
  left: 5%;
  font-size: 220px;
}

.cta::after {
  content: "∑";
  right: 6%;
  font-size: 175px;
}

.cta h2 {
  position: relative;
  max-width: 22ch;
  margin: 0 auto;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.14;
}

.cta p {
  position: relative;
  max-width: 44ch;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}

.cta .actions {
  position: relative;
  justify-content: center;
  margin-top: 30px;
}

/* Footer */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
  padding: 34px 0;
}

.site-footer .brand-mark {
  width: 27px;
  height: 27px;
  font-size: 16px;
}

.footer-note {
  flex: 1 1 100%;
  margin: 0;
  color: var(--faint);
  font-size: 12.5px;
}

/* Legal pages */

.legal-page {
  padding: 60px 0 96px;
}

.legal-content {
  max-width: 68ch;
}

.legal-content h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 5.2vw, 52px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.legal-content h2 {
  margin: 44px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 19px;
  letter-spacing: -0.02em;
}

.legal-content p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal-date {
  display: inline-block;
  margin: 0 0 8px !important;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--faint) !important;
  font-size: 12.5px !important;
}

.back-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
}

.back-link span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.back-link:hover span {
  transform: translateX(-4px);
}

/* Motion */

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

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 var(--accent-tint);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 4px var(--accent-tint);
  }
}

.hero-copy > *,
.hero-visual {
  animation: rise 0.65s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}

.hero-copy > *:nth-child(2) {
  animation-delay: 0.05s;
}

.hero-copy > *:nth-child(3) {
  animation-delay: 0.1s;
}

.hero-copy > *:nth-child(4) {
  animation-delay: 0.15s;
}

.hero-copy > *:nth-child(5) {
  animation-delay: 0.2s;
}

.hero-visual {
  animation-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive */

@media (max-width: 860px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .shell,
  .home,
  .legal-page {
    width: min(100% - 32px, 1080px);
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 52px 0 68px;
  }

  h1 {
    max-width: none;
  }

  .hero-visual {
    max-width: 560px;
  }

  .hero-visual::before {
    inset: 10% 0 -6%;
  }

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

  .symbol-grid {
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  }

  .symbol-grid li {
    padding: 15px 6px 12px;
  }

  .cta::before,
  .cta::after {
    display: none;
  }

  .site-footer .shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
}
