@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --maple-red: #b95a38;
  --maple-red-deep: #8d3f2d;
  --gold: #d9b26a;
  --gold-soft: #f1d79a;
  --cream: #f7f1e8;
  --cream-deep: #efe3d0;
  --leaf: #2d5c43;
  --leaf-dark: #1d3d2d;
  --charcoal: #1f2a2f;
  --muted: #576570;
  --white: #ffffff;
  --shadow-soft: 0 24px 60px rgba(26, 38, 44, 0.08);
  --blur: rgba(255,255,255,0.7);
  --radius-xl: 2rem;
  --radius-lg: 1.4rem;
  --radius-md: 1rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: auto; }
body {
  font-family: 'Manrope', sans-serif;
  background: linear-gradient(180deg, #fffdf9 0%, #f7f1e8 100%);
  color: var(--charcoal);
}

h1, h2, h3, h4, .display-font {
  font-family: 'Fraunces', serif;
  letter-spacing: -0.04em;
}

img { max-width: 100%; display: block; }

a { transition: all 180ms var(--ease); }
button, input, textarea { font: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--leaf-dark);
  color: var(--white);
  padding: .8rem 1.2rem;
  border-radius: 0 0 0.8rem 0.8rem;
}
.skip-link:focus { left: 1rem; }

#scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--maple-red), var(--gold));
  z-index: 70;
  box-shadow: 0 0 14px rgba(185, 90, 56, 0.6);
}

.page-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.section-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.soft-card {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(31,42,47,0.08);
  box-shadow: var(--shadow-soft);
}

.nav-surface {
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(29, 61, 45, 0.08);
}

.nav-link {
  position: relative;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--charcoal);
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: var(--maple-red);
  transition: transform 220ms var(--ease);
}
.nav-link:hover::after, .nav-link.active::after {
  transform: scaleX(1);
}

.dropdown-panel {
  position: absolute;
  left: 50%;
  top: calc(100% + 1rem);
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 220ms var(--ease);
  pointer-events: none;
}
.nav-desktop .group:hover .dropdown-panel,
.nav-desktop .group:focus-within .dropdown-panel,
.nav-desktop .group.open .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.social-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(29,61,45,0.08);
  background: rgba(255,255,255,0.5);
  color: var(--leaf-dark);
}
.social-icon:hover {
  background: var(--leaf-dark);
  color: var(--white);
  transform: translateY(-2px);
}

.hero-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(30px);
  opacity: 0.32;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-soft);
  background: #e9e0d1;
  border: 1px solid rgba(255,255,255,0.4);
}
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease);
}
.gallery-card:hover img { transform: scale(1.04); }

.leaf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(185, 90, 56, 0.08);
  color: var(--maple-red-deep);
  border: 1px solid rgba(185, 90, 56, 0.12);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.96;
  color: var(--charcoal);
}

.section-kicker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--maple-red-deep);
  font-weight: 800;
}

.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border-radius: 999px;
  min-height: 3.2rem;
  padding: 0.9rem 1.35rem;
  font-weight: 800;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease), color 200ms var(--ease);
}
.btn-primary {
  background: linear-gradient(135deg, var(--maple-red) 0%, var(--gold) 100%);
  color: var(--white);
  box-shadow: 0 14px 24px rgba(185, 90, 56, 0.22);
}
.btn-primary:hover, .btn-secondary:hover, .btn-outline:hover {
  transform: translateY(-2px);
}
.btn-secondary {
  background: rgba(255,255,255,0.7);
  color: var(--charcoal);
  border: 1px solid rgba(31,42,47,0.08);
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(29,61,45,0.18);
  color: var(--leaf-dark);
}

.feature-card {
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(29,61,45,0.08);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.feature-card img {
  height: 260px;
  width: 100%;
  object-fit: cover;
}

.post-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(29,61,45,0.08);
  box-shadow: var(--shadow-soft);
}
.post-card .post-media {
  aspect-ratio: 4 / 5;
  background: #f2e8d8;
}
.post-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card .post-label {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(31,42,47,0.72);
  color: var(--white);
  padding: 0.46rem 0.8rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faculty-card {
  min-width: 240px;
  max-width: 260px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(31,42,47,0.08);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.faculty-card img {
  width: 100%;
  height: 340px;
  object-fit: cover;
}
.faculty-card__role {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  background: rgba(31,42,47,0.72);
  color: var(--white);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.25rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(185,90,56,0.2), rgba(41,92,66,0.4), rgba(185,90,56,0.2));
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  align-items: start;
}
.timeline-dot {
  position: relative;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--maple-red), var(--gold));
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(185,90,56,0.25);
  z-index: 2;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.tab-button {
  position: relative;
  padding: 0.78rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(29,61,45,0.1);
  background: rgba(255,255,255,0.5);
  color: var(--charcoal);
  font-weight: 700;
}
.tab-button.active {
  background: #fff;
  border-color: rgba(185,90,56,0.25);
  color: var(--maple-red-deep);
}
.tab-button.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--maple-red));
  border-radius: 999px;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeUp 360ms var(--ease);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}
.gallery-grid .item-a { grid-column: span 7; }
.gallery-grid .item-b { grid-column: span 5; }
.gallery-grid .item-c { grid-column: span 4; }
.gallery-grid .item-d { grid-column: span 8; }
.gallery-grid .item-e { grid-column: span 12; }

.gallery-grid .gallery-card {
  min-height: 220px;
}

.masonry-grid {
  column-count: 1;
  column-gap: 1rem;
}
@media (min-width: 768px) {
  .masonry-grid { column-count: 2; }
}
@media (min-width: 1024px) {
  .masonry-grid { column-count: 3; }
}
.masonry-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 1rem;
  break-inside: avoid;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(17, 22, 24, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  width: auto;
  border-radius: 1.5rem;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
}

.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid rgba(29,61,45,0.08);
  border-bottom: 1px solid rgba(29,61,45,0.08);
  background: rgba(255,255,255,0.45);
}
.marquee-track {
  display: inline-flex;
  gap: 2rem;
  padding: 1rem 0;
  white-space: nowrap;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee-item {
  color: var(--leaf-dark);
  font-weight: 800;
  letter-spacing: 0.04em;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.contact-card {
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(29,61,45,0.08);
  box-shadow: var(--shadow-soft);
  border-radius: 1.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-open {
  background: rgba(45, 92, 67, 0.12);
  color: var(--leaf-dark);
}
.status-closed {
  background: rgba(185, 90, 56, 0.12);
  color: var(--maple-red-deep);
}

.map-frame {
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(29,61,45,0.08);
}

input, textarea {
  width: 100%;
  border: 1px solid rgba(29,61,45,0.12);
  background: rgba(255,255,255,0.6);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  color: var(--charcoal);
}
input:focus, textarea:focus { outline: 3px solid rgba(185,90,56,0.14); border-color: rgba(185,90,56,0.4); }

.form-status {
  display: none;
  border-radius: 0.9rem;
  padding: 0.8rem 1rem;
  font-weight: 700;
}
.form-status.is-visible { display: block; }
.form-status.success {
  background: rgba(45, 92, 67, 0.1);
  color: var(--leaf-dark);
}
.form-status.error {
  background: rgba(185,90,56,0.1);
  color: var(--maple-red-deep);
}

@media (max-width: 767px) {
  .nav-desktop { display: none; }
  .header-social { display: none; }
  .header-call { display: none; }
}
@media (max-width: 1179px) {
  .nav-desktop { display: none !important; }
  .nav-mobile { display: block !important; }
  #mobile-menu-button.nav-mobile { display: inline-flex !important; }
  .header-social, .header-call { display: none !important; }
  .nav-surface .page-shell > div { gap: 0.5rem; }
}
@media (min-width: 1180px) {
  .nav-mobile { display: none; }
}

@media (min-width: 1180px) {
  .nav-desktop { gap: 1rem !important; }
  .nav-surface .page-shell > div { gap: 0.75rem; }
  .nav-surface .page-shell > div > a[aria-label="Great Maple School home"] { gap: 0.6rem; }
  .nav-surface .header-social { gap: 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.15fr 1fr; }
}

.nav-surface [aria-label="Great Maple School home"] > div,
.nav-surface [aria-label="Great Maple School home"] .font-display,
.nav-surface [aria-label="Great Maple School home"] .text-\[0\.6rem\],
footer .font-display,
footer .text-\[0\.7rem\] {
  white-space: nowrap;
}

.nav-surface [aria-label="Great Maple School home"] .text-\[0\.6rem\],
footer .text-\[0\.7rem\] {
  letter-spacing: 0.1em;
}

.mission-heading {
  position: relative;
  max-width: 22ch;
  margin-inline: auto;
  font-size: clamp(1.75rem, 3.5vw, 3.25rem);
  line-height: 1.12;
}

.mission-heading::after {
  content: "";
  display: block;
  width: 4rem;
  height: 3px;
  margin: 1.1rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--maple-red));
  transform-origin: center;
  animation: mission-accent 3.2s ease-in-out infinite alternate;
}

@keyframes mission-accent {
  from { transform: scaleX(0.72); opacity: 0.7; }
  to { transform: scaleX(1); opacity: 1; }
}

.programme-early main > section:first-child {
  margin-top: 0.5rem;
  border-radius: 2rem;
  background: linear-gradient(135deg, #fff5d9, #f8e7df);
}
.programme-early main > section:first-child > div {
  max-width: 58rem;
}
.programme-early main > section:first-child .section-kicker,
.programme-early main > section:nth-child(2) h2 {
  color: #a56819;
}
.programme-early main > section:nth-child(2) .feature-card {
  border-radius: 2.25rem 2.25rem 1rem 1rem;
  border-top: 5px solid #d9b26a;
  background: #fffaf0;
}

.programme-primary main > section:first-child {
  border-left: 7px solid #2d5c43;
  padding-left: clamp(1.5rem, 5vw, 4rem);
  text-align: left;
}
.programme-primary main > section:first-child > div {
  max-width: 58rem;
  margin-left: 0;
  text-align: left;
}
.programme-primary main > section:nth-child(2) .feature-card {
  border-radius: 0.75rem 2rem 0.75rem 2rem;
  border-left: 4px solid #2d5c43;
  background: #f3f8f2;
}

.programme-middle main > section:first-child {
  border-radius: 2.5rem;
  background: #203a50;
  color: #fff;
}
.programme-middle main > section:first-child .section-kicker,
.programme-middle main > section:first-child h1,
.programme-middle main > section:first-child p {
  color: #fff;
}
.programme-middle main > section:nth-child(2) .feature-card {
  border-radius: 1rem;
  border-bottom: 5px solid #467b95;
  background: #edf5f7;
}

@media (max-width: 767px) {
  .programme-primary main > section:first-child { padding-left: 1.5rem; }
  .programme-middle main > section:first-child { border-radius: 1.5rem; }
}
