/* ==========================================================================
   AWWWARDS-LEVEL PREMIUM DESIGN SYSTEM - 7-STAR ARCHITECTURE
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap');

:root {
  /* Ultra-Refined Palette */
  --bg-primary: #F4F2EF; /* Very soft warm off-white */
  --bg-secondary: #EBE7E0;
  --bg-dark: #1A1A1A;
  --text-dark: #121212;
  --text-light: #7A7A7A;
  --accent: #B28E8E;
  --header-light-bg: rgba(244, 242, 239, 0.82);
  --header-dark-bg: rgba(17, 17, 17, 0.78);
  --header-light-border: rgba(18, 18, 18, 0.08);
  --header-dark-border: rgba(244, 242, 239, 0.12);

  /* Typography */
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  --display-xl: clamp(2.35rem, 5.9vw, 5.3rem);
  --display-lg: clamp(1.95rem, 4.5vw, 4.1rem);
  --display-md: clamp(1.55rem, 2.9vw, 2.6rem);
  --body-lg: clamp(1.02rem, 1.2vw, 1.28rem);
  --body-feature: clamp(1.05rem, 1.35vw, 1.45rem);

  /* Layout Constants */
  --container-pad: 4vw;
  --section-pad: 15vh;
  --spacing-md: 2rem;

  /* Easings - Elite standard */
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
  --ease-smooth: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  background: var(--bg-primary);
  color: var(--text-dark);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

header,
section,
footer {
  width: 100%;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text-dark);
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: clamp(2.55rem, 6.9vw, 6.4rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(2rem, 4.8vw, 4.35rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.4rem, 2.45vw, 2.45rem);
  line-height: 1.1;
}

p {
  font-size: clamp(1rem, 1vw, 1.18rem);
  color: var(--text-light);
  max-width: 50ch;
  font-weight: 300;
}

/* Tone down the oversized display scale across cover sections without changing layout. */
.hero h1,
.ed-header h1,
.prac-hero h1,
.event-hero h1,
.test-hero h1,
.book-hero h1,
.con-visual h2 {
  font-size: var(--display-xl) !important;
  line-height: 0.92;
}

.statement-block h2,
.ed-sticky h2,
.home-tests h2,
.event-section h2,
.register-wrap h2,
.prac-title h2 {
  font-size: var(--display-lg) !important;
}

.ed-content,
.ed-content p {
  font-size: var(--body-feature) !important;
  line-height: 1.48 !important;
}

.ed-content p.light,
.hero-p,
.test-quote {
  font-size: var(--body-lg) !important;
  line-height: 1.55;
}

.sc-item {
  font-size: clamp(1.45rem, 2.55vw, 2.85rem) !important;
}

.spec-block h3 {
  font-size: clamp(1.4rem, 2.1vw, 2rem) !important;
}

.foot-giant {
  font-size: clamp(1.9rem, 6vw, 6.2rem) !important;
}

.text-italic {
  font-style: italic;
  font-weight: 300;
}

/* --------------------------------------------------------------------------
   LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--section-pad) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4vw;
}

/* --------------------------------------------------------------------------
   MAGNETIC / ADVANCED BUTTONS
   -------------------------------------------------------------------------- */
.btn-magnetic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  max-width: 100%;
  padding: 1.5rem 3rem;
  border-radius: 100px;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  border: 1px solid rgba(0,0,0,0.2);
  color: var(--text-dark);
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: color 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
  text-decoration: none;
  /* Disable inner pointer events so math calculates from btn edge */
}

.btn-magnetic > span {
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.btn-magnetic::before {
  content: '';
  position: absolute;
  top: 100%; left: 0;
  width: 100%; height: 100%;
  background-color: var(--text-dark);
  border-radius: 50% 50% 0 0;
  transition: transform 0.6s var(--ease-out-expo), border-radius 0.6s var(--ease-out-expo);
  z-index: 1;
}

.btn-magnetic:hover, .btn-magnetic:hover span {
  color: var(--bg-primary);
  border-color: var(--text-dark);
}

.btn-magnetic:hover::before {
  transform: translateY(-100%);
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   NAVIGATION (INVISIBLE UNTIL SCROLL/HOVER OR INTEGRATED)
   -------------------------------------------------------------------------- */
.nav-elite {
  /* Script toggles these variables so the fixed header stays readable on any section. */
  --header-fg: var(--text-dark);
  --header-bg: var(--header-light-bg);
  --header-border: var(--header-light-border);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100vw;
  padding: 1rem var(--container-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(1rem, 2vw, 2.5rem);
  box-sizing: border-box;
  isolation: isolate;
  z-index: 300;
  color: var(--header-fg) !important;
  mix-blend-mode: normal !important;
  transition: color 0.24s ease, transform 0.24s ease;
}

.nav-elite::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.24s ease, border-color 0.24s ease;
  z-index: -1;
}

body[data-header-default="dark"] .nav-elite {
  --header-fg: var(--bg-primary);
  --header-bg: var(--header-dark-bg);
  --header-border: var(--header-dark-border);
}

.nav-elite.header--light {
  --header-fg: var(--text-dark);
  --header-bg: var(--header-light-bg);
  --header-border: var(--header-light-border);
}

.nav-elite.header--dark {
  --header-fg: var(--bg-primary);
  --header-bg: var(--header-dark-bg);
  --header-border: var(--header-dark-border);
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1.05rem + 1.1vw, 2rem);
  font-style: italic;
  text-decoration: none;
  color: inherit;
  line-height: 1;
  flex: 0 1 auto;
  max-width: min(48vw, 22rem);
  margin-right: auto;
  word-break: break-word;
}

.nav-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(0.65rem, 1.2vw, 1.35rem);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.nav-links li {
  flex: 0 0 auto;
}

.nav-link {
  display: inline-flex;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: inherit;
  position: relative;
  white-space: nowrap;
}

.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 100%; height: 1px;
  background-color: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease-out-expo);
}

.nav-link:hover::after {
  transform: scaleX(1); transform-origin: left;
}

/* --------------------------------------------------------------------------
   ADVANCED ANIMATIONS (MASKS, PARALLAX, REVEALS)
   -------------------------------------------------------------------------- */

/* Cinematic mask reveal for typography */
.mask-wrap {
  overflow: hidden;
  display: inline-block;
  vertical-align: bottom;
  line-height: 1;
}

.mask-inner {
  display: inline-block;
  transform: translateY(115%) rotate(5deg);
  opacity: 1; /* Instant load */
  transform-origin: top left;
  transition: transform 1.4s var(--ease-out-expo), opacity 1.4s var(--ease-out-expo);
}

.is-inview .mask-inner,
body.show-hero .mask-inner {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

/* Image Parallax Container */
.px-container {
  overflow: hidden;
  position: relative;
}

.px-img {
  width: 100%;
  height: 130%; /* allows room to move */
  object-fit: cover;
  transform: translateY(-15%);
  will-change: transform;
}

/* Image Reveal Mask */
.img-reveal::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--bg-primary);
  transform-origin: bottom;
  transition: transform 1.5s var(--ease-in-out-circ);
  z-index: 2;
}

.is-inview.img-reveal::after,
body.show-hero .img-reveal::after {
  transform: scaleY(0);
}

/* Fade up details */
.fade-up {
  opacity: 1; /* Instant load */
  transform: translateY(30px);
  transition: opacity 1.2s var(--ease-out-expo), transform 1.2s var(--ease-out-expo);
}

.is-inview .fade-up,
.is-inview.fade-up,
body.show-hero .fade-up {
  opacity: 1;
  transform: translateY(0);
}

.home-tests-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 8vh;
}

.home-tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1rem, 2vw, 2rem);
}

.home-test-card {
  min-width: 0;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3vw;
  margin-bottom: 2vw;
}

/* --------------------------------------------------------------------------
   RESPONSIVE OVERRIDES
   -------------------------------------------------------------------------- */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    flex: 0 0 auto;
    z-index: 320;
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
}

/* Open state for hamburger */
.mobile-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 1240px) {
  .nav-brand {
    max-width: min(42vw, 18rem);
  }

  .nav-links {
    gap: 0.72rem;
  }

  .nav-link {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 1100px) {
  :root {
    --container-pad: clamp(1rem, 5vw, 2rem);
    --section-pad: clamp(4rem, 10vh, 6rem);
  }

  .grid-2 {
    grid-template-columns: 1fr !important;
  }

  .mobile-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav-elite {
    padding: 0.95rem var(--container-pad);
  }

  .nav-brand {
    position: relative;
    z-index: 320;
    max-width: calc(100% - 4rem);
  }

  .nav-links {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(17, 17, 17, 0.96);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.25rem;
    transform: translateY(-1rem);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.24s ease, visibility 0.24s ease;
    z-index: 250;
    margin: 0;
    padding: calc(5rem + env(safe-area-inset-top)) var(--container-pad) 2rem;
    overflow-y: auto;
  }

  .nav-links.nav-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    opacity: 1;
    transform: translateY(12px);
    transition: opacity 0.24s ease, transform 0.24s ease;
  }

  .nav-links.nav-active li {
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links.nav-active li:nth-child(1) { transition-delay: 0.03s; }
  .nav-links.nav-active li:nth-child(2) { transition-delay: 0.06s; }
  .nav-links.nav-active li:nth-child(3) { transition-delay: 0.09s; }
  .nav-links.nav-active li:nth-child(4) { transition-delay: 0.12s; }
  .nav-links.nav-active li:nth-child(5) { transition-delay: 0.15s; }
  .nav-links.nav-active li:nth-child(6) { transition-delay: 0.18s; }

  .nav-link {
    color: var(--bg-primary) !important;
    font-size: clamp(1.1rem, 4vw, 1.4rem);
  }

  body.nav-open .nav-elite {
    --header-fg: var(--bg-primary);
    --header-bg: rgba(17, 17, 17, 0.96);
    --header-border: var(--header-dark-border);
  }

  .hero,
  .event-hero,
  .test-hero,
  .ed-header,
  .prac-hero {
    padding-top: calc(5rem + 5vw) !important;
    padding-bottom: clamp(3rem, 8vw, 4.5rem) !important;
  }

  .book-hero,
  .book-form-area,
  .booking-success,
  .con-visual,
  .con-details {
    padding-top: calc(5rem + 5vw) !important;
    padding-bottom: clamp(3rem, 8vw, 4.5rem) !important;
  }

  .hero-grid,
  .sc-grid,
  .ed-grid,
  .book-layout,
  .con-layout,
  .register-wrap {
    grid-template-columns: 1fr !important;
    gap: clamp(1.5rem, 4vw, 2.5rem) !important;
  }

  .ed-sticky {
    position: static !important;
    top: auto !important;
  }

  .foot-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
  }

  footer[style*="min-height: 80vh"] {
    min-height: auto !important;
    gap: 2rem !important;
    padding-bottom: max(2rem, env(safe-area-inset-bottom)) !important;
  }

  footer[style*="min-height: 80vh"] .foot-giant {
    margin-top: 2rem !important;
    text-align: left !important;
  }

  footer[style*="min-height: 80vh"] .btn-magnetic {
    width: auto;
  }

  .prac-row {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    padding: 2rem var(--container-pad) !important;
  }

  .prac-meta {
    gap: 1rem !important;
  }

  .spec-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
    gap: 1rem !important;
  }

  .spec-block {
    padding: 1.5rem !important;
  }

  .home-tests-head {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 3rem;
  }

  .home-tests-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  }

  .location-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .cal-ess {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .time-ess {
    gap: 0.75rem !important;
  }

  .ct {
    flex: 1 1 calc(50% - 0.75rem) !important;
    min-width: 0 !important;
    padding: 0.9rem 1rem !important;
  }

  .cd {
    min-height: 72px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }

  .test-grid {
    column-count: 2 !important;
    column-gap: 1rem !important;
  }

  .preloader-counter {
    font-size: 20vw;
  }
}

@media (max-width: 768px) {
  :root {
    --container-pad: clamp(1rem, 4vw, 1.5rem);
    --section-pad: clamp(3.5rem, 8vh, 4.5rem);
  }

  h1 {
    font-size: clamp(2.15rem, 9.8vw, 3.5rem);
  }

  h2 {
    font-size: clamp(1.75rem, 7.8vw, 2.8rem);
  }

  h3 {
    font-size: clamp(1.2rem, 5.2vw, 1.75rem);
  }

  p {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .hero {
    min-height: 100svh !important;
    height: auto !important;
    justify-content: center !important;
    padding-top: calc(4.85rem + 2vh) !important;
    padding-bottom: clamp(3rem, 8vw, 4rem) !important;
  }

  .hero h1 {
    max-width: 9ch;
  }

  .hero-grid {
    margin-top: 1.5rem !important;
    gap: 1rem !important;
    align-items: flex-start !important;
  }

  .hero-action,
  .btn-magnetic {
    width: 100%;
  }

  .btn-magnetic {
    min-height: 3.25rem;
    padding: 1rem 1.25rem;
    font-size: 0.78rem;
    letter-spacing: 0.07em;
  }

  .hero-p,
  p {
    max-width: 100%;
  }

  .hero,
  .event-hero,
  .test-hero,
  .ed-header,
  .prac-hero,
  .book-hero,
  .book-form-area,
  .booking-success,
  .con-visual,
  .con-details,
  .register-wrap {
    padding-left: var(--container-pad) !important;
    padding-right: var(--container-pad) !important;
  }

  .gallery-grid,
  .home-tests-grid,
  .spec-grid {
    grid-template-columns: 1fr !important;
  }

  .test-grid {
    column-count: 1 !important;
  }

  .cal-ess {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .ct {
    flex-basis: calc(50% - 0.75rem) !important;
  }

  .map-wrap {
    height: 260px !important;
  }

  .foot-giant {
    font-size: clamp(2.2rem, 10.5vw, 4.4rem) !important;
  }

  .f-input,
  .f-select,
  .f-textarea {
    font-size: 16px !important;
  }

  .status-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  footer[style*="min-height: 80vh"] {
    padding-top: clamp(3rem, 9vw, 4rem) !important;
  }
}

@media (max-width: 480px) {
  .nav-elite {
    padding: 0.85rem var(--container-pad);
  }

  .hero {
    justify-content: center !important;
    padding-top: calc(4.85rem + 1vh) !important;
    padding-bottom: calc(4.25rem + 1vh) !important;
  }

  .hero-grid {
    margin-top: 1.25rem !important;
  }

  .nav-brand {
    max-width: calc(100% - 3.75rem);
    font-size: clamp(1.2rem, 4.8vw, 1.45rem);
  }

  .cal-ess {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ct {
    flex-basis: 100% !important;
  }

  .home-test-card,
  .spec-block,
  .test-card {
    padding: 1.25rem !important;
  }

  .hero,
  .event-hero,
  .test-hero,
  .ed-header,
  .prac-hero,
  .book-hero,
  .book-form-area,
  .booking-success,
  .con-visual,
  .con-details {
    padding-top: calc(4.5rem + 1vh) !important;
    padding-bottom: 2.75rem !important;
  }

  .nav-links {
    padding-top: calc(4.75rem + env(safe-area-inset-top));
  }

  .nav-link {
    font-size: 1rem;
  }

  footer[style*="min-height: 80vh"] .btn-magnetic {
    width: 100%;
  }
}
