body.math-loading nav,
body.math-loading main {
  visibility: hidden;
}

body.math-loaded nav,
body.math-loaded main {
  visibility: visible;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: #2b2b2b;
  color: white;
  padding: 40px 0;
  overflow-x: hidden;
}

main {
  width: min(90%, 900px);
  margin: 0 auto;
  padding: 20px;
}

h1, h2 {
  text-align: center;
  font-family: "Inter", sans-serif;
}

h1 {
  background: #050505;
  padding: 1.5rem 3rem;
  border-bottom: 2px solid #00f0ff;
  color: #00f0ff;
}

h2 {
  padding: 1.5rem 3rem;
  border-bottom: 2px solid #00f0ff;
  color: #00f0ff;
}

h1:hover {
  text-shadow:
    0 0 10px #00f0ff,
    0 0 30px #00f0ff,
    0 0 60px #00f0ff;
}

header h1 {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

p {
  text-align: left;
  margin-bottom: 16px;
  line-height: 1.7;
}

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: -25px;
  max-width: 100%;
  height: auto;
}

.shift-left-small {
  transform: translateX(-16px);
}

.shift-left {
  transform: translateX(-23px);
}

.shift-left-more {
  transform: translateX(-31px);
}

.item p {
  display: inline-block;
  margin-top: 5px;
  margin-bottom: 5px;
  font-size: 18px;
}

mjx-container {
  color: white;
  font-size: 1.1em;
  line-height: 1.6;
  overflow-x: auto;
  overflow-y: hidden;
}

mjx-container[display="true"] {
  margin: 20px 0;
  padding-top: 0.15em;
  padding-bottom: 0.15em;
}

.eg {
  color: #00f0ff;
}

.ctext {
  background-color: #444;
  color: #00ffcc;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: monospace;
}

.code-wrapper {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

pre {
  padding: 18px;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  font-size: 12px;
  overflow-x: auto;
  background: #1e1e1e;
  color: #f8f8f2;
  white-space: pre;
}

/* ============================= */
/* PRISM SYNTAX HIGHLIGHTING     */
/* ============================= */

.token.keyword {
  color: #e114c6;
}

.token.function {
  color: #00ffcc;
}

.token.comment {
  color: #919ded;
  font-style: italic;
}

.token.string {
  color: #e79d13;
}

.token.number {
  color: #f08d49;
}

.token.operator {
  color: #1be239;
}

.token.punctuation {
  color: #cccccc;
}

.token.property {
  color: #f92672;
}

.token.constant {
  color: #f99157;
}

.token.boolean {
  color: #f99157;
}

.token.class-name {
  color: #ffcc66;
}

.token.parameter {
  color: #d6deeb;
}

.token.decorator {
  color: #82aaff;
  font-style: italic;
}

.token.builtin {
  color: #6699cc;
}

.token.variable {
  color: #f8f8f2;
}

.binder-button {
  display: block;
  width: fit-content;
  margin: 30px auto;
  padding: 12px 18px;
  color: black;
  background: #00f0ff;
  font-weight: bold;
  text-decoration: none;
  border-radius: 6px;
  text-align: center;
}

.binder-button.small-binder-button {
  padding: 7px 12px;
  font-size: 0.9rem;
  margin: 18px auto;
  border-radius: 5px;
}

.binder-button:hover {
  background: #24e734;
  color: black;
}

.binder-button:active {
  color: white;
}

/* ============================= */
/* NAVBAR                        */
/* ============================= */

.navbar {
  margin: 0;
  padding: 18px 16px;
  background: #212225;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 1rem 2rem;
  border-bottom: 2px solid #00f0ff;
  border-radius: 6px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  text-align: center;
  flex-wrap: wrap;
  text-decoration: none;      /* removes underline */
  color: inherit;   
}

.brand-mark {
  color: #00f0ff;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 600;
  line-height: 1;
  transition: text-shadow 0.25s ease, transform 0.25s ease;
}

.brand-title {
  color: #00f0ff;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
  transition: text-shadow 0.25s ease, transform 0.25s ease;
}

.site-brand:hover .brand-mark,
.site-brand:hover .brand-title {
  text-shadow:
    0 0 8px #00f0ff,
    0 0 20px #00f0ff,
    0 0 40px #00f0ff;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  text-decoration: none;
  color: #00f0ff;
  font-size: 17px;
  font-weight: 500;
  transition: color 0.2s ease, text-shadow 0.25s ease;
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #7df9ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.dropdown {
  position: relative;
}

.dropdown .dropbtn {
  cursor: pointer;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background: #2a2b2e;
  min-width: 240px;
  max-width: min(90vw, 320px);
  padding: 8px 0;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dropdown-content li {
  list-style: none;
}

.dropdown-content a {
  display: block;
  padding: 10px 14px;
  color: #00f0ff;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
  white-space: normal;
  border-radius: 0;
}

.dropdown-content a:hover {
  background: #3a3b3f;
  color: #7df9ff;
}

.submenu {
  position: relative;
}

.submenu-content {
  position: absolute;
  top: 0;
  left: 100%;
  background: #2a2b2e;
  min-width: 240px;
  padding: 8px 0;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.submenu:hover .submenu-content,
.submenu:focus-within .submenu-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.submenu-content a {
  display: block;
  padding: 10px 14px;
  color: #00f0ff;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
  white-space: normal;
}

.submenu-content a:hover {
  background: #3a3b3f;
  color: #7df9ff;
}

/* ============================= */
/* SECTION TABS                  */
/* ============================= */

.section-tabs {
  margin: 15px 0 0;

  text-align: center;

  padding-bottom: 18px;

  border-bottom: 1px solid rgba(0,240,255,0.25);
}

.section-tabs a {
  text-decoration: none;

  color: #7ddfe6;

  margin: 0 20px;

  font-size: 1.05rem;

  transition: color 0.2s ease;
}

.section-tabs a:hover {
  color: white;
}

.section-tabs a.active {
  color: #00f0ff;
  font-weight: 700;
}

.section-tabs-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.section-tabs-wide a {
  white-space: normal;
  line-height: 1.35;
}

/* ============================= */
/* PAGE INDEX                    */
/* ============================= */

.page-index {
  margin-top: 34px;
  padding: 34px 38px;

  background: #08090c;

  border-top: 3px solid #00f0ff;
  border-bottom: 3px solid #00f0ff;

  box-shadow:
    0 0 28px rgba(0,240,255,0.12),
    0 18px 42px rgba(0,0,0,0.35);
}

.page-index h2 {
  margin-top: 0;

  background: none;

  border-bottom: 1px solid rgba(0,240,255,0.35);

  color: #00f0ff;

  letter-spacing: 1px;
}

.page-index-grid {
  display: flex;
  flex-direction: column;

  gap: 6px;
}

/* Tables */

.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0;
}

.transform-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: center;
  font-size: 1.2em;
  color: #e6e6e6;
}

.transform-table th,
.transform-table td {
  border: 1px solid #aaa;
  padding: 12px;
}


/* ============================= */
/* MAIN SECTION ITEMS            */
/* ============================= */

.page-index-card {
  display: block;

  position: relative;

  padding: 15px 45px 15px 52px;

  background: transparent;

  color: #00f0ff;

  text-decoration: none;

  border-bottom: 1px solid rgba(0,240,255,0.16);

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.page-index-card:hover {
  background: rgba(0,240,255,0.05);

  color: #7df9ff;

  transform: translateX(6px);
}

.page-index-card::before {
  content: "▸";

  position: absolute;

  left: 16px;
  top: 13px;

  color: #00f0ff;

  font-size: 1.25rem;

  text-shadow:
    0 0 8px rgba(0,240,255,0.8),
    0 0 16px rgba(0,240,255,0.4);
}

.page-index-title {
  font-size: 1.14rem;
  font-weight: 700;
}


/* ============================= */
/* DROPDOWNS                     */
/* ============================= */

.page-index-dropdown summary {
  cursor: pointer;

  list-style: none;

  position: relative;
}

.page-index-dropdown summary::-webkit-details-marker {
  display: none;
}

.page-index-dropdown summary::after {
  content: "▼";

  position: absolute;

  right: 0;
  top: 50%;

  transform: translateY(-50%);

  color: #00f0ff;

  font-size: 0.8rem;

  transition:
    transform 0.25s ease,
    color 0.2s ease;
}

.page-index-dropdown:hover summary::after {
  color: #7df9ff;
}

.page-index-dropdown[open] summary::after {
  transform:
    translateY(-50%)
    rotate(180deg);
}


/* ============================= */
/* SUBSECTIONS                   */
/* ============================= */

.page-index-subsections {
  margin-top: 12px;

  padding: 8px 0 4px;

  display: grid;

  gap: 7px;
}

.page-index-subsections a {
  display: block;

  color: #d8ffff;

  text-decoration: none;

  padding: 8px 12px 8px 20px;

  border-left: 2px solid rgba(0,240,255,0.35);

  background: rgba(0,240,255,0.035);

  font-size: 0.95rem;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.page-index-subsections a:hover {
  color: #7df9ff;

  background: rgba(0,240,255,0.08);

  transform: translateX(5px);
}


.quote {
  color: #7ddfe6;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  text-align: center;
  line-height: 1.6;
}


/* ============================= */
/* HOMEPAGE HERO                 */
/* ============================= */

.hero-section {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 35%),
    radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.25), transparent 40%),
    #1b1c20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  margin: 30px 0;
  padding: 60px 28px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  text-align: center;
}

.hero-content h1 {
  margin: 24px auto 18px;
  background: transparent;
  border-bottom: none;
  padding: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: 0.5px;
  text-shadow:
    0 0 8px rgba(0, 240, 255, 0.35);
}

.hero-tagline {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: #e8fefe;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-buttons a {
  display: inline-block;
  padding: 13px 20px;
  border-radius: 999px;
  background: #00f0ff;
  color: #050505;
  font-weight: bold;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hero-buttons a:hover {
  transform: translateY(-3px);
  background: #7df9ff;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
}

.hero-equations {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.18;
  pointer-events: none;
}

.hero-equations span {
  position: absolute;
  color: rgba(255, 255, 255, 0.55);
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  animation: floatEquation 12s ease-in-out infinite alternate;
}

.hero-equations span:nth-child(1) {
  top: 12%;
  left: 8%;
}

.hero-equations span:nth-child(2) {
  top: 22%;
  right: 10%;
  animation-delay: 1.5s;
}

.hero-equations span:nth-child(3) {
  bottom: 18%;
  left: 10%;
  animation-delay: 3s;
}

.hero-equations span:nth-child(4) {
  bottom: 12%;
  right: 8%;
  animation-delay: 4.5s;
}

@keyframes floatEquation {
  from {
    transform: translateY(0) scale(1);
  }

  to {
    transform: translateY(-22px) scale(1.04);
  }
}

/* ============================= */
/* HOMEPAGE INTRO + TOPIC CARDS  */
/* ============================= */

.intro-panel {
  background: #212225;
  border-left: 3px solid #00f0ff;
  border-radius: 12px;
  padding: 28px;
  margin: 35px 0;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
}

.intro-panel p {
  font-size: 1.08rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 45px 0;
}

.topic-card {
  display: block;
  background:
    linear-gradient(145deg, rgba(0, 240, 255, 0.08), transparent 45%),
    #212225;
  color: white;
  text-decoration: none;
  padding: 26px;
  border-radius: 16px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.topic-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 240, 255, 0.65);
  box-shadow:
    0 16px 45px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(0, 240, 255, 0.18);
}

.topic-card h2 {
  margin: 0 0 14px;
  padding: 0 0 12px;
  background: none;
  border-bottom: 2px solid rgba(0, 240, 255, 0.55);
  text-align: left;
  font-size: 1.35rem;
}

.topic-card p {
  margin: 0;
  color: #e5e5e5;
}

/* ============================= */
/* EQUATION GALLERY              */
/* ============================= */

.equation-gallery {
  margin: 55px 0;
  padding: 34px;
  background: #18191c;
  border-radius: 18px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.equation-gallery h2 {
  margin-top: 0;
  background: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.equation-card {
  display: block;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(0, 240, 255, 0.1), transparent 45%),
    #242529;
  color: white;
  text-decoration: none;
  border-radius: 16px;
  padding: 22px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.equation-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(0, 240, 255, 0.7);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.38),
    0 0 28px rgba(0, 240, 255, 0.2);
}

.equation-card h3 {
  color: #00f0ff;
  margin: 18px 0 10px;
  font-size: 1.3rem;
}

.equation-card p {
  text-align: center;
  margin: 0;
  color: white;
  transition: transform 0.25s ease, color 0.25s ease;
}

.equation-card:hover p {
  transform: scale(1.08);
  color: #7df9ff;
}

.equation-note {
  display: block;
  margin-top: 14px;
  color: #d8ffff;
  font-size: 0.92rem;
  text-align: center;
  opacity: 0.82;
}

.equation-visual {
  position: relative;
  height: 135px;
  border-radius: 14px;
  background: #101114;
  border: 1px solid rgba(0, 240, 255, 0.22);
  overflow: hidden;
}

.equation-visual svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Wave equation: travelling sinusoidal disturbance */

.wave-visual svg {
  width: 200%;
  height: 100%;
}

.wave-path {
  fill: none;
  stroke: #00f0ff;
  stroke-width: 4;
  filter: drop-shadow(0 0 8px #00f0ff);
}

.wave-motion {
  animation: waveFlow 4s linear infinite reverse;
}

@keyframes waveFlow {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-300px);
  }
}


/* Heat equation: localized heat diffusing outward */

.heatmap-visual {
  background: #101114;
  overflow: hidden;
}

.heat-blob {
  position: absolute;
  left: 18%;
  top: 50%;
  width: 35px;
  height: 35px;
  transform: translate(-50%, -50%);
  border-radius: 50%;

  background:
    radial-gradient(circle,
      rgba(255,255,180,1) 0%,
      rgba(255,140,0,0.9) 24%,
      rgba(255,0,0,0.6) 52%,
      rgba(0,240,255,0.22) 100%);

  filter: blur(5px);
  animation: diffuseHeat 5s linear infinite;
}

@keyframes diffuseHeat {
  0% {
    width: 35px;
    height: 35px;
    opacity: 1;
  }

  100% {
    width: 280px;
    height: 280px;
    opacity: 0.25;
  }
}

/* Laplace equation: smooth steady-state contour field */

.laplace-visual {
  background:
    linear-gradient(90deg,
      rgba(255,140,0,0.45) 0%,
      rgba(0,240,255,0.18) 48%,
      rgba(0,255,204,0.28) 100%),
    #101114;
}

.laplace-contour {
  fill: none;
  stroke: rgba(255,255,255,0.55);
  stroke-width: 2;
  filter: drop-shadow(0 0 5px rgba(0,240,255,0.45));
  animation: laplaceSteadyGlow 4s linear infinite;
}

.c2 {
  animation-delay: 0.4s;
}

.c3 {
  animation-delay: 0.8s;
}

.c4 {
  animation-delay: 1.2s;
}

.laplace-boundary {
  stroke-width: 7;
  stroke-linecap: round;
}

.hot-boundary {
  stroke: rgba(255,140,0,0.95);
  filter: drop-shadow(0 0 10px rgba(255,140,0,0.8));
}

.cold-boundary {
  stroke: rgba(0,255,204,0.9);
  filter: drop-shadow(0 0 10px rgba(0,255,204,0.8));
}

@keyframes laplaceSteadyGlow {
  0% {
    opacity: 0.45;
  }

  50% {
    opacity: 0.85;
  }

  100% {
    opacity: 0.45;
  }
}

/* Schrödinger equation: localized packet moving right and spreading */

.quantum-visual {
  background:
    radial-gradient(
      circle at center,
      rgba(0,240,255,0.14),
      transparent 65%
    ),
    #101114;
}

.packet-baseline {
  stroke: rgba(255,255,255,0.18);
  stroke-width: 1;
}

.wavepacket {
  fill: none;
  stroke: #00f0ff;
  stroke-width: 1.45;
  opacity: 0.95;
  filter: drop-shadow(0 0 5px #00f0ff);
  transform-origin: center;
  animation: packetSpread 6s linear infinite;
}

@keyframes packetSpread {
  0% {
    transform: translateX(-38px) scaleX(0.23);
    opacity: 1;
  }

  100% {
    transform: translateX(38px) scaleX(1.75);
    opacity: 0.34;
  }
}

/* ============================= */
/* HOMEPAGE ROADMAP              */
/* ============================= */

.site-roadmap {
  margin: 55px 0 20px;
  padding: 32px;
  background: #212225;
  border-radius: 16px;
  border: 1px solid rgba(0, 240, 255, 0.18);
}

.site-roadmap h2 {
  margin-top: 0;
  background: none;
}

.roadmap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.roadmap a {
  color: #050505;
  background: #00f0ff;
  padding: 10px 15px;
  border-radius: 999px;
  font-weight: bold;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.roadmap a:hover {
  transform: translateY(-3px);
  background: #7df9ff;
}

.roadmap span {
  color: #00f0ff;
  font-size: 1.4rem;
}



/* ============================= */
/* LARGE TABLETS / SMALL LAPTOPS */
/* ============================= */

@media (max-width: 1024px) {
  body {
    padding: 28px 0;
  }

  .navbar {
    padding: 16px 14px;
  }

  .nav-links {
    gap: 12px 18px;
  }

  .nav-links a {
    font-size: 16px;
    padding: 7px 9px;
  }

  .dropdown-content {
    min-width: 220px;
  }

  main {
    width: min(94%, 900px);
    padding: 18px;
  }

  h1,
  h2 {
    padding: 1.2rem 1.8rem;
  }

  .page-index {
    padding: 28px 30px;
  }

  .page-index-card {
    padding: 14px 42px 14px 48px;
  }

  .page-index-card::before {
    left: 14px;
    top: 13px;
  }

  .page-index-title {
    font-size: 1.05rem;
  }

  .page-index-subsections a {
    font-size: 0.92rem;
  }
}

/* ============================= */
/* TABLETS / PHONES              */
/* ============================= */

@media (max-width: 768px) {

  body {
    padding: 20px 0;
  }

  .navbar {
    padding: 14px 12px;
  }

  .nav-center {
    gap: 12px;
  }

  .site-brand {
    flex-direction: column;
    gap: 8px;
    padding: 0.7rem 0.8rem;
  }

  .brand-mark,
  .brand-title {
    text-align: center;
  }

  /* CLEAN MOBILE NAV */
  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links > li > a,
  .dropdown .dropbtn {
    width: 100%;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.98rem;
    background: transparent;
    border-radius: 0;
    white-space: normal;
  }

  /* HIDE DROPDOWNS ON MOBILE */
  .dropdown {
    position: static;
  }

  .dropdown-content {
    display: none !important;
  }

  /* CONTENT */
  main {
    width: 94%;
    padding: 14px;
  }

  h1,
  h2 {
    padding: 1rem 1rem;
    font-size: 1.45rem;
  }

  p {
    font-size: 1rem;
  }

  .item p {
    font-size: 1rem;
  }

  .page-index {
    padding: 24px 18px;
    margin-top: 24px;
  }

  .page-index h2 {
    padding: 0 0 1rem 0;
    font-size: 1.35rem;
  }

  .page-index-card {
    padding: 13px 36px 13px 42px;
  }

  .page-index-card::before {
    left: 13px;
    top: 12px;
    font-size: 1.15rem;
  }

  .page-index-title {
    font-size: 1rem;
  }

  .page-index-subsections {
    margin-top: 10px;
    gap: 6px;
  }

  .page-index-subsections a {
    font-size: 0.92rem;
    padding: 8px 10px 8px 16px;
  }

  pre {
    font-size: 11px;
    padding: 14px;
  }

  img {
    margin-top: 0;
  }

  /* Re-center shifted images on phones */

  .shift-left-small {
    transform: translateX(-4px);
  }

  .shift-left {
    transform: translateX(-8px);
  }

  .shift-left-more {
    transform: translateX(-12px);
  }

  .section-tabs-wide {
    grid-template-columns: 1fr;
  }

  .section-tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .section-tabs a {
    margin: 0;
  }

  .hero-section {
    min-height: auto;
    padding: 42px 18px;
  }

  .hero-content h1 {
    font-size: 2.3rem;
  }

  .hero-equations {
    display: none;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons a {
    width: min(280px, 100%);
    text-align: center;
  }

  .hero-equations span {
    font-size: 1rem;
  }

  .topic-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .equation-gallery,
  .site-roadmap {
    padding: 24px 18px;
  }

  .roadmap {
    flex-direction: column;
  }

  .roadmap span {
    transform: rotate(90deg);
  }

  .transform-table {
    font-size: 1rem;
    min-width: 560px;
  }

  .transform-table th,
  .transform-table td {
    padding: 10px;
  }

  .transform-table {
    font-size: 0.85em;
}
}


/* ============================= */
/* SMALL PHONES                  */
/* ============================= */

@media (max-width: 480px) {

  body {
    padding: 14px 0;
  }

  .navbar {
    padding: 12px 10px;
  }

  .site-brand {
    padding: 0.6rem 0.6rem;
    gap: 6px;
  }

  .brand-mark {
    font-size: 1.3rem;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .nav-links {
    gap: 6px;
  }

  .nav-links > li > a,
  .dropdown .dropbtn {
    font-size: 0.92rem;
    padding: 9px 8px;
  }

  main {
    width: 96%;
    padding: 10px;
  }

  h1,
  h2 {
    font-size: 1.25rem;
    padding: 0.9rem 0.8rem;
  }

  p {
    line-height: 1.65;
  }

  .quote {
    font-size: 1.05rem;
  }

  .page-index {
    padding: 20px 14px;
    margin-top: 20px;
  }

  .page-index-card {
    padding: 12px 32px 12px 38px;
  }

  .page-index-title {
    font-size: 0.95rem;
  }

  .page-index-subsections a {
    font-size: 0.88rem;
  }

  pre {
    font-size: 10px;
    padding: 12px;
    border-radius: 10px;
  }

}