/* ---------------------------------------------------------------------------
   Design tokens - change colors and spacing here to re-theme the whole site.
--------------------------------------------------------------------------- */
:root {
  /* Palette taken from the logo: sigma blue, phi ochre, neutral text tones. */
  --color-primary: #185fa5;
  --color-primary-dark: #0e3a66;
  --color-accent: #ba7517;
  --color-accent-dark: #955d0f;
  --color-bg: #ffffff;
  --color-bg-alt: #f2f6fa;
  --color-text: #1f1e1c;
  --color-text-muted: #52514e;
  --color-border: #dde3ea;
  --color-on-primary: #f4f7fa;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container-width: 1100px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(24, 95, 165, 0.10);
}

/* ------------------------------- Reset ---------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

img,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--color-primary);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-primary);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-lead {
  max-width: 44rem;
  color: var(--color-text-muted);
}

/* ------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-outline {
  border-color: var(--color-on-primary);
  color: var(--color-on-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ------------------------------- Header --------------------------------- */
/* Light header so the logo's dark wordmark stays readable. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 3rem;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-weight: 500;
}

.site-nav a:hover {
  background: var(--color-bg-alt);
}

.site-nav a.active {
  background: var(--color-primary);
  color: #ffffff;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  color: var(--color-primary);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

/* -------------------------------- Hero ---------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-on-primary);
  padding: 4.5rem 0;
}

.hero h1 {
  color: #ffffff;
  max-width: 22ch;
}

.hero p {
  max-width: 46rem;
  font-size: 1.15rem;
  color: rgba(244, 247, 250, 0.9);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero-math {
  position: absolute;
  right: -2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11rem;
  font-weight: 700;
  color: rgba(233, 178, 106, 0.16);
  user-select: none;
  pointer-events: none;
}

/* ------------------------------- Cards ---------------------------------- */
.card-grid {
  display: grid;
  /* minmax(280px) caps the grid at 3 columns within the 1100px container. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-icon {
  font-size: 1.9rem;
  margin-bottom: 0.6rem;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  color: var(--color-text-muted);
  margin: 0;
}

/* ------------------------------ Teachers -------------------------------- */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.teacher-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.teacher-avatar {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
}

.teacher-card h3 {
  margin-bottom: 0.2rem;
}

.teacher-card p {
  color: var(--color-text-muted);
  margin: 0;
}

/* ------------------------------- Courses -------------------------------- */
.course-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.course {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.course-badge {
  align-self: start;
  background: var(--color-primary);
  color: #ffffff;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.course h3 {
  margin-bottom: 0.35rem;
}

.course p {
  margin-bottom: 0.5rem;
}

.course-meta {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ------------------------------- Tables --------------------------------- */
.table-wrap {
  overflow-x: auto;
  margin-top: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

thead th {
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}


/* ---------------------------- Testimonials ------------------------------ */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.testimonial {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  margin: 0;
}

.testimonial blockquote {
  margin: 0 0 1rem;
  flex: 1;
}

.testimonial blockquote::before {
  content: "“";
  display: block;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-accent);
}

.testimonial figcaption {
  font-weight: 600;
  color: var(--color-primary);
}

.testimonial figcaption span {
  display: block;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ---------------------------- Achievements ------------------------------ */
.achievement-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.achievement {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1.25rem;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.achievement-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.achievement-year {
  background: var(--color-primary);
  color: #ffffff;
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.achievement p {
  margin: 0;
  align-self: center;
}

/* ------------------------------ Contacts -------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

.contact-details ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.contact-details li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.contact-details li:last-child {
  border-bottom: none;
}

.contact-details strong {
  color: var(--color-primary);
}

.map-embed {
  border: 0;
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* -------------------------------- Forms --------------------------------- */
.contact-form {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.form-field {
  margin-bottom: 1.1rem;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--color-primary);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

.form-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --------------------------------- CTA ---------------------------------- */
.cta {
  background: linear-gradient(150deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-on-primary);
  text-align: center;
  padding: 3.5rem 0;
}

.cta h2 {
  color: #ffffff;
}

.cta p {
  color: rgba(244, 247, 250, 0.9);
  max-width: 40rem;
  margin: 0 auto 1.5rem;
}

/* -------------------------------- Footer -------------------------------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(244, 247, 250, 0.85);
  padding: 2.5rem 0 1.5rem;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.site-footer h3 {
  color: #ffffff;
  font-size: 1.05rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  padding: 0.2rem 0;
}

.site-footer a {
  color: rgba(244, 247, 250, 0.85);
}

.footer-copy {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.25rem;
  text-align: center;
  color: rgba(244, 247, 250, 0.6);
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.25rem 1.25rem;
    box-shadow: var(--shadow);
  }

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

  .hero-math {
    display: none;
  }

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

  .course-badge {
    justify-self: start;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }
}
