/* dynamically displayed content */
[data-theme="light"] .curse {
  display: none;
}

[data-theme="dark"] .benefits {
  display: none;
}

* {
  scroll-behavior: smooth;
}

/* General */
body {
  position: relative;
  color: var(--main-text-color);
  overflow-x: hidden;
  background-color: var(--main-bg-color);
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  padding: 2rem 0.5rem;
}

a {
  color: inherit;
}

.main-footer {
  margin-top: 10rem;
  font-size: 0.9rem;
  font-weight: 200;
}

.main-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
  gap: 1.5rem;
}

.content-block {
  position: relative;
  padding: 1rem 1rem;
  max-width: 90vw;
  width: 100%;
  background: transparent;
  color: var(--main-text-color);
  border-style: none;
  box-sizing: border-box;
}

.unformat-href {
  text-decoration: none;
  color: inherit;
}

.content-block a h2,
h3 {
  position: relative;
}

.content-block a h2::before {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 98%;
  height: 2px;
  background-color: var(--medium-text-color);
  border-radius: 2px;
  opacity: 0.1;
}

.content-block a h3::before {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 98%;
  height: 2px;
  background-color: var(--medium-text-color);
  border-radius: 2px;
  opacity: 0.1;
}

.content-block a h2::after {
  content: "#";
  position: relative;
  left: 12px;
  text-align: left;
  color: var(--secondary-bg-color);
  opacity: 0;
  transition: opacity 100ms ease-in;
}

.content-block a h3::after {
  content: "#";
  position: relative;
  left: 12px;
  text-align: left;
  color: var(--secondary-bg-color);
  opacity: 0;
  transition: opacity 100ms ease-in;
}

.content-block a h2:hover {
  cursor: pointer;
}

.content-block a h3:hover {
  cursor: pointer;
}

.content-block a h2:hover::after {
  opacity: 1;
}

.content-block a h3:hover::after {
  opacity: 1;
}

.content-block img {
  max-width: 100%;
  mix-blend-mode: darken;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding: 0;
  margin-bottom: 1rem;
  text-align: left;
}

.quote-block {
  position: relative;
  font-weight: 200;
  margin-left: 12px;
  font-size: 13pt;
}

.quote-block::before {
  content: "";
  position: absolute;
  height: 90%;
  width: 2px;
  background-color: var(--main-text-color);
  top: 50%;
  translate: 0 -50%;
  left: -10px;
  opacity: 0.5;
}

.main-title {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -6%;
  margin: 0;
  text-align: center;
}

.main-subtitle {
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--medium-text-color);
  padding: 0 1rem;
}

.title-block span {
  position: relative;
}

.doodle-line {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  bottom: -4px;
  width: 90%;
  z-index: 2;
}

.toc {
  display: none;
}

.controls-block {
  display: flex;
  flex-direction: row;
  width: fit-content;
  border-radius: 50px;
  gap: 10px;
  padding: 5px;
  max-width: 90vw;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 1rem;
  background-color: var(--tabs-bg-color);
}

.overlay {
  position: fixed;
  top: -110%;
  height: 100%;
  width: 100%;
  z-index: 100;
  filter: saturate(0.5) brightness(1);
}

.overlay.active {
  top: 110%;
  filter: saturate(1) brightness(0.7);
}

.overlay-1 {
  z-index: 999;
  background: var(--overlay-1-light);
  transition:
    top 2000ms 400ms ease-in-out,
    filter 1500ms 400ms ease-in-out;
}

.overlay-1.active {
  background: var(--overlay-1);
}

.overlay-2 {
  z-index: 998;
  height: 100%;
  background: var(--overlay-2);
  transition:
    top 2000ms 300ms ease-in-out,
    filter 1500ms 300ms ease-in-out;
}

.overlay-3 {
  z-index: 997;
  height: 100%;
  background: var(--overlay-3);
  transition:
    top 2000ms ease-in-out,
    filter 1500ms ease-in-out;
}

#curse-demo-norm-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

#curse-demo-controls-1,
#curse-demo-controls-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#blessing-btn-1 {
  width: 200px;
}

#demo-1 h2 {
  margin-bottom: 1rem;
}

#bless-demo-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#curse-btn-1 {
  width: 200px;
}

#curse-demo h2,
h3 {
  margin-bottom: 1rem;
}

.proof {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  background-color: var(--tertiary-bg-color);
  border-radius: 20px;
  padding: 10px;
  box-shadow: var(--box-shadow-3);
}

.proof {
  height: fit-content;
  width: auto;
}

.proof-collapsable {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s ease-out;
  width: 100%;
}

.proof.active .proof-collapsable {
  grid-template-rows: 1fr;
}

.proof-content {
  display: block;
  overflow: hidden;
  padding: 10px 40px;
}

.pycode {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  background-color: var(--tertiary-bg-color);
  border-radius: 20px;
  padding: 10px;
  box-shadow: var(--box-shadow-3);
}

.pycode-collapsable {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s ease-out;
  width: 100%;
}

.pycode.active .pycode-collapsable {
  grid-template-rows: 1fr;
}

.pycode-content {
  padding: 0;
  margin: 5px;
  overflow-x: auto;
  overflow: hidden;
  background: var(--tertiary-bg-color);
  color: #47a5b8;
  width: 100%;
  text-align: left;
}

.pycode-inner {
  overflow-x: auto;
  white-space: pre;
  display: block;
  width: 100%;
  text-align: left;
}

.kw {
  color: #9a5cd0;
  font-weight: bold;
}

.lib {
  color: #e17c6f;
}

.number {
  color: #d6b566;
}

.commentaire {
  color: #56d692;
  font-style: italic;
}

#curse-graph-4 {
  width: 100% !important;
  height: 100% !important;
}

.graph-box {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
  background-blend-mode: normal;
  padding: 20px;
  border-radius: 20px 10px;
  margin-top: 40px;
}

.graph-box::after {
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  z-index: -1;
  height: 100%;
  width: 100%;
  translate: -50% -50%;
  border-radius: 20px;
  box-sizing: border-box;
  box-shadow: var(--box-shadow-1);
}

[data-theme="light"] .graph-box::after {
  border-color: var(--main-text-color);
  background: white;
}

[data-theme="dark"] .graph-box::after {
  border-color: var(--tertiary-bg-color);
  background: var(--main-text-color);
}

/* Responsive */

/* Ecrans de taille moyenne (tablettes, PC...) */
@media screen and (min-width: 600px) {
  .main-layout {
    display: flex;
    gap: 2rem;
  }

  .main {
    flex-grow: 2;
    font-size: 1.1rem;
    padding: 3rem 2rem;
  }

  .content-block {
    padding: 0;
    max-width: 750px;
  }

  .title-block {
    margin-bottom: 2rem;
    text-align: center;
  }

  .main-title {
    font-size: 4rem;
  }

  .main-subtitle {
    font-size: 0.96rem;
  }

  .doodle-line {
    bottom: -8px;
  }

  .controls-block {
    margin-bottom: 3rem;
  }
}

/* Ecrans de grande taille */
@media screen and (min-width: 1200px) {
  .toc {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    position: sticky;
    right: 2rem;
    padding: 2rem;
    top: 2rem;
    gap: 1rem;
    min-width: none;
    width: 100%;
    max-width: 22rem;
    height: fit-content;
    background: var(--tertiary-bg-color);
    border-radius: 20px;
    box-shadow: var(--box-shadow-3);
    margin-top: 60px;
  }

  [data-theme="light"] .curse .toc-item {
    display: none;
  }

  [data-theme="dark"] .benefits .toc-item {
    display: none;
  }

  .toc p {
    margin: 0;
    position: relative;
    cursor: pointer;
    opacity: 0.7;
  }

  .toc a {
    color: var(--main-text-color);
    margin: 0;
    text-decoration: none;
  }

  .toc p::before {
    content: "";
    position: absolute;
    height: 90%;
    width: 2px;
    background-color: var(--main-text-color);
    top: 50%;
    translate: 0 -50%;
    left: -7px;
    opacity: 0;
  }

  .toc p:hover {
    opacity: 1;
  }

  .toc p:hover::before {
    opacity: 0.1;
  }

  .toc .active p::before {
    opacity: 0.7;
  }

  .toc .active p:hover::before {
    opacity: 0.7;
  }

  .toc .active p {
    opacity: 1;
  }

  .toc-item.subtitle {
    font-weight: 300;
    font-size: 1rem;
    margin-left: 2px;
  }
}
