/* ===== Karen : English Game — design tokens ===== */
:root {
  --cm-bg: #f4f4f4;
  --cm-accent: #31a8ff;
  --cm-accent-dark: #18547f;
  --cm-accent-darker: #05051e;
  --cm-accent-bg: #d6eeff;
  --cm-text: #0d1600;
  --cm-text-muted: #05051e;
  --cm-white: #ffffff;
  --cm-purple: rgba(99, 102, 241, 0.15);
  --cm-max-width: 1792px;
  --cm-radius-lg: 64px;
  --cm-radius-md: 32px;
}

.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;
}

.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-lang-switch,
.cm-section {
  grid-area: stack;
}

.cm-section {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.cm-back {
  align-items: center;
  align-self: start;
  backdrop-filter: blur(2px);
  background: rgba(214, 238, 255, 0.5);
  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: rgba(214, 238, 255, 0.85);
  transform: translateX(-2px);
}

.cm-back svg {
  height: 24px;
  width: 24px;
}

.cm-lang-switch {
  align-items: center;
  align-self: start;
  backdrop-filter: blur(2px);
  border-radius: 50%;
  display: flex;
  height: 60px;
  justify-content: center;
  justify-self: end;
  margin-top: -96px;
  opacity: 0.7;
  overflow: hidden;
  position: sticky;
  top: 32px;
  transition: opacity 0.2s, transform 0.2s;
  width: 60px;
  z-index: 10;
  
}

.cm-lang-switch:hover {
  opacity: 1;
  transform: scale(1.05);
}

.cm-lang-switch__flag {
  position: relative;
}

.cm-lang-switch__flag.is-hidden {
  display: none;
}

.cm-hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.cm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.cm-tag {
  align-items: center;
  background: var(--cm-accent-bg);
  border: 1px solid var(--cm-accent);
  border-radius: 999px;
  color: var(--cm-text-muted);
  display: inline-flex;
  font-size: 18px;
  gap: 4px;
  padding: 5px 13px;
  text-transform: uppercase;
}

.cm-tag svg {
  flex-shrink: 0;
  height: 12px;
  width: 12px;
}

.cm-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 700;
  letter-spacing: -3.36px;
  line-height: 0.8;
  text-transform: uppercase;
  margin: 0;
}

.cm-title__dark {
  color: var(--cm-text-muted);
}

.cm-title__accent {
  color: var(--cm-accent);
}

.cm-subtitle {
  margin: 0;
  font-size: clamp(16px, 2vw, 24px);
  max-width: 1286px;
  text-transform: uppercase;
}

.cm-context-grid {
  display: grid;
  gap: 64px;
  grid-template-columns: repeat(3, 1fr);
}

.cm-context-card {
  backdrop-filter: blur(8px);
  border: 2px solid var(--cm-accent-bg);
  border-radius: var(--cm-radius-md);
  min-height: 300px;
  height: auto;
  overflow: hidden;
  padding: 40px;
  position: relative;
}

.cm-context-card--light {
  background: linear-gradient(242deg, rgba(255, 255, 255, 0.6) 13%, rgba(255, 255, 255, 0.2) 73%);
}

.cm-context-card--accent {
  background: linear-gradient(152deg, #05051e 13%, #206ca5 84%);
  border-color: #b1b2f8;
  color: var(--cm-white);
}

.cm-context-card__number {
  color: var(--cm-purple);
  font-family: 'Poppins', sans-serif;
  font-size: 128px;
  font-weight: 600;
  left: -2px;
  line-height: 1;
  position: absolute;
  text-transform: uppercase;
  top: 37px;
}

.cm-context-card--accent .cm-context-card__number {
  color: rgba(224, 224, 252, 0.25);
  left: auto;
  right: 0;
}

.cm-context-card__heading {
  align-items: center;
  display: flex;
  gap: 5px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.cm-context-card__line {
  background: var(--cm-accent);
  border-radius: 999px;
  flex-shrink: 0;
  height: 6px;
  width: 45px;
}

.cm-context-card--accent .cm-context-card__line {
  background: var(--cm-accent-bg);
}

.cm-context-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
}

.cm-context-card__text {
  font-size: 20px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.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--active {
  color: var(--cm-accent);
}

.cm-tabs__btn--active::after {
  background: var(--cm-accent);
  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-tab-error {
  color: #c0392b;
  font-size: 18px;
  padding: 32px;
  text-align: center;
}

.cm-tabs__spinner {
  animation: cm-spin 0.8s linear infinite;
  border: 3px solid rgba(49, 168, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--cm-accent);
  height: 40px;
  width: 40px;
}

@keyframes cm-spin {
  to { transform: rotate(360deg); }
}

.ka-gallery-heading {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  text-align: center;
}

.ka-gallery-heading__accent {
  color: var(--cm-accent-dark);
}

.ka-gallery {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, minmax(180px, auto));
}

.ka-gallery__photo {
  border-radius: 16px;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  width: 100%;
}

.ka-gallery__photo--box-closed {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  min-height: 380px;
  object-fit: cover;
  object-position: 4% center;
  width: 100%;
}

.ka-gallery__photo--photo01 { grid-column: 3; grid-row: 2; }
.ka-gallery__photo--photo02 { grid-column: 4; grid-row: 2; }

.ka-gallery__photo-wrap {
  align-items: flex-start;
  align-self: stretch;
  border-radius: 16px;
  display: flex;
  grid-column: 1;
  grid-row: 3 / 6;
  height: 100%;
  justify-content: center;
  min-height: 380px;
  overflow: hidden;
  position: relative;
}

.ka-gallery__photo--rotated {
  flex-shrink: 0;
  height: 100%;
  max-width: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: top center;
  position: relative;
  width: auto;
}

.ka-gallery__photo--photo03 {
  grid-column: 2 / 4;
  grid-row: 3;
  min-height: 220px;
}

.ka-gallery__photo--photo04 { grid-column: 2; grid-row: 4; }
.ka-gallery__photo--photo05 { grid-column: 3; grid-row: 4; }
.ka-gallery__photo--photo06 { grid-column: 4; grid-row: 5; min-height: 220px; }

.ka-gallery-card {
  backdrop-filter: blur(8px);
  border: 2px solid var(--cm-accent-bg);
  border-radius: var(--cm-radius-md);
  overflow: hidden;
  padding: 40px 16px;
  position: relative;
}

.ka-gallery-card--light {
  background: linear-gradient(242deg, rgba(255, 255, 255, 0.6) 13%, rgba(255, 255, 255, 0.2) 73%);
}

.ka-gallery-card--accent {
  background: linear-gradient(163deg, #05051e 13%, #206ca5 84%);
  border-color: #b1b2f8;
  color: var(--cm-white);
}

.ka-gallery-card--architecture { grid-column: 3 / 5; grid-row: 1; }
.ka-gallery-card--colorimetrie { grid-column: 4; grid-row: 3 / 5; }
.ka-gallery-card--print { grid-column: 2 / 4; grid-row: 5; }

.ka-gallery-card__number {
  color: var(--cm-purple);
  font-family: 'Poppins', sans-serif;
  font-size: 128px;
  font-weight: 600;
  left: -2px;
  line-height: 1;
  position: absolute;
  text-transform: uppercase;
  top: 37px;
}

.ka-gallery-card--accent .ka-gallery-card__number {
  color: rgba(224, 224, 252, 0.25);
  left: auto;
  right: 0;
}

.ka-gallery-card__heading {
  align-items: center;
  display: flex;
  gap: 5px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.ka-gallery-card__line {
  background: var(--cm-accent);
  border-radius: 999px;
  flex-shrink: 0;
  height: 6px;
  width: 45px;
}

.ka-gallery-card--accent .ka-gallery-card__line {
  background: var(--cm-accent-bg);
}

.ka-gallery-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
}

.ka-gallery-card__text {
  font-size: 20px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.cm-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;
}

.cm-closing__badge {
  background: var(--cm-accent-darker);
  border-radius: 4px;
  color: var(--cm-accent-bg);
  display: inline-block;
  font-size: 18px;
  padding: 8px;
  text-transform: uppercase;
  width: fit-content;
}

.cm-closing__title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 32px;
  max-width: 740px;
}

.cm-closing__text {
  font-size: 20px;
  line-height: 1.5;
  max-width: 816px;
}

@media (max-width: 1200px) {
  .cm-context-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cm-context-card {
    min-height: 240px;
  }

  .ka-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }

  .ka-gallery__photo,
  .ka-gallery__photo-wrap,
  .ka-gallery-card {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: 220px;
  }

  .ka-gallery__photo--rotated {
    height: auto;
    min-height: 220px;
    object-fit: cover;
    transform: none;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .cm-container {
    padding: 100px 24px 48px;
  }

  .cm-back,
  .cm-lang-switch {
    margin-top: -84px;
    top: 16px;
  }

  .ka-gallery {
    grid-template-columns: 1fr;
  }

  .cm-closing {
    padding: 24px;
  }
}
