/* ==========================================================================
   Melasma Clinic case study: "Before / After"
   The page moves from fragments to a finished site. Loads after poster.css.
   ========================================================================== */

:root {
  --mc-navy: #054B84;    /* the clinic's Book button blue */
  --mc-orange: #F26822;  /* the clinic's logo orange */
  --mc-white: #F7F6F2;
}

.mc-text {
  max-width: 36em;
  font-size: 17px;
}

.mc-text p + p,
.mc-text p + ul,
.mc-text ul + p {
  margin-top: var(--s2);
}

.mc-text ul {
  padding-left: var(--s3);
}

.mc-text li + li {
  margin-top: var(--s1);
}

/* Hero: the homepage, cut into strips that come together
   ========================================================================== */

.mc-hero {
  overflow-x: clip;
}

.mc-hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "art"
    "info";
  column-gap: var(--s5);
  row-gap: var(--s6);
  padding-top: var(--s8);
  padding-bottom: var(--s12);
}


.mc-art {
  grid-area: art;
  position: relative;
  max-width: 960px;
  padding: 7% 0 0 7%;
}

.mc-art__square {
  position: absolute;
  left: 0;
  top: 0;
  width: 62%;
  aspect-ratio: 1;
  background: var(--mc-navy);
  filter: url(#rough);
}


.strips {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  aspect-ratio: 16 / 10;
  /* One shadow that follows every strip, moving or landed */
  filter: drop-shadow(0 14px 16px rgba(26, 23, 20, 0.3));
}

/* The finished screenshot as one piece: covers the hairline seams between strips */
.strips::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/melasma/home-en.webp") center / 100% 100% no-repeat;
  border: 1px solid var(--ink);
}

.strip {
  background-image: url("../images/melasma/home-en.webp");
  background-size: 600% 100%;
  /* Each strip carries its piece of the outer frame while it moves */
  border-block: 1px solid var(--ink);
}

.strip:first-child { border-left: 1px solid var(--ink); }
.strip:last-child { border-right: 1px solid var(--ink); }

.strip:nth-child(1) { background-position: 0% 0; }
.strip:nth-child(2) { background-position: 20% 0; }
.strip:nth-child(3) { background-position: 40% 0; }
.strip:nth-child(4) { background-position: 60% 0; }
.strip:nth-child(5) { background-position: 80% 0; }
.strip:nth-child(6) { background-position: 100% 0; }

/* Fragments slide together into the finished homepage */
@media (prefers-reduced-motion: no-preference) {
  /* Strips slide in side by side; the finished image fades in as the last one lands */
  .strip { animation: strip-in 1100ms var(--ease-out) both; }
  .strips::after { animation: print-fade 350ms ease 1550ms both; }
  .strip:nth-child(1) { --from: -18%; animation-delay: 200ms; }
  .strip:nth-child(2) { --from: 14%;  animation-delay: 280ms; }
  .strip:nth-child(3) { --from: -9%;  animation-delay: 360ms; }
  .strip:nth-child(4) { --from: 20%;  animation-delay: 440ms; }
  .strip:nth-child(5) { --from: -14%; animation-delay: 520ms; }
  .strip:nth-child(6) { --from: 10%;  animation-delay: 600ms; }
  .mc-art__square { animation: print-circle 900ms var(--ease-out) 60ms both; }
  .mc-info { animation: print-fade 700ms var(--ease-out) 900ms both; }
}

@keyframes strip-in {
  from { opacity: 0; transform: translateY(var(--from)); }
}

@keyframes stamp-dot {
  from { opacity: 0; scale: 1.8; }
}

.mc-info {
  grid-area: info;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
}

.mc-info h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 100%;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.mc-info__summary {
  margin-top: var(--s2);
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.5;
}

.mc-meta {
  margin: 0;
  border-top: 2px solid var(--ink);
}

.mc-meta div {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}

.mc-meta dt {
  color: var(--ink-soft);
}

.mc-meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.mc-btn {
  display: inline-block;
  margin-top: var(--s3);
  padding: 12px var(--s4);
  border-radius: 999px;
  background: var(--mc-navy);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background-color 200ms ease;
}

.mc-btn:hover {
  background: var(--ink);
  color: #fff;
}

/* Sections: English heading with its Indonesian twin
   ========================================================================== */

.mc-section {
  padding: var(--s12) 0;
}

.mc-h2 {
  display: inline-block;
  margin-bottom: var(--s5);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--mc-orange);
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 75%;
  font-size: clamp(44px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}


.mc-h3 {
  display: inline-block;
  margin-bottom: var(--s3);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mc-orange);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
}


.mc-step {
  margin-top: var(--s12);
}

/* Before and after: oversized outline words that bracket the story */
.mc-marker {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 62%;
  font-size: clamp(96px, 16vw, 220px);
  line-height: 0.8;
  letter-spacing: -0.01em;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  user-select: none;
}

.mc-marker--after {
  color: var(--mc-navy);
  -webkit-text-stroke: 0;
}

.mc-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--s8);
  align-items: start;
}

.mc-before {
  padding: var(--s5);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
  rotate: 1.5deg;
}

.mc-before span {
  color: var(--mc-orange);
}

/* Context: the six clinic locations */
.locations {
  padding: var(--s4);
  border: 1.5px solid var(--ink);
  background: var(--mc-white);
}

.locations__title {
  margin-bottom: var(--s3);
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 75%;
  font-size: 32px;
  line-height: 1;
  color: var(--mc-navy);
}

.locations ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.locations li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(5, 75, 132, 0.35);
  border-radius: 12px;
  font-weight: 600;
}

.locations li::before {
  content: "";
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--mc-orange);
}


/* Step 1: the agreed direction as a brief card */
.brief {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  margin-top: 0;
  padding: var(--s4);
  border: 1.5px solid var(--ink);
  background: var(--mc-white);
  max-width: 640px;
}

.brief__swatches {
  display: flex;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.brief__swatches li {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.brief__swatches span {
  width: 56px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(26, 23, 20, 0.25);
}

.brief__words {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  padding: 0;
  list-style: none;
}

.brief__words li {
  padding: 4px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

/* Figures */
.mc-figure--side {
  margin-top: 0;
}

.mc-figure {
  margin-top: var(--s6);
}

.mc-figure img,
.lang-switch__frame {
  width: 100%;
  border: 1px solid var(--ink);
  box-shadow: 0 18px 36px -22px rgba(26, 23, 20, 0.55);
}

.mc-figure figcaption {
  max-width: 36em;
  margin-top: var(--s2);
  font-size: 14px;
  color: var(--ink-soft);
}

/* Step 3: a working EN / ID switch */
.lang-switch__controls {
  display: inline-flex;
  margin-bottom: var(--s2);
  padding: 4px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

.lang-switch__controls button {
  padding: 6px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 14px/1.2 var(--font-body);
  cursor: pointer;
}

.lang-switch__controls button[aria-pressed="true"] {
  background: var(--mc-navy);
  color: #fff;
}

.lang-switch__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.lang-switch__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  box-shadow: none;
  transition: opacity 350ms ease;
}

.lang-switch__frame img[hidden] {
  display: block;
  opacity: 0;
}

.mc-pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--s4);
  align-items: start;
}

.mc-pair .mc-figure:last-child {
  margin-top: 48px;
}

.mc-pair .mc-figure {
  margin-top: 0;
}

/* Outcome: the after column mirrors the before card */
.mc-after {
  display: grid;
  justify-items: start;
  gap: var(--s4);
}

.mc-after .deco {
  margin-top: 0;
}

.mc-after .mc-btn {
  margin-top: 0;
}

/* Outcome: a deco frame, the Deadlock thread */
.deco {
  position: relative;
  margin-top: var(--s5);
  padding: var(--s6) var(--s5);
  border: 2px solid var(--mc-navy);
  outline: 1px solid var(--mc-navy);
  outline-offset: 6px;
  max-width: 760px;
  text-align: center;
}

.deco::before,
.deco::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  translate: 0 -50%;
  rotate: 45deg;
  background: var(--mc-orange);
}

.deco::before { left: -9px; }
.deco::after { right: -9px; }

.deco p {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  color: var(--mc-navy);
}


/* Next project */
.next {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: var(--s6);
  align-items: center;
  padding: var(--s12) 0;
  border-top: 2px solid var(--ink);
}

.next__label {
  color: var(--ink-soft);
  font-size: 14px;
}

.next__title {
  margin-top: var(--s1);
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 75%;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
}

.next__title a {
  color: var(--ink);
  text-decoration: none;
}

.next__title a:hover {
  color: var(--vermilion-text);
}

/* Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .mc-info,
  .mc-split,
  .mc-pair { grid-template-columns: minmax(0, 1fr); }
  .mc-pair .mc-figure:last-child { max-width: 320px; margin-top: 0; }
}

@media (max-width: 640px) {
  .mc-hero .wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "art" "info";
    row-gap: var(--s5);
    padding-top: var(--s4);
  }


  .mc-section { padding: var(--s8) 0; }
  .mc-before { padding: var(--s4); rotate: 0deg; }
  .deco { padding: var(--s5) var(--s3); }
  .next { grid-template-columns: minmax(0, 1fr); }
}

/* Desktop: art and title side by side, so the whole hero fits the first screen */
@media (min-width: 961px) {
  .mc-hero .wrap {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: "art info";
    align-items: center;
    column-gap: var(--s8);
    min-height: calc(100svh - 72px);
    padding-top: var(--s5);
    padding-bottom: var(--s5);
  }

  .mc-art {
    max-width: none;
  }

  .mc-info {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s4);
  }
}

/* One full-width moment to break the side-by-side rhythm */
.mc-figure--wide {
  margin-top: var(--s6);
}

.mc-figure--wide img {
  width: 100%;
}
