/* ============================================================
   Jay Pardasani — Responsive Styles
   Desktop (1200px+) remains unchanged — overrides only below.
   Breakpoints: 1199 / 991 / 767 / 479
   ============================================================ */

/* ------------------------------------------------------------
   Large desktop polish (optional — no layout change)
   ------------------------------------------------------------ */
@media (min-width: 1440px) {
  /* Approved desktop composition — intentionally untouched */
}

/* ------------------------------------------------------------
   Laptop: 992px – 1199px
   Soften density; keep multi-column where it still works
   ------------------------------------------------------------ */
@media (max-width: 1199px) {
  :root {
    --container: min(100%, calc(100% - 2.75rem));
    --container-wide: min(100%, calc(100% - 2.25rem));
    --fs-hero: clamp(2.5rem, 5.5vw, 4.25rem);
  }

  .nav__menu {
    gap: 1.35rem;
  }

  .inst-map,
  .inst-map__canvas {
    min-height: 420px;
  }

  .inst-cards {
    gap: 1rem;
  }

  .inst-card {
    padding: 1.5rem 1.25rem 1.35rem;
  }

  .loc-grid,
  .findus-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav__link {
    font-size: 0.8125rem;
  }

  .hero__content {
    gap: 2rem;
  }

  .hero__portrait-frame {
    width: min(100%, 460px);
  }

  .footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2rem;
  }
}

/* ------------------------------------------------------------
   Tablet: 768px – 991px
   Stack major sections, hamburger nav, vertical journey
   ------------------------------------------------------------ */
@media (max-width: 991px) {
  :root {
    --nav-height: 70px;
    --section-pad: clamp(3.5rem, 8vw, 5rem);
    --container: min(100%, calc(100% - 2.5rem));
    --container-wide: min(100%, calc(100% - 2rem));
    --fs-hero: clamp(2.15rem, 6.5vw, 3.25rem);
    --fs-h2: clamp(1.6rem, 4vw, 2.25rem);
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* ---- Mobile navigation ---- */
  .nav__menu {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: calc(var(--nav-height) + 1.5rem) 2rem 2.5rem;
    background:
      radial-gradient(ellipse 70% 50% at 50% 20%, rgba(201, 162, 39, 0.12) 0%, transparent 55%),
      linear-gradient(165deg, #0a0a0a 0%, #141414 55%, #0d0d0d 100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.5rem);
    transition:
      opacity var(--duration) var(--ease-out),
      visibility var(--duration) var(--ease-out),
      transform var(--duration) var(--ease-out);
  }

  .nav__menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav__menu .nav__link {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    padding: 0.65rem 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.01em;
  }

  .nav__menu .nav__link::after {
    display: none;
  }

  .nav__menu .nav__link:hover,
  .nav__menu .nav__link.is-active {
    color: var(--color-accent);
  }

  .nav__social {
    display: none;
  }

  .nav__toggle {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    flex-shrink: 0;
  }

  .nav__toggle span {
    width: 22px;
  }

  .nav--hero-light:not(.is-scrolled) .nav__toggle span {
    background: var(--color-secondary);
  }

  .nav--hero-light .nav__menu.is-open ~ .nav__actions .nav__toggle span,
  .nav .nav__toggle.is-open span {
    background: var(--color-secondary);
  }

  body.nav-open .nav:not(.is-scrolled) .nav__logo,
  body.nav-open .nav.is-scrolled .nav__logo {
    color: var(--color-secondary);
  }

  body.nav-open .nav__toggle span {
    background: var(--color-secondary);
  }

  /* ---- Hero: intentional mobile composition ---- */
  .hero {
    min-height: auto;
    align-items: stretch;
  }

  .hero__content {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: center;
    min-height: auto;
    padding-top: var(--nav-height);
    padding-bottom: 2.5rem;
  }

  .hero__text {
    order: 1;
    padding-block: 2.25rem 1.25rem;
    max-width: 36rem;
    margin-inline: auto;
  }

  .hero__eyebrow {
    justify-content: center;
    margin-bottom: 1.25rem;
  }

  .hero__eyebrow::before {
    display: none;
  }

  .hero__title {
    font-size: var(--fs-hero);
    line-height: 1.12;
    margin-bottom: 1.25rem;
  }

  .hero__subtitle {
    letter-spacing: 0.05em;
    margin-bottom: 1.75rem;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__portrait {
    order: 2;
    max-height: none;
    margin-top: -0.5rem;
  }

  .hero__portrait-frame {
    width: clamp(260px, 72vw, 400px);
    aspect-ratio: 3 / 3.55;
    margin-inline: auto;
  }

  .hero__portrait-img {
    object-fit: cover;
    object-position: 72% 12%;
  }

  .hero__scroll {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 0.75rem auto 0;
    padding-bottom: 0.5rem;
  }

  /* ---- About ---- */
  .about__grid {
    grid-template-columns: 1fr;
    row-gap: 2rem;
    column-gap: 0;
  }

  .about__content {
    grid-column: auto;
    order: 1;
    width: 100%;
    max-width: 40rem;
    margin-inline: auto;
  }

  .about__image-wrap {
    grid-column: auto;
    grid-row: auto;
    order: 2;
    max-width: 420px;
    width: 100%;
    margin-inline: auto;
  }

  .about__image-accent {
    right: -0.5rem;
    bottom: -0.5rem;
    width: 55%;
    height: 55%;
  }

  .about__mission-vision {
    grid-column: auto;
    order: 3;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 40rem;
    margin-inline: auto;
  }

  .about__highlights {
    grid-column: auto;
    order: 4;
    width: 100%;
    max-width: 40rem;
    margin-inline: auto;
  }

  .about__cta {
    grid-column: auto;
    order: 5;
    width: 100%;
    max-width: 40rem;
    margin-inline: auto;
  }

  .about__block p,
  .about__intro {
    max-width: 40rem;
  }

  /* ---- Stats ---- */
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }

  .stat:nth-child(2)::after {
    display: none;
  }

  /* ---- Journey: vertical timeline ---- */
  .journey__track-wrap {
    overflow: visible;
    padding-bottom: 0;
    margin-top: var(--space-lg);
  }

  .journey__track {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding: 0.5rem 0 1rem 0.75rem;
    gap: 0;
  }

  .journey__line {
    top: 0;
    bottom: 0;
    left: 0.75rem;
    right: auto;
    width: 1px;
    height: auto;
    transform: none;
  }

  .journey__line-progress {
    width: 100%;
    height: 0%;
    transition: height 0.1s linear;
  }

  .journey__item {
    width: 100%;
    max-width: 100%;
    flex-shrink: 1;
    padding: 0 0 1.75rem 1.75rem;
  }

  .journey__dot {
    top: 1.35rem;
    left: 0.75rem;
    transform: translate(-50%, 0);
  }

  .journey__card {
    margin-bottom: 0;
    width: 100%;
  }

  .journey__item:nth-child(even) .journey__card {
    margin-top: 0;
    margin-bottom: 0;
  }

  .journey__card:hover {
    transform: translateY(-3px);
  }

  /* ---- Organizations ---- */
  .orgs__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* ---- Gallery ---- */
  .gallery__masonry {
    columns: 2;
  }

  @supports (grid-template-rows: masonry) {
    .gallery__masonry {
      grid-template-columns: repeat(2, 1fr);
      columns: auto;
    }
  }

  .gallery__filters {
    justify-content: center;
    gap: 0.45rem;
  }

  .gallery__filter {
    min-height: 44px;
    padding: 0.55rem 1rem;
  }

  /* ---- Blogs: 2-col on tablet ---- */
  .blogs__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.35rem;
  }

  .blog-card__media {
    aspect-ratio: 16 / 9;
  }

  .blog-card__title {
    font-size: clamp(1.05rem, 2.4vw, 1.2rem);
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
  }

  .blog-card__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ---- Contact ---- */
  .contact__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact__grid > * {
    min-width: 0;
    max-width: 100%;
  }

  .contact__form-wrap,
  .contact__info,
  .form,
  .form__input,
  .form__textarea,
  .form__submit {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .form__submit {
    min-height: 48px;
  }

  .contact__detail-value {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .contact__social {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  /* ---- Footer / misc ---- */
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .values__grid {
    grid-template-columns: 1fr 1fr;
  }

  .inst-intro,
  .school-layout,
  .inst-panel__layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .inst-cards {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .inst-card {
    min-height: 0;
    padding: 1.15rem 1.2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "index label cta"
      "index name cta";
    column-gap: 0.9rem;
    row-gap: 0.15rem;
    align-items: center;
  }

  .inst-card.is-active,
  .inst-card:hover {
    transform: translateY(-3px);
  }

  .inst-card__index {
    grid-area: index;
    font-size: 1.65rem;
    margin: 0;
  }

  .inst-card__label {
    grid-area: label;
    margin: 0;
  }

  .inst-card__name {
    grid-area: name;
    font-size: 1.2rem;
    margin: 0;
  }

  .inst-card__desc,
  .inst-card__meta {
    display: none;
  }

  .inst-card__cta {
    grid-area: cta;
  }

  .inst-card__cta-text {
    display: none;
  }

  .inst-card__cta svg {
    width: 18px;
    height: 18px;
  }

  .inst-card__cta--soon {
    font-size: 0.65rem;
  }

  .inst-panel__media,
  .inst-panel__media img,
  .jyot-visual {
    min-height: 280px;
  }

  .jyot-facts {
    grid-template-columns: 1fr;
  }

  .school-layout__image {
    min-height: 320px;
  }

  .school-layout__accent {
    display: none;
  }

  .loc-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .loc-row__actions {
    justify-content: flex-start;
  }

  .eco {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .eco__line {
    left: 50%;
    right: auto;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 1px;
    height: auto;
    transform: translateX(-50%);
  }

  .eco__line::after {
    transform: scaleY(0);
    transform-origin: top;
  }

  .eco.is-revealed .eco__line::after {
    transform: scaleY(1);
  }

  .eco__node::before {
    margin: 0 auto 1rem;
    box-shadow: 0 0 0 6px var(--bg-section);
  }

  .loc-grid,
  .findus-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-hero h1 {
    font-size: clamp(1.85rem, 5vw, 2.75rem);
  }

  .institutes-hero .hero__title {
    font-size: clamp(2.35rem, 6.5vw, 3.4rem);
  }

  /* Reduce motion intensity on touch layouts */
  .about__image {
    will-change: auto;
  }

  [data-reveal="left"],
  [data-reveal="right"] {
    transform: translateY(28px);
  }

  [data-reveal] {
    transform: translateY(28px);
  }

  [data-reveal].is-revealed {
    transform: none;
  }
}

/* ------------------------------------------------------------
   Mobile: 480px – 767px
   ------------------------------------------------------------ */
@media (max-width: 767px) {
  :root {
    --container: min(100%, calc(100% - 2rem));
    --container-wide: min(100%, calc(100% - 1.75rem));
    --section-pad: 3.5rem;
    --fs-hero: clamp(1.85rem, 8vw, 2.45rem);
    --fs-body: 1rem;
    --space-xl: 2.5rem;
    --space-2xl: 3.5rem;
  }

  .hero__text {
    padding-block: 1.75rem 1rem;
  }

  .hero__eyebrow {
    margin-bottom: 1rem;
    font-size: 0.7rem;
  }

  .hero__title {
    margin-bottom: 1rem;
  }

  .hero__subtitle {
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    margin-bottom: 1.35rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .hero__actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .hero__portrait-frame {
    width: clamp(240px, 82vw, 360px);
    aspect-ratio: 3 / 3.5;
  }

  .hero__portrait-img {
    object-position: 70% 10%;
  }

  .hero__scroll {
    margin-top: 0.5rem;
  }

  .about__image-wrap {
    max-width: 100%;
  }

  .about__mission-vision {
    gap: 1.5rem;
  }

  .stats {
    padding-block: 3rem;
  }

  .stat {
    padding: 1.35rem 0.75rem;
  }

  .stat:not(:last-child)::after {
    display: none;
  }

  .stat:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .stat__number {
    font-size: clamp(2rem, 9vw, 2.75rem);
  }

  .orgs__grid {
    grid-template-columns: 1fr;
  }

  .org-card {
    aspect-ratio: 16 / 10;
  }

  .gallery__masonry {
    columns: 2;
    column-gap: 0.75rem;
  }

  @supports (grid-template-rows: masonry) {
    .gallery__masonry {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.75rem;
      columns: auto;
    }
  }

  .gallery__item {
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
  }

  .gallery__item img {
    min-height: 120px;
    object-fit: cover;
  }

  .gallery__filters {
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 0.5rem;
  }

  .gallery__filter {
    flex: 0 1 auto;
  }

  .blogs__grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .blog-card {
    width: 100%;
    max-width: 100%;
  }

  .blog-card__media {
    aspect-ratio: 16 / 9;
  }

  .blog-card__body {
    padding: 1.25rem 1.15rem 1.35rem;
  }

  .blog-card__title {
    font-size: clamp(1.15rem, 4.5vw, 1.35rem);
    line-height: 1.35;
  }

  .blog-card__excerpt {
    -webkit-line-clamp: 3;
    margin-bottom: 1rem;
  }

  .blog-card:hover {
    transform: translateY(-4px);
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer__social {
    flex-wrap: wrap;
  }

  .values__grid {
    grid-template-columns: 1fr;
  }

  .loc-grid,
  .findus-grid,
  .findus-cities,
  .inst-intro__aside {
    grid-template-columns: 1fr;
  }

  .inst-map,
  .inst-map__canvas {
    min-height: 360px;
  }

  .inst-map__copy {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: none;
  }

  .inst-map__marker-label {
    white-space: normal;
    max-width: 10rem;
  }

  .institutes-hero {
    min-height: auto;
    padding-bottom: 3rem;
  }

  .institutes-hero--compact {
    min-height: auto;
    padding-bottom: 2.5rem;
  }

  .institutes-hero .hero__title {
    font-size: clamp(2.1rem, 10vw, 2.8rem);
  }

  .inst-quick__options {
    width: 100%;
    border-radius: var(--radius-lg);
    justify-content: stretch;
  }

  .inst-quick__btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .school-range__from,
  .school-range__to {
    font-size: clamp(3.25rem, 18vw, 5rem);
  }

  .inst-explorer__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .inst-tabs {
    width: 100%;
  }

  .inst-tab {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
  }

  .inst-cta__actions {
    justify-content: center;
  }

  .inst-cta__actions .btn {
    width: 100%;
  }

  .testimonial__card {
    padding: 1.75rem 1.25rem;
  }

  .quote-section__text {
    font-size: clamp(1.35rem, 6.5vw, 2rem);
  }

  .contact__form-wrap {
    padding: 1.35rem 1.15rem;
    width: 100%;
  }

  .contact__map {
    height: 240px;
    width: 100%;
  }

  .contact__social-link,
  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .newsletter__card {
    padding: 2rem 1.35rem;
    margin-inline: 1rem;
    max-width: calc(100% - 2rem);
  }

  .float-social {
    right: 1rem;
    bottom: 1rem;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox__prev,
  .lightbox__next {
    width: 44px;
    height: 44px;
  }

  .lightbox__prev {
    left: 0.5rem;
  }

  .lightbox__next {
    right: 0.5rem;
  }

  .lightbox__close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .cursor {
    display: none !important;
  }

  .section__subtitle {
    max-width: 100%;
  }

  /* Guard common overflow sources */
  img,
  iframe,
  video,
  svg {
    max-width: 100%;
  }

  .btn {
    max-width: 100%;
  }
}

/* ------------------------------------------------------------
   Small mobile: 320px – 479px
   ------------------------------------------------------------ */
@media (max-width: 479px) {
  :root {
    --container: min(100%, calc(100% - 1.5rem));
    --container-wide: min(100%, calc(100% - 1.25rem));
    --section-pad: 3rem;
    --fs-hero: clamp(1.65rem, 8.8vw, 2.1rem);
    --nav-height: 64px;
  }

  .nav__logo {
    font-size: 1.35rem;
  }

  .nav__menu .nav__link {
    font-size: 1.4rem;
    padding-block: 0.55rem;
  }

  .hero__text {
    padding-block: 1.5rem 0.75rem;
  }

  .hero__title {
    line-height: 1.1;
  }

  .hero__portrait-frame {
    width: clamp(220px, 88vw, 320px);
  }

  .stats__grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat__label {
    font-size: 0.75rem;
  }

  .gallery__masonry {
    columns: 1;
  }

  @supports (grid-template-rows: masonry) {
    .gallery__masonry {
      grid-template-columns: 1fr;
      columns: auto;
    }
  }

  .gallery__item img {
    min-height: 160px;
  }

  .journey__track {
    padding-left: 0.5rem;
  }

  .journey__line {
    left: 0.5rem;
  }

  .journey__dot {
    left: 0.5rem;
  }

  .journey__item {
    padding-left: 1.5rem;
  }

  .journey__card:has(.journey__media) .journey__year,
  .journey__card:has(.journey__media) .journey__card-title,
  .journey__card:has(.journey__media) .journey__card-desc {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .contact__detail {
    gap: 0.75rem;
  }

  .page-hero {
    padding-block: 5.5rem 2.5rem;
  }

  .page-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
  }
}

/* ------------------------------------------------------------
   Prefers reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .nav__menu,
  .hero__portrait-frame,
  .blog-card,
  .journey__card,
  .gallery__item img {
    transition: none !important;
  }

  .hero__gradient,
  .hero__scroll-mouse::after {
    animation: none !important;
  }
}

/* ------------------------------------------------------------
   Print
   ------------------------------------------------------------ */
@media print {
  .nav,
  .loader,
  .cursor,
  .scroll-progress,
  .float-social,
  .newsletter,
  .page-transition,
  .hero__particles {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .section {
    padding: 1.5rem 0;
    break-inside: avoid;
  }
}
