/* Shared responsive and mobile polish for the Excelsior static pages */

:root {
  --site-shell: clamp(1rem, 4vw, 2rem);
  --site-shell-wide: clamp(1rem, 5vw, 2.5rem);
  --site-radius: 20px;
  --site-card-border: rgba(201, 148, 58, 0.12);
  --site-card-bg: linear-gradient(180deg, rgba(34, 33, 32, 0.92), rgba(26, 26, 30, 0.86));
  --site-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  --site-nav-clearance: clamp(6.75rem, 12vh, 8.5rem);
}

html {
  scroll-padding-top: 6rem;
}

body {
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden !important;
}

img,
video {
  max-width: 100%;
}

:where(section, div, footer)[id] {
  scroll-margin-top: 6rem;
}

nav {
  padding-top: env(safe-area-inset-top, 0px);
}

.nav-bar {
  width: min(calc(100% - 1.25rem), 1240px);
  margin-inline: auto;
  border: 1px solid rgba(201, 148, 58, 0.12);
  background: linear-gradient(180deg, rgba(18, 18, 22, 0.9), rgba(26, 26, 30, 0.78));
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.26);
}

.nav-logo-brand {
  max-width: 11rem;
  line-height: 1.05;
  text-wrap: balance;
}

.mobile-menu {
  justify-content: flex-start;
  gap: 0.85rem;
  padding: calc(5.5rem + env(safe-area-inset-top, 0px)) clamp(1.1rem, 5vw, 2rem)
    calc(2rem + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 15% 18%, rgba(201, 148, 58, 0.14), transparent 24%),
    radial-gradient(circle at 84% 22%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(12, 12, 16, 0.98) 0%, rgba(18, 18, 22, 0.96) 58%, rgba(30, 29, 27, 0.98) 100%);
}

.mobile-menu li {
  width: 100%;
}

.mobile-menu a {
  width: 100%;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(201, 148, 58, 0.12);
  letter-spacing: 0.16em;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu li:last-child a {
  border-bottom: none;
}

.mag-btn,
.nav-link,
.nav-cta,
.menu-toggle,
.mobile-menu a,
.project-lightbox-close,
.project-lightbox-nav,
.project-lightbox-dot {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.section-heading {
  text-wrap: balance;
}

.section-label,
.footer-col-title,
.footer-brand-sub,
.hero-eyebrow,
.page-hero-count,
.proj-location,
.hire-stat-label,
.how-step-title {
  letter-spacing: 0.24em;
}

.footer-col-links a,
.footer-contact-value,
.footer-contact-value a {
  overflow-wrap: anywhere;
}

.project-card,
.proj-item,
.equip-card,
.hire-stat,
.how-step,
.vision-block {
  box-shadow: var(--site-shadow);
}

.page-hero-content,
.hero-paragraph,
.svc-card,
.project-card,
.proj-item,
.equip-card,
.hire-stat,
.how-step {
  border-color: var(--site-card-border);
}

@media (max-width: 1180px), (max-height: 860px) {
  .page-home #hero {
    align-items: flex-start;
  }

  .page-home .hero-content {
    padding-top: var(--site-nav-clearance);
    padding-bottom: clamp(2.5rem, 8vh, 4.5rem);
  }
}

@media (max-width: 1024px) {
  .projects-main,
  .projects-cta-section,
  .hire-intro,
  .equip-section,
  .how-section,
  .cta-section,
  .section-pad,
  .projects-section-inner {
    padding-inline: var(--site-shell-wide) !important;
  }

  .about-layout {
    gap: 3rem !important;
  }

  .footer-main {
    gap: 2rem !important;
  }

  .page-hero-content {
    max-width: min(100%, 42rem);
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 5.5rem;
  }

  .nav-bar {
    width: calc(100% - 1rem);
    height: 56px !important;
    margin-top: 0.45rem !important;
    padding-inline: 0.9rem !important;
    border-radius: 22px;
  }

  nav.scrolled .nav-bar {
    width: calc(100% - 0.75rem);
    height: 52px !important;
  }

  .nav-logo-brand {
    max-width: 8.75rem;
    font-size: 0.62rem !important;
    letter-spacing: 0.16em !important;
  }

  .menu-toggle {
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
  }

  .mobile-menu a {
    font-size: clamp(1.1rem, 5.5vw, 1.55rem);
  }

  .section-pad,
  .projects-main,
  .projects-cta-section,
  .hire-intro,
  .equip-section,
  .how-section,
  .cta-section,
  .projects-section-inner {
    padding-inline: var(--site-shell) !important;
  }

  .section-heading {
    font-size: clamp(2.1rem, 9vw, 3.6rem) !important;
    line-height: 0.98;
    max-width: 12ch;
  }

  .section-label,
  .footer-col-title {
    font-size: 0.62rem;
  }

  .mag-btn {
    min-height: 3.25rem;
    padding-inline: 1.4rem !important;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: calc(7rem + env(safe-area-inset-top, 0px)) var(--site-shell) max(1.5rem, 7vh) !important;
    max-width: 100%;
  }

  #hero {
    min-height: 100svh !important;
    min-height: 100dvh !important;
  }

  .hero-eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    font-size: 0.58rem !important;
    letter-spacing: 0.2em !important;
  }

  .hero-heading {
    max-width: 11ch;
    font-size: clamp(2.35rem, 11vw, 4rem) !important;
    line-height: 0.95;
  }

  .hero-paragraph {
    display: block !important;
    max-width: 32rem !important;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(14, 14, 18, 0.18), rgba(14, 14, 18, 0.58));
    backdrop-filter: blur(10px);
    color: var(--cream-dim);
    font-size: 0.96rem !important;
    line-height: 1.72 !important;
  }

  .hero-buttons {
    width: 100%;
    max-width: 22rem;
  }

  .hero-buttons .mag-btn {
    width: 100%;
  }

  .stats-section {
    padding: 1.25rem var(--site-shell) 3rem !important;
    gap: 0.85rem !important;
  }

  .stat-block {
    min-height: 7rem;
    padding: 1rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .stat-desc {
    font-size: 0.56rem !important;
    letter-spacing: 0.18em !important;
    line-height: 1.45;
  }

  .about-prose p,
  .services-intro p,
  .proj-desc,
  .equip-desc,
  .hire-intro p,
  .how-step-desc,
  .footer-brand-desc,
  .modal-status-text,
  .page-hero-sub {
    font-size: 0.95rem !important;
    line-height: 1.72 !important;
  }

  .about-portrait {
    max-width: 34rem;
    margin-inline: auto;
  }

  .about-year-float {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    width: fit-content;
    max-width: min(100%, 18rem);
    margin-top: 1rem;
    margin-left: auto;
    padding: 1rem 1.2rem !important;
  }

  .about-year-float .big-year {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .about-year-float .sub {
    font-size: 0.54rem;
    letter-spacing: 0.24em !important;
    line-height: 1.7;
  }

  .founder-sign {
    flex-direction: column;
    align-items: flex-start;
  }

  .services-mega-grid {
    gap: 0.75rem !important;
  }

  .svc-card {
    min-height: 11rem;
    border-radius: 18px;
    background: var(--site-card-bg);
  }

  .svc-name {
    font-size: 0.8rem !important;
    letter-spacing: 0.08em;
  }

  .svc-desc {
    font-size: 0.88rem !important;
    line-height: 1.6;
  }

  .project-card,
  .proj-item,
  .equip-card,
  .hire-stat,
  .how-step,
  .vision-block {
    border-radius: var(--site-radius) !important;
  }

  .projects-section-inner,
  .projects-main,
  .projects-cta-section,
  .hire-intro,
  .equip-section,
  .how-section,
  .cta-section {
    padding-top: 4.5rem !important;
    padding-bottom: 4.5rem !important;
  }

  .project-card {
    aspect-ratio: 5 / 4 !important;
  }

  .vision-block p {
    font-size: 1rem !important;
    line-height: 1.8;
  }

  .footer-main {
    padding-inline: var(--site-shell) !important;
  }

  .footer-logo-row {
    align-items: flex-start;
    gap: 0.85rem;
  }

  .footer-brand-sub {
    font-size: 0.52rem;
    line-height: 1.6;
  }

  .footer-bottom-bar {
    padding-bottom: max(1.2rem, env(safe-area-inset-bottom, 0px));
  }

  .modal {
    width: min(calc(100% - 1rem), 40rem);
    max-height: calc(100dvh - 1rem);
  }

  .modal-subtitle {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .page-hero {
    min-height: 100svh !important;
    min-height: 100dvh !important;
  }

  .page-hero-content {
    width: auto;
    max-width: none;
    margin: 0 var(--site-shell) 1rem;
    padding: 1.3rem 1.2rem 1.4rem !important;
    border: 1px solid var(--site-card-border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(16, 16, 20, 0.76), rgba(24, 24, 28, 0.9));
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  }

  .page-hero-heading {
    max-width: 11ch;
    font-size: clamp(2.2rem, 10vw, 3.6rem) !important;
    line-height: 0.96;
  }

  .page-hero-sub {
    margin-top: 1rem !important;
  }

  .proj-body {
    padding: 1.25rem 1.15rem 1.3rem !important;
  }

  .proj-image {
    aspect-ratio: 4 / 3;
  }

  .proj-image-num {
    top: 0.9rem;
    left: 1rem;
    font-size: 2.7rem;
  }

  .proj-name {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .proj-location {
    font-size: 0.58rem;
    line-height: 1.5;
    letter-spacing: 0.18em !important;
  }

  .proj-tags span {
    padding: 0.4rem 0.75rem;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
  }

  .hire-intro {
    gap: 2rem !important;
  }

  .hire-intro h2 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

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

  .hire-stat {
    padding: 1.25rem 1rem;
  }

  .hire-stat-label {
    font-size: 0.56rem;
    line-height: 1.5;
    letter-spacing: 0.18em !important;
  }

  .equip-grid,
  .how-grid {
    gap: 1rem !important;
  }

  .equip-card {
    padding: 1.4rem 1.2rem !important;
  }

  .equip-name {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
  }

  .equip-list li {
    font-size: 0.86rem;
    line-height: 1.6;
  }

  .how-step {
    padding: 1.4rem 1.1rem !important;
    text-align: left;
  }

  .how-step-title {
    letter-spacing: 0.18em !important;
  }
}

@media (max-width: 560px) {
  .nav-bar {
    width: calc(100% - 0.75rem);
  }

  .nav-logo-brand {
    max-width: 7.25rem;
    font-size: 0.55rem !important;
  }

  .hero-content {
    padding-top: calc(6.5rem + env(safe-area-inset-top, 0px)) !important;
  }

  .hero-eyebrow {
    font-size: 0.52rem !important;
    letter-spacing: 0.16em !important;
  }

  .hero-heading {
    font-size: clamp(2.05rem, 11.5vw, 3rem) !important;
  }

  .hero-paragraph {
    padding: 0.8rem 0.85rem;
    font-size: 0.9rem !important;
  }

  .about-year-float {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .about-year-float .sub {
    letter-spacing: 0.18em !important;
  }

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

  .svc-card {
    min-height: 0;
  }

  .project-card {
    aspect-ratio: 1 / 1.05 !important;
  }

  .footer-logo-row {
    flex-direction: column;
  }

  .footer-logo-row img {
    height: 44px !important;
  }

  .page-hero-content {
    margin-inline: 1rem;
  }

  .page-hero-heading {
    font-size: clamp(1.9rem, 10vw, 2.8rem) !important;
  }

  .project-lightbox-overlay {
    padding: 0.75rem !important;
  }

  .project-lightbox img {
    max-height: 64svh !important;
    max-height: 64dvh !important;
  }

  .project-lightbox-close {
    top: 0.25rem !important;
    right: 0.25rem !important;
  }

  .project-lightbox-nav {
    top: auto !important;
    bottom: -3rem !important;
    transform: none !important;
  }

  .project-lightbox-nav.prev {
    left: calc(50% - 3.3rem) !important;
  }

  .project-lightbox-nav.next {
    right: calc(50% - 3.3rem) !important;
  }

  .project-lightbox-meta {
    padding-bottom: 3.4rem;
  }

  .hire-stats,
  .how-grid {
    grid-template-columns: 1fr !important;
  }

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

  .modal {
    width: calc(100% - 0.75rem);
    padding: 1.5rem 1rem !important;
  }
}

@media (max-width: 420px) {
  .section-heading {
    max-width: 10ch;
  }

  .mobile-menu a {
    font-size: 1rem;
  }

  .mag-btn .btn-text {
    white-space: normal;
    text-align: center;
  }

  .stat-num {
    font-size: 2.1rem !important;
  }

  .stat-desc {
    font-size: 0.5rem !important;
  }

  .founder-avatar {
    width: 104px !important;
    height: 104px !important;
  }

  .page-hero-content {
    padding: 1.1rem 1rem 1.2rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu a,
  .nav-bar,
  .project-card,
  .proj-item,
  .equip-card,
  .how-step,
  .svc-card {
    transition: none !important;
  }
}
