:root {
  --cm-bg: #f4f4f4;
  --cm-green: #db3a34;
  --cm-green-dark: #db3a34;
  --cm-green-darker: #db3a34;
  --cm-green-bg: #f0e3d4;
  --cm-text: #0d1600;
  --cm-text-dark: #05051e;
  --cm-white: #ffffff;
  --cm-mint: #d6eeff;
  --cm-max-width: 1792px;
  --cm-radius-lg: 64px;
  --cm-radius-md: 32px;
  --cm-radius-sm: 26px;
}

/* ===== Reset scoped to project page ===== */
.cm-page {
  background: var(--cm-bg);
  color: var(--cm-text);
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  line-height: 1.4;
  min-height: 100vh;
}

.cm-page *,
.cm-page *::before,
.cm-page *::after {
  box-sizing: border-box;
}

.cm-page img {
  display: block;
  max-width: 100%;
}

.cm-page a {
  color: inherit;
  text-decoration: none;
}

.cm-page button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

/* ===== Layout ===== */
.cm-container {
  display: grid;
  grid-template-areas: "stack";
  margin: 0 auto;
  max-width: var(--cm-max-width);
  padding: 128px 64px 64px;
  position: relative;
  width: 100%;
}

.cm-back,
.cm-section {
  grid-area: stack;
}

.cm-section {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* ===== Back button ===== */
.cm-back {
  align-items: center;
  align-self: start;
  backdrop-filter: blur(2px);
  background: #FDE0D880;
  border-radius: 999px;
  box-shadow: 0 4px 4px rgba(253, 224, 216, 0.25);
  display: flex;
  height: 60px;
  justify-content: center;
  justify-self: start;
  margin-top: -96px;
  position: sticky;
  top: 32px;
  transition: background 0.2s, transform 0.2s;
  width: 80px;
  z-index: 10;
}

.cm-back:hover {
  background: #FDE0D8d9;
  transform: translateX(-2px);
}

/* ===== Hero ===== */
.cg-hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.cg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.cg-tag {
  align-items: center;
  background: var(--cm-green-bg);
  border: 1px solid #4c3837;
  border-radius: 999px;
  color: #4c3837;
  display: inline-flex;
  font-size: 18px;
  gap: 6px;
  padding: 5px 13px;
  text-transform: uppercase;
}

.cg-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 700;
  line-height: 0.8;
  text-transform: uppercase;
  margin: 0;
}

.cg-title__dark,
.cg-title__accent {
  color: var(--cm-text-dark);
  letter-spacing: -3.36px;
}

.cg-subtitle {
  color: var(--cm-text);
  font-size: clamp(16px, 2vw, 24px);
  max-width: 1286px;
  text-transform: uppercase;
  margin: 0;
}

/* ===== Context cards ===== */
.cg-context-grid {
  display: grid;
  gap: 64px;
  grid-template-columns: repeat(3, 1fr);
}

.cg-context-card {
  backdrop-filter: blur(8px);
  border-radius: 32px;
  min-height: 354px;
  overflow: hidden;
  padding: 40px;
  position: relative;
}

.cg-context-card--light {
  background: linear-gradient(245deg, rgba(255, 255, 255, 0.6) 13%, rgba(255, 255, 255, 0.2) 73%);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.cg-context-card--accent {
  background: linear-gradient(123deg, #261C1B 17.91%, #4C3837 65.87%, #F0E3D4 113.83%);
  border: 2px solid rgba(253, 224, 216, 0.20);
  color: var(--cm-white);
}

.cg-context-card__number {
  color: rgba(219, 58, 52, 0.15);
  font-family: 'Poppins', sans-serif;
  font-size: 128px;
  font-weight: 600;
  left: -2px;
  line-height: 1;
  position: absolute;
  text-transform: uppercase;
  top: calc(40px + 16px - 64px + 24px);
}

.cg-context-card__number--accent {
  color: rgba(215, 225, 234, 0.3);
  left: auto;
  right: 0;
}

.cg-context-card__heading {
  align-items: center;
  display: flex;
  gap: 5px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.cg-context-card__heading--accent .cg-context-card__line {
  background: #d7e1ea;
}

.cg-context-card__line {
  background: var(--cm-green);
  border-radius: 999px;
  flex-shrink: 0;
  height: 6px;
  width: 45px;
}

.cg-context-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
}

.cg-context-card__title--accent {
  color: #d7e1ea;
}

.cg-context-card__text {
  font-size: 20px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.cg-context-card__text--accent {
  color: #fff;
}

/* ===== Tabs (same structure as autres projets) ===== */
.cm-tabs {
  position: relative;
}

.cm-tabs__nav {
  display: flex;
  gap: clamp(24px, 10vw, 157px);
  justify-content: center;
  padding-bottom: 16px;
}

.cm-tabs__btn {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 32px;
  padding: 10px;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}

.cm-tabs__btn:hover {
  color: var(--cm-green);
}

.cm-tabs__btn--active {
  color: var(--cm-green);
}

.cm-tabs__btn--active::after {
  background: var(--cm-green);
  border-radius: 2px;
  bottom: -16px;
  content: '';
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
}

.cm-tabs__divider {
  background: rgba(42, 42, 42, 0.15);
  height: 1px;
  width: 100%;
}

.cm-tabs__panel {
  min-height: 200px;
  position: relative;
}

.cm-tabs__panel.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

.cm-tabs__loader {
  align-items: center;
  display: none;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.cm-tabs__panel.is-loading .cm-tabs__loader {
  display: flex;
}

.cm-tabs__spinner {
  animation: cm-spin 0.8s linear infinite;
  border: 3px solid rgba(219, 58, 52, 0.2);
  border-radius: 50%;
  border-top-color: var(--cm-green);
  height: 40px;
  width: 40px;
}

@keyframes cm-spin {
  to {
    transform: rotate(360deg);
  }
}

.cm-tab-error {
  color: #c0392b;
  font-size: 18px;
  padding: 32px;
  text-align: center;
}

/* ===== Tab: Expertise (Compétences) ===== */
.cg-skills-heading {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  text-align: center;
}

.cg-skills-heading__accent {
  color: var(--cm-green-dark);
}

.cg-skills-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(4, 1fr);
}

.cg-skill-card {
  background: linear-gradient(125deg, #fff 61%, var(--cm-green-bg) 100%);
  border-radius: var(--cm-radius-sm);
  box-shadow: 3px 3px 26px #d4d4d4;
  color: #0f0b0b;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 355px;
  padding: 26px;
}

.cg-skill-card:hover {
  background: linear-gradient(301deg, #fff 61%, var(--cm-green-bg) 100%);
}

.cg-skill-card__icon-wrap {
  align-items: center;
  display: flex;
  height: 100px;
  justify-content: flex-start;
  position: relative;
  width: 111px;
}

.cg-skill-card__icon {
  display: block;
  height: 98px;
  object-fit: contain;
  object-position: left top;
  width: 111px;
}

.cg-skill-card__icon--hover {
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transition: opacity 0.25s ease;
}

.cg-skill-card:hover .cg-skill-card__icon--hover {
  opacity: 1;
}

.cg-skill-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
}

.cg-skill-card__tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: auto;
}

.cg-skill-tag {
  background: #d7e1ea;
  border: 1px solid #114b5f;
  border-radius: 999px;
  color: #0f0b0b;
  font-size: 16px;
  padding: 4px 10px;
  text-transform: uppercase;
  width: fit-content;
}

/* ===== Shared closing card ===== */
.cg-closing {
  background: var(--cm-white);
  border-radius: var(--cm-radius-lg);
  box-shadow: 4px 8px 16px rgba(212, 212, 212, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px 64px;
}

.cg-closing__badge {
  background: var(--cm-text-dark);
  border-radius: 4px;
  color: var(--cm-mint);
  display: inline-block;
  font-size: 18px;
  padding: 8px;
  text-transform: uppercase;
  width: fit-content;
}

.cg-closing__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
  max-width: 500px;
}

.cg-closing__text {
  font-size: 20px;
  line-height: 1.5;
  max-width: 816px;
}

/* ===== Carousel ===== */
.cg-carousel {
  margin: 64px 0;
}

.cg-carousel__viewport {
  margin: 0 auto;
  max-width: 900px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.cg-carousel__track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.85, 0, 0.15, 1);
  will-change: transform;
}

.cg-carousel__img {
  flex: 0 0 100%;
  max-width: 900px;
  object-fit: cover;
  width: 100%;
}

.cg-carousel__nav {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
}

.cg-carousel__btn {
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  padding: 4px;
}

.cg-carousel__btn svg {
  display: block;
  height: 20px;
  width: 20px;
}

.cg-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.cg-carousel__dots .cg-carousel__dot {
  background: #ccc;
  border: none;
  border-radius: 100%;
  cursor: pointer;
  height: 12px;
  padding: 0;
  width: 12px;
}

.cg-carousel__dot[aria-current="true"] {
  background: #4c3837;
}

/* ===== Tab: Retour d'expérience ===== */
.cg-rex-heading {
  font-family: 'Poppins', sans-serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.cg-rex-heading__accent {
  color: var(--cm-green-dark);
}

.cg-rex-grid {
  display: grid;
  gap: 64px;
  grid-template-columns: repeat(3, 1fr);
}

.cg-rex-card {
  background: var(--cm-white);
  border-radius: var(--cm-radius-lg);
  box-shadow: 4px 8px 16px rgba(212, 212, 212, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 482px;
  padding: 32px;
}

.cg-rex-card__icon-wrap {
  height: 130px;
  position: relative;
  width: 160px;
}

.cg-rex-card__icon {
  display: block;
  height: 130px;
  object-fit: contain;
  object-position: left top;
  width: 160px;
}

.cg-rex-card__icon--hover {
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transition: opacity 0.25s ease;
}

.cg-rex-card:hover .cg-rex-card__icon--hover {
  opacity: 1;
}

.cg-rex-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
}

.cg-rex-card__p {
  font-size: 20px;
  line-height: 1.5;
}

.cg-rex-card__label {
  font-weight: 600;
}

/* ===== Tab: Étude de cas ===== */
.cg-phase-title {
  font-family: 'Poppins', sans-serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  padding-top: 8px;
  text-align: center;
}

.cg-phase-title__subtitle {
  color: #DB3A34;
}

.cg-two-col {
  align-items: stretch;
  display: grid;
  gap: 64px;
  grid-template-columns: 514px minmax(0, 1fr);
  height: 1000px;
}

.cg-lcard {
  background: var(--cm-white);
  border-radius: var(--cm-radius-lg);
  box-shadow: 4px 8px 16px rgba(212, 212, 212, 0.25);
  flex: 0 0 514px;
  padding: 32px 64px;
}

.cg-lcard__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
  margin: 0 0 10px;
}

.cg-lcard__text {
  display: flex;
  flex-direction: column;
  font-size: 20px;
  gap: 16px;
  line-height: 1.5;
  margin: 0;
}

.cg-lcard__text p {
  margin: 0;
}

.cg-mindmap {
  background: var(--cm-white);
  border-radius: var(--cm-radius-lg);
  box-shadow: 4px 8px 16px rgba(212, 212, 212, 0.25);
  min-height: 813px;
  overflow: hidden;
  position: relative;
}

.cg-mindmap__badge {
  background: var(--cm-text-dark);
  border-radius: 4px;
  color: var(--cm-mint);
  font-size: 18px;
  left: 64px;
  padding: 8px;
  position: absolute;
  text-transform: uppercase;
  top: 32px;
  z-index: 2;
}

.cg-mindmap__frame {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  min-height: 813px;
  overflow: hidden;
  padding: 32px;
}

.cg-mindmap__img {
  display: block;
  height: auto;
  max-height: none;
  max-width: none;
  object-fit: contain;
  transform: rotate(-90deg);
  width: 854px;
}

.cg-croquis-grid {
  display: grid;
  gap: 64px;
  grid-template-columns: repeat(2, 1fr);
}

.cg-croquis-card {
  background: var(--cm-white);
  border-radius: 32px;
  box-shadow: 2px 4px 8px rgba(212, 212, 212, 0.25);
  margin: 0;
  min-height: 592px;
  overflow: hidden;
  position: relative;
}

.cg-croquis-card__badge {
  background: #05051E;
  border-radius: 4px;
  color: var(--cm-mint);
  font-size: 18px;
  left: 24px;
  padding: 8px;
  position: absolute;
  text-transform: uppercase;
  top: 24px;
  z-index: 2;
}

.cg-croquis-card img {
  display: block;
  height: 100%;
  min-height: 592px;
  object-fit: contain;
  width: 100%;
}

.cg-phase-intro {
  font-size: 20px;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 1166px;
  text-align: center;
}

.cg-iteration-card,
.cg-renoncement-card {
  background: var(--cm-white);
  border-radius: var(--cm-radius-lg);
  box-shadow: 4px 8px 16px rgba(212, 212, 212, 0.25);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px 64px;
}

.cg-iteration-card__badge {
  background: var(--cm-text-dark);
  border-radius: 4px;
  color: var(--cm-mint);
  font-size: 18px;
  padding: 8px;
  text-transform: uppercase;
  width: fit-content;
}

.cg-iteration-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cg-iteration-flow--with-text {
  align-items: center;
  flex-direction: row;
  gap: 28px;
}

.cg-iteration-flow__track {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 28px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.cg-iteration-flow__track--long {
  margin-top: 10px;
}

.cg-iteration-step {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 10px;
}

.cg-iteration-step__group {
  align-items: center;
  display: flex;
  gap: 12px;
}

.cg-iteration-step__img {
  display: block;
  height: 237px;
  object-fit: contain;
  width: 237px;
}

.cg-iteration-step__img--wide {
  height: 177px;
  width: 286px;
}

.cg-iteration-step__img--tall {
  height: 177px;
  width: 180px;
}

.cg-iteration-step__img--sketch {
  height: 176px;
  width: 204px;
}

.cg-iteration-step__img--logo {
  height: 144px;
  width: 100px;
}

.cg-iteration-step__img--long {
  height: 158px;
  width: 345px;
}

.cg-iteration-step__img--long-wide {
  height: 177px;
  width: 500px;
}

.cg-iteration-step__img--long-final {
  height: 144px;
  width: 620px;
}

.cg-iteration-card--compact .cg-iteration-flow__track {
  gap: 16px;
  overflow-x: visible;
}

.cg-iteration-card--compact .cg-iteration-arrow {
  flex: 0 0 36px;
  height: 32px;
  width: 36px;
}

.cg-iteration-card--compact .cg-iteration-arrow svg {
  height: auto;
  width: 100%;
}

.cg-iteration-card--compact .cg-iteration-step__group {
  gap: 8px;
}

.cg-iteration-card--compact .cg-iteration-step__img {
  height: 150px;
  width: 150px;
}

.cg-iteration-card--compact .cg-iteration-step__img--wide {
  height: 110px;
  width: 180px;
}

.cg-iteration-card--compact .cg-iteration-step__img--tall {
  height: 110px;
  width: 110px;
}

.cg-iteration-card--compact .cg-iteration-step__img--logo {
  height: 87px;
  width: 60px;
}

.cg-iteration-card--compact .cg-iteration-step__img--long {
  height: 100px;
  width: 220px;
}

.cg-iteration-card--compact .cg-iteration-step__img--long-wide {
  height: 110px;
  width: 320px;
}

.cg-iteration-card--compact .cg-iteration-step__img--long-final {
  height: 90px;
  width: 400px;
}

.cg-iteration-step__label {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.cg-iteration-arrow {
  flex: 0 0 52px;
  height: 45px;
  width: 52px;
}

.cg-iteration-flow__text,
.cg-iteration-card__text {
  flex: 1;
  font-size: 20px;
  line-height: 1.5;
  margin: 0;
  min-width: 280px;
}

.cg-renoncement-card__body {
  align-items: center;
  display: flex;
  gap: 64px;
}

.cg-renoncement-card__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  font-size: 20px;
  gap: 16px;
  line-height: 1.5;
}

.cg-renoncement-card__text p {
  margin: 0;
}

.cg-renoncement-card__img {
  flex: 0 0 447px;
  height: 447px;
  object-fit: contain;
  width: 447px;
}

.cg-pistes-stack {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.cg-piste-band {
  background: var(--cm-white);
  border-radius: var(--cm-radius-lg);
  box-shadow: 4px 8px 16px rgba(212, 212, 212, 0.25);
  overflow: hidden;
  padding: 32px 64px;
  position: relative;
}

.cg-piste-band--selected {
  border: 4px solid var(--cm-green-dark);
}

.cg-piste-band__badge {
  background: var(--cm-text-dark);
  border-radius: 4px;
  color: var(--cm-mint);
  display: inline-block;
  font-size: 18px;
  margin-bottom: 24px;
  padding: 8px;
  text-transform: uppercase;
}

.cg-piste-band__badge--selected {
  background: var(--cm-green-dark);
  border-radius: 0 0 0 16px;
  color: #fff;
  font-size: 18px;
  padding: 8px 16px;
  position: absolute;
  right: 0px;
  text-transform: uppercase;
  top: 0;
  width: 240px;
}

.cg-piste-band__content {
  align-items: center;
  display: flex;
  gap: 64px;
}

.cg-piste-band--reverse .cg-piste-band__content {
  flex-direction: row-reverse;
}

.cg-piste-band__media {
  align-items: center;
  display: flex;
  flex: 0 0 200px;
  justify-content: center;
}

.cg-piste-band__img {
  height: 288px;
  object-fit: contain;
  width: 200px;
}

.cg-piste-band__body {
  flex: 1;
  font-size: 20px;
  line-height: 1.5;
}

.cg-piste-band__body p {
  margin: 0 0 16px;
}

.cg-piste-band__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
  margin: 0 0 16px;
}

.cg-piste-band__title--accent {
  color: var(--cm-green-dark);
}

@media (max-width: 1200px) {
  .cg-context-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cg-skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cg-rex-grid {
    grid-template-columns: 1fr;
  }

  .cg-two-col,
  .cg-croquis-grid {
    grid-template-columns: 1fr;
  }

  .cg-lcard {
    flex: none;
  }

  .cg-mindmap {
    min-height: 500px;
  }

  .cg-mindmap__frame {
    min-height: 500px;
  }

  .cg-mindmap__img {
    width: min(854px, 120vw);
  }

  .cg-iteration-card--compact .cg-iteration-flow__track {
    overflow-x: auto;
  }

  .cg-iteration-flow--with-text,
  .cg-renoncement-card__body,
  .cg-piste-band__content,
  .cg-piste-band--reverse .cg-piste-band__content {
    flex-direction: column;
  }

  .cg-renoncement-card__img {
    flex: none;
    height: auto;
    max-width: 100%;
    width: 100%;
  }

  .cg-lcard,
  .cg-iteration-card,
  .cg-renoncement-card,
  .cg-piste-band {
    padding: 32px 24px;
  }
}

@media (max-width: 768px) {
  .cm-container {
    padding: 100px 24px 48px;
  }

  .cm-back {
    margin-top: -84px;
    top: 16px;
  }

  .cm-tabs__nav {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .cg-skills-grid {
    grid-template-columns: 1fr;
  }

  .cg-phase-title {
    font-size: 44px;
  }

  .cg-piste-band__badge--selected {
    position: static;
    margin-bottom: 16px;
    width: fit-content;
  }
}

