/* Case study template — shared base for all 3 case studies */

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: clip;
  padding: 140px var(--page-gutter) 90px;
  text-align: center;
  isolation: isolate;
}

.hero__decor {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__squiggle {
  position: absolute;
  width: clamp(120px, 20vw, 288px);
  height: auto;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 50%);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 50%);
  -webkit-mask-size: 100% 200%;
  mask-size: 100% 200%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0% 100%;
  mask-position: 0% 100%;
  animation: squiggle-reveal var(--load-squiggle-duration) ease-out forwards;
}

@keyframes squiggle-reveal {
  to {
    -webkit-mask-position: 0% 0%;
    mask-position: 0% 0%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__squiggle {
    animation: none;
    -webkit-mask-position: 0% 0%;
    mask-position: 0% 0%;
  }
}

.hero__squiggle--top-left {
  top: -12%;
  left: 2%;
  transform: rotate(-161.61deg);
  animation-delay: var(--load-squiggle-delay-1);
}

.hero__squiggle--top-right {
  top: -8%;
  right: 4%;
  transform: rotate(0deg);
  animation-delay: var(--load-squiggle-delay-2);
}

.hero__squiggle--left {
  top: 22%;
  left: 4%;
  transform: rotate(-90deg);
  animation-delay: var(--load-squiggle-delay-3);
}

.hero__title {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  max-width: 55ch;
  transform: rotate(-3.25deg);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 9vw, var(--text-hero));
  line-height: 1;
  white-space: nowrap;
}

.hero__title-kicker {
  display: block;
  font-size: 0.4048em;
  margin-bottom: 0.05em;
  text-transform: uppercase;
}

.hero__title-mask {
  display: inline-block;
  overflow: hidden;
  padding: 0.08em 0.06em;
  margin: -0.08em -0.06em;
  vertical-align: top;
}

.hero__title-text {
  display: inline-block;
  transform: translateY(115%);
  animation: write-title var(--load-title-duration) var(--ease-load) var(--load-title-delay) forwards;
}

@keyframes write-title {
  to {
    transform: translateY(0%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title-text {
    animation: none;
    transform: translateY(0%);
  }
}

.hero__title-underline {
  position: absolute;
  z-index: -1;
  left: 3%;
  right: 3%;
  bottom: -0.2em;
  width: 94%;
  height: auto;
  overflow: visible;
  transform: rotate(3.82deg);
}

.hero__title-wrap {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 130%;
  max-width: none;
  height: auto;
  overflow: visible;
  transform: translate(-50%, -50%);
}

.hero__title-underline-path {
  stroke-dasharray: 1930;
  stroke-dashoffset: 1930;
  animation: draw-underline var(--load-underline-duration) var(--ease-draw) var(--load-underline-delay) forwards;
}

@keyframes draw-underline {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title-underline-path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

.hero__tags {
  position: relative;
  justify-content: center;
  margin-top: clamp(48px, 8vw, 96px);
}

/* ---------- Page body ---------- */

.case-study {
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding: 0 var(--page-gutter);
  display: flex;
  flex-direction: column;
}

.hero-image {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1292 / 642;
  border-radius: var(--radius-sm);
  overflow: clip;
  background: var(--color-accent-blue);
}

.hero-image__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Overview ---------- */

.overview {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-top: 1px solid var(--color-border);
  padding: var(--space-sm) 0 var(--space-lg);
}

.overview__label {
  flex: 1 1 0;
  min-width: 160px;
}

.overview__content {
  flex: 1 1 0;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 42px;
}

.overview__text p + p {
  margin-top: var(--space-xs);
}

.overview__cta {
  white-space: nowrap;
}

.overview__squiggle {
  position: absolute;
  right: -2%;
  bottom: -30%;
  width: clamp(120px, 14vw, 201px);
  z-index: -1;
  pointer-events: none;
}

/* ---------- Section heading ---------- */

.section-heading {
  border-top: 1px solid var(--color-border);
  padding-top: 72px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-heading__title {
  font-family: "Instrument Serif", var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 48px);
  line-height: 1;
}

/* ---------- Content blocks (Process / Design Output) ---------- */

.content-block {
  display: flex;
  flex-direction: column;
  gap: 42px;
  padding-bottom: var(--space-lg);
}

/* ---------- Media (image blocks: full-width or 50/50) ----------
   Width follows the block type (full or half via .media-row); height is
   whatever the uploaded asset's own aspect ratio produces — never cropped
   to a fixed box. */

.media {
  position: relative;
  width: 100%;
  min-height: 0;
  border-radius: var(--radius-md);
  overflow: clip;
  background: var(--color-surface);
}

.media > img {
  display: block;
  width: 100%;
  height: auto;
}

.media-row {
  display: flex;
  gap: 42px;
}

.media-row .media {
  flex: 1 1 0;
  min-width: 0;
  border-radius: var(--radius-sm);
}

.media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-placeholder);
}

.media__placeholder-label {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  text-align: center;
  padding: 0 24px;
}

.media__dot {
  position: absolute;
  left: 37.2%;
  top: 48.9%;
  width: 12.8%;
  height: 25.4%;
  pointer-events: none;
}

.media__inset {
  position: absolute;
  left: 6.3%;
  top: -3.8%;
  width: 93.7%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ---------- Media captions (optional; overlay or below) ---------- */

.media__caption--overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 263px;
}

.media__caption-notch {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.media__caption-row {
  display: flex;
  align-items: flex-end;
  width: 100%;
}

.media__caption-pill {
  background: #fafafa;
  padding: 16px 24px 10px 10px;
  border-top-right-radius: var(--radius-md);
  font-size: var(--text-body);
  color: var(--color-text);
  white-space: nowrap;
}

.media__caption--below {
  margin-top: -18px;
  font-size: var(--text-body);
  color: var(--color-text);
}

/* ---------- Holiday type icon panel ---------- */

.holiday-icons {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 32px);
  width: 100%;
  height: 100%;
  padding: 24px;
}

.holiday-icons__icon {
  position: relative;
  flex: 1 1 0;
  max-width: 198px;
  aspect-ratio: 1 / 1;
}

.holiday-icons__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.holiday-icons__icon--seaview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.holiday-icons__seaview-base,
.holiday-icons__seaview-accent {
  position: absolute;
  width: 60%;
  height: auto;
}

.holiday-icons__seaview-base {
  top: 20%;
}

.holiday-icons__seaview-accent {
  top: 55%;
  left: 8%;
  width: 45%;
}

.holiday-icons__dot {
  position: absolute;
  left: 37.2%;
  top: 48.9%;
  width: 12.8%;
  height: 25.4%;
  pointer-events: none;
}

/* ---------- Case navigation (Last / Next) ---------- */

.case-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 96px 0;
}

.case-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: var(--color-text);
}

.case-nav__arrow {
  font-family: var(--font-body);
  font-weight: 300;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero {
    padding-top: 100px;
  }

  .overview {
    flex-direction: column;
  }

  .media-row {
    flex-direction: column;
  }

  .media-row .media {
    flex: none;
  }

  .case-nav {
    padding: 64px 0;
  }
}

@media (max-width: 560px) {
  .hero__title {
    white-space: normal;
  }

  .media__caption-pill {
    white-space: normal;
    max-width: 60vw;
  }

  .case-nav__link {
    font-size: clamp(1.5rem, 8vw, 2rem);
  }
}

/* ---------- Scroll-reveal stagger ----------
   Paired/grouped .reveal elements fan in slightly offset instead of
   popping in together. Base timing lives in css/reveal.css. */

.overview__content.reveal {
  transition-delay: 0.1s;
}

.media-row .media.reveal:nth-child(2) {
  transition-delay: 0.12s;
}
