@charset "UTF-8";

/*
 * ════════════════════════════════════════════════════════════════
 *  FEAScript Website
 *  Finite Element Simulation in JavaScript
 *  https://feascript.com
 *  CC BY 4.0 License © 2023–2026 FEAScript
 * ════════════════════════════════════════════════════════════════
 */

:where(html:not(.site)) * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html:where(:not(.site)) {
  max-width: 1500px;
  margin: auto;
  font-family: "Roboto", sans-serif;
  font-size: 90%;
  scroll-behavior: smooth;
  position: relative;
}

:where(html:not(.site)) body {
  padding: 20px;
  line-height: 1.6;
}

:where(html:not(.site)) h1,
:where(html:not(.site)) h2,
:where(html:not(.site)) h3 {
  background: none;
  font-weight: normal;
  padding: 0.4em 0 0.2em;
  margin: 0 0 0.5em;
  color: #555;
}

:where(html:not(.site)) h1 {
  font-size: 150%;
  line-height: 1.2em;
  margin-bottom: 0.4em;
}

:where(html:not(.site)) h1.top {
  border-bottom: 1px solid #aaa;
  position: relative;
}

:where(html:not(.site)) p {
  margin: 1em 0;
}

:where(html:not(.site)) a {
  text-decoration: none;
}

:where(html:not(.site)) #responsive-logo {
  height: 80px;
}

:where(html:not(.site)) .announcement-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 8px 16px;
  margin: -20px 0px 0;
  background: #f4f4f5;
  font-size: 0.9em;
  color: #555;
}

:where(html:not(.site)) .announcement-bar .version-label {
  font-weight: bold;
  color: #333;
}

:where(html:not(.site)) .announcement-bar .version-sep {
  color: #bbb;
}

:where(html:not(.site)) .announcement-bar a img {
  vertical-align: middle;
}

:where(html:not(.site)) .announcement-bar a {
  color: #0056b3;
}

:where(html:not(.site)) footer {
  position: relative;
  background-color: #f7e7b7;
  padding: 2px 0 2px 5px;
  text-align: left;
  border-top: 2px solid #e0c97f;
}

@media screen and (max-width: 500px) {
  :where(html:not(.site)) body {
    padding: 10px;
  }

  :where(html:not(.site)) .announcement-bar {
    margin: -10px -10px 0;
  }

  :where(html:not(.site)) h1 {
    font-size: 155%;
  }

  :where(html:not(.site)) #responsive-logo {
    height: 50px;
  }
}

@media screen and (min-width: 500px) and (max-width: 1000px) {
  :where(html:not(.site)) body {
    padding: 15px;
  }

  :where(html:not(.site)) .announcement-bar {
    margin: -15px -15px 0;
  }

  :where(html:not(.site)) h1 {
    font-size: 170%;
  }

  :where(html:not(.site)) #responsive-logo {
    height: 60px;
  }
}

@media screen and (min-width: 1000px) {
  :where(html:not(.site)) h1 {
    font-size: 180%;
  }
}

/* ─────────────────────────────────────────────────────────────
   SITE: TOKENS
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #fdfaf2;
  --bg-sunken: #f6efd9;
  --ink: #333333;
  --ink-strong: #1d1d1d;
  --muted: #5c5c5c;
  --faint: #8c8a82;
  --line: rgba(51, 51, 51, 0.16);
  --line-strong: rgba(51, 51, 51, 0.45);
  --invert-bg: #2b2b2b;
  --invert-fg: #fdfaf2;

  --gold: #d4aa00;
  --gold-ink: #8f7200;
  --cream: #f7e7b7;
  --link: #0056b3;

  --paper: rgba(51, 51, 51, 0.045);
  --paper-major: rgba(51, 51, 51, 0.08);

  /* Physics colours (taken from the FEAScript Studio logo) */
  --phys-heat: #c8003f;
  --phys-flow: #0086d4;
  --phys-structure: #00a86b;
  --phys-front: #d4aa00;

  --font-body: "Roboto", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --nav-h: 4.5rem;
  --maxw: 1280px;
}

html[data-theme="dark"] {
  --bg: #181818;
  --bg-sunken: #222222;
  --ink: #e6e3da;
  --ink-strong: #ffffff;
  --muted: #a9a69c;
  --faint: #77756d;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.4);
  --invert-bg: #f7e7b7;
  --invert-fg: #1d1d1d;
  --gold-ink: #e6c230;
  --link: #5aa2ec;

  --paper: rgba(255, 255, 255, 0.04);
  --paper-major: rgba(255, 255, 255, 0.07);
  --phys-heat: #ff5c8d;
  --phys-flow: #5aa2ec;
  --phys-structure: #2fcf93;
  --phys-front: #e6c230;
}

[data-physics="heat"] {
  --phys: var(--phys-heat);
}

[data-physics="flow"] {
  --phys: var(--phys-flow);
}

[data-physics="structure"] {
  --phys: var(--phys-structure);
}

[data-physics="front"],
[data-physics="general"] {
  --phys: var(--phys-front);
}

/* ─────────────────────────────────────────────────────────────
   SITE: BASE
   ───────────────────────────────────────────────────────────── */

:where(html.site) *,
:where(html.site) *::before,
:where(html.site) *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html.site {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 3rem);
}

:where(html.site) body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--paper-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-major) 1px, transparent 1px),
    linear-gradient(var(--paper) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper) 1px, transparent 1px);
  background-size:
    120px 120px,
    120px 120px,
    24px 24px,
    24px 24px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

:where(html.site) img,
:where(html.site) svg,
:where(html.site) canvas {
  display: block;
  max-width: 100%;
}

:where(html.site) a {
  color: inherit;
  text-decoration: none;
}

:where(html.site) ul {
  list-style: none;
}

:where(html.site) button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:where(html.site) :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.skip-link:focus {
  top: 0.5rem;
}

/* Inline links inside running text */
.prose a,
.link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
}

.prose a:hover,
.link:hover {
  text-decoration-color: currentColor;
}

:where(html.site) code {
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-sunken);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ─────────────────────────────────────────────────────────────
   SHARED COMPONENTS
   ───────────────────────────────────────────────────────────── */

.label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.text-muted {
  color: var(--muted);
}

.text-faint {
  color: var(--faint);
}

.accent {
  color: var(--gold-ink);
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    opacity 0.15s,
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.btn-solid {
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.btn-solid:hover {
  opacity: 0.8;
}

.btn-outline {
  border-color: var(--line-strong);
  background: var(--bg);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--invert-bg);
  border-color: transparent;
  color: var(--invert-fg);
}

.btn-sm {
  height: 2.25rem;
  padding: 0 1rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  vertical-align: middle;
  color: var(--muted);
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--gold);
}

/* ─────────────────────────────────────────────────────────────
   ANNOUNCEMENT BAR + NAVIGATION
   ───────────────────────────────────────────────────────────── */

.announce {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.9rem;
  padding: 0.4rem 1rem;
  background: var(--invert-bg);
  color: var(--invert-fg);
  text-align: center;
}

.announce img {
  display: inline-block;
  vertical-align: middle;
}

.site-nav {
  position: sticky;
  top: 0.75rem;
  z-index: 50;
  max-width: calc(var(--maxw) - 2rem);
  margin: 0.75rem 1rem 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.35);
}

@media (min-width: 1280px) {
  .site-nav {
    margin-inline: auto;
  }
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 3rem;
  padding-right: 0.5rem;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.02em;
  padding: 0 0.75rem 0 1.4rem;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  white-space: nowrap;
}

.nav-brand > svg {
  width: 0.72em;
  height: 0.72em;
  margin-right: 0.05em;
}

.nav-brand:hover {
  opacity: 0.7;
}

.nav-links {
  display: none;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--muted);
  white-space: nowrap;
}

.nav-link span {
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.nav-link:hover {
  color: var(--ink-strong);
}

.nav-link:hover span {
  background: var(--invert-bg);
  color: var(--invert-fg);
}

/* Links that lead to a different page (Docs, Studio) are set apart in gold */
.nav-link-out {
  color: var(--gold-ink);
}

.nav-link-out span {
  border: 1px solid var(--gold);
}

/* A thin divider separates the in-page links from the links to other pages */
.nav-link:not(.nav-link-out) + .nav-link-out {
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.nav-link-out span::after {
  content: " \2197";
}

.nav-link-out:hover span {
  border-color: var(--gold);
  background: var(--gold);
  color: #1d1d1d;
}

.mobile-nav a.nav-link-out {
  color: var(--gold-ink);
  font-weight: 500;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-icon:hover {
  background: var(--bg-sunken);
  color: var(--ink-strong);
}

.nav-icon svg {
  width: 1rem;
  height: 1rem;
}

.nav-cta {
  display: none;
  align-items: center;
  height: 2.25rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: var(--invert-bg);
  color: var(--invert-fg);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-cta:hover {
  opacity: 0.8;
}

.nav-github {
  display: none;
  width: auto;
  padding: 0 0.85rem;
}

/* Sun / moon switch */
.theme-toggle {
  position: relative;
  flex-direction: row-reverse;
  justify-content: space-between;
  width: 3.75rem;
  padding: 0 0.5rem;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  transition: transform 0.2s;
}

html[data-theme="dark"] .theme-toggle::before {
  transform: translateX(24px);
}

.theme-toggle svg {
  position: relative;
  z-index: 1;
}

.theme-toggle .icon-sun {
  color: #1d1d1d;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  color: var(--faint);
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  color: #1d1d1d;
}

.theme-toggle .icon-moon {
  color: var(--faint);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.4);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.mobile-nav a:hover {
  color: var(--ink-strong);
}

@media (min-width: 1200px) {
  .nav-links {
    display: flex;
  }

  .nav-cta,
  .nav-github {
    display: flex;
  }

  .nav-burger,
  .mobile-nav.open {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  margin-top: -3.875rem;
  background: var(--bg);
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 3.875rem;
  min-height: calc(100svh - 2rem);
}

#mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 45%, #000 20%, transparent 85%);
  mask-image: radial-gradient(ellipse 80% 75% at 50% 45%, #000 20%, transparent 85%);
}

.hero-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

.hero-content::before {
  content: "";
  position: absolute;
  inset: -4rem -8rem;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bg) 85%, transparent), transparent);
}

.wordmark-wrap {
  width: 100%;
  container-type: inline-size;
}

.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.02em;
  font-size: 15cqw;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  padding-bottom: 0.3em;
}

.wordmark > svg {
  width: 0.72em;
  height: 0.72em;
  margin-right: 0.05em;
}

/* Logo-style "t": a long tail below the baseline */
.wordmark .wm-t,
.footer-wordmark .wm-t,
.nav-brand .wm-t {
  display: inline;
  width: 0.3em;
  height: 1.15em;
  margin: 0 0 -0.32em 0.02em;
  vertical-align: -0.16em;
}

.hero h1 {
  margin-top: 2rem;
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.hero-lede {
  max-width: 34rem;
  margin-top: 1rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-top: 1.25rem;
}

.hero-links a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.hero-links a:hover {
  text-decoration-color: currentColor;
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  margin-top: 1.75rem;
  padding: 0.35rem 0.4rem 0.35rem 1rem;
  border: 1px solid var(--line-strong);
  background: #1f1f1f;
  color: #e6e3da;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

.cmd-prompt {
  color: var(--gold);
}

.cmd code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: nowrap;
}

.cmd-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  color: #e6e3da;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}

.cmd-copy svg {
  width: 14px;
  height: 14px;
}

.cmd-copy:hover {
  background: var(--cream);
  color: #1d1d1d;
}

.cmd-copy.copied {
  border-color: #2e7d32;
  background: #2e7d32;
  color: #fff;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-top: 1.75rem;
  color: var(--faint);
}

.hero-meta a:hover {
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────────────────────────── */

.section {
  position: relative;
  border-top: 1px solid var(--line);
}

.section-frame {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

/* Section label: a small pill that stays below the navigation and names the current section while scrolling */
.eyebrow {
  position: sticky;
  top: calc(var(--nav-h) - 0.25rem);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: fit-content;
  margin: 1.75rem 0 0 1.5rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  text-transform: lowercase;
  color: var(--muted);
}

.eyebrow p::before {
  content: "// ";
  color: var(--faint);
}

.section-head.eq-head {
  position: relative;
}

.eq {
  display: none;
  position: absolute;
  top: 0;
  right: 2.5rem;
  bottom: 0;
  width: 34%;
  overflow: hidden;
  pointer-events: none;
}

.eq-head h2 {
  max-width: 44rem;
}

@media (min-width: 1000px) {
  .eq {
    display: block;
  }
}

.eq span {
  position: absolute;
  font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "Times New Roman", serif;
  font-style: italic;
  line-height: 1;
  white-space: nowrap;
  color: var(--ink-strong);
  opacity: 0.18;
}

.eq-1 {
  top: 10%;
  right: 0;
  font-size: 2.25rem;
}

.eq-2 {
  top: 28%;
  right: 24%;
  font-size: 4.5rem;
}

.eq-3 {
  top: 64%;
  left: 0;
  font-size: 1.5rem;
}

.eq-4 {
  top: 74%;
  right: 0;
  font-size: 1.875rem;
}

.eq-5 {
  top: 20%;
  left: 2%;
  font-size: 1.25rem;
}

.eq-6 {
  top: 52%;
  right: 4%;
  font-size: 2.75rem;
}

.eq-7 {
  top: 90%;
  right: 30%;
  font-size: 1.375rem;
}

.section-head {
  padding: 1.5rem 1.5rem 3.5rem;
}

.section-head h2 {
  max-width: 48rem;
  font-size: clamp(2.25rem, 5.4vw, 3.75rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}

.section-head p {
  max-width: 40rem;
  margin-top: 1.25rem;
  font-size: 1.125rem;
  color: var(--muted);
}

@media (min-width: 768px) {
  .eyebrow {
    margin-left: 2.5rem;
  }

  .section-head {
    padding: 2rem 2.5rem 5rem;
  }
}

.grid {
  display: grid;
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.cell {
  min-width: 0;
  background: var(--bg);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: span 2;
  }
}

.cell-pad {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
}

.cell-pad h3 {
  margin-top: 1.5rem;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.cell-pad > h3:first-child {
  margin-top: 0;
}

/* Reserve two title lines when long titles wrap in three narrow columns */
@media (min-width: 768px) and (max-width: 1180px) {
  .cell-pad > h3:has(+ .feature-list) {
    min-height: 2.4em;
  }
}

.cell-pad .desc strong {
  font-weight: 500;
  color: var(--ink-strong);
}

.cell-pad .desc {
  margin-top: 0.5rem;
  color: var(--muted);
}

.cell-pad .btn {
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .cell-pad {
    padding: 2rem;
  }
}

.cell-note {
  padding: 1.5rem;
  color: var(--muted);
}

@media (min-width: 768px) {
  .cell-note {
    padding: 1.5rem 2.5rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   QUICK START CODE BLOCK
   ───────────────────────────────────────────────────────────── */

.quickstart {
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .quickstart {
    padding: 2rem 2.5rem 3rem;
  }
}

.code-block {
  border: 1px solid var(--line-strong);
  background: #1f1f1f;
  color: #e6e3da;
}

.code-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.code-bar .file {
  color: #a9a69c;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.code-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #e6e3da;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.code-btn svg {
  width: 14px;
  height: 14px;
}

.code-btn:hover {
  background: var(--cream);
  color: #1d1d1d;
}

.code-btn.copied {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.code-btn-video::before,
.code-btn-codepen::before {
  content: "";
  width: 6px;
  height: 6px;
}

.code-btn-video::before {
  background: #ff3b3b;
}

.code-btn-codepen::before {
  background: #47cf73;
}

.code-block pre {
  max-height: 450px;
  overflow: auto;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre;
}

.tok-tag {
  color: #7cb7ff;
}

.tok-attr {
  color: #9cdcfe;
}

.tok-str {
  color: #ce9178;
}

.tok-kw {
  color: #c586c0;
}

.tok-fn {
  color: #e6c230;
}

.tok-num {
  color: #b5cea8;
}

.tok-comment {
  color: #7f8c7a;
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────
   FEATURES
   ───────────────────────────────────────────────────────────── */

.feature-list {
  width: 100%;
  margin-top: 1rem;
}

.feature-list li {
  position: relative;
  padding: 0.2rem 0 0.2rem 1.1rem;
  color: var(--muted);
}

.feature-list li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--phys, var(--gold-ink));
}

.feature-list ul {
  margin-top: 0.1rem;
}

.feature-list a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
}

.feature-list a:hover {
  text-decoration-color: currentColor;
}

/* ─────────────────────────────────────────────────────────────
   TUTORIAL CARDS
   ───────────────────────────────────────────────────────────── */

.tutorial {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  box-shadow: inset 3px 0 0 var(--phys, var(--line-strong));
}

.fig-label {
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--phys, var(--faint)) 70%, var(--ink));
}

.tutorial-img {
  order: 2;
  flex-shrink: 0;
  width: 120px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-sunken);
}

.tutorial-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-self: stretch;
  min-width: 0;
}

@media (max-width: 500px) {
  .tutorial-img {
    display: none;
  }
}

.tutorial-body h3 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-strong);
}

.tutorial-body p {
  margin-top: 0.3rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.badge {
  --dot: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--dot);
}

.badge:hover {
  border-color: transparent;
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.badge-mt {
  --dot: #5585a3;
}

.badge-gmsh {
  --dot: #8a9277;
}

.badge-scribbler {
  --dot: #e6c400;
}

.badge-codepen {
  --dot: #47cf73;
}

/* ─────────────────────────────────────────────────────────────
   SPONSORS / PROOF
   ───────────────────────────────────────────────────────────── */

.inline-media {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.inline-media img {
  height: 20px;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-row img {
  height: 30px;
  width: auto;
}

/* ─────────────────────────────────────────────────────────────
   MAILING LIST (final CTA)
   ───────────────────────────────────────────────────────────── */

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 1.5rem;
  text-align: center;
}

.cta h2 {
  margin-top: 1.5rem;
  max-width: 52rem;
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}

.cta > p.lede {
  max-width: 28rem;
  margin-top: 1.5rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.maillist-form {
  width: 100%;
  max-width: 30rem;
  margin-top: 2.25rem;
  text-align: left;
}

.maillist-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.maillist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.maillist-row input[type="email"] {
  flex: 1;
  min-width: 14rem;
  height: 3rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-strong);
  font: inherit;
}

.maillist-row input[type="email"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent);
}

.maillist-row input[type="submit"] {
  cursor: pointer;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
}

.maillist-disclosure {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--faint);
}

.maillist-honeypot {
  position: absolute;
  left: -5000px;
}

/* ─────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────── */

.footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
}

@media (min-width: 768px) {
  .footer-inner {
    padding-inline: 2rem;
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 1.5rem;
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
    gap: 2.25rem 2rem;
  }
}

.footer-brand {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .footer-brand {
    grid-column: auto;
    padding-right: 2rem;
  }
}

.footer-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.02em;
  padding-bottom: 0.3em;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink-strong);
}

.footer-wordmark > svg {
  width: 0.72em;
  height: 0.72em;
  margin-right: 0.05em;
}

.footer-tagline {
  max-width: 22rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}

.footer-mail {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--gold-ink);
}

.footer-mail:hover {
  color: var(--ink-strong);
}

.footer-col {
  min-width: 0;
}

.footer-col h2 {
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.footer-col h2::before {
  content: "// ";
  color: var(--gold-ink);
}

.footer-col ul {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
  color: var(--muted);
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.footer-col a:hover {
  color: var(--ink-strong);
  transform: translateX(3px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 3rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ─────────────────────────────────────────────────────────────
   SITE: DOCUMENT PAGES (tutorials and long-form content)
   ───────────────────────────────────────────────────────────── */

.section-head.doc-head {
  padding: 1.25rem 1.5rem 0;
}

@media (min-width: 768px) {
  .section-head.doc-head {
    padding: 1.5rem 2.5rem 0;
  }
}

.doc-head h1 {
  max-width: 52rem;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}

.doc-head p {
  max-width: 40rem;
  margin-top: 1rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.eyebrow a:hover {
  color: var(--ink-strong);
}

.doc {
  max-width: 58rem;
  padding: 0.5rem 1.5rem 4rem;
  counter-reset: fig;
}

@media (min-width: 768px) {
  .doc {
    padding: 0.5rem 2.5rem 5rem;
  }
}

.doc > * + * {
  margin-top: 1rem;
}

.doc .eyebrow {
  position: static;
  margin: 3rem 0 0;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.doc .eyebrow[aria-level="3"] {
  margin-top: 2rem;
}

.doc h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.doc h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink-strong);
}

.doc p,
.doc li {
  max-width: 46rem;
  line-height: 1.7;
}

.doc a:not(.badge) {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
}

.doc a:not(.badge):hover {
  text-decoration-color: currentColor;
}

.doc ul:not(#menu) {
  padding-left: 0;
}

.doc ul:not(#menu) li {
  position: relative;
  padding-left: 1.1rem;
  margin-top: 0.25rem;
}

.doc ul:not(#menu) li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--gold-ink);
}

.doc pre {
  max-height: 480px;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #1f1f1f;
  color: #e6e3da;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre;
}

/* Code listings with a file bar and a copy button (same look as the quick-start block) */
.doc .code-block {
  margin-top: 1rem;
}

.doc .code-block pre {
  margin-top: 0;
  border: none;
}

.doc pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.doc .highlight-container {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  background: var(--bg-sunken);
}

.doc .highlight-container p {
  margin: 0;
  max-width: none;
}

.doc .center-image {
  margin-top: 1.5rem;
  text-align: center;
}

.doc .center-image img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}

/* Tutorial schematics: line art without a frame, inverted in dark mode */
.doc .center-image img.schematic {
  border: none;
  background: none;
}

html[data-theme="dark"] .doc .center-image img.schematic {
  filter: invert(0.88);
}

.doc .image-caption {
  margin: 0.5rem auto 0;
  font-size: 0.8125rem;
  color: var(--faint);
}

.doc .image-caption::before {
  content: "Fig. " counter(fig) ". ";
  counter-increment: fig;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--muted);
}

.doc mjx-container {
  text-align: left;
}

.doc ul#menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.doc ul#menu li {
  max-width: none;
  padding: 0;
  margin: 0;
}

.doc ul#menu a {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.doc ul#menu a:hover {
  border-color: transparent;
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.doc #loading {
  display: none;
  text-align: center;
  font-weight: 500;
}

.doc .spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 0.6rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink-strong);
  border-radius: 50%;
  vertical-align: middle;
  animation: spin 1s ease-in-out infinite;
}

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

.doc button,
.doc select,
.doc input:not([type="submit"]) {
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-strong);
  font: inherit;
  font-size: 0.9375rem;
}

.doc button {
  cursor: pointer;
  background: var(--invert-bg);
  border-color: transparent;
  color: var(--invert-fg);
  font-weight: 500;
}

.doc button:hover {
  opacity: 0.8;
}

.doc label {
  color: var(--muted);
}

/* Waitlist / form pages */

.doc .maillist-form {
  margin-top: 1.5rem;
}

.doc .maillist-row input[type="email"] {
  height: 3rem;
  padding: 0 1rem;
}

/* ─────────────────────────────────────────────────────────────
   MOTION
   ───────────────────────────────────────────────────────────── */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

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

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
