/* Shared site header, footer, cookie banner and global helpers */
:root {
  --navy: #123653;
  --blue: #6da8bf;
  --blue-soft: #dceef4;
  --bg: #f4f8fc;
  --white: #ffffff;
  --ink: #243746;
  --muted: rgba(36, 55, 70, 0.70);
  --line: rgba(18, 54, 83, 0.13);
  --gold: #e0b750;
  --shadow: rgba(18, 54, 83, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.18, 1.15, 0.35, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  padding-top: 82px;
  min-height: 100vh;
  font-family: "Quicksand", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 12%, rgba(109,168,191,0.16), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #eef6fa 100%);
  overflow-x: hidden;
}

a { color: inherit; }

.site {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.site::before {
  content: "";
  position: fixed;
  right: -11vw;
  top: 118px;
  width: min(48vw, 660px);
  aspect-ratio: 1;
  background: url("../images/logo.png") center / contain no-repeat;
  opacity: 0.075;
  z-index: -1;
  pointer-events: none;
  transform: rotate(-2deg);
  filter: saturate(0.95);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: transparent;
  overflow: visible;
  display: grid;
  place-items: center;
  box-shadow: none;
  flex: 0 0 auto;
  border: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 14px 24px rgba(18,54,83,0.12));
}

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.92;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  white-space: nowrap;
}

.brand-text span {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.menu {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
}

.menu a {
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.menu a:focus-visible,
.btn:focus-visible,
.cookie-banner button:focus-visible,
.footer-cookie:focus-visible,
.footer-social:focus-visible {
  outline: 3px solid rgba(224,183,80,0.72);
  outline-offset: 4px;
  border-radius: 999px;
}

.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 280ms var(--ease);
}

.menu a:hover::after,
.menu a.active::after,
.menu a.current-page::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu a.active,
.menu a.current-page {
  color: var(--blue);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white) !important;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(18,54,83,0.16);
  transition: transform 280ms var(--ease-spring), box-shadow 280ms ease, background 280ms ease;
}

.nav-cta:hover {
  background: #0b2944;
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(18,54,83,0.20);
}

.nav-cta::after { display: none !important; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--navy);
}

/* Optional certificate submenu */
.certificate-subnav {
  position: fixed;
  top: 82px;
  left: 0;
  right: 0;
  z-index: 55;
  background: rgba(244,248,252,0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.certificate-subnav-inner {
  width: min(1240px, calc(100% - 40px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.certificate-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  white-space: nowrap;
}

.certificate-label::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold);
}

.certificate-links {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
}

.certificate-links::-webkit-scrollbar { display: none; }

.certificate-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255,255,255,0.68);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.84rem;
  white-space: nowrap;
  transition: background 220ms ease, transform 220ms var(--ease-spring), color 220ms ease;
}

.certificate-links a:hover,
.certificate-links a.current-subpage {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}

body.has-certificate-subnav {
  padding-top: 140px;
}

body.has-certificate-subnav html,
html.has-certificate-subnav {
  scroll-padding-top: 158px;
}

/* Floating enrol button */
.floating-enroll-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #f3c95d);
  color: var(--navy);
  text-decoration: none;
  font-family: "Quicksand", Arial, sans-serif;
  font-weight: 800;
  box-shadow: 0 20px 42px rgba(18,54,83,0.18);
  border: 2px solid rgba(255,255,255,0.82);
  transition: transform 280ms var(--ease-spring), box-shadow 280ms ease;
}

.floating-enroll-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 26px 54px rgba(18,54,83,0.23);
}

.star-icon { font-size: 1.05rem; line-height: 1; }
.enroll-text { font-size: 0.78rem; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; }

/* Footer */
.site-footer {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(244,248,252,0.86)),
    radial-gradient(circle at 8% 20%, rgba(224,183,80,0.12), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(109,168,191,0.16), transparent 26%);
  padding: 28px 20px 18px;
  color: rgba(36,55,70,0.72);
  font-size: 0.92rem;
  font-weight: 600;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.footer-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.footer-mark {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.footer-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(18,54,83,0.10));
}

.footer-brand strong {
  display: block;
  color: var(--navy);
  font-family: "Montserrat", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: 1rem;
}

.footer-brand span {
  display: block;
  margin-top: 4px;
  color: var(--blue);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.footer-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.footer-cookie {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.86rem;
  transition: background 220ms ease, transform 220ms var(--ease-spring), color 220ms ease;
}

.footer-cookie:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}

.footer-social {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: 0 12px 28px rgba(18,54,83,0.14);
  transition: transform 220ms var(--ease-spring), background 220ms ease;
}

.footer-social:hover {
  transform: translateY(-2px);
  background: var(--blue);
}

.footer-social svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: var(--white);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-social svg circle:last-child {
  fill: var(--white);
  stroke: none;
}

.footer-bottom {
  width: min(1180px, calc(100% - 40px));
  margin: 18px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(18,54,83,0.10);
  text-align: center;
  color: rgba(36,55,70,0.58);
  font-size: 0.86rem;
  font-weight: 700;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  box-shadow: 0 20px 58px rgba(18,54,83,0.16);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 600;
  font-size: 0.92rem;
}

.cookie-banner a {
  color: var(--navy);
  font-weight: 800;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.cookie-banner button {
  border: 0;
  min-width: 112px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .menu { gap: 14px; font-size: 0.86rem; }
  .nav, .certificate-subnav-inner { width: min(1240px, calc(100% - 28px)); }
}

@media (max-width: 980px) {
  .menu {
    display: none;
    position: absolute;
    top: 82px;
    right: 0;
    width: min(330px, calc(100vw - 40px));
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 22px 54px rgba(18,54,83,0.14);
    border: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .menu.active { display: flex; }
  .menu a { padding: 10px 8px; white-space: normal; }
  .nav-cta { width: 100%; }
  .menu-toggle { display: flex; }

  .certificate-subnav { top: 82px; }
  body.has-certificate-subnav { padding-top: 164px; }

  .certificate-subnav-inner {
    min-height: auto;
    padding: 10px 0;
    display: grid;
    align-items: start;
  }

  .certificate-links {
    width: 100%;
    justify-content: flex-start;
  }

  .footer-shell {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .site::before {
    width: min(70vw, 600px);
    right: -28vw;
    opacity: 0.055;
  }
}

@media (max-width: 640px) {
  .site::before {
    width: 94vw;
    right: -48vw;
    top: 118px;
    opacity: 0.045;
  }

  .nav, .certificate-subnav-inner {
    width: min(100% - 28px, 1180px);
  }

  body { padding-top: 78px; }
  body.has-certificate-subnav { padding-top: 152px; }
  html { scroll-padding-top: 96px; }

  .nav { min-height: 78px; }
  .certificate-subnav { top: 78px; }

  .brand-mark {
    width: 56px;
    height: 56px;
  }

  .brand-text span { display: none; }

  .brand-text strong {
    font-size: 0.88rem;
    max-width: 190px;
    white-space: normal;
  }

  .floating-enroll-btn {
    right: 14px;
    bottom: 14px;
    padding: 12px 16px;
  }

  .footer-shell,
  .footer-bottom {
    width: min(100% - 28px, 1180px);
  }

  .footer-actions {
    justify-content: center;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .cookie-banner button { width: 100%; }
}

/* Hero course round thumbnails: crop image inside circle */
.hero-actions#courses .hero-course-thumb {
  width: 58px;
  height: 58px;
  min-width: 58px;
  max-width: 58px;
  min-height: 58px;
  max-height: 58px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  border: 3px solid rgba(255,255,255,0.92);
  display: block;
  box-sizing: border-box;
}

.hero-actions#courses .hero-course-thumb img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
  position: static;
  inset: auto;
  transform: none;
  background: transparent;
}

@media (max-width: 640px) {
  .hero-actions#courses .hero-course-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
  }
}

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