:root {
  color-scheme: light;
  --surface: #fafafa;
  --surface-2: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #0d9488;
  --accent-2: #0f766e;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
  --radius: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Non-English home hero: longer translated lines. Balance copy with the visual column. */
html:not(:lang(en)) .home-hero-copy > p.text-xs {
  white-space: pre-line;
  text-transform: none;
  letter-spacing: 0.06em;
}

html:not(:lang(en)) .home-hero-copy > h1 {
  white-space: pre-line;
  text-wrap: balance;
  line-height: 1.22;
  overflow-wrap: break-word;
}

@media (min-width: 640px) {
  html:not(:lang(en)) .home-hero-copy > h1 {
    line-height: 1.18;
  }
}

html:not(:lang(en)) .home-hero-copy > p.max-w-xl {
  white-space: pre-line;
  max-width: 42rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

@media (max-width: 639px) {
  html:not(:lang(en)) .home-hero-copy .mt-10.grid.grid-cols-3 {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

@media (min-width: 640px) {
  html:not(:lang(en)) .home-hero-copy .mt-10.grid.grid-cols-3 {
    max-width: 40rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

html:not(:lang(en)) .home-hero-copy .mt-10.grid .text-xs {
  line-height: 1.35;
  hyphens: auto;
  word-break: break-word;
}

/* Home hero: carousel. Letterbox uses stage wash (grid sits above section gradient). */
.hero-carousel {
  border-radius: 1.25rem;
  background-color: transparent;
  background-image: none;
  min-height: 0;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.055),
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 36px rgba(15, 23, 42, 0.065),
    0 28px 72px rgba(15, 23, 42, 0.055);
}

@media (min-width: 1024px) {
  .hero-carousel {
    border-radius: 1.5rem;
  }
}

.hero-carousel__stage {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(58vh, 500px);
  overflow: hidden;
  background: transparent;
}

.hero-carousel__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: rgb(248, 250, 252);
  background-image:
    radial-gradient(ellipse 130% 90% at 50% 108%, rgba(13, 148, 136, 0.14), transparent 48%),
    radial-gradient(900px 500px at 20% -10%, rgba(13, 148, 136, 0.16), transparent),
    radial-gradient(700px 420px at 90% 0%, rgba(15, 23, 42, 0.09), transparent);
}

@media (min-width: 640px) {
  .hero-carousel__stage {
    max-height: min(62vh, 560px);
  }
}

.hero-carousel__slide {
  position: absolute;
  inset: clamp(8px, 1.25vw, 14px);
  margin: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.hero-carousel__media-picture {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-width: 0;
  min-height: 0;
}

/* Full image inside stage (letterbox); safe inset avoids edge clip at rounded corners. */
[data-hero-carousel] .hero-carousel__slide img.hero-carousel__media,
[data-hero-carousel] .hero-carousel__media-picture img.hero-carousel__media {
  position: relative;
  z-index: 0;
  display: block;
  box-sizing: border-box;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center;
  flex-shrink: 1;
  min-width: 0;
  min-height: 0;
}

.hero-carousel__slide.is-active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.hero-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.625rem;
  height: 2.625rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 4px 14px rgba(15, 23, 42, 0.08),
    0 12px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  transform: translateY(-50%);
}

.hero-carousel__arrow:hover {
  background: #ffffff;
  border-color: rgba(13, 148, 136, 0.32);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 6px 20px rgba(15, 23, 42, 0.1),
    0 16px 36px rgba(13, 148, 136, 0.08);
  transform: translateY(-50%) scale(1.04);
}

.hero-carousel__arrow:active {
  transform: translateY(-50%) scale(0.98);
}

.hero-carousel__arrow:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.9);
  outline-offset: 3px;
}

.hero-carousel__arrow--prev {
  left: 0.5rem;
}

.hero-carousel__arrow--next {
  right: 0.5rem;
}

@media (min-width: 640px) {
  .hero-carousel__arrow--prev {
    left: 0.875rem;
  }

  .hero-carousel__arrow--next {
    right: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .hero-carousel__arrow {
    width: 2.875rem;
    height: 2.875rem;
  }

  .hero-carousel__arrow--prev {
    left: 1rem;
  }

  .hero-carousel__arrow--next {
    right: 1rem;
  }
}

.hero-carousel__dots {
  position: static;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.65rem 1rem 0.75rem;
  pointer-events: auto;
  background: transparent;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.hero-carousel__dot {
  width: 0.5rem;
  height: 0.5rem;
  min-width: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  cursor: pointer;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, transform 0.2s ease;
}

.hero-carousel__dot:hover {
  background: rgba(15, 23, 42, 0.3);
}

.hero-carousel__dot:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.95);
  outline-offset: 3px;
}

.hero-carousel__dot.is-active {
  width: 1.5rem;
  background: #0d9488;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(13, 148, 136, 0.35);
}

/* Home editorial block: panoramic skins strip above “Editorial standards” copy */
.editorial-skins-strip {
  height: clamp(4rem, 13vw, 7rem);
  background-color: #050508;
  background-image: url("../images/background.png");
  background-repeat: no-repeat;
  background-position: center 32%;
  background-size: min(100%, 2100px) auto;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

::selection {
  background: rgba(13, 148, 136, 0.18);
  color: var(--ink);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Above the fold: do not depend on IntersectionObserver (zero-size grid edge cases left hero copy invisible). */
.reveal.reveal--instant {
  opacity: 1;
  transform: none;
  transition: none;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.fixed-download-btn {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, #0f172a, #0b1220 55%, #0f766e);
  color: #f8fafc;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.35);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.fixed-download-btn:hover {
  transform: translateY(-50%) scale(1.02);
  filter: brightness(1.05);
  box-shadow: 0 22px 70px rgba(2, 6, 23, 0.42);
}

.fixed-download-btn:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.85);
  outline-offset: 4px;
}

@media (max-width: 640px) {
  .fixed-download-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .fixed-download-btn {
    padding: 0.75rem;
    right: 0.75rem;
  }
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.language-switcher {
  position: relative;
}

.language-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.language-switcher__toggle::-webkit-details-marker {
  display: none;
}

.language-switcher__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 11rem;
  padding: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.14);
}

.language-switcher__item {
  display: flex;
  align-items: center;
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.language-switcher__item:hover,
.language-switcher__item[aria-current="true"] {
  background: #f0fdfa;
  color: #0f766e;
}

.mobile-language-switcher {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.mobile-language-switcher__label {
  padding: 0 0.75rem 0.5rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-language-switcher__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0 0.75rem 0.25rem;
}

.mobile-language-switcher__item {
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.55rem 0.65rem;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-language-switcher__item:hover,
.mobile-language-switcher__item.is-active {
  background: #f0fdfa;
  color: #0f766e;
}

.card-hover {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.video-grid-card {
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .video-grid-card:hover {
    transform: translateY(-4px);
  }
}

details.faq details summary::-webkit-details-marker {
  display: none;
}

.prose-flow p + p {
  margin-top: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .back-to-top,
  .fixed-download-btn,
  .card-hover {
    transition: none;
  }

  .nav-link::after {
    transition: none;
  }

  .language-switcher__toggle,
  .language-switcher__item,
  .mobile-language-switcher__item {
    transition: none;
  }

  .video-grid-card:hover {
    transform: none;
  }

  .hero-carousel__slide {
    transition: none;
  }

  .hero-carousel__dot {
    transition: none;
  }
}
