/* ==========================================================================
   layout.css — Container, Nav, Hero, Sections, Footer, Grids
   ========================================================================== */

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* --------------------------------------------------------------------------
   Site Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: rgba(248, 249, 250, 0.80);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal),
              box-shadow var(--transition-normal);
}

.site-header.scrolled {
  background-color: rgba(248, 249, 250, 0.95);
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-6);
}

/* Two-tone logo: MASS bold + "with Method" light */
.nav__logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
  text-decoration: none;
}

.nav__logo:hover {
  opacity: 0.7;
}

.nav__logo-mass {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  line-height: 1;
}

.nav__logo-suffix {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  color: var(--color-text-secondary);
  letter-spacing: 0;
  line-height: 1;
}

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

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: var(--space-3);
  background-color: currentColor;
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

.nav__link:hover {
  color: var(--color-text-primary);
}

.nav__link:hover::after {
  width: calc(100% - var(--space-6));
}

.nav__link--active {
  color: var(--color-text-primary);
  font-weight: var(--weight-semibold);
}

.nav__link--active::after {
  width: calc(100% - var(--space-6));
}

/* Burger Button (mobile) */
.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: var(--space-2);
  flex-shrink: 0;
  transition: background-color var(--transition-fast);
}

.nav__burger:hover {
  background-color: var(--color-bg-alt);
}

.nav__burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.nav__burger[aria-expanded="true"] .nav__burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__burger[aria-expanded="true"] .nav__burger-line:nth-child(2) {
  opacity: 0;
}
.nav__burger[aria-expanded="true"] .nav__burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Section Base
   -------------------------------------------------------------------------- */
.section {
  padding-block: var(--space-24);
}

.section--alt {
  background-color: rgba(237, 238, 239, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.section--hero {
  padding-block: var(--space-16) var(--space-32);
  min-height: calc(90vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Inside the hero section, the container becomes a centered column */
.section--hero > .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.section--hero-small {
  padding-block: var(--space-16);
  min-height: auto;
}

.section--filter {
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--color-border-subtle);
}

.section--grid {
  padding-block: var(--space-12);
}

/* Section header */
.section__header {
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-16);
  text-align: center;
}

.section__label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-3xl), 5vw, 5rem);
  font-weight: var(--weight-normal);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
  color: var(--color-text-primary);
}

.section__title-divider {
  width: 4rem;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-8);
}

.section__intro {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* --------------------------------------------------------------------------
   Hero — Editorial Layout
   -------------------------------------------------------------------------- */

/* Wrapper for the full-width editorial composition */
.hero__editorial {
  position: relative;
  width: 100%;
  height: 280px;
  margin-bottom: var(--space-12);
  user-select: none;
  overflow: visible;
}

/* "MASS" — light outline, acts as a typographic background texture */
.hero__bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(110px, 15vw, 240px);
  font-weight: var(--weight-black);
  color: var(--color-surface-highest);
  -webkit-text-stroke: 1.5px var(--color-border);
  paint-order: stroke fill;
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: uppercase;
  z-index: 0;
  white-space: nowrap;
  animation: fadeInUpCentered 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* "with Method" — dark Bodoni italic, centered over MASS */
.hero__overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-2deg);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--weight-normal);
  font-size: clamp(50px, 8vw, 130px);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  z-index: 1;
  animation: fadeInUpCenteredRotated 0.8s cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

/* Centered text block: subline + CTAs */
.hero__text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 620px;
}

/* Non-editorial hero (snacks page etc.) */
.hero__content {
  max-width: 760px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__headline {
  font-size: clamp(var(--text-3xl), 6vw, var(--text-6xl));
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
}

.hero__subline {
  font-size: clamp(var(--text-base), 2vw, var(--text-xl));
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 600px;
  margin-bottom: var(--space-12);
}

.hero__cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* Scroll indicator */
.hero__scroll-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: var(--space-12);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.hero__scroll-hint:hover {
  color: var(--color-text-secondary);
}

.hero__scroll-arrow {
  width: 14px;
  height: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border-subtle);
  padding-block: var(--space-12);
  background-color: var(--color-surface-lowest);
}

.footer__grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer__logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  margin-bottom: var(--space-2);
  text-decoration: none;
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-4);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  padding: var(--space-1) 0;
  position: relative;
}

.footer__link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--color-text-primary);
  transition: width var(--transition-normal);
}

.footer__link:hover {
  color: var(--color-text-primary);
}

.footer__link:hover::after {
  width: 100%;
}

.footer__disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Grids
   -------------------------------------------------------------------------- */
.cards-grid {
  display: grid;
  gap: var(--space-6);
}

.cards-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* --------------------------------------------------------------------------
   Subsection Title
   -------------------------------------------------------------------------- */
.subsection__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-top: var(--space-16);
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --container-pad: var(--space-5);
  }

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

  .footer__grid {
    flex-direction: column;
    gap: var(--space-6);
  }

  .footer__links {
    flex-wrap: wrap;
  }

  .hero__editorial {
    height: 220px;
  }
}

@media (max-width: 640px) {
  :root {
    --container-pad: var(--space-4);
  }

  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: rgba(248, 249, 250, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
    gap: var(--space-1);
  }

  .nav__links.nav__links--open {
    display: flex;
  }

  .nav__link {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
  }

  .nav__burger {
    display: flex;
  }

  .cards-grid--3 {
    grid-template-columns: 1fr;
  }

  .hero__cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero__cta-group .btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .section {
    padding-block: var(--space-16);
  }

  .section--hero {
    padding-block: var(--space-12) var(--space-16);
    min-height: auto;
  }

  .section__header {
    margin-bottom: var(--space-10);
  }

  .hero__editorial {
    height: 140px;
    margin-bottom: var(--space-8);
  }

  /* Prevent hero text overflow on small phones */
  .hero__bg-text {
    font-size: clamp(72px, 18vw, 240px);
  }

  .hero__overlay-text {
    font-size: clamp(34px, 9vw, 130px);
  }

  .hero__subline {
    margin-bottom: var(--space-8);
  }

  .hero__scroll-hint {
    margin-top: var(--space-8);
  }

  .section__intro {
    font-size: var(--text-base);
  }
}
