* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  background-color: white;
  background-image: url("images/test2.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #0d3b66;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  /* Sticky footer: page is at least screen height, footer pushed to bottom */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Header (top dark bar: logo + social links) ===== */

header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  /* Side padding lines the contents up with the 1000px page column (like the footer);
     on narrow screens it falls back to 40px */
  padding: 20px max(40px, calc(50vw - 800px));
  background-color: #0d3b66;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  min-height: 120px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 40px;
  color: inherit;
  text-decoration: none;
}

.logo {
  height: 100px;
  width: auto;
}

.logo2 {
  height: 250px;
  width: auto;
}

.site-name {
  font-weight: 600;
  font-size: 1.5em;
  color: white;
}

.social-links {
  display: flex;
  gap: 20px;
}

.social-links a {
  color: white;
  font-weight: 500;
  text-decoration: none;
}

.social-links a:hover {
  text-decoration: underline;
}

/* ===== Header subbar (lighter blue bar: nav + link) ===== */

.header-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #4a7fc9;
  color: white;
  padding: 12px max(40px, calc(50vw - 600px));
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-bottom: 40px;
}

.header-subbar nav {
  display: flex;
  gap: 20px;
}

.header-subbar nav a {
  color: white;
  font-weight: 500;
  text-decoration: none;
}

.header-subbar nav a:hover {
  text-decoration: underline;
}

.header-subbar .link {
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.header-subbar .link:hover {
  text-decoration: underline;
}

/* ===== CTA bar (above footer) ===== */

.cta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #4a7fc9;
  color: white;
  /* Same side padding as the header, so the text lines up with the page column */
  padding: 20px max(40px, calc(50vw - 500px));
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
}

.cta-bar p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4em;
  font-weight: 700;
}

.yt-logo {
  height: 1.3em; /* scales with the text */
  width: auto;
}

/* Keeps the logo lined up with the text now that it's wrapped in a link */
.yt-link {
  display: flex;
}

/* Square, solid button like the reference */
.cta-bar .btn {
  border-radius: 0;
}

/* ===== Footer ===== */

/* Takes up the leftover space above the footer on short pages */
footer,
#site-footer {
  margin-top: auto;
}

footer {
  background-color: #0d3b66;
  color: white;
  padding: 40px;
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
}

.footer-columns {
  display: flex;
  gap: 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.footer-col h4 {
  margin-bottom: 15px;
}

.footer-col a {
  display: block;
  color: #cdd9e8;
  margin-bottom: 8px;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1000px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.85em;
  color: #cdd9e8;
}

/* ===== Cards ===== */

/* Grid + subgrid: every card's image, title, text and button share rows,
   so titles line up even when some images are shorter than others */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 30px;
  margin: 60px 0;
}

.card {
  display: grid;
  grid-row: span 4; /* img, h3, p, a */
  grid-template-rows: subgrid;
  row-gap: 0;
}

.card img,
.card video {
  align-self: start; /* keep image/video at top of its row, empty space below */
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 20px;
}

.card h3 {
  color: #0057a3;
  margin-bottom: 12px;
}

.card p {
  margin-bottom: 20px;
  color: #444;
}

/* ===== Buttons (outlined) ===== */

.btn {
  display: inline-block;
  align-self: flex-start; /* don't stretch when placed directly in body */
  justify-self: start;    /* don't stretch when placed in a grid (cards) */
  padding: 10px 22px;
  border: 2px solid #0057a3;
  border-radius: 4px;
  background-color: transparent;
  color: #0057a3;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover {
  background-color: #0057a3;
  color: white;
}

/* Filled variant: add "btn-filled" next to "btn", e.g. class="btn btn-filled" */
.btn-filled {
  background-color: #0d3b66;
  border-color: #0d3b66;
  color: white;
}

.btn-filled:hover {
  background-color: #0057a3;
  border-color: #0057a3;
}

/* ===== Hero ===== */

.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 60px 0;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

.hero-text p {
  margin-bottom: 15px;
  color: #555;
}

.hero-buttons {
  margin-top: 30px;
  display: flex;
  gap: 15px;
}

.hero-image {
  flex: 1;
}

.hero-image img {
  width: 75%;
  height: auto;
  border-radius: 8px;
  display: block;
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 50%,
    rgba(0,0,0,0.8) 65%,
    rgba(0,0,0,0.4) 80%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse at center,
    black 50%,
    rgba(0,0,0,0.8) 65%,
    rgba(0,0,0,0.4) 80%,
    transparent 100%
  );
}

/* ===== Sub-page layout: sidebar + content ===== */

.page-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  margin: 40px 0;
}

#page-nav {
  position: sticky; /* stays visible while scrolling long pages */
  top: 20px;
  align-self: start;
  border-right: 1px solid #dde5ef;
  padding-right: 20px;
}

#page-nav h4 {
  margin-bottom: 10px;
}

#page-nav ul {
  list-style: none;
}

#page-nav li {
  margin-bottom: 6px;
}

#page-nav a.current {
  font-weight: 700;
  color: #0d3b66;
}

#page-nav .coming-soon {
  color: #a0aec0;
}

.page-layout main {
  min-width: 0; /* let the content column shrink instead of pushing the page wider */
}

/* Wide equations scroll inside their own box instead of widening the page */
.latex-example {
  overflow-x: auto;
  margin: 20px 0;
}

#prev-next {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
}

/* Phones: sidebar goes above the content */
@media (max-width: 700px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  #page-nav {
    position: static;
    border-right: none;
    padding-right: 0;
  }
}

/* ===== Misc ===== */

.spacer {
  height: 60px;
}