:root {
  --teal: #008f7d;
  --teal-dark: #007567;
  --teal-deep: #008677;
  --red: #e84b37;
  --ink: #34383f;
  --muted: #6f7785;
  --line: #dedede;
  --soft: #f3f4f4;
  --white: #ffffff;
  --shadow: 0 16px 38px rgba(38, 45, 56, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

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

a:hover {
  color: var(--teal-dark);
}

.site-header {
  background: var(--white);
}

.quick-nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid #d7d7d7;
  background: #e8e8e8;
}

.quick-nav a {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border-right: 1px solid #d2d2d2;
  color: #555b63;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.quick-nav a:first-child {
  border-left: 1px solid #d2d2d2;
}

.quick-nav a::before {
  content: "";
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  background: var(--nav-icon) center / contain no-repeat;
}

.nav-school {
  --nav-icon: url("../img/menu/house.svg");
}

.nav-syllabus {
  --nav-icon: url("../img/menu/book.svg");
}

.nav-lessons {
  --nav-icon: url("../img/menu/pencil.svg");
}

.nav-projects {
  --nav-icon: url("../img/menu/users.svg");
}

.nav-downloads {
  --nav-icon: url("../img/menu/download.svg");
}

.nav-contact {
  --nav-icon: url("../img/menu/at-sign.svg");
}

.quick-nav a:hover {
  background: #f2f2f2;
  color: var(--teal);
}

.brand-bar {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-logo {
  width: 240px;
  max-width: 100%;
  height: auto;
  display: block;
}

.header-links {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 15px;
}

.header-links a {
  font-weight: 700;
  text-decoration: none;
}

.hero {
  min-height: 380px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 120, 105, 0.86), rgba(0, 120, 105, 0.58) 46%, rgba(48, 54, 64, 0.18)),
    url("../img/brand/gymzl-default.jpg") center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 8px;
  background: var(--red);
}

.hero-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 64px 24px 72px;
  color: var(--white);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--white);
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 20px 0 0;
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid transparent;
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  background: var(--red);
  color: var(--white);
}

.button-primary:hover {
  background: #cf3e2d;
  color: var(--white);
}

.button-secondary {
  border-color: var(--white);
  color: var(--white);
}

.button-secondary:hover {
  background: var(--white);
  color: var(--teal-dark);
}

.button-disabled {
  cursor: not-allowed;
  background: #d9dddd;
  color: #59606a;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px;
}

.muted-section {
  max-width: none;
  background: var(--soft);
}

.muted-section > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading-centered {
  text-align: center;
}

.section-heading h2,
.downloads-panel h2,
.site-footer h2 {
  margin: 0;
  color: #6f7a8d;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading p:last-child {
  margin-bottom: 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.overview-item {
  border-top: 4px solid var(--teal);
  padding: 24px 0 0;
}

.overview-number {
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
}

.overview-item h3,
.lesson-card h3,
.project-card h3 {
  margin: 6px 0 10px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.overview-item p,
.lesson-card p,
.project-card p {
  margin: 0;
  color: #4d545f;
}

.split-section {
  border-top: 1px solid var(--line);
}

.syllabus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 48px;
  align-items: start;
}

.syllabus-copy p {
  margin-top: 0;
  font-size: 18px;
}

.text-link {
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.syllabus-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.syllabus-list li {
  padding: 18px 0 18px 30px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.syllabus-list li::before {
  content: "";
  width: 9px;
  height: 9px;
  position: absolute;
  left: 4px;
  top: 26px;
  background: var(--red);
}

.lesson-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.lesson-card,
.project-card {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(37, 45, 52, 0.06);
}

.lesson-card {
  padding: 24px;
}

.lesson-meta,
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  background: #edf4f3;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lesson-card ul {
  margin: 18px 0 0;
  padding-left: 18px;
}

.lesson-card li + li {
  margin-top: 6px;
}

.project-card {
  overflow: hidden;
  min-height: 430px;
  display: flex;
  flex-direction: column;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--soft);
  border-bottom: 4px solid var(--teal);
}

.project-image-button {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.project-image-button:focus-visible,
.project-thumb-button:focus-visible,
.gallery-close:focus-visible,
.gallery-nav:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.project-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.project-image-button:hover img {
  filter: saturate(1.08);
  transform: scale(1.02);
}

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: #f7f8f8;
  border-bottom: 4px solid var(--teal);
}

.project-thumb-button {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: zoom-in;
}

.project-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-thumb-button:hover {
  border-color: var(--teal);
}

.project-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 18px;
}

.project-download {
  min-height: 40px;
  padding: 9px 14px;
  background: var(--teal);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}

.project-download:hover {
  background: var(--teal-dark);
  color: var(--white);
}

.project-download[aria-disabled="true"] {
  pointer-events: none;
}

.checksum {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.downloads-section {
  padding-top: 0;
}

.downloads-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  gap: 48px;
  padding: 42px;
  background: var(--teal-deep);
  color: var(--white);
  box-shadow: var(--shadow);
}

.downloads-panel .section-kicker,
.downloads-panel h2 {
  color: var(--white);
}

.downloads-panel p {
  margin-bottom: 0;
}

.steps-list {
  margin: 0;
  padding-left: 24px;
}

.steps-list li {
  padding-left: 8px;
  margin-bottom: 14px;
}

.steps-list code {
  color: var(--white);
  font-weight: 800;
}

.site-footer {
  background: var(--teal-deep);
  color: var(--white);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 34px;
  padding: 24px;
  background: var(--red);
}

.footer-nav a {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.footer-main {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 44px;
  padding: 54px 24px 60px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.footer-logo {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.footer-region-logo {
  width: 170px;
  max-width: 100%;
  height: auto;
}

.site-footer h2 {
  color: var(--white);
  font-size: 18px;
}

.site-footer a {
  color: var(--white);
}

.site-footer p {
  margin: 10px 0 0;
}

.load-error {
  padding: 20px;
  border-left: 5px solid var(--red);
  background: #fff5f2;
  color: var(--ink);
}

.gallery-open {
  overflow: hidden;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(24, 29, 35, 0.78);
}

.gallery-modal[hidden] {
  display: none;
}

.gallery-panel {
  width: min(1040px, 100%);
  max-height: calc(100vh - 56px);
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.gallery-panel > img {
  width: 100%;
  max-height: calc(100vh - 170px);
  display: block;
  object-fit: contain;
  background: #15191e;
}

.gallery-close,
.gallery-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.gallery-close {
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  font-size: 30px;
}

.gallery-nav {
  top: 50%;
  width: 46px;
  height: 58px;
  transform: translateY(-50%);
  font-size: 42px;
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

.gallery-close:hover,
.gallery-nav:hover {
  background: var(--teal);
  color: var(--white);
}

.gallery-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-top: 4px solid var(--teal);
}

.gallery-caption h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}

.gallery-caption p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 920px) {
  .quick-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-nav a {
    min-height: 46px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .quick-nav a::before {
    width: 18px;
    height: 18px;
  }

  .brand-bar,
  .syllabus-layout,
  .downloads-panel,
  .footer-main {
    grid-template-columns: 1fr;
  }

  .brand-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-grid,
  .lesson-grid,
  .project-grid {
    grid-template-columns: 1fr 1fr;
  }

}

@media (max-width: 640px) {
  .quick-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-nav a {
    min-height: 38px;
    padding: 6px 4px;
    font-size: 10px;
  }

  .quick-nav a::before {
    display: none;
  }

  .brand-bar {
    min-height: 96px;
    gap: 12px;
    padding: 18px;
  }

  .brand {
    gap: 12px;
    font-size: 16px;
  }

  .brand-logo {
    width: 190px;
  }

  .header-links {
    display: none;
  }

  .header-links,
  .hero-actions,
  .footer-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .hero {
    min-height: 440px;
  }

  .hero p {
    font-size: 17px;
  }

  .overview-grid,
  .lesson-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 54px 18px;
  }

  .downloads-panel {
    padding: 30px 22px;
  }

  .gallery-modal {
    padding: 12px;
  }

  .gallery-panel {
    max-height: calc(100vh - 24px);
  }

  .gallery-panel > img {
    max-height: calc(100vh - 140px);
  }

  .gallery-close {
    width: 38px;
    height: 38px;
  }

  .gallery-nav {
    width: 40px;
    height: 50px;
    font-size: 36px;
  }

  .gallery-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
  }
}
