.mfun-home,
.mfun-products-page {
  --mfun-ink: #22253c;
  --mfun-text: #52586e;
  --mfun-blue: #3347af;
  --mfun-border: #e5e3e8;
  --mfun-paper: #f8f6f0;
  --mfun-lilac: #f5f5fc;
  color: var(--mfun-ink);
}

:is(.mfun-home, .mfun-products-page) .container {
  width: min(calc(100% - clamp(36px, 8vw, 112px)), 1200px);
}

:is(.mfun-home, .mfun-products-page) .nav a[aria-current="page"] {
  color: var(--mfun-blue);
  text-decoration: underline;
  text-underline-offset: 6px;
}

:is(.mfun-home, .mfun-products-page) .nav a:hover { color: var(--mfun-blue); }

:is(.mfun-home, .mfun-products-page) .header-cta {
  border-color: var(--mfun-blue);
  border-radius: 6px;
  background: var(--mfun-blue);
  color: #fff;
}

:is(.mfun-home, .mfun-products-page) .header-cta:hover {
  border-color: #263789;
  background: #263789;
}

:is(.mfun-home, .mfun-products-page) :where(main [id]) { scroll-margin-top: 94px; }

.mfun-section { padding-block: clamp(46px, 6.4vw, 94px); }

:is(.mfun-section, .home-cooperation) h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.25vw, 2.7rem);
  line-height: 1.24;
  letter-spacing: -.045em;
}

.mfun-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 1.2rem;
  row-gap: .6rem;
  margin-bottom: clamp(1.35rem, 3vw, 2.3rem);
}

.mfun-action,
.mfun-link {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: .93rem;
  font-weight: 700;
}

.mfun-action {
  justify-content: center;
  min-height: 48px;
  padding: .75rem 1.15rem;
  border-radius: 8px;
  background: var(--mfun-blue);
  color: #fff;
}

.mfun-action:hover { background: #263789; }

.mfun-link { color: var(--mfun-blue); line-height: 1.55; }
.mfun-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.home-hero {
  --hero-height: clamp(428px, 39vw, 640px);
  --hero-media-width: min(59%, 960px);
  --hero-canvas: #eee9e1;
  --hero-rail: 52px;
  position: relative;
  isolation: isolate;
  padding-bottom: var(--hero-rail);
  background: var(--hero-canvas);
}

.home-hero-inner {
  display: grid;
  align-items: center;
  min-height: var(--hero-height);
  padding-block: 2.2rem;
}

.home-hero-copy {
  z-index: 1;
  position: relative;
  width: min(47%, 570px);
}

.home-hero h1,
.product-intro h1 {
  margin: 0;
  font-weight: 760;
  font-size: clamp(2.4rem, 4.6vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -.032em;
}

.home-hero h1 span { display: block; }

.home-hero h1 .company-headline-tag {
  font-size: clamp(1.02rem, 2.05vw, 1.42rem);
  font-weight: 560;
  letter-spacing: -.004em;
  color: var(--mfun-blue);
  margin-top: .42em;
}

.home-hero-lead {
  color: var(--mfun-text);
  font-size: clamp(1rem, 1.46vw, 1.26rem);
  line-height: 1.6;
  margin: 1.3rem 0 0;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
  margin-top: 1.7rem;
}

.home-actions .mfun-action { min-height: 52px; padding-inline: 1.25rem; }
.home-actions .mfun-link { min-height: 44px; }

.home-overline {
  margin: 1.65rem 0 0;
  color: var(--mfun-text);
  font-size: .84rem;
  letter-spacing: .04em;
}

.home-hero-media {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.home-hero-slide,
.home-hero-media::after {
  position: absolute;
  inset: 0 0 auto auto;
  width: var(--hero-media-width);
  height: calc(100% - var(--hero-rail));
}

.home-hero-media::after {
  content: '';
  background: linear-gradient(90deg, var(--hero-canvas), transparent 30%);
}

.home-hero-slide {
  object-fit: cover;
  object-position: center 45%;
  opacity: 0;
  transition: opacity .46s ease-out;
}

.home-hero-slide.is-current { opacity: 1; }

.home-hero-media figcaption,
.home-hero-controls {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: center;
  min-height: var(--hero-rail);
  color: var(--mfun-ink);
}

.home-hero-media figcaption {
  left: max(clamp(18px, 4vw, 56px), calc((100% - 1200px) / 2));
  font-size: .79rem;
}

.home-hero-controls {
  right: max(clamp(18px, 4vw, 56px), calc((100% - 1200px) / 2));
  pointer-events: auto;
}

.home-hero-controls button {
  display: grid;
  place-items: center;
  width: clamp(32px, 3.15vw, 44px);
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
}

.home-hero-controls button:hover { background: #e2dbd1; }
.home-hero-controls button[hidden] { display: none; }
.home-hero-dot::before { content: ''; width: 13px; height: 3px; border-radius: 3px; background: #777484; }
.home-hero-dot[aria-pressed="true"]::before { width: 22px; background: var(--mfun-blue); }
.home-hero-arrow::before { content: ''; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; }
.home-hero-prev::before { transform: translateX(2px) rotate(135deg); }
.home-hero-next::before { transform: translateX(-2px) rotate(-45deg); }
.home-hero-rotation::before { content: ''; width: 4px; height: 12px; border-inline: 2px solid currentColor; }
.home-hero-rotation.is-paused::before { width: 0; height: 0; border: solid transparent; border-width: 6px 0 6px 9px; border-left-color: currentColor; }

.home-directions { padding-top: clamp(34px, 4.2vw, 58px); }

.home-directions .mfun-section-heading {
  position: relative;
  justify-content: center;
  margin-bottom: clamp(1.3rem, 2vw, 1.75rem);
}

.home-directions .mfun-section-heading h2::after {
  content: '';
  display: block;
  width: 2rem;
  height: 2px;
  margin: .7rem auto 0;
  background: var(--mfun-blue);
}

.home-directions .mfun-section-heading .mfun-link {
  position: absolute;
  right: 0;
  top: .65rem;
}

.home-product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.45vw, 24px); }

.home-product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border-bottom: 1px solid var(--mfun-border);
}

.home-product-card:hover { border-color: var(--mfun-blue); }
.home-product-card:hover .home-product-name { color: var(--mfun-blue); }

.home-product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--mfun-paper);
}

.home-product-card:first-child img { border: 1px solid var(--mfun-border); }

.home-product-name {
  display: flex;
  color: var(--mfun-ink);
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  min-height: 52px;
  padding: .7rem 0;
  font-size: clamp(.94rem, 1.43vw, 1.22rem);
  font-weight: 690;
}

.home-product-name span { color: var(--mfun-blue); font-size: .95rem; }

.home-product-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .55rem 1.5rem;
  padding-top: 1rem;
}

.home-product-foot p,
.home-company-date {
  margin: 0;
  color: var(--mfun-text);
  font-size: .84rem;
  line-height: 1.65;
}

.home-product-foot nav { display: flex; gap: 1.22rem; }
.home-product-foot nav a { color: var(--mfun-blue); font-weight: 650; font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; }

.home-company { background: var(--mfun-lilac); }

.home-company-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(1.4rem, 6vw, 5rem);
  align-items: center;
}

.home-company-grid :is(p, h3) { margin: 0; }

.home-company-grid p,
.home-cooperation p,
.product-panel-copy p,
.product-resource p {
  color: var(--mfun-text);
  line-height: 1.78;
}

.home-company-grid > div:first-child > p { margin-top: .8rem; }
.home-company-grid .mfun-link { margin-top: 1.05rem; }

.home-industry {
  padding: clamp(1.25rem, 3.2vw, 2.2rem);
  border: 1px solid #e4e4f0;
  background: #fff;
  border-radius: 14px;
}

.home-industry h3 { margin-bottom: .5rem; font-size: 1.36rem; }

.home-cooperation { background: var(--mfun-paper); padding-block: clamp(36px, 5vw, 68px); }
.home-cooperation .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.home-cooperation h2 { font-size: clamp(1.6rem, 2.9vw, 2.24rem); }
.home-cooperation p { margin: .7rem 0 0; }
.home-cooperation :is(.mfun-link,.mfun-action) { flex-shrink: 0; }

.home-faq-grid { display: grid; grid-template-columns: .65fr 1.35fr; gap: 2rem; }
.home-faq .faq-list { display: grid; gap: .65rem; border: 0; }
.home-faq details { border: 1px solid var(--mfun-border); border-radius: 9px; padding: 0 1rem; }
.home-faq details[open] { border-color: #bbc5e9; background: var(--mfun-lilac); }
.home-faq summary { cursor: pointer; list-style: none; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .8rem; font-weight: 680; }
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq summary span { color: var(--mfun-blue); font-size: 1.2rem; font-weight: 400; }
.home-faq details[open] summary span { transform: rotate(45deg); }
.home-faq details p { color: var(--mfun-text); margin: 0 0 1rem; line-height: 1.78; font-size: .94rem; }

.mfun-home .contact { padding-block: clamp(46px, 6.4vw, 92px); background: #242942; }
.mfun-home .contact-grid { grid-template-columns: .75fr 1fr; align-items: center; gap: 2.3rem 7%; }
.mfun-home .contact h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); }
.mfun-home .contact-copy > p { margin: .9rem 0 0; }
.mfun-home .contact-form { width: min(100%, 480px); justify-self: end; border-radius: 15px; padding: clamp(1.2rem, 3vw, 2.15rem); }
.mfun-home .contact-form h3 { margin: 0; font-size: 1.08rem; }
.mfun-home .contact-qr { margin: 1.1rem 0; }
.mfun-home .contact-qr img { width: min(100%, 190px); }
.mfun-home .contact-form > p { font-size: .85rem; color: var(--mfun-text); line-height: 1.65; }
.mfun-home .contact-mark { display: none; }

.product-intro {
  padding-block: clamp(24px, 3.2vw, 48px) 0;
  background: var(--mfun-paper);
}

.product-breadcrumb {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--mfun-text);
  font-size: .83rem;
  margin-bottom: clamp(.8rem, 2.1vw, 1.6rem);
}

.product-breadcrumb a { color: var(--mfun-blue); text-decoration: underline; text-underline-offset: 3px; }

.product-intro h1 { font-size: clamp(2.6rem, 5.3vw, 4.75rem); }

.product-intro p { max-width: 720px; color: var(--mfun-text); line-height: 1.72; margin: 1rem 0 0; font-size: clamp(1rem, 1.5vw, 1.14rem); }
.product-intro p.product-intro-note { font-size: .86rem; margin-top: .48rem; }

.product-jumps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(.5rem, 2vw, 1.8rem);
  margin-top: clamp(1.3rem, 3vw, 2.2rem);
  border-top: 1px solid var(--mfun-border);
}
.product-jumps a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  min-height: 52px;
  padding: .65rem .25rem;
  border-bottom: 2px solid transparent;
  color: var(--mfun-ink);
  font-size: .94rem;
  font-weight: 680;
}

.product-jumps a::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-inline-end: .25rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}

.product-jumps a:hover,
main:has(#plush:target) .product-jumps a[href="#plush"],
main:has(#interactive:target) .product-jumps a[href="#interactive"],
main:has(#locator:target) .product-jumps a[href="#locator"],
main:has(#camera:target) .product-jumps a[href="#camera"] {
  border-color: var(--mfun-blue);
  color: var(--mfun-blue);
}

.product-showcase { padding-block: 0; }

.product-panel {
  display: grid;
  grid-template-columns: minmax(0, 2.12fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.3rem, 4vw, 4.5rem);
  padding-block: clamp(1.65rem, 4vw, 3.8rem);
}

.product-panel + .product-panel { border-top: 1px solid var(--mfun-border); }
.product-panel:target h2 { color: var(--mfun-blue); }

.product-panel-photos {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr);
  aspect-ratio: 2.55 / 1;
  gap: clamp(5px, 1vw, 13px);
}

.product-photo {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--mfun-paper);
  cursor: zoom-in;
}

.product-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-photo-packshot { border: 1px solid var(--mfun-border); background: #fff; }
.product-photo-packshot img { object-fit: contain; }
.product-photo:focus-visible { outline-offset: -4px; }
.product-photo-mark {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid #e5e2e2;
  border-radius: 7px;
  background: #fffffff4;
  color: var(--mfun-blue);
  font-size: .94rem;
  font-weight: 750;
}

.product-photo:hover .product-photo-mark,
.product-photo:focus-visible .product-photo-mark {
  color: #fff;
  border-color: var(--mfun-blue);
  background: var(--mfun-blue);
}

.product-panel-copy h2 { font-size: clamp(1.55rem, 2.55vw, 2.15rem); }
.product-panel-copy p { font-size: 1rem; margin: .75rem 0 0; }
.product-panel-copy .mfun-link { margin-top: 1rem; }

.product-knowledge { background: var(--mfun-lilac); }

.product-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff;
  border: 1px solid #e1e3ee;
  border-radius: 14px;
}

.product-resource { padding: clamp(1.15rem, 2.5vw, 1.8rem); }
.product-resource + .product-resource { border-left: 1px solid #e1e3ee; }
.product-resource h3 { font-size: 1.2rem; margin: 0; }
.product-resource p { font-size: .94rem; margin: .62rem 0 .9rem; }

.product-viewer {
  width: min(calc(100% - 32px), 920px);
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid #e1e3ee;
  border-radius: 16px;
  color: var(--mfun-ink);
  background: #fff;
  box-shadow: 0 22px 90px #10132960;
}

.product-viewer::backdrop { background: #171b31ba; }
.product-viewer-content { padding: .75rem 1rem; }

.product-viewer-header,
.product-viewer-bottom,
.product-viewer-controls {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.product-viewer-header,
.product-viewer-bottom { justify-content: space-between; }
.product-viewer-header { margin-bottom: .6rem; }
.product-viewer-bottom { margin-top: .6rem; }
.product-viewer-header h2 { font-size: 1.12rem; margin: 0; }

.product-viewer-image {
  width: 100%;
  height: min(64dvh, 710px);
  object-fit: contain;
  border-radius: 9px;
  background: var(--mfun-paper);
}

.product-viewer-caption { color: var(--mfun-text); font-size: .93rem; line-height: 1.5; margin: 0; }
.product-viewer-controls { flex-shrink: 0; font-size: .82rem; font-variant-numeric: tabular-nums; }

.product-viewer button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dcdfee;
  border-radius: 8px;
  color: var(--mfun-blue);
  background: #f7f7fd;
  font-size: 1.22rem;
}

.product-viewer button:hover { color: #fff; background: var(--mfun-blue); }

@media (max-width: 800px) {
  .home-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-cooperation .container { align-items: flex-start; }
  .home-company-grid, .home-faq-grid { grid-template-columns: 1fr; }
  .mfun-home .contact-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .mfun-home .contact-form { justify-self: start; }
  .product-panel { grid-template-columns: minmax(0, 1fr); }
  .product-resource-grid { grid-template-columns: 1fr; }
  .product-resource + .product-resource { border-left: 0; border-top: 1px solid #e1e3ee; }
}

@media (max-width: 760px) {
  .home-hero {
    --hero-height: clamp(214px, 65vw, 395px);
    --hero-media-width: 100%;
  }
  .home-hero-inner {
    min-height: auto;
    padding-block: calc(var(--hero-height) + 1.45rem) 1.05rem;
  }
  .home-hero-copy { width: 100%; }
  .home-hero h1 { font-size: clamp(1.94rem, 7vw, 3rem); }
  .home-hero-slide { height: var(--hero-height); object-position: center 45%; }
  .home-hero-media::after { display: none; }
  .home-hero-lead { margin-top: .82rem; }
  .home-actions { margin-top: 1.1rem; }
  .home-actions .mfun-action { min-height: 48px; }
  .home-overline { margin-top: 1rem; }
}

@media (max-width: 560px) {
  :is(.mfun-home, .mfun-products-page) :where(main [id]) { scroll-margin-top: 82px; }
  .home-directions .mfun-section-heading { justify-content: space-between; }
  .home-directions .mfun-section-heading h2::after { display: none; }
  .home-directions .mfun-section-heading .mfun-link { position: static; }
  .home-cooperation .container { flex-direction: column; }
  .product-jumps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-jumps a { min-height: 44px; font-size: .89rem; }
  .product-panel-photos { aspect-ratio: 1.95 / 1; }
  .product-viewer-content { padding: .65rem; }
  .product-viewer-image { aspect-ratio: 4 / 3; height: auto; max-height: 58dvh; }
  .product-viewer-bottom { flex-wrap: wrap; }
  .product-viewer-controls { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-slide { transition: none; }
}
