.ids__space {
  height: calc(var(--ids__density) * 0.7em);

  &.S {
    height: calc(var(--ids__density) * 0.7em);
  }

  &.M {
    height: calc(var(--ids__density) * 1.4em);
  }

  &.L {
    height: calc(var(--ids__density) * 2.4em);
  }

  &.XL {
    height: calc(var(--ids__density) * 4em);
  }
}

.ids__wrapper {
  position: relative;
  width: 95%;
  margin: 0 auto;
  max-width: 1920px;

  @media (width < 767px) {
    width: 100%;
    padding: 0 calc(var(--ids__density) * 0.6em);
  }

  &.L {
    width: 90%;

    @media (width < 767px) {
      width: 100%;
      padding: 0 calc(var(--ids__density) * 0.6em);
    }
  }

  &.XL {
    width: 100%;
    padding: 0 calc(var(--ids__density) * 0.75em);

    @media (width < 767px) {
      padding: 0 calc(var(--ids__density) * 0.6em);
    }
  }

  &.XXL {
    width: 100%;

    @media (width < 767px) {
      padding: 0;
    }
  }

  & .ids__text-width {
    width: 85%;

    @media (width < 767px) {
      width: 100%;
    }
  }
}

.ids__sequence {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: calc(var(--ids__density) * 0.4em);
  --gap: 0em;
  gap: var(--gap);

  &.no-margin {
    margin-bottom: 0;
  }

  &.overlap {
    .ids__sequence-item {
      margin-right: -0.5px;
      margin-bottom: -0.5px;
      width: calc((100% - var(--gap) * (var(--columns) - 1)) / var(--columns) + 0.5px);
    }
  }

  &.gap-L {
    --gap: 1.5em;
    margin-bottom: calc(var(--gap) * 1.5);
  }

  &.gap-M {
    --gap: 1em;
    margin-bottom: calc(var(--gap) * 1.5);
  }

  &.gap-S {
    --gap: 0.5em;
    margin-bottom: calc(var(--gap) * 1.5);
  }

  .ids__sequence-item {
    --columns: 4;
    width: calc((100% - var(--gap) * (var(--columns) - 1)) / var(--columns));

    @media (width < 767px) {
      --columns: 2;
    }
  }

  &.XL {
    .ids__sequence-item {
      --columns: 2;

      @media (width < 767px) {
        --columns: 1;
      }
    }
  }

  &.L {
    .ids__sequence-item {
      --columns: 3;

      @media (width < 767px) {
        --columns: 2;
      }
    }
  }

  &.S {
    .ids__sequence-item {
      --columns: 6;

      @media (width < 767px) {
        --columns: 3;
      }
    }
  }
}

.ids__rounded {
  border-radius: var(--ids__radius);
  corner-shape: squircle;
  overflow: hidden;
}

@supports not (corner-shape: squircle) {
  .ids__rounded {
    border-radius: 0;
    border-radius: initial;
    mask:
      url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><path d="m0,1 c0,-1 0,-1 1,-1 l99,0 l0,100 l-100,0 Z"/></svg>') top left / calc(var(--ids__radius) * 100) no-repeat intersect,
      url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><path d="m0,0 l99,0 c1,0 1,0 1,1 l0,99 l-100,0 l0,-100 Z"/></svg>') top right / calc(var(--ids__radius) * 100) no-repeat intersect,
      url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><path d="m0,0 l100,0 l0,99 c0,1 -0,1 -1,1 l-99,0 Z"/></svg>') bottom right / calc(var(--ids__radius) * 100) no-repeat intersect,
      url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><path d="m0,0 l100,0 l0,100 l-99,0 c-1,0 -1,-0 -1,-1 Z"/></svg>') bottom left / calc(var(--ids__radius) * 100) no-repeat intersect;
  }
}

header,
footer {
  padding: calc(var(--ids__density) * 1em);
}

/* Hero Section */
/* Styles moved to ids.css as .ids__text-constrained and .ids__text-meta */

/* Media Utilities */
/* Style moved to ids.css as .ids__media-full */

/* Case Study Layout */
.case-study__grid {
  display: flex;
  gap: 2em;
  align-items: flex-start;
}

.case-study__title {
  margin: 0;
  flex-shrink: 0;
}

.case-study__description {
  flex: 1;
  max-width: 600px;
}

/* Goethe Case Study */
.goethe-case {
  max-width: 533px;
}

.goethe-case__container {
  position: relative;
  width: 100%;
}

.goethe-case__bezel {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.goethe-case__video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 93%;
  height: auto;
  border-radius: 12px;
}

/* Wolfram Case Study */
.wolfram-case {
  position: relative;
}

.wolfram-lettering {
  width: 70%;
  height: auto;
  display: block;
  transform: scaleY(1.15);
  position: relative;
  z-index: 15;
}

.wolfram-text {
  position: relative;
  z-index: 5;
}

/* Link styles removed as they are now global in ids.css */

.wolfram-spread-top {
  position: absolute;
  top: -3%;
  right: 0;
  width: 28%;
  height: auto;
  z-index: 10;
}

.wolfram-spread-bottom {
  position: absolute;
  bottom: -5%;
  right: 3%;
  width: 28%;
  height: auto;
  z-index: 10;
}

@media (max-width: 767px) {
  .wolfram-case {
    display: flex;
    flex-direction: column;
  }

  .wolfram-lettering {
    width: 100% !important;
    transform: scaleY(1.1) !important;
  }

  .wolfram-text {
    width: 100% !important;
  }

  .wolfram-spread-top,
  .wolfram-spread-bottom {
    position: relative !important;
    width: 100% !important;
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    margin-top: 1em;
  }
}

/* Edadeal Case Study */
.edadeal-case {
  display: flex;
  align-items: center;
  justify-content: center;
}

.edadeal-character {
  width: 41.7%;
  height: auto;
  position: relative;
  z-index: 2;
}

.edadeal-all {
  width: 60.3%;
  height: auto;
  margin-left: -2%;
  position: relative;
  z-index: 1;
}

@media (max-width: 767px) {
  .edadeal-case {
    flex-direction: column;
  }

  .edadeal-character {
    width: 80%;
    height: auto;
    margin-bottom: 1em;
  }

  .edadeal-all {
    width: 100%;
    height: auto;
    margin-left: 0;
  }
}

/* IPAK v2 Case Study */
.ipak-v2-case {
  display: flex;
  align-items: stretch;
  width: 100%;
  background-color: #D4DED9;
}

.ipak-v2-l {
  flex-grow: 10000;
  flex-basis: 0;
  min-width: 0;
  height: auto;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
}

.ipak-v2-middle {
  flex-grow: 4878;
  flex-basis: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.ipak-v2-grid-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.ipak-v2-grid-top img,
.ipak-v2-grid-top video {
  width: 100%;
  height: auto;
  display: block;
}

.ipak-v2-grid-bottom {
  width: 100%;
  height: auto;
  display: block;
  flex-grow: 1;
  object-fit: cover;
  position: relative;
  z-index: 0;
}

.ipak-v2-r {
  flex-grow: 8539;
  flex-basis: 0;
  min-width: 0;
  height: auto;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 0;
}

@media (max-width: 767px) {
  .ipak-v2-case {
    flex-direction: column;
  }

  .ipak-v2-l,
  .ipak-v2-middle,
  .ipak-v2-r {
    width: 100%;
    margin-right: 0;
  }

  .ipak-v2-grid-bottom {
    order: -1;
  }
}