/*
 * Brand pages (components/brands/BrandPage.tsx, BrandAnimation.tsx).
 * Content width = header width: --mpw-content-max plus --mpw-gutter.
 */

.mpw-brand {
  --ink: #111112;
  --muted: #6b6b70;
  --line: rgba(0, 0, 0, 0.08);
  --surface: #f6f6f4;
  --yellow: #f1c95a;
  color: var(--ink);
}

.mpw-brand__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--mpw-content-max, 1600px);
  margin: 0 auto;
  padding-left: var(--mpw-gutter, 1.25rem);
  padding-right: var(--mpw-gutter, 1.25rem);
}

.mpw-brand__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mpw-brand__eyebrow::before {
  content: "";
  flex: 0 0 1.75rem;
  height: 2px;
  background: var(--yellow);
}

/* Hero ----------------------------------------------------------------- */

.mpw-brand__hero {
  padding: calc(var(--mpw-header-clearance, 9rem) + 1rem) 0 clamp(3rem, 7vw, 6rem);
  background: linear-gradient(180deg, #fff 0%, var(--surface) 100%);
}

.mpw-brand__hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.mpw-brand__crumbs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.mpw-brand__crumbs a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.mpw-brand__crumbs a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.mpw-brand__title {
  margin: 0;
  font-size: clamp(2.5rem, 5.4vw, 4.75rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.mpw-brand__tagline {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.3125rem);
  font-weight: 300;
  line-height: 1.5;
}

.mpw-brand__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.mpw-brand__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mpw-brand__button:hover,
.mpw-brand__button:focus-visible {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.mpw-brand__button--primary {
  border-color: var(--yellow);
  background: var(--yellow);
}

.mpw-brand__button--ghost {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.mpw-brand__button--light {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.mpw-brand__button--light:hover {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

.mpw-brand__logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid var(--line);
  border-radius: var(--mpw-radius, 12px);
  background: #fff;
}

.mpw-brand__logo-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Intro ------------------------------------------------------------------ */

.mpw-brand__intro {
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}

.mpw-brand__intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.mpw-brand__lead-logo {
  display: block;
  height: 64px;
  width: auto;
  margin-bottom: 2rem;
}

.mpw-brand__lead p {
  margin: 0 0 1.25rem;
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.mpw-brand__glance {
  padding: 1.75rem;
  border-top: 3px solid var(--yellow);
  background: var(--surface);
}

.mpw-brand__glance h2 {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.mpw-brand__glance ul,
.mpw-brand__checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mpw-brand__glance li,
.mpw-brand__checks li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.75rem;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}

.mpw-brand__glance li:last-child,
.mpw-brand__checks li:last-child {
  border-bottom: 0;
}

.mpw-brand__glance li::before,
.mpw-brand__checks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 1.05rem;
  width: 0.7rem;
  height: 0.4rem;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-45deg);
}

/* Sections ---------------------------------------------------------------- */

.mpw-brand__sections {
  padding-bottom: clamp(3.5rem, 8vw, 7rem);
}

.mpw-brand__section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(1.5rem, 6vw, 6rem);
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 1px solid var(--line);
}

.mpw-brand__section h2 {
  margin: 0;
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.mpw-brand__section-body p {
  margin: 0 0 1rem;
  color: #3d3d41;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.mpw-brand__section-body p:last-child {
  margin-bottom: 0;
}

.mpw-brand__checks {
  margin-top: 1.25rem;
}

.mpw-brand__quote {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: clamp(1.75rem, 4vw, 3rem);
  border-left: 3px solid var(--yellow);
  background: var(--surface);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 300;
  line-height: 1.4;
}

/* Gallery ----------------------------------------------------------------- */

.mpw-brand__gallery {
  padding-bottom: clamp(3.5rem, 8vw, 7rem);
}

.mpw-brand__gallery-grid {
  display: grid;
  gap: 1rem;
}

.mpw-brand__gallery-grid--1 { grid-template-columns: 1fr; }
.mpw-brand__gallery-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mpw-brand__gallery-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mpw-brand__gallery figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--mpw-radius-sm, 8px);
  background: var(--surface);
  aspect-ratio: 4 / 3;
}

.mpw-brand__gallery-grid--1 figure {
  aspect-ratio: 21 / 9;
}

.mpw-brand__gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.mpw-brand__gallery figure:hover img {
  transform: scale(1.04);
}

/* Family ------------------------------------------------------------------ */

.mpw-brand__family {
  padding: clamp(3.5rem, 8vw, 7rem) 0;
  background: var(--surface);
}

.mpw-brand__family-text {
  max-width: 40rem;
  margin: 0 0 2rem;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 300;
  line-height: 1.45;
}

.mpw-brand__family-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.mpw-brand__family-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--mpw-radius, 12px);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mpw-brand__family-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.35);
}

.mpw-brand__family-card img {
  height: 44px;
  width: auto;
  align-self: flex-start;
  margin-bottom: 0.75rem;
}

.mpw-brand__family-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.mpw-brand__family-teaser {
  color: var(--muted);
  line-height: 1.5;
}

.mpw-brand__family-link {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mpw-brand__family-link::after {
  content: " →";
}

/* CTA band ---------------------------------------------------------------- */

.mpw-brand__cta {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  background: #0e0e0f;
  color: #fff;
}

.mpw-brand__cta-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.mpw-brand__cta h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.mpw-brand__cta p {
  max-width: 36rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}

.mpw-brand__cta .mpw-brand__actions {
  margin-top: 0;
}

/* Animations -------------------------------------------------------------- */
/* One family: same frame, room, light colour and falloff, line weights, step
   rail and caption. States are classes (is-s1 … is-sN) set by the component;
   everything moves via transitions. Leaving a state uses --reset. */

.mpw-anim {
  --light: #fff3c6;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --reset: 0.9s;
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--mpw-radius, 12px);
  background: #121214;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 40px 80px -42px rgba(0, 0, 0, 0.6);
}

.mpw-anim__stage {
  position: relative;
  aspect-ratio: 16 / 10;
}

.mpw-anim__stage > svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* shared line work */
.mpw-anim__edge {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}

.mpw-anim__body {
  fill: #202023;
  stroke: rgba(255, 255, 255, 0.26);
  stroke-width: 1.25;
}

.mpw-anim__detail {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.25;
  stroke-linecap: round;
}

/* generic state primitives: fade (opacity) and draw (stroke) */
.mpw-anim .mpw-fx {
  opacity: 0;
  transition: opacity var(--reset) var(--ease);
}

.mpw-anim.is-s1 .mpw-fx.at-1,
.mpw-anim.is-s2 .mpw-fx.at-2,
.mpw-anim.is-s3 .mpw-fx.at-3,
.mpw-anim.is-s4 .mpw-fx.at-4 {
  opacity: var(--to, 1);
  transition: opacity var(--in, 1.2s) var(--ease) var(--delay, 0s);
}

.mpw-anim .mpw-draw {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0s linear var(--reset);
}

.mpw-anim.is-s1 .mpw-draw.at-1,
.mpw-anim.is-s2 .mpw-draw.at-2,
.mpw-anim.is-s3 .mpw-draw.at-3,
.mpw-anim.is-s4 .mpw-draw.at-4 {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--in, 1.2s) var(--ease-io) var(--delay, 0s);
}

/* pause / play */
.mpw-anim__toggle {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.55);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  opacity: 0.7;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 160ms ease, border-color 160ms ease, color 160ms ease;
}

.mpw-anim:hover .mpw-anim__toggle,
.mpw-anim__toggle:focus-visible {
  opacity: 1;
}

.mpw-anim__toggle:hover {
  border-color: var(--yellow);
  color: #fff;
}

.mpw-anim__toggle:focus-visible,
.mpw-anim__item:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.mpw-anim__toggle svg {
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* step rail (steps or colour variants, same slot and look) */
.mpw-anim__rail {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 1rem 0.875rem;
  margin: 0;
  padding: 1.25rem 1.5rem 0;
  list-style: none;
}

.mpw-anim__item {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.45);
  font: inherit;
  text-align: left;
  transition: color 160ms ease;
}

button.mpw-anim__item {
  cursor: pointer;
}

button.mpw-anim__item:hover,
.mpw-anim__item.is-current {
  color: #fff;
}

.mpw-anim__item.is-done {
  color: rgba(255, 255, 255, 0.72);
}

.mpw-anim__track {
  position: relative;
  display: block;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.mpw-anim__fill {
  position: absolute;
  inset: 0;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease), background-color 0.4s ease;
}

.mpw-anim__item.is-active .mpw-anim__fill {
  transform: scaleX(1);
  transition: transform var(--dur, 2s) linear;
}

.mpw-anim__item.is-held .mpw-anim__fill {
  transition: transform 0.4s var(--ease);
}

.mpw-anim__item.is-done .mpw-anim__fill {
  transform: scaleX(1);
  background: rgba(255, 255, 255, 0.45);
}

.mpw-anim__label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.mpw-anim__index {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  transition: color 160ms ease;
}

.mpw-anim__item.is-current .mpw-anim__index {
  color: var(--yellow);
}

.mpw-anim__swatch {
  flex: 0 0 auto;
  align-self: center;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.mpw-anim__item.is-current .mpw-anim__swatch {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 0 2px #121214, 0 0 0 3px var(--yellow);
}

.mpw-anim figcaption {
  padding: 1rem 1.5rem 1.4rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: left;
}

/* NewLux: controller → driver → LED strip → profile luminaire */
.mpw-anim--newlux .nl-cable {
  fill: none;
  stroke: rgba(255, 255, 255, 0.13);
  stroke-width: 1.25;
  stroke-dasharray: 2 4;
}

.mpw-anim--newlux .nl-feed {
  fill: none;
  stroke: var(--light);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.mpw-anim--newlux .nl-feed--glow {
  stroke-width: 4;
  opacity: 0.7;
}

/* once the luminaire is on, the cables step back */
.mpw-anim--newlux .nl-feeds {
  transition: opacity var(--reset) var(--ease);
}

.mpw-anim--newlux.is-s4 .nl-feeds {
  opacity: 0.35;
  transition: opacity 1.6s var(--ease) 0.4s;
}

.mpw-anim--newlux .nl-ripple {
  fill: none;
  stroke: var(--light);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.mpw-anim--newlux.is-s1 .nl-ripple {
  animation: mpw-ripple 1.3s var(--ease) 0.1s 1;
}

@keyframes mpw-ripple {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* LightLine: concrete wall, profile, module, line of light */
.mpw-anim--lightline .ll-joint {
  fill: none;
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 1;
}

.mpw-anim--lightline .ll-joint--hi {
  stroke: rgba(255, 255, 255, 0.035);
}

.mpw-anim--lightline .ll-tie {
  fill: #0d0d0e;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}

.mpw-anim--lightline .ll-profile,
.mpw-anim--lightline .ll-module {
  opacity: 0;
  transform: translateY(-22px);
  transition: opacity var(--reset) var(--ease), transform 0s linear var(--reset);
}

.mpw-anim--lightline.is-s1 .ll-profile {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease) 0.25s, transform 1.2s var(--ease) 0.25s;
}

.mpw-anim--lightline .ll-module {
  transform: translateY(-30px);
}

.mpw-anim--lightline.is-s2 .ll-module {
  opacity: 1;
  transform: none;
  /* slight overshoot reads as the click */
  transition: opacity 0.4s var(--ease) 0.3s, transform 0.8s cubic-bezier(0.34, 1.5, 0.64, 1) 0.3s;
}

.mpw-anim--lightline .ll-grow {
  transform: scaleX(0);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0s linear var(--reset);
}

.mpw-anim--lightline.is-s3 .ll-grow {
  transform: scaleX(1);
  transition: transform 1.6s var(--ease-io) 0.15s;
}

/* DependLight: gentle sway, steady light, colour variants */
.mpw-anim--dependlight {
  --shade: #8e8e8b;
}

.mpw-anim--dependlight .dl-pendant {
  transform-origin: 320px 36px;
  animation: dl-sway 9s ease-in-out infinite;
}

@keyframes dl-sway {
  0%, 100% { transform: rotate(-1.1deg); }
  50% { transform: rotate(1.1deg); }
}

.mpw-anim--dependlight .dl-cable {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 1.25;
}

.mpw-anim--dependlight .dl-shade {
  fill: var(--shade);
  transition: fill 0.9s var(--ease);
}

.mpw-anim--dependlight .dl-on {
  animation: dl-on 1.8s var(--ease) 0.2s both;
}

@keyframes dl-on {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mpw-anim[data-paused] * {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .mpw-anim *,
  .mpw-anim *::before,
  .mpw-anim *::after {
    animation: none !important;
    transition: none !important;
  }

  /* lit end state, even before hydration */
  .mpw-anim .mpw-fx {
    opacity: var(--to, 1);
  }

  .mpw-anim .mpw-draw {
    stroke-dashoffset: 0;
  }

  .mpw-anim--newlux .nl-feeds {
    opacity: 0.35;
  }

  .mpw-anim--lightline .ll-profile,
  .mpw-anim--lightline .ll-module,
  .mpw-anim--lightline .ll-grow {
    opacity: 1;
    transform: none;
  }
}

/* Responsive -------------------------------------------------------------- */

@media screen and (max-width: 991px) {
  .mpw-brand__hero-grid,
  .mpw-brand__intro-grid,
  .mpw-brand__section {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 767px) {
  .mpw-brand__gallery-grid--2,
  .mpw-brand__gallery-grid--3,
  .mpw-brand__family-grid {
    grid-template-columns: 1fr;
  }

  .mpw-anim__rail {
    padding: 1.1rem 1.25rem 0;
  }

  .mpw-anim__rail--n4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mpw-anim figcaption {
    padding: 0.9rem 1.25rem 1.25rem;
  }

  .mpw-anim__toggle {
    top: 0.625rem;
    right: 0.625rem;
    width: 2rem;
    height: 2rem;
  }

  .mpw-brand__actions .mpw-brand__button {
    flex: 1 1 100%;
  }
}

/* Global title rules set dark ink on h2; the CTA band is dark. */
.mpw-brand__cta h2 {
  color: #fff !important;
}

@media screen and (max-width: 991px) {
  .mpw-brand__hero {
    padding-top: 2.5rem;
  }
}
