/* =========================================================================
   M/s Anupam Sharma & Co. — Responsive Stylesheet
   -------------------------------------------------------------------------
   Loaded AFTER style.css and animations.css — overrides only, no new
   design tokens. Every rule is inside a media query so desktop behaviour
   is fully preserved.

   SECTIONS
   01. Global container / section tightening
   02. Breakpoint 1200px — large desktop
   03. Breakpoint 1024px — small desktop / large tablet
   04. Breakpoint 960px — MOBILE NAV + primary stacking
   05. Breakpoint 900px — narrow tablet
   06. Breakpoint 768px — small tablet / large phone
   07. Breakpoint 640px — phone
   08. Breakpoint 480px — small phone
   09. Breakpoint 390px / 375px / 320px — ultra small
   10. Touch-device polish
   ========================================================================= */


/* -------------------------------------------------------------------------
   01. GLOBAL CONTAINER / SECTION TIGHTENING
   The hero/header offset already uses --header-h which is unchanged.
   We only trim the section vertical rhythm below 1024px.
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .section {
    padding-block: clamp(3.25rem, 6vw, 5.5rem);
  }
}


/* -------------------------------------------------------------------------
   02. LARGE DESKTOP (<= 1200px)
   Content stays 4-up for services, 3-up for updates. Just slightly
   tighter gutters in the hero grid.
   ------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .hero__inner {
    gap: 3rem;
  }

  .footer__grid {
    grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
    gap: 2.5rem;
  }
}


/* -------------------------------------------------------------------------
   03. SMALL DESKTOP / LARGE TABLET (<= 1024px)
   - Services drops from 4 to 2 columns
   - Why-us / about / legacy / industry keep 2 columns (still comfortable)
   - Hero visual shrinks a little
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .service-card {
    padding: 1.75rem 1.5rem 1.5rem;
  }

  .hero__inner {
    gap: 2.5rem;
  }

  .hero__frame {
    max-width: 400px;
  }

  .hero__chip {
    left: -1rem;
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
  }

  .why__media,
  .about__media {
    max-width: 520px;
    margin-inline: auto;
  }
}


/* -------------------------------------------------------------------------
   04. MOBILE NAV + PRIMARY STACKING (<= 960px)
   This is the master breakpoint — the header becomes a hamburger menu
   and ALL major 2-column grids collapse to a single column.
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {

  /* ---- 4.1 Hamburger visibility ---------------------------------------- */
  .nav__toggle {
    display: grid;
    place-items: center;
    color: inherit;
    background: transparent;
  }

  /* When the menu is open, force the header solid so the hamburger and
     brand are always legible — even on the transparent home-page hero.  */
  .site-header.is-open {
    background: var(--white);
    color: var(--text);
    box-shadow: 0 1px 0 var(--border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* ---- 4.2 The full-screen nav panel shell ----------------------------- */
  /* NOTE: opacity / visibility / transform on .nav are controlled by
     animations.css. We only define the layout + paint here.             */
  .nav {
    position: fixed;
    inset: 0;
    width: 100%;
    padding: calc(var(--header-h-scrolled) + 1.5rem) var(--gutter) 2rem;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background: var(--white);
    color: var(--primary);
    border-top: 1px solid var(--border);
    z-index: 90;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .nav__item {
    border-bottom: 1px solid var(--border);
  }

  .nav__item:first-child {
    border-top: 1px solid var(--border);
  }

  .nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.15rem 0.25rem;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--primary);
  }

  /* The gold underline animation from desktop doesn't suit the panel */
  .nav__link::after {
    display: none;
  }

  .nav__link.is-active {
    color: var(--secondary);
  }

  /* Chevron for expandable items — placed to the right of the label */
  .nav__item--has-dropdown > .nav__link::before {
    order: 2;
    margin-left: auto;
    color: var(--muted);
  }

  /* ---- 4.3 Accordion dropdowns ---------------------------------------- */
  /* Position / max-height / opacity motion lives in animations.css.
     Only cosmetic overrides here.                                        */
  .nav__dropdown {
    position: static;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg-soft);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Show the dropdown only when the accordion is expanded */
  .nav__item--has-dropdown.is-expanded > .nav__dropdown {
    visibility: visible;
  }

  .nav__dropdown a {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 0.92rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }

  .nav__dropdown a:last-child {
    border-bottom: 0;
  }

  .nav__dropdown a:hover,
  .nav__dropdown a:focus-visible {
    background: var(--light-blue);
    color: var(--primary);
    padding-left: 1.75rem;
  }

  /* ---- 4.4 Hero — single column --------------------------------------- */
  .hero {
    min-height: auto;
    padding: calc(var(--header-h) + 1.75rem) 0 3rem;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__content {
    max-width: none;
  }

  .hero__visual {
    max-width: 460px;
    margin-inline: auto;
    width: 100%;
  }

  .hero__frame {
    aspect-ratio: 4 / 3;
    max-width: 100%;
  }

  .hero__frame::before {
    width: 60px;
    height: 60px;
    top: -10px;
    right: -10px;
  }

  .hero__chip {
    left: 1rem;
    bottom: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
  }

  .hero__scroll {
    display: none;
  }

  /* ---- 4.5 Section grids collapse to one column ----------------------- */
  .legacy__grid,
  .about__grid,
  .why__grid,
  .industry-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about__media,
  .why__media {
    aspect-ratio: 16 / 11;
    max-width: none;
    margin-inline: 0;
  }

  .about__media::before {
    width: 44px;
    height: 44px;
  }

  /* ---- 4.6 Values — two-column compact ------------------------------- */
  .value-row {
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.25rem;
    padding: 1.4rem 0;
    align-items: baseline;
  }

  .value-row__text {
    grid-column: 1 / -1;
    padding-left: calc(1.25rem + 60px);
    max-width: none;
  }

  /* Disable the padding shift on touch — it feels jumpy without hover */
  .value-row:hover,
  .value-row:focus-visible {
    padding-inline: 0;
    background: transparent;
  }

  .value-row:hover .value-row__line,
  .value-row:focus-visible .value-row__line {
    width: 0;
  }

  /* ---- 4.7 CTA band — stack ------------------------------------------ */
  .cta-band__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }

  .cta-band__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
  }

  /* ---- 4.8 Section-head split — stack -------------------------------- */
  .section-head--split {
    align-items: flex-start;
    gap: 1rem;
  }
}


/* -------------------------------------------------------------------------
   05. NARROW TABLET (<= 900px)
   - Updates grid 3 → 2
   - Footer grid 4 → 2
   - Section head split truly stacks
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .update-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem 2.5rem;
  }

  .footer__brand {
    grid-column: 1 / -1;
    max-width: 560px;
  }

  .section-head--split {
    flex-direction: column;
    align-items: flex-start;
  }

  .value-row__text {
    padding-left: calc(1.25rem + 48px);
  }
}


/* -------------------------------------------------------------------------
   06. SMALL TABLET / LARGE PHONE (<= 768px)
   - Section rhythm tightens further
   - Header height steps down a touch on scroll
   - Footer bottom bar stacks
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .section {
    padding-block: 3.25rem;
  }

  .section-head {
    margin-bottom: 2rem;
  }

  .section-title {
    letter-spacing: -0.005em;
  }

  /* Header height */
  :root {
    --header-h: 76px;
    --header-h-scrolled: 64px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .brand__name {
    font-size: 0.94rem;
  }

  .brand__role {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
  }

  /* Values — fully stacked */
  .value-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-block: 1.4rem;
  }

  .value-row__text {
    padding-left: 0;
  }

  /* Footer bottom bar */
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .footer__legal {
    flex-wrap: wrap;
    gap: 1rem;
  }

  /* CTA band actions */
  .cta-band__actions {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* -------------------------------------------------------------------------
   07. PHONE (<= 640px)
   - All multi-column grids go single column
   - Hero actions become full-width buttons
   - Footer stacks to a single column
   ------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .service-grid,
  .update-grid,
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .service-card,
  .update-card {
    padding: 1.75rem 1.5rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .hero__actions .btn {
    justify-content: center;
    width: 100%;
  }

  .hero__meta {
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
  }

  .hero__meta li + li::before {
    margin-right: 0.5rem;
  }

  .hero__visual {
    max-width: 100%;
  }

  .hero__frame {
    aspect-ratio: 16 / 11;
  }

  .hero__chip {
    position: static;
    margin-top: 1rem;
    display: inline-flex;
    width: fit-content;
    box-shadow: var(--shadow-sm);
  }

  /* Values tight */
  .value-row {
    padding-block: 1.15rem;
  }

  .value-row__title {
    font-size: 1.2rem;
  }

  /* Industries — detail panel below list */
  .industry-panel__body {
    padding: 1.35rem;
  }

  .industry-panel__title {
    font-size: 1.2rem;
  }

  /* Footer */
  .footer__top {
    padding-bottom: 2rem;
  }

  .footer__brand {
    grid-column: auto;
  }

  .footer__grid {
    gap: 1.75rem;
  }

  /* CTA band */
  .cta-band {
    padding-block: 3rem;
  }

  .cta-band__title {
    font-size: 1.9rem;
  }

  /* Buttons slightly smaller */
  .btn {
    padding: 0.85rem 1.25rem;
    font-size: 0.84rem;
  }
}


/* -------------------------------------------------------------------------
   08. SMALL PHONE (<= 480px)
   - Further typography trim
   - Tighter hero padding
   - Smaller brand block
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .section {
    padding-block: 2.75rem;
  }

  .hero {
    padding: calc(var(--header-h) + 1.25rem) 0 2.25rem;
  }

  .hero__title {
    font-size: clamp(2rem, 8.5vw, 2.6rem);
    line-height: 1.12;
  }

  .hero__tagline {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  .hero__text {
    font-size: 0.96rem;
    line-height: 1.7;
  }

  .hero__eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    padding-bottom: 0.75rem;
    margin-bottom: 1.1rem;
  }

  .hero__meta {
    display: none; /* the chip already shows practice context */
  }

  .brand__text {
    max-width: 190px;
  }

  .brand__name {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand__role {
    font-size: 0.58rem;
  }

  .nav__link {
    font-size: 0.96rem;
    padding: 1rem 0.15rem;
  }

  .nav__dropdown a {
    font-size: 0.88rem;
    padding: 0.75rem 1.25rem;
  }

  .pillar {
    padding: 1.4rem 1.4rem 1.4rem 4.25rem;
  }

  .pillar__index {
    left: 1.4rem;
    top: 1.4rem;
    font-size: 1.2rem;
  }

  .section-sub {
    font-size: 1rem;
  }

  .value-row__title {
    font-size: 1.15rem;
  }

  .value-row__text {
    font-size: 0.9rem;
  }

  .industry-item {
    grid-template-columns: 36px 1fr 20px;
    gap: 0.75rem;
    padding: 1rem 0.25rem;
  }

  .industry-item__label {
    font-size: 1rem;
  }

  .cta-band__actions {
    gap: 0.75rem;
  }

  .footer__bottom {
    padding-block: 1.25rem;
    font-size: 0.78rem;
  }
}


/* -------------------------------------------------------------------------
   09. ULTRA SMALL (<= 390px / 375px / 320px)
   - Only the strictest tightening. No new layout changes.
   ------------------------------------------------------------------------- */
@media (max-width: 390px) {
  :root {
    --gutter: 1.15rem;
  }

  .hero__title {
    font-size: clamp(1.85rem, 8vw, 2.3rem);
  }

  .section-title {
    font-size: clamp(1.5rem, 6vw, 1.85rem);
  }

  .brand__mark {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .brand__name {
    max-width: 165px;
    font-size: 0.84rem;
  }

  .service-card__title {
    font-size: 1.1rem;
  }

  .update-card__title {
    font-size: 1.1rem;
  }
}

@media (max-width: 375px) {
  :root {
    --gutter: 1rem;
  }

  .hero__title {
    font-size: 1.85rem;
  }

  .hero__tagline {
    letter-spacing: 0.1em;
  }
}

@media (max-width: 320px) {
  .brand__name {
    max-width: 140px;
    font-size: 0.8rem;
  }

  .brand__role {
    letter-spacing: 0.14em;
  }

  .hero__title {
    font-size: 1.7rem;
  }

  .btn {
    padding: 0.8rem 1.1rem;
    font-size: 0.8rem;
  }

  .section-title {
    font-size: 1.45rem;
  }

  .footer__heading {
    font-size: 0.66rem;
  }

  .footer__list {
    gap: 0.45rem;
  }
}


/* -------------------------------------------------------------------------
   10. TOUCH-DEVICE POLISH
   Disable hover-only "shift" effects on devices that cannot truly hover,
   preventing accidental jumps when a tap triggers :hover.
   (Hover-based colours, borders and arrow slides are kept — they reset
   immediately and don't cause layout shift.)
   ------------------------------------------------------------------------- */
@media (hover: none) {
  .pillar:hover,
  .service-card:hover,
  .update-card:hover,
  .why-item:hover {
    transform: none;
  }

  .service-card:hover::before,
  .update-card:hover::after {
    transform: none;
    opacity: 0;
  }

  .value-row:hover {
    background: transparent;
  }

  .value-row:hover .value-row__line {
    width: 0;
  }

  .industry-panel:hover .industry-panel__media img {
    transform: none;
  }
}