/* =========================================================
   Perfect Designs case study (dark, yellow-accented)
   Builds on css/case-study.css. Colours are the project's own
   design-system values, read from the case-study artwork.
   ========================================================= */

@font-face {
  /* Bold, subset to the letters of the word "Montserrat" (specimen only) */
  font-family: "Montserrat";
  src: url("../assets/fonts/montserrat-700-subset.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

.cs--pd {
  --pd-bg: #0d0d0d;          /* page; matches the specimen cards' own background */
  --pd-surface: #2e2e2e;     /* design-system "Background" */
  --pd-primary: #ffb929;     /* design-system "Primary Color" */
  --pd-beige: #ffeabe;       /* design-system "Accent Beige" */
  --pd-text: #f5f5f5;
  --pd-muted: #bdbdbd;
  --pd-border: #383838;
  --cs-paper: var(--pd-bg);
  --cs-ink: var(--pd-text);
  --cs-gold: var(--pd-primary);
  --cs-body: var(--font-sans);
}

.cs--pd main {
  background: var(--pd-bg);
  color: var(--pd-text);
  font-family: var(--font-sans);
}

.cs--pd .cs-container {
  max-width: 1180px;
}

.pd-accent {
  color: var(--pd-beige);
}

/* ---------- Headings with icons ---------- */
.pd-h {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--pd-text);
}

.pd-h__icon {
  flex-shrink: 0;
  width: 0.8em;
  height: 0.8em;
  color: #d9d9d9;
}

.pd-h--sub {
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.85rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.pd-section > .pd-h--sub:first-child {
  margin-top: 0;
}

.pd-h--sub .pd-h__icon--sm,
.pd-h__icon--sm {
  width: 0.7em;
  height: 0.7em;
}

.pd-h--small {
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
}

/* ---------- Pills ---------- */
.pd-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.45rem 1.15rem;
  border: 1.5px solid #d9d9d9;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  color: var(--pd-text);
}

.pd-pill--sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border-width: 1px;
}

/* ---------- Hero ---------- */
.pd-hero {
  padding-block: clamp(2rem, 4vw, 3rem) clamp(2rem, 5vw, 3.5rem);
}

.pd-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pd-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pd-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.pd-hero__media img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.6));
}

.pd-hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pd-hero__logo {
  width: clamp(180px, 22vw, 260px);
  height: auto;
}

.pd-hero__title {
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--pd-text);
  text-wrap: balance;
}

.pd-hero__intro {
  max-width: 26rem;
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--pd-muted);
}

/* ---------- Sections ---------- */
.pd-section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

/* ---------- Overview ---------- */
.pd-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  margin-top: clamp(1.5rem, 3vw, 2rem);
}

.pd-facts {
  display: grid;
  gap: 1.1rem;
  margin: 0 0 1.75rem;
}

.pd-facts div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.pd-facts dt {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pd-beige);
}

.pd-facts dd {
  margin: 0;
  color: var(--pd-muted);
}

.pd-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.pd-tools img {
  width: 46px;
  height: 46px;
}

.pd-overview__text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--pd-muted);
}

/* ---------- Timeline ---------- */
/* :where() keeps this reset at zero specificity, so the grid rules below still apply */
:where(.timeline) ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline {
  --cols: 10; /* 5 weeks, 2 columns each, so cards can straddle weeks */
  position: relative;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-bottom: 1rem;
}

.timeline__phases,
.timeline__weeks,
.timeline__grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}

.timeline__phases {
  margin-bottom: 1.25rem;
}

.timeline__phase {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  color: var(--pd-text);
}

.timeline__phase--discover { grid-column: 1 / 3; }
.timeline__phase--design   { grid-column: 3 / 6; }
.timeline__phase--develop  { grid-column: 6 / 8; }
.timeline__phase--delivery { grid-column: 8 / 11; }

/* week columns with dashed dividers running the full height */
.timeline__weeks {
  position: absolute;
  inset: 2.75rem 0 0;
  pointer-events: none;
}

.timeline__weeks span {
  grid-column: span 2;
  padding-top: 0.5rem;
  border-left: 1px dashed #5a5a5a;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  color: #6f6f6f;
}

.timeline__weeks span:last-child {
  border-right: 1px dashed #5a5a5a;
}

.timeline__grid {
  position: relative;
  grid-auto-rows: auto;
  row-gap: 1.25rem;
  align-items: start;   /* each card is only as tall as its content */
  padding-top: 5rem;    /* starts below the WEEK labels */
}

.milestone {
  margin: 0 0.4rem;
  overflow: hidden;
  border-radius: 8px;
  background: #383838;
}

/* placement mirrors the original timeline graphic */
.milestone--understand  { grid-column: 1 / 3;  grid-row: 1; }
.milestone--ideation    { grid-column: 4 / 6;  grid-row: 1; margin-top: 1.5rem; }
.milestone--launch      { grid-column: 9 / 11; grid-row: 1; margin-top: 2.5rem; }
.milestone--design      { grid-column: 5 / 7;  grid-row: 2; }
.milestone--research    { grid-column: 2 / 4;  grid-row: 3; margin-top: -1rem; }
.milestone--development { grid-column: 7 / 9;  grid-row: 4; margin-top: -1.5rem; }

.milestone__weeks {
  display: none; /* shown only in the stacked phone layout */
}

.milestone__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  background: var(--pd-beige);
  font-size: clamp(0.95rem, 0.8rem + 0.45vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #111;
}

.milestone__title svg {
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
}

.milestone__text {
  margin: 0;
  padding: 0.65rem 0.75rem 0.8rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #e6e6e6;
}

/* ---------- Goals ---------- */
.pd-goals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.pd-goals__text {
  padding-left: clamp(0rem, 3vw, 2.5rem);
}

.pd-goals__list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-left: 1.25rem;
  list-style: disc;
  color: var(--pd-muted);
}

.pd-goals__list li::marker {
  color: var(--pd-primary);
}

/* the services panel sits in a large rounded surface, as in the reference */
.pd-goals__media {
  margin: 0;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: clamp(3rem, 8vw, 6rem) 0 0 clamp(1rem, 2vw, 1.5rem);
  background: var(--pd-surface);
}

.pd-goals__media img {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin-inline: auto;
}

/* ---------- Challenges & Solutions ----------
   Four dark cells on a lighter backdrop. Their inner corners are
   rounded, so where they meet the backdrop shows through as the
   curved star shape from the reference. */
.pd-cs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #232323;
  border-radius: 4px;
}

.pd-cs__cell {
  --r: clamp(3rem, 8vw, 6.5rem);
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem);
  background: var(--pd-bg);
  color: var(--pd-muted);
  line-height: 1.8;
}

.pd-cs__cell--tl { border-bottom-right-radius: var(--r); }
.pd-cs__cell--tr { border-bottom-left-radius: var(--r); }
.pd-cs__cell--bl { border-top-right-radius: var(--r); }
.pd-cs__cell--br { border-top-left-radius: var(--r); }

/* thin divider down the middle, like the reference */
.pd-cs__cell--tl,
.pd-cs__cell--bl {
  box-shadow: inset -1px 0 0 #2a2a2a;
}

.pd-cs__cell p {
  margin: 0.75rem 0 0;
}

.pd-cs__cell .pd-h + p {
  margin-top: 1.25rem;
}

.pd-cs__title {
  margin: 1.5rem 0 0;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--pd-text);
}

.pd-cs__cell--bl .pd-cs__title {
  margin-top: 0;
}

.pd-cs__label {
  font-weight: 700;
  color: var(--pd-text);
}

.pd-cs__result {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--pd-text);
}

.pd-list__tick {
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.35em;
}

.pd-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.pd-list li {
  position: relative;
  padding-left: 1.6rem;
}

.pd-list li::before {
  content: "\2726"; /* four-pointed star */
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85em;
  color: #d9d9d9;
}

.pd-cs__flow {
  margin: 2rem 0 0;
}

.pd-cs__flow img {
  width: min(100%, 420px);
  height: auto;
}

/* ---------- Design system: colours ---------- */
.pd-swatches {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: clamp(0.9rem, 2.5vw, 1.75rem);
  max-width: 860px;
  margin: clamp(1.25rem, 3vw, 2rem) auto 0;
}

.pd-swatch {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: clamp(110px, 13vw, 150px);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: clamp(16px, 2.5vw, 26px);
  background: var(--swatch);
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1.05rem);
  color: var(--pd-text);
}

/* the Background swatch is the tall one on the left */
.pd-swatch--bg      { grid-column: 1; grid-row: 1 / 3; min-height: clamp(240px, 30vw, 360px); }
.pd-swatch--primary { grid-column: 2; grid-row: 1; }
.pd-swatch--beige   { grid-column: 2; grid-row: 2; }
.pd-swatch--black   { grid-column: 1; grid-row: 3; }
.pd-swatch--white   { grid-column: 2; grid-row: 3; }

.pd-swatch--primary,
.pd-swatch--beige,
.pd-swatch--white {
  border-color: transparent;
  color: #111;
}

.pd-swatch__name {
  font-weight: 600;
}

/* ---------- Design system: typography ---------- */
.pd-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.pd-type__name {
  margin: 0;
  padding-left: clamp(0rem, 3vw, 2.5rem);
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--pd-text);
}

.pd-type__name--montserrat { font-family: "Montserrat", var(--font-sans); }
.pd-type__name--lato       { font-family: "Lato", var(--font-sans); }

.pd-type img {
  justify-self: end;
  width: min(100%, 400px);
  height: auto;
}

/* ---------- Design system: icons ---------- */
.pd-icons {
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
}

.pd-icons img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Mockups ---------- */
.pd-mockups {
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
}

.pd-mockups img {
  display: block;
  width: 100%;
  height: auto; /* the composition stays intact */
}

/* ---------- Website link ---------- */
.pd-link {
  text-align: center;
}

.pd-link .pd-h {
  justify-content: flex-start;
  text-align: left;
}

.pd-link__lead {
  margin: 2rem 0 0;
  font-size: 1.15rem;
  color: var(--pd-text);
}

.pd-link__url {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--pd-text);
  text-decoration: underline;
  text-decoration-color: var(--pd-primary);
  text-underline-offset: 6px;
  transition: color 0.2s ease;
}

.pd-link__url:hover {
  color: var(--pd-primary);
}

/* ---------- Footer row ---------- */
.cs--pd .cs-next {
  border-top: 1px solid var(--pd-border);
}

.cs--pd .cs-next__link {
  font-family: var(--font-sans);
}

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .pd-hero__grid,
  .pd-overview,
  .pd-goals {
    grid-template-columns: minmax(0, 1fr);
  }

  .pd-hero__media {
    max-width: 520px;
    margin-inline: auto;
  }

  .pd-goals__text {
    padding-left: 0;
  }

  .pd-cs__cell {
    --r: clamp(2.5rem, 7vw, 4rem);
  }
}

/* ---------- Phones: stacked timeline, single-column blocks ---------- */
@media (max-width: 760px) {
  .timeline__phases,
  .timeline__weeks {
    display: none;
  }

  .timeline__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0 0 0 1.25rem;
    border-left: 1px dashed #5a5a5a;
  }

  .milestone,
  .milestone--understand,
  .milestone--ideation,
  .milestone--launch,
  .milestone--design,
  .milestone--research,
  .milestone--development {
    grid-column: 1;
    grid-row: auto;
    margin: 0;
  }

  .milestone__weeks {
    display: block;
    margin: 0;
    padding: 0.5rem 0.75rem 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pd-muted);
    background: #383838;
    order: 2;
  }

  .milestone {
    display: flex;
    flex-direction: column;
  }

  .milestone__title { order: 1; }
  .milestone__text  { order: 3; }

  /* challenges & solutions: one column, curves kept small */
  .pd-cs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .pd-cs__cell--tl { order: 1; }
  .pd-cs__cell--tr { order: 2; }
  .pd-cs__cell--bl { order: 3; }
  .pd-cs__cell--br { order: 4; }

  .pd-cs__cell {
    --r: 2.5rem;
    box-shadow: none !important;
  }

  .pd-cs__cell--tl { border-radius: 0 0 var(--r) 0; }
  .pd-cs__cell--tr { border-radius: var(--r) 0 0 0; margin-top: 1rem; }
  .pd-cs__cell--bl { border-radius: 0 var(--r) 0 0; margin-top: 1rem; }
  .pd-cs__cell--br { border-radius: var(--r) 0 0 0; margin-top: 1rem; }
}

@media (max-width: 640px) {
  .pd-swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pd-swatch--bg { min-height: 200px; }

  .pd-type {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .pd-type__name {
    padding-left: 0;
  }

  .pd-type img {
    justify-self: center;
    width: min(75%, 320px);
  }

  /* the wide icon strip scrolls sideways inside its own box instead of shrinking illegibly */
  .pd-icons {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .pd-icons img {
    width: 640px;
    max-width: none;
  }
}
