
/* =========================================================
   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;
}

.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;
  }
}

