/* ==========================================================================
   CrossRoads Tutoring — site stylesheet
   1. Tokens   2. Base   3. Components   4. Loader   5. Nav   6. Hero
   7. Team   8. Subjects   9. Footer / Contact   10. Reduced motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --cream: #fbf1e6;
  --sky: #9fd8e5;
  --lavender: #d3d4ed;
  --coral: #f7859c;
  --peach: #ffdbb4;
  --periwinkle: #9093d1;
  --orange: #ff8961;
  --ink: #222;
  --ink-soft: #404756;

  --font-heading: "Montserrat", sans-serif;
  --font-body: "Open Sans", sans-serif;
  --font-slab: "Roboto Slab", serif;

  --gutter: clamp(16px, 5vw, 48px);
  --content-max: 1200px;
  --section-y: clamp(56px, 8vw, 104px);
  --nav-h: 80px;

  --text-title: clamp(2.75rem, 1.4rem + 5.6vw, 5.3rem);
  --text-section: clamp(2rem, 1.2rem + 3.4vw, 4.5rem);
  --text-lg: clamp(1rem, .95rem + .25vw, 1.125rem);

  --ease: cubic-bezier(.455, .03, .515, .955);
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.55;
}

body.is-loading { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--font-heading); font-weight: 800; line-height: 1; }
p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--periwinkle); outline-offset: 3px; border-radius: 4px; }

/* Anchor targets sit below the fixed nav */
[id] { scroll-margin-top: var(--nav-h); }
#Home { scroll-margin-top: 0; }

/* 3. Components ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: var(--section-y); }
.band--cream { background: var(--cream); }
.band--sky { background: var(--sky); }
.band--lavender { background: var(--lavender); }

.wave { display: block; width: 100%; height: auto; }
.wave--on-white { background: #fff; }
.wave--on-cream { background: var(--cream); }
.wave--on-sky { background: var(--sky); }

/* Small label with a blob behind its first letter */
.label,
.blob-link { position: relative; isolation: isolate; display: inline-block; }

.label {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.5;
  text-align: center;
}

.blob-link::before {
  opacity: 0;
  transform: scale(.6);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

.blob-link:hover::before,
.blob-link:focus-visible::before { opacity: 1; transform: none; }

.label--hero { --blob: url("../images/621c7f7a53d9edff07227de3_section_blob.svg"); }
.label--team { --blob: url("../images/621cc6410f5abc4295644094_section_blob2.svg"); }
.label--contact { --blob: url("../images/621dca93277c2505f9bd849c_section_blob3.svg"); }

.label::before,
.blob-link::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -.2em;
  left: -.45em;
  width: 20px;
  height: 20px;
  background: var(--blob, url("../images/621dfcd10187caf50f94dcc7_section_blob4.svg")) center / contain no-repeat;
}

.section-title {
  margin-top: 16px;
  font-size: var(--text-section);
  text-align: center;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 12px;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  box-shadow: -2px 2px 0 2px #000000b0;
  transform: translate(2px, -2px);
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}

.button:hover,
.button:focus-visible {
  background: var(--sky);
  color: var(--ink);
  transform: none;
  box-shadow: -1px 1px 0 1px #000000b0;
}

.nav-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s var(--ease);
}

.nav-link:hover { color: #d9506f; }

/* 4. Loader ---------------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: var(--cream);
  overflow: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}

.loader.is-hidden { opacity: 0; visibility: hidden; }

.loader__title {
  position: relative;
  z-index: 1;
  max-width: 11ch;
  color: var(--orange);
  font-size: clamp(3rem, 1rem + 10vw, 9.4rem);
  text-align: center;
  text-transform: capitalize;
  animation: loader-in .8s var(--ease) both;
}

.loader__blob {
  position: absolute;
  width: clamp(110px, 25vw, 360px);
  animation: loader-float 3.2s ease-in-out infinite alternate;
}

.loader__blob--a { top: 12%; right: 12%; }
.loader__blob--b { bottom: 12%; left: 12%; animation-delay: -1.6s; }

@keyframes loader-in { from { opacity: 0; transform: translateY(20px); } }
@keyframes loader-float { to { transform: translateY(-14px) rotate(4deg); } }

/* Content fades up once the loader leaves */
.reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.is-loading .reveal { opacity: 0; transform: translateY(24px); }

/* Hero illustrations only fade in (no movement) */
.hero__art.reveal { transition: opacity 1.2s var(--ease); }
.is-loading .hero__art.reveal { transform: none; }

/* 5. Navigation ------------------------------------------------------------ */
.site-nav {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 50;
  width: min(var(--content-max), calc(100% - 2 * var(--gutter)));
  transform: translateX(-50%);
}

.site-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 12px 8px 20px;
  border: 1px solid #9093d166;
  border-radius: 999px;
  background: #fbf1e6ee;
  box-shadow: 0 6px 24px #22222214;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-nav__brand img { width: 52px; height: auto; }

.site-nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}

.site-nav__menu .button { padding: 10px 22px; font-size: .95rem; }

.site-nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.site-nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}

.site-nav.is-open .site-nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav.is-open .site-nav__toggle span:nth-child(2) { opacity: 0; }
.site-nav.is-open .site-nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 991px) {
  .site-nav__toggle { display: block; }

  .site-nav__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid #9093d166;
    border-radius: 24px;
    background: var(--cream);
    box-shadow: 0 12px 32px #22222222;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }

  .site-nav.is-open .site-nav__menu { opacity: 1; visibility: visible; transform: none; }

  .site-nav__menu .nav-link { padding: 12px 16px; border-radius: 12px; }
  .site-nav__menu .nav-link:hover { background: #ffffffaa; }
  .site-nav__menu .button { margin-top: 8px; }
}

/* 6. Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(100svh, 780px);
  padding: calc(var(--nav-h) + 32px) var(--gutter) 40px;
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
  text-align: center;
}

.hero__title {
  max-width: 11ch;
  margin-block: 20px;
  font-size: var(--text-title);
  line-height: .92;
}

.hero__tagline {
  margin-bottom: 28px;
  padding: 12px 20px;
  border: 1px solid var(--periwinkle);
  border-radius: 25px;
  background: #ffdbb480;
  color: var(--ink-soft);
  font-weight: 600;
}

.hero__art {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  pointer-events: none;
}

.hero__art img { position: absolute; }

.hero__boy { bottom: 0; left: 0; width: clamp(160px, 22vw, 320px); }
.hero__girl { bottom: 0; right: 0; width: clamp(160px, 22vw, 320px); }
.hero__blob--1 { top: 26%; left: 16%; width: clamp(90px, 14vw, 200px); }
.hero__blob--2 { bottom: 8%; right: 22%; width: clamp(90px, 14vw, 200px); }

@media (max-width: 767px) {
  .hero { min-height: 0; justify-content: flex-start; }

  .hero__art {
    position: static;
    max-width: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: calc(100% + 2 * var(--gutter));
    order: 2;
    margin: 32px calc(-1 * var(--gutter)) -40px;
  }

  .hero__art img { position: static; }
  .hero__boy, .hero__girl { width: min(42vw, 240px); }
  .hero__blob { display: none; }
}

/* 7. Team ------------------------------------------------------------------ */
.team__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  margin-top: clamp(24px, 4vw, 48px);
}

.team__members { display: flex; flex-direction: column; gap: 28px; }

.member + .member { padding-top: 28px; border-top: 1px solid var(--ink); }

.member__name { margin-bottom: 12px; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); line-height: 1.15; }

.member p { max-width: 52ch; color: var(--ink-soft); font-size: 1rem; }
.member p + p { margin-top: 12px; }

.member__link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 700;
  text-decoration: none;
}

.member__link:hover { opacity: .65; }

.team__art {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

.team__art img { width: 100%; transform: scaleX(-1); }

@media (max-width: 767px) {
  .team__layout { grid-template-columns: 1fr; }
  .team__art { order: -1; max-width: 260px; }
}

/* 8. Subjects -------------------------------------------------------------- */
.slider__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 32px);
  margin-top: 16px;
}

.slider__title { font-size: var(--text-section); text-align: center; }

.slider__arrow {
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: url("../images/621cc6410f5abc4295644094_section_blob2.svg") center / cover no-repeat;
  color: #fff;
  cursor: pointer;
  transition: transform .2s var(--ease);
}

.slider__arrow:hover { transform: scale(1.1); }
.slider__arrow svg { width: 22px; height: 22px; margin: auto; }

.slider__viewport { margin-top: clamp(20px, 3vw, 40px); overflow: hidden; }

.slider__track { display: flex; transition: transform .5s var(--ease); }

.slide { flex: 0 0 100%; min-width: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.5vw, 20px);
  max-width: var(--content-max);
  margin-inline: auto;
}

.card { position: relative; aspect-ratio: 532 / 492; }

.card__blob { position: absolute; inset: 0; width: 100%; height: 100%; }

.card__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10% 12%;
  color: #111;
  font-family: var(--font-slab);
  text-align: center;
}

.card__title {
  margin-bottom: .6em;
  font-family: var(--font-slab);
  font-size: clamp(.95rem, .45rem + 1.35vw, 1.4rem);
  font-weight: 700;
  line-height: 1.2;
}

.card__desc {
  font-size: clamp(.7rem, .35rem + .85vw, .95rem);
  line-height: 1.4;
}

.slider__dots { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

.slider__dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.slider__dot[aria-current="true"] { background: var(--ink); }

@media (max-width: 859px) {
  .cards { grid-template-columns: 1fr; max-width: 340px; gap: 12px; }
  .card__text { padding: 12% 11%; }
  .card__title { font-size: 1.35rem; }
  .card__desc { font-size: .875rem; }
  .slider__arrow { width: 44px; height: 44px; }
}

/* 9. Footer / Contact ------------------------------------------------------ */
.contact__heading {
  max-width: 100%;
  margin-top: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
  font-size: var(--text-section);
  text-align: left;
}

.contact__label { display: block; text-align: left; }

.contact__links {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px 48px;
  padding-block: 28px;
  border-bottom: 1px solid var(--ink);
}

.link-group { display: flex; flex-wrap: wrap; gap: 20px 48px; }
.link-group--main { flex-direction: column; gap: 24px; }
.link-row { display: flex; flex-wrap: wrap; gap: 20px 48px; }
.link-group--other { flex-direction: column; gap: 20px; }

.contact__credits { display: flex; flex-wrap: wrap; gap: 16px 48px; padding-top: 24px; }

@media (max-width: 767px) {
  .contact__links { grid-template-columns: 1fr; }
  .contact__heading, .contact__label { text-align: center; }
  .link-row, .contact__credits, .link-group--other { align-items: center; justify-content: center; }
  .link-group--main { align-items: center; }
  .link-row { flex-direction: column; gap: 16px; }
  .contact__links { text-align: center; }
  .contact__credits { flex-direction: column; gap: 16px; }
}

/* 10. Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
