/* ef11 stage on an image: see stage.twig. */

.ef-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--color-base-100);
}

.ef-stage__bg img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  /* image_sizes caps the width inline at the source width; a cover image fills the stage anyway. */
  max-width: none !important;
  object-fit: cover;
}

.ef-stage--blur .ef-stage__bg img {
  filter: blur(1.5rem);
  transform: scale(1.1);
}

/* Without box the text stands on the image: a dark Navy shade from the left
   keeps it readable (Figma: #0D172E at 94 / 72 / 18 / 5 %). */
.ef-stage:not(.ef-stage--box) .ef-stage__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(13 23 46 / 0.94) 0%, rgb(13 23 46 / 0.72) 33%, rgb(13 23 46 / 0.18) 66%, rgb(13 23 46 / 0.05) 100%);
}

.ef-stage__inner {
  padding-block: 3.5rem;
}

.ef-stage__content {
  max-width: 36rem;
}

/* Opaque on small screens, where the box covers most of the image; 90 % from 48rem as in the design (Figma "intro with image"). */
.ef-stage--box .ef-stage__content {
  max-width: 34rem;
  padding: 1.75rem;
  background-color: var(--color-base-100);
}

/* Phones: the image shows as an even frame around the box, above and below
   as wide as at the sides (the container's 1rem). */
@media (max-width: 47.99rem) {
  .ef-stage--box .ef-stage__inner {
    padding-block: 1rem;
  }
}

@media (min-width: 48rem) {
  .ef-stage__inner {
    padding-block: 5.5rem;
  }

  .ef-stage--box .ef-stage__content {
    padding: 2.25rem;
    background-color: color-mix(in srgb, var(--color-base-100) 90%, transparent);
  }
}

/* The box spans the text column, 8 of 12 grid columns (css/utils/text-measure.pcss). */
@media (min-width: 64rem) {
  .ef-stage--box .ef-stage__content {
    max-width: var(--text-measure);
  }
}

/* Kicker left, year right (case study). */
.ef-stage__meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ef-stage__year {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Award badges (Figma stage template): 120px, upright, as they are; bottom
   right in the box from 48rem, below the text on phones. */
.ef-stage__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 48rem) {
  .ef-stage--box .ef-stage__content {
    position: relative;
  }

  /* The button row is as tall as the badge, so the badge never covers the text. */
  .ef-stage--box .ef-stage__content:has(.ef-stage__badges) .ef-stage__buttons {
    display: flex;
    align-items: flex-end;
    min-height: 7.5rem;
  }

  .ef-stage--box .ef-stage__badges {
    position: absolute;
    right: 2.25rem;
    bottom: 2.25rem;
    margin: 0;
  }
}

.ef-stage__badges :where(div) {
  display: contents;
}

.ef-stage__badges img {
  width: 7.5rem;
  height: 7.5rem !important;
  object-fit: contain;
}

.ef-stage__kicker {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Without box (home): small caps in Rust 20, as the eyebrow of the design. */
.ef-stage:not(.ef-stage--box) .ef-stage__kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-link);
}

.ef-stage__title {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-heading);
  font-size: 2.25rem;
  line-height: 2.625rem;
}

@media (min-width: 48rem) {
  .ef-stage__title {
    font-size: 3rem;
    line-height: 3.5rem;
  }
}

.ef-stage__text {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.ef-stage--box .ef-stage__text {
  font-size: 1rem;
  line-height: 1.625rem;
}

.ef-stage__image {
  margin-top: 1.5rem;
}

.ef-stage__image img {
  display: block;
  width: 100%;
  height: auto;
}

.ef-stage__meta {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.ef-stage__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* Home: the ship scene as background, shaded from the left like every
   stage on an image (Figma #0D172E 94/72/18/5 %), a wave in the page colour
   below. */
.ef-stage--ship {
  background-color: #0d172e;
}

.ef-stage__scene {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% 60%;
}

.ef-stage--ship::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(13 23 46 / 0.94) 0%, rgb(13 23 46 / 0.72) 42%, rgb(13 23 46 / 0.18) 78%, rgb(13 23 46 / 0.05) 100%);
  pointer-events: none;
}

/* Phones: the text runs across the whole width, so the shade does too
   (every stage with text on its image). */
@media (max-width: 47.99rem) {
  .ef-stage:not(.ef-stage--box) .ef-stage__bg::after,
  .ef-stage--ship::after {
    background: linear-gradient(90deg, rgb(13 23 46 / 0.94) 0%, rgb(13 23 46 / 0.8) 60%, rgb(13 23 46 / 0.6) 100%);
  }
}

.ef-stage--ship .ef-stage__inner {
  padding-bottom: 7rem;
}

@media (min-width: 48rem) {
  .ef-stage--ship .ef-stage__inner {
    padding-block: 7rem 11rem;
  }
}

.ef-stage__wave {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2rem;
  color: var(--ef-page-bg);
}

/* The wave path is two periods wide and drifts by one period, while the
   whole wave rises and falls: a visible, calm swell. Animations in
   css/ef11.pcss (ef-wave, ef-swell), shared with the footer wave. */
.ef-stage__wave {
  animation: ef-swell 6s ease-in-out infinite alternate;
}

.ef-stage__wave path {
  transform-box: fill-box;
  animation: ef-wave 24s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ef-stage__wave,
  .ef-stage__wave path {
    animation: none;
  }
}

@media (min-width: 48rem) {
  .ef-stage__wave {
    height: 4.5rem;
  }
}

/* Home header (Figma "Startseite Header", 11/2026): from large screens the
   title 70/75 and the text 22/33; shade stops at 42 and 78 % (above); the
   buttons with an arrow, the second as a white outline. */
@media (min-width: 64rem) {
  .ef-stage--ship .ef-stage__title {
    font-size: 4.375rem;
    line-height: 4.6875rem;
  }

  .ef-stage--ship .ef-stage__text {
    font-size: 1.375rem;
    line-height: 2.0625rem;
  }
}

.ef-stage--ship .ef-stage__buttons .btn::after {
  content: "";
  width: 0.8125rem;
  height: 0.75rem;
  margin-inline-start: 0.5rem;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 10'%3E%3Cpath d='M8 0 7 1.1 10.2 4.2H0v1.6h10.2L7 8.9 8 10l5-5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* The arrow points down only for a jump on the page. */
.ef-stage--ship .ef-stage__buttons .btn[href^="#"]::after {
  rotate: 90deg;
}

.ef-stage--ship .ef-stage__buttons .btn-outline:not(:hover, :focus-visible) {
  --btn-color: #fff;
  --btn-fg: #fff;
  --btn-border: #fff;
  color: #fff;
}
