:root {
  color-scheme: light;
  --surface: #fafaf9;
  --surface-2: #ffffff;
  --ink: #18181b;
  --muted: #52525b;
  --line: rgba(24, 24, 27, 0.1);
  --accent: #059669;
  --accent-2: #047857;
  --shadow: 0 24px 80px rgba(24, 24, 27, 0.1);
  --radius: 1rem;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Scope section: stronger visual hierarchy, less "plain text" feel */
.scope-modern {
  position: relative;
  background:
    radial-gradient(1000px 380px at 10% -8%, rgba(5, 150, 105, 0.08), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(15, 23, 42, 0.045), transparent 62%),
    #fff;
}

.scope-modern h2 {
  letter-spacing: -0.02em;
}

.scope-modern .reveal.grid > .reveal {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.scope-modern .reveal.grid > .reveal:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.scope-modern .reveal.grid > .reveal p {
  line-height: 1.7;
}

/* Home hero: panoramic wash from static/images (background.png, built for wide strips) */
.home-hero {
  min-height: 0;
}

.home-hero__photo {
  background-image: url("../images/background.png");
  background-repeat: no-repeat;
  background-position: center 28%;
  background-size: min(115%, 2000px) auto;
  opacity: 0.44;
  filter: saturate(1.15) contrast(1.08);
}

@media (min-width: 1024px) {
  .home-hero {
    min-height: min(52vh, 38rem);
  }
}

@media (max-width: 639px) {
  .home-hero__photo {
    background-size: cover;
    opacity: 0.36;
  }
}

/* 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(50vh, 400px);
  overflow: hidden;
  background: transparent;
}

.hero-carousel__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: rgb(250, 250, 249);
  background-image:
    radial-gradient(ellipse 130% 90% at 50% 108%, rgba(5, 150, 105, 0.12), transparent 48%),
    radial-gradient(900px 500px at 20% -10%, rgba(5, 150, 105, 0.14), transparent),
    radial-gradient(700px 420px at 90% 0%, rgba(28, 25, 23, 0.06), transparent);
}

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

.hero-carousel__slide {
  position: absolute;
  inset: 0;
  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 visible inside stage (no crop). Flex + max dimensions; wins over Tailwind preflight on img. */
[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;
  /* Always scale up to the stage size (prevents "intrinsic-size" letterboxing). */
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  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(5, 150, 105, 0.35);
  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(5, 150, 105, 0.1);
  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(5, 150, 105, 0.95);
  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(5, 150, 105, 0.95);
  outline-offset: 3px;
}

.hero-carousel__dot.is-active {
  width: 1.5rem;
  background: #059669;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(5, 150, 105, 0.35);
}

/* Home hero: no card chrome. Image sits on section wash, modest footprint. */
.home-hero .hero-carousel--flush {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.home-hero .hero-carousel--flush .hero-carousel__stage {
  max-height: min(42vh, 300px);
}

@media (min-width: 640px) {
  .home-hero .hero-carousel--flush .hero-carousel__stage {
    max-height: min(44vh, 320px);
  }
}

@media (min-width: 1024px) {
  .home-hero .hero-carousel--flush .hero-carousel__stage {
    max-height: min(40vh, 340px);
  }
}

.home-hero .hero-carousel--flush .hero-carousel__stage::before {
  display: none;
}

.home-hero .hero-carousel--flush .hero-carousel__dots {
  border-top: none;
  padding: 0.45rem 0 0;
}

/* 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(5, 150, 105, 0.2);
  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.35);
  background: linear-gradient(135deg, #047857, #064e3b 52%, #1c1917);
  color: #ecfdf5;
  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(110, 231, 183, 0.95);
  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.2rem;
  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;
  display: flex;
  align-items: center;
  align-self: center;
}

.language-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.375rem 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: #ecfdf5;
  color: #047857;
}

.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: #ecfdf5;
  color: #047857;
}

.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;
  }
}
