
/* =========================================================
   MATH MEETS CODING
   Earthy Modern Design System
   ========================================================= */

/* 1. COLORS
--------------------------------------------------------- */

:root {
  --cream: #F7F1E7;
  --terracotta: #B85C42;
  --forest: #456B50;
  --sand: #EDE5D8;
  --ochre: #C28B35;
  --charcoal: #302D29;
  --mauve: #8A657C;

  --muted: #777065;
  --border: #DED4C5;
  --white: #FFFCF7;

  --soft-terracotta: #F3E4DC;
  --soft-green: #E5EDE5;
  --soft-ochre: #F5EBD8;
  --soft-mauve: #F0E8EE;

  --container: 1160px;

  --shadow-sm: 0 3px 12px rgba(48,45,41,.06);
  --shadow-md: 0 10px 30px rgba(48,45,41,.10);

  --radius: 14px;
}


/* 2. RESET AND GLOBAL
--------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

a:hover {
  color: var(--forest);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4, h5 {
  color: var(--charcoal);
  line-height: 1.25;
  font-weight: 750;
  margin-top: 0;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  color: var(--muted);
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}


/* 3. HEADER
--------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-wrap {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
}

/* Logo */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: var(--charcoal);
}

.brand:hover {
  color: var(--charcoal);
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--terracotta);
  color: var(--cream);
  border-radius: 12px;
  font-size: 2rem;
  font-weight: 800;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-text strong {
  font-size: 1rem;
  font-weight: 800;
}

.brand-text small {
  color: #968B7D;
  font-size: .66rem;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

/* Main navigation */

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 25px;
  flex: 1;
}


/* LOGIN */

.nav-login {
    display: inline-block;
    border: 1.5px solid var(--terracotta);
    border-radius: 6px;
    padding: 7px 10px;
    color: var(--terracotta);
    background: var(--white);
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}

.nav-login:hover {
    border-color: var(--terracotta);
    background: var(--soft-terracotta);
    color: var(--terracotta);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--charcoal);
  font-size: .91rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  color: var(--terracotta);
}

.dropdown-arrow {
  font-size: 1.1rem;
  color: var(--terracotta);
}

/* Dropdown menus */

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: -15px;
  min-width: 235px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 1001;
}

.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown {
  display: block;
}

.dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--charcoal);
  font-size: .9rem;
}

.dropdown a:hover {
  background: var(--sand);
  color: var(--terracotta);
}

/* Mobile menu toggle */

.menu-toggle {
  display: none;
  width: 43px;
  height: 40px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--charcoal);
  margin: 5px 0;
}


/* 4. HERO
--------------------------------------------------------- */

.hero {
  background: var(--sand);
  padding: 95px 0;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 65px;
}

.hero-content {
  max-width: 650px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--terracotta);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: 2px;
}

.hero h1 {
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 5vw, 3.9rem);
  letter-spacing: -1.5px;
  line-height: 1.15;
}

.hero h1 span {
  color: var(--terracotta);
}

.hero-content > p {
  max-width: 590px;
  font-size: 1.1rem;
  line-height: 1.85;
  margin-bottom: 28px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Hero mathematical illustration */

.hero-art {
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit {
  width: 290px;
  height: 290px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(184,92,66,.45);
  border-radius: 50%;
  animation: none;
}

.orbit::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(69,107,80,.35);
  border-radius: 50%;
}

.orbit-core {
  width: 115px;
  height: 115px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--terracotta);
  color: var(--cream);
  border-radius: 30px;
  font-size: 4rem;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.orbit-node {
  position: absolute;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--cream);
  color: var(--forest);
  font-size: 1.7rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  animation: orbit-counter-spin 35s linear infinite;
}

.node-a {
  top: -10px;
  left: 120px;
}

.node-b {
  right: -12px;
  top: 120px;
}

.node-c {
  bottom: -10px;
  left: 120px;
}

.node-d {
  left: -12px;
  top: 120px;
}

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

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


/* 5. BUTTONS
--------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 25px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .95rem;
  font-weight: 750;
  text-align: center;
  transition: all .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--terracotta);
  color: white;
}

.btn-primary:hover {
  background: #984832;
  color: white;
}

.btn-secondary {
  background: var(--forest);
  color: white;
}

.btn-secondary:hover {
  background: #36543F;
  color: white;
}

.btn-outline {
  background: transparent;
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.btn-outline:hover {
  background: var(--terracotta);
  color: white;
}

.btn-dark {
  background: var(--charcoal);
  color: var(--cream);
}

.btn-dark:hover {
  background: var(--forest);
  color: white;
}


/* 6. SECTIONS
--------------------------------------------------------- */

.section {
  padding: 85px 0;
  background: var(--cream);
}

.section-light {
  background: var(--sand);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 45px;
  text-align: center;
}

.section-heading h2 {
  margin-bottom: 15px;
}

.section-heading p {
  font-size: 1.03rem;
  line-height: 1.8;
  margin-bottom: 0;
}


/* 7. SUBJECT GRID
--------------------------------------------------------- */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
}

.subject-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
  min-height: 275px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  color: var(--charcoal);
}

.subject-card:hover {
  color: var(--charcoal);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.subject-icon {
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft-terracotta);
  color: var(--terracotta);
  border-radius: 14px;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 22px;
}

.subject-card:nth-child(3n+2) .subject-icon {
  background: var(--soft-green);
  color: var(--forest);
}

.subject-card:nth-child(3n) .subject-icon {
  background: var(--soft-ochre);
  color: var(--ochre);
}

.subject-card h3 {
  margin-bottom: 10px;
}

.subject-card p {
  font-size: .95rem;
  line-height: 1.75;
  margin-bottom: 20px;
}

.card-link {
  display: inline-block;
  margin-top: auto;
  color: var(--terracotta);
  font-size: .92rem;
  font-weight: 750;
}

.subject-card:hover .card-link {
  color: var(--forest);
}


/* 8. AP COURSE GRID
--------------------------------------------------------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.course-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.course-label {
  display: inline-block;
  padding: 5px 11px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: var(--soft-mauve);
  color: var(--mauve);
  font-size: .76rem;
  font-weight: 800;
}

.course-card h3 {
  margin-bottom: 12px;
}

.course-card p {
  font-size: .94rem;
  line-height: 1.75;
  margin-bottom: 20px;
}


/* 9. CALLOUT AND CODE WINDOW
--------------------------------------------------------- */

.callout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 45px;
  padding: 45px;
  background: var(--soft-green);
  border: 1px solid #D5E1D5;
  border-radius: 20px;
}

.callout h2 {
  font-size: 2rem;
  margin-bottom: 18px;
}

.callout p {
  line-height: 1.85;
}

.code-window {
  overflow: hidden;
  border-radius: 12px;
  background: var(--charcoal);
  box-shadow: var(--shadow-md);
}

.code-window-header {
  padding: 13px 20px;
  background: #48433C;
  color: var(--cream);
  font-size: .83rem;
  font-weight: 700;
}

.code-window pre {
  padding: 22px;
  margin: 0;
  overflow-x: auto;
  color: #F7F1E7;
  font-family: Consolas, "Courier New", monospace;
  font-size: .86rem;
  line-height: 1.8;
}

.code-window code {
  color: inherit;
}


/* 10. TUTORIAL LIST AND INFO BOX
--------------------------------------------------------- */

.tutorial-list {
  max-width: 850px;
  margin: 0 auto;
}

.info-box {
  padding: 28px;
  background: var(--soft-ochre);
  border-left: 4px solid var(--ochre);
  border-radius: 0 10px 10px 0;
}

.info-box strong {
  color: var(--charcoal);
  font-size: 1.05rem;
}

.info-box p {
  margin: 8px 0 0;
}

.text-center {
  text-align: center;
}


/* 11. FOOTER
--------------------------------------------------------- */

.site-footer {
  padding: 65px 0 20px;
  background: var(--charcoal);
  color: var(--cream);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  font-size: 1.05rem;
  font-weight: 800;
}

.footer-logo:hover {
  color: white;
}

.footer-logo .brand-mark {
  background: var(--terracotta);
}

.footer-brand p {
  max-width: 300px;
  margin-top: 20px;
  color: #C9BFB0;
  font-size: .92rem;
  line-height: 1.8;
}

.footer-tagline {
  color: var(--ochre) !important;
  font-size: .72rem !important;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.footer-column h3 {
  color: var(--cream);
  font-size: 1rem;
  margin-bottom: 20px;
}

.footer-column a {
  display: block;
  margin-bottom: 11px;
  color: #C9BFB0;
  font-size: .88rem;
}

.footer-column a:hover {
  color: var(--ochre);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 50px;
  padding-top: 22px;
  border-top: 1px solid #514A43;
}

.footer-bottom p {
  color: #BEB4A7;
  font-size: .82rem;
  margin: 0;
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  color: #C9BFB0;
  font-size: .85rem;
}

.footer-legal a:hover {
  color: var(--ochre);
}


/* 12. RESPONSIVE NAVIGATION
--------------------------------------------------------- */

@media (max-width: 1050px) {
  .nav-wrap {
    gap: 20px;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-link {
    font-size: .84rem;
  }
}

@media (max-width: 850px) {

  .nav-wrap {
    min-height: 75px;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 0;
    border-top: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 12px 5px;
    font-size: .95rem;
  }

  .dropdown {
    position: static;
    width: 100%;
    min-width: 0;
    display: none;
    padding: 5px 10px 10px 20px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--sand);
  }

  .has-dropdown:hover > .dropdown {
    display: none;
  }

  .has-dropdown.open > .dropdown {
    display: block;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-content {
    max-width: 720px;
  }

  .hero-art {
    min-height: 280px;
  }

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

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

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* 13. MOBILE
--------------------------------------------------------- */

@media (max-width: 560px) {

  .container {
    width: calc(100% - 36px);
  }

  .hero {
    padding: 65px 0;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-content > p {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-art {
    min-height: 240px;
  }

  .orbit {
    width: 220px;
    height: 220px;
  }

  .orbit::before {
    width: 160px;
    height: 160px;
  }

  .orbit-core {
    width: 90px;
    height: 90px;
    font-size: 3rem;
  }

  .orbit-node {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
  }

  .node-a,
  .node-c {
    left: 88px;
  }

  .node-b,
  .node-d {
    top: 88px;
  }

  .section {
    padding: 60px 0;
  }

  .section-heading {
    margin-bottom: 30px;
  }

  .subject-grid,
  .course-grid {
    grid-template-columns: 1fr;
  }

  .subject-card {
    min-height: auto;
  }

  .callout {
    padding: 25px;
  }

  .callout h2 {
    font-size: 1.65rem;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row .btn {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px 20px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

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

  .brand-text strong {
    font-size: .9rem;
  }

  .brand-text small {
    font-size: .59rem;
  }
}


/* 14. ACCESSIBILITY
--------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
}

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


/* =========================================================
   MATH MEETS CODING
   Course-page layout refinement
   C4M-inspired structure, existing Math palette
   Append to the bottom of style2.css
========================================================= */


/* ---------------------------------------------------------
   1. COURSE HERO
--------------------------------------------------------- */

.subject-hero {
  padding: 0;
  background: var(--sand);
}

.subject-hero .hero-inner {
  min-height: 430px;
  grid-template-columns: 1.1fr .9fr;
  gap: 70px;
  padding-top: 65px;
  padding-bottom: 65px;
}

.subject-hero .breadcrumb {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: .82rem;
}

.subject-hero .breadcrumb a {
  color: var(--terracotta);
  font-weight: 650;
}

.subject-hero .breadcrumb a:hover {
  color: var(--forest);
}

.subject-hero .eyebrow {
  margin-bottom: 15px;
}

.subject-hero h1 {
  max-width: 680px;
  margin-bottom: 20px;
  font-size: clamp(2.7rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -1.5px;
}

.subject-hero .hero-inner > div:first-child > p {
  max-width: 620px;
  margin-bottom: 28px;
  font-size: 1.08rem;
  line-height: 1.8;
}

.subject-hero .hero-actions {
  gap: 13px;
}

.subject-hero .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 47px;
  padding: 12px 23px;
  border: 1px solid var(--terracotta);
  border-radius: 8px;
  background: var(--terracotta);
  color: white;
  font-size: .9rem;
  font-weight: 750;
  transition: .2s ease;
}

.subject-hero .button:hover {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
  transform: translateY(-2px);
}

.subject-hero .button.secondary {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--border);
}

.subject-hero .button.secondary:hover {
  background: var(--white);
  border-color: var(--forest);
  color: var(--forest);
}

.subject-hero .hero-art {
  min-height: 300px;
}

.subject-hero .orbit {
  width: 280px;
  height: 280px;
  box-shadow: var(--shadow-sm);
}

.subject-hero .orbit-core {
  width: 112px;
  height: 112px;
  border-radius: 27px;
}

.subject-hero .orbit-node {
  width: 50px;
  height: 50px;
  border: 1px solid var(--border);
}


/* ---------------------------------------------------------
   2. SECTION HEADINGS
--------------------------------------------------------- */

.section {
  padding: 78px 0;
}

.section.soft {
  background: var(--sand);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 35px;
  margin-bottom: 32px;
}

.section-head > div {
  flex: 1;
}

.section-head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -1px;
}

.section-head > p {
  max-width: 470px;
  margin: 0;
  font-size: .95rem;
  line-height: 1.75;
}


/* ---------------------------------------------------------
   3. INTRODUCTION AND TOPICS
--------------------------------------------------------- */

.subject-intro {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: stretch;
  gap: 28px;
}

.subject-intro > div {
  min-width: 0;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.subject-intro > div:first-child {
  border-top: 4px solid var(--terracotta);
}

.subject-intro > div:last-child {
  border-top: 4px solid var(--forest);
}

.subject-intro h2 {
  margin: 8px 0 18px;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  line-height: 1.25;
  letter-spacing: -.6px;
}

.subject-intro p {
  font-size: .96rem;
  line-height: 1.85;
  margin-bottom: 14px;
}

.subject-intro p:last-child {
  margin-bottom: 0;
}


/* Topic cards */

.topic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 15px;
}

.topic {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--charcoal);
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.4;
  transition: .2s ease;
}

.topic:before {
  content: "↗";
  flex-shrink: 0;
  margin-right: 10px;
  color: var(--terracotta);
  font-weight: 800;
}

.topic:hover {
  background: var(--soft-green);
  border-color: var(--forest);
  transform: translateY(-2px);
}


/* ---------------------------------------------------------
   4. COURSE UNIT ACCORDIONS
--------------------------------------------------------- */

.tutorial-list {
  display: grid;
  gap: 13px;
  width: 100%;
  max-width: none;
  margin: 0;
}

.tutorial-accordion {
  overflow: hidden;
  margin: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.tutorial-accordion:hover {
  border-color: var(--terracotta);
  box-shadow: var(--shadow-md);
}

.tutorial-accordion[open] {
  border-color: var(--terracotta);
  box-shadow: var(--shadow-md);
}

.tutorial-accordion summary {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 19px;
  min-height: 100px;
  padding: 20px 25px;
  list-style: none;
  cursor: pointer;
  transition: background .2s ease;
}

.tutorial-accordion summary::-webkit-details-marker {
  display: none;
}

.tutorial-accordion summary:hover {
  background: var(--cream);
}

.tutorial-index {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--soft-terracotta);
  color: var(--terracotta);
  font-size: 1rem;
  font-weight: 850;
}

.tutorial-accordion:nth-child(3n+2) .tutorial-index {
  background: var(--soft-green);
  color: var(--forest);
}

.tutorial-accordion:nth-child(3n) .tutorial-index {
  background: var(--soft-ochre);
  color: var(--ochre);
}

.tutorial-heading {
  min-width: 0;
}

.tutorial-heading h3 {
  margin: 0 0 6px;
  color: var(--charcoal);
  font-size: 1.08rem;
  line-height: 1.35;
}

.tutorial-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
}

.tutorial-accordion .access {
  padding: 6px 11px;
  border-radius: 20px;
  background: var(--soft-green);
  color: var(--forest);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .5px;
}

.tutorial-arrow {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--terracotta);
  font-size: 1.1rem;
  transition: transform .25s ease;
}

.tutorial-accordion[open] .tutorial-arrow {
  transform: rotate(180deg);
}


/* Lesson panel */

.lesson-panel {
  padding: 22px 30px 25px 96px;
  background: var(--cream);
  border-top: 1px solid var(--border);
}

.lesson-panel h4 {
  margin: 0 0 12px;
  color: var(--charcoal);
  font-size: .9rem;
  font-weight: 800;
}

.lesson-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.lesson-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.lesson-list li:last-child {
  border-bottom: 0;
}

.lesson-link {
  color: var(--charcoal);
  font-size: .91rem;
  font-weight: 600;
  line-height: 1.5;
}

.lesson-link:hover {
  color: var(--terracotta);
}

.lesson-type {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--soft-mauve);
  color: var(--mauve);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .4px;
}


/* ---------------------------------------------------------
   5. NOTICE BOX
--------------------------------------------------------- */

.notice {
  margin-top: 25px;
  padding: 20px 24px;
  background: var(--soft-ochre);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ochre);
  border-radius: 0 11px 11px 0;
  color: var(--charcoal);
  font-size: .92rem;
  line-height: 1.7;
}

.notice strong {
  color: var(--charcoal);
}


/* ---------------------------------------------------------
   6. PYTHON / R CALLOUT
--------------------------------------------------------- */

.callout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 42px;
  background: var(--soft-green);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.callout h2 {
  margin-bottom: 16px;
  font-size: clamp(1.65rem, 2.5vw, 2.1rem);
  line-height: 1.25;
}

.callout p {
  margin: 0;
  font-size: .96rem;
  line-height: 1.85;
}

.code-window {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #48433C;
  border-radius: 12px;
  background: var(--charcoal);
  box-shadow: var(--shadow-md);
}

.code-window-header {
  padding: 13px 19px;
  background: #48433C;
  color: var(--cream);
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .3px;
}

.code-window pre {
  max-width: 100%;
  padding: 22px;
  margin: 0;
  overflow-x: auto;
  color: var(--cream);
  font-size: .82rem;
  line-height: 1.75;
  tab-size: 2;
}

.code-window code {
  color: inherit;
}


/* ---------------------------------------------------------
   7. FINAL COURSE CTA
--------------------------------------------------------- */

.section-heading {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.section-heading h2 {
  margin-bottom: 14px;
}

.section-heading p {
  max-width: 650px;
  margin: 0 auto 24px;
  line-height: 1.8;
}

.section-heading .button-row {
  justify-content: center;
  margin-top: 25px;
}


/* ---------------------------------------------------------
   8. RESPONSIVE LAYOUT
--------------------------------------------------------- */

@media (max-width: 900px) {

  .subject-hero .hero-inner {
    grid-template-columns: 1fr .75fr;
    gap: 30px;
  }

  .subject-intro {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .subject-intro > div {
    padding: 25px;
  }

  .callout {
    gap: 25px;
    padding: 30px;
  }

  .tutorial-accordion summary {
    gap: 14px;
    padding: 19px;
  }

  .lesson-panel {
    padding-left: 82px;
  }
}


@media (max-width: 700px) {

  .section {
    padding: 58px 0;
  }

  .subject-hero .hero-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 45px;
    padding-bottom: 35px;
  }

  .subject-hero h1 {
    font-size: clamp(2.35rem, 9vw, 3.1rem);
  }

  .subject-hero .hero-inner > div:first-child > p {
    font-size: 1rem;
  }

  .subject-hero .hero-art {
    min-height: 230px;
  }

  .subject-hero .orbit {
    width: 220px;
    height: 220px;
  }

  .subject-hero .orbit-core {
    width: 90px;
    height: 90px;
    font-size: 3rem;
  }

  .subject-intro {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .subject-intro > div {
    padding: 25px;
  }

  .section-head {
    display: block;
  }

  .section-head > p {
    margin-top: 14px;
  }

  .tutorial-accordion summary {
    grid-template-columns: 44px minmax(0, 1fr) 22px;
    gap: 13px;
    min-height: 85px;
    padding: 16px;
  }

  .tutorial-index {
    width: 42px;
    height: 42px;
    font-size: .9rem;
  }

  .tutorial-accordion summary .access {
    display: none;
  }

  .tutorial-heading h3 {
    font-size: .98rem;
  }

  .tutorial-heading p {
    font-size: .82rem;
  }

  .lesson-panel {
    padding: 19px 20px;
  }

  .lesson-list li {
    align-items: flex-start;
  }

  .lesson-link {
    font-size: .86rem;
  }

  .lesson-type {
    font-size: .62rem;
  }

  .callout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 25px;
  }

  .callout h2 {
    font-size: 1.65rem;
  }

  .code-window pre {
    font-size: .75rem;
    padding: 17px;
  }

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


@media (max-width: 430px) {

  .subject-hero .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .subject-hero .hero-actions .button {
    width: 100%;
  }

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

  .lesson-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
}



/* =========================================================
   BLOG — EDITORIAL DESIGN
   Math Meets Coding
========================================================= */

/* Main page */

.blog-page {
  background: var(--cream);
  padding-bottom: 70px;
}

/* ---------------------------------------------------------
   BLOG HERO
--------------------------------------------------------- */

.blog-hero {
  position: relative;
  padding: 85px 0 75px;
  background: var(--sand);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.blog-hero .container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  text-align: center;
}

.blog-hero .eyebrow {
  margin-bottom: 20px;
  letter-spacing: 2.5px;
}

.blog-hero h1 {
  max-width: 850px;
  margin: 0 auto 20px;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.12;
  letter-spacing: -1.8px;
}

.blog-hero p {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.08rem;
  line-height: 1.9;
}

/* Decorative underline */

.blog-hero h1::after {
  content: "";
  display: block;
  width: 65px;
  height: 4px;
  margin: 25px auto 0;
  background: var(--terracotta);
  border-radius: 5px;
}

/* ---------------------------------------------------------
   BLOG CONTENT
--------------------------------------------------------- */

.blog-section {
  padding: 70px 0;
}

.blog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.blog-heading .eyebrow {
  margin: 0;
}

.blog-heading h2 {
  margin: 8px 0 0;
  font-size: 2rem;
}

/* ---------------------------------------------------------
   BLOG LIST
--------------------------------------------------------- */

.blog-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 950px;
  margin: 0 auto;
}

/* Article card */

.blog-card {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  padding: 34px 38px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease,
              border-color .25s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--terracotta);
  box-shadow: var(--shadow-md);
}

.blog-card-content {
  min-width: 0;
}

/* ---------------------------------------------------------
   METADATA
--------------------------------------------------------- */

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 19px;
}

.blog-meta time {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .5px;
}

/* Categories */

.blog-category {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 5px;
  background: var(--soft-terracotta);
  color: var(--terracotta);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .7px;
}

/* Alternate category colors */

.blog-category:nth-of-type(2) {
  background: var(--soft-green);
  color: var(--forest);
}

/* Tags */

.blog-tag {
  display: inline-block;
  padding: 4px 9px;
  margin-right: 5px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--cream);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
}

/* ---------------------------------------------------------
   ARTICLE TITLE
--------------------------------------------------------- */

.blog-card h3 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  line-height: 1.35;
  letter-spacing: -.5px;
}

.blog-card h3 a {
  color: var(--charcoal);
  text-decoration: none;
  transition: color .2s ease;
}

.blog-card h3 a:hover {
  color: var(--terracotta);
}

/* Excerpt */

.blog-excerpt {
  max-width: 780px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.85;
}

/* Read more */

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--terracotta);
  font-size: .9rem;
  font-weight: 800;
  transition: gap .2s ease, color .2s ease;
}

.blog-read-more:hover {
  gap: 13px;
  color: var(--forest);
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 700px) {

  .blog-hero {
    padding: 60px 0 55px;
  }

  .blog-hero h1 {
    font-size: 2.5rem;
  }

  .blog-hero p {
    font-size: 1rem;
  }

  .blog-section {
    padding: 48px 0;
  }

  .blog-card {
    padding: 25px 22px;
  }

  .blog-card h3 {
    font-size: 1.35rem;
  }

  .blog-heading {
    display: block;
  }
}


/* =========================================================
   INDIVIDUAL BLOG POSTS — EDITORIAL ARTICLE LAYOUT
========================================================= */

.post-page {
  background: var(--cream);
  padding-bottom: 80px;
}

/* ---------- Article header ---------- */

.post-hero {
  background: var(--sand);
  border-bottom: 1px solid var(--border);
  padding: 38px 0 55px;
}

.post-hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* Breadcrumb */

.post-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.6;
}

.post-breadcrumb a {
  color: var(--forest);
  text-decoration: none;
  font-weight: 650;
}

.post-breadcrumb a:hover {
  color: var(--terracotta);
}

.post-breadcrumb span:last-child {
  color: var(--charcoal);
}

/* Eyebrow */

.post-hero .eyebrow {
  margin-bottom: 17px;
  color: var(--terracotta);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Main title */

.post-hero h1 {
  max-width: 850px;
  margin: 0 0 20px;
  color: var(--charcoal);
  font-size: clamp(2.3rem, 5vw, 3.65rem);
  line-height: 1.13;
  letter-spacing: -1.6px;
  font-weight: 800;
}

/* Short subtitle / teaser */

.post-teaser {
  max-width: 720px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

/* ---------- Metadata ---------- */

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.post-meta time {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  margin-right: 5px;
}

.post-category {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 5px;
  background: var(--soft-green);
  color: var(--forest);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .7px;
}

.post-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
}

.post-tag {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
}

/* ---------- Article body ---------- */

.post-content-section {
  padding: 65px 0 30px;
}

.post-content-section > .container {
  max-width: 900px;
}

.post-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 58px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  color: var(--charcoal);
  font-size: 1.05rem;
  line-height: 1.95;
}

/* Paragraphs */

.post-content p {
  margin: 0 0 1.5em;
  color: #49443D;
  font-size: 1.04rem;
  line-height: 1.95;
}

/* Headings */

.post-content h2 {
  margin: 2.2em 0 .75em;
  color: var(--charcoal);
  font-size: 1.8rem;
  line-height: 1.3;
  letter-spacing: -.5px;
}

.post-content h3 {
  margin: 1.8em 0 .65em;
  color: var(--forest);
  font-size: 1.35rem;
  line-height: 1.4;
}

/* Links */

.post-content a {
  color: var(--terracotta);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-content a:hover {
  color: var(--forest);
}

/* Lists */

.post-content ul,
.post-content ol {
  margin: 0 0 1.6em;
  padding-left: 1.5em;
}

.post-content li {
  margin-bottom: .55em;
  padding-left: .25em;
  line-height: 1.8;
}

.post-content li::marker {
  color: var(--terracotta);
}

/* Blockquotes */

.post-content blockquote {
  margin: 2em 0;
  padding: 20px 25px;
  border-left: 4px solid var(--terracotta);
  border-radius: 0 8px 8px 0;
  background: var(--soft-terracotta);
  color: var(--charcoal);
}

.post-content blockquote p {
  margin: 0;
  color: var(--charcoal);
}

/* Images */

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 10px;
}

.post-content figure {
  margin: 2em 0;
}

.post-content figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

/* Code */

.post-content pre {
  overflow-x: auto;
  margin: 1.8em 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #F2EDE4;
  font-size: .88rem;
  line-height: 1.65;
}

.post-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--sand);
  color: var(--charcoal);
  font-size: .9em;
}

.post-content pre code {
  padding: 0;
  background: transparent;
}

/* Tables */

.post-content table {
  width: 100%;
  margin: 2em 0;
  border-collapse: collapse;
  font-size: .9rem;
}

.post-content th,
.post-content td {
  padding: 12px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--sand);
  color: var(--charcoal);
  font-weight: 750;
}

/* ---------- Back navigation ---------- */

.post-navigation {
  max-width: 760px;
  margin: 30px auto 0;
}

.post-navigation a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--forest);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
  transition: color .2s ease, gap .2s ease;
}

.post-navigation a:hover {
  gap: 13px;
  color: var(--terracotta);
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .post-hero {
    padding: 25px 0 38px;
  }

  .post-breadcrumb {
    margin-bottom: 30px;
    font-size: .72rem;
  }

  .post-hero h1 {
    font-size: 2.25rem;
    letter-spacing: -.8px;
  }

  .post-teaser {
    font-size: 1rem;
  }

  .post-content-section {
    padding: 35px 0 20px;
  }

  .post-content {
    padding: 28px 23px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .post-content p {
    font-size: 1rem;
  }

  .post-content h2 {
    font-size: 1.5rem;
  }

  .post-meta {
    gap: 9px;
  }
}

