/*
  Media Fera — Layout
  Header, section grids and responsive structure.
*/

/* ============ Header ============ */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: var(--space-sm) var(--gutter-mobile) 0;
}

main {
  display: block;
  width: 100%;
  padding-top: 76px; /* clears the fixed floating header (12px offset + 64px bar) */
  background: var(--color-background);
}

.site-header__bar {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--space-md);
  border-radius: var(--radius-full);
  background: var(--color-header-surface);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-float);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand__link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Ready for the real logo file — not referenced by any <img> yet, so it
   stays inert (no broken image) until images/brand/logo.svg exists. */
.brand__logo {
  display: block;
  height: 28px;
  width: auto;
}

.primary-nav {
  display: none;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__cta {
  display: none;
}

.menu-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav {
  position: absolute;
  top: calc(64px + var(--space-md));
  left: var(--gutter-mobile);
  right: var(--gutter-mobile);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border-radius: 24px;
  background: var(--color-surface-container-lowest);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-deck);
}

.mobile-nav[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .header__cta {
    display: inline-flex;
    white-space: nowrap;
  }
}

/* The full horizontal nav needs more room than a tablet viewport can
   spare alongside the brand, badge and CTA — it switches on at desktop
   width only. Tablet keeps the same hamburger nav as mobile. */
@media (min-width: 1024px) {
  .site-header__bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-xs);
  }

  .brand {
    justify-self: start;
    white-space: nowrap;
  }

  .primary-nav {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 2px;
    padding: 4px;
    border-radius: var(--radius-full);
    background: var(--color-surface-container-low);
  }

  .primary-nav a {
    padding: 8px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    transition: background 0.2s ease;
  }

  .primary-nav a:hover {
    background: var(--color-surface-container-lowest);
  }

  .header__actions {
    justify-self: end;
    gap: 8px;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }
}

/* More breathing room once the desktop viewport has room to spare */
@media (min-width: 1280px) {
  .site-header__bar {
    gap: var(--space-md);
  }

  .primary-nav a {
    padding: 8px 16px;
  }

  .header__actions {
    gap: var(--space-sm);
  }
}

/* ============ Hero ============ */

.hero {
  position: relative;
  overflow: hidden;
  padding-top: var(--space-md);
}

.hero__inner {
  max-width: var(--content-max);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__glow {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  filter: blur(90px);
}

.hero__glow--top {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 840px;
  height: 520px;
  background: radial-gradient(closest-side, rgba(195, 192, 255, 0.4), rgba(211, 228, 254, 0.3), transparent);
}

.hero__glow--side {
  top: -128px;
  right: 12px;
  width: 384px;
  height: 384px;
  background: rgba(208, 188, 255, 0.3);
  border-radius: var(--radius-full);
}

.hero__badge {
  margin-bottom: var(--space-md);
}

/* Scoped to the hero h1 only (not .text-display-hero itself, which the
   production section also borrows) — fluid clamp() instead of a fixed px
   + single breakpoint jump, and a smaller cap than before so the static
   line reads as refined/editorial rather than oversized. */
.hero__title {
  width: 100%;
  max-width: 56rem;
  margin-bottom: var(--space-sm);
  font-size: clamp(2.125rem, 1.7rem + 2.1vw, 3.75rem);
  line-height: 1.12;
}

/* Rotating second line: fixed-height stage so cycling phrases never
   shift the CTA/description below it. JS measures the tallest phrase
   (which may wrap on narrow screens) and refines this min-height; the
   values below are a no-JS/pre-JS fallback sized for one line at the
   clamp()'d font-size below.
   Deliberately much smaller than the static headline (never a fixed px
   value) so it reads as a supporting accent, not a second headline — at
   this size every rotator phrase, including the longest one, fits on a
   single line from 768px up; mobile may still wrap to 2 lines. */
.hero__rotator {
  position: relative;
  display: block;
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  overflow: hidden;
  min-height: 34px;
}

@media (min-width: 768px) {
  .hero__rotator {
    min-height: 48px;
  }
}

.hero__rotator-item {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(calc(-50% + 18px));
  opacity: 0;
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-secondary);
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
  .hero__rotator-item {
    font-size: clamp(2.25rem, 2.1rem + 0.5vw, 2.5rem);
    white-space: nowrap;
  }
}

.hero__rotator-item.is-active {
  opacity: 1;
  transform: translateY(-50%);
}

.hero__rotator-item.is-leaving {
  opacity: 0;
  transform: translateY(calc(-50% - 22px));
}

@media (prefers-reduced-motion: reduce) {
  .hero__rotator-item {
    transition: none;
  }
}

.hero__lead {
  max-width: 42rem;
  margin-inline: auto;
  margin-bottom: var(--space-sm);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.hero__deck {
  width: 100%;
  max-width: 72rem;
}

.deck__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--space-xs);
  padding-bottom: var(--space-sm);
}

.deck__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck__url {
  display: none;
  align-items: center;
  gap: 8px;
}

.deck__controls {
  display: none;
  align-items: center;
  gap: 8px;
}

@media (min-width: 640px) {
  .deck__url,
  .deck__controls {
    display: flex;
  }
}

.deck__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-low);
  padding: var(--gutter);
}

.deck__main {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-container-highest);
}

.deck__side {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

@media (min-width: 1024px) {
  .deck__grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .deck__main {
    grid-column: span 8;
  }

  .deck__side {
    grid-column: span 4;
  }
}

/* ============ Credibility (16 years) ============ */

.credibility__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  align-items: center;
}

@media (min-width: 1024px) {
  .credibility__grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .credibility__figure {
    grid-column: span 5;
  }

  .credibility__content {
    grid-column: span 7;
    padding-left: var(--space-lg);
  }
}

/* ============ Section headings ============ */

.section-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .section-heading--split {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

/* ============ Client grid ============ */

.client-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}

@media (min-width: 768px) {
  .client-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============ Project grid ============ */

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(12, 1fr);
    align-items: start;
  }

  .project-card--wide {
    grid-column: span 8;
  }

  .project-card--narrow {
    grid-column: span 4;
  }
}

/* ============ Service grid ============ */

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

@media (min-width: 768px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .service-card--feature {
    grid-column: span 2;
  }
}

/* ============ Industry chip cloud ============ */

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  max-width: 64rem;
  margin-inline: auto;
}

/* ============ Digital showcase ============ */

.showcase__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  align-items: center;
}

@media (min-width: 1024px) {
  .showcase__grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .showcase__content {
    grid-column: span 5;
  }

  .showcase__deck {
    grid-column: span 7;
  }
}

.showcase__checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.showcase__checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ Production feature (dark) ============ */

.production-feature {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  /* Deliberately always dark regardless of site theme — see
     --color-cinematic-surface in tokens.css. */
  background: var(--color-cinematic-surface);
  color: var(--color-on-cinematic);
}

.production-feature__bg {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-size: cover;
  background-position: center;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

.production-feature__inner {
  position: relative;
  z-index: 1;
  max-width: 56rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.production-feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.production-feature__tag {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  white-space: nowrap;
}

/* ============ Geography section ============ */

.geo-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* Centered so a lone wrapped item (the "Global" stop) reads as a
     deliberate destination, not an orphaned leftover. */
  justify-content: center;
  gap: 10px;
}

.geo-highlights {
  margin-top: var(--space-md);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .geo-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

.geo-highlight {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-surface-container-lowest);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

/* ============ Method grid ============ */

.method-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

@media (min-width: 768px) {
  .method-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============ Contact ============ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-lg);
    align-items: start;
  }

  .contact-info {
    grid-column: span 5;
  }

  .contact-form-wrap {
    grid-column: span 7;
  }
}

.contact-info__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.contact-info__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.contact-info__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============ Footer ============ */

.site-footer {
  width: 100%;
  padding: var(--space-lg) var(--gutter-mobile) var(--space-xl);
}

@media (min-width: 768px) {
  .site-footer {
    padding-inline: var(--margin);
  }
}

.footer-card {
  max-width: var(--content-max);
  margin-inline: auto;
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-hairline);
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

@media (min-width: 1024px) {
  .site-footer .footer-card {
    padding: var(--space-xl);
  }

  .footer-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-lg);
    align-items: start;
  }

  .footer-brand {
    grid-column: span 5;
  }

  .footer-contact {
    grid-column: span 4;
  }

  .footer-nav {
    grid-column: span 3;
  }
}

.footer-bottom {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}
