* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

:root {
  --coef: 1.2;
  --s0: 1rem;
  --s-1: calc(var(--s0) / var(--coef));
  --s1: calc(var(--coef) * var(--s0));
  --s2: calc(var(--coef) * var(--s1));
  --s3: calc(var(--coef) * var(--s2));
  --s4: calc(var(--coef) * var(--s3));
  --s5: calc(var(--coef) * var(--s4));

  --bg: white;
  --fg: black;
  --accent: #1e1e1e;
  --gap: 2rem;
  --delay: 1s;
  --easing: cubic-bezier(0.87, 0, 0.13, 1);
  --max-width: 1100px;
  --stroke-width: 2px;

  --border: ridge var(--fg) 0.4rem;

  --article-width: 20vmin;
  --rayon: 26vmin;
}

html,
body {
  scroll-behavior: smooth;
}

body {
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  background-color: var(--bg);
  color: var(--fg);
  margin: 0;
  font-family: serif;
  font-style: normal;
  font-weight: normal;
  transition:
    background-color var(--easing) var(--delay),
    color var(--easing) var(--delay);
  height: 100vh;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--fg);
}

::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
  cursor: grabbing;
}

body ::selection {
  background: var(--accent);
  color: var(--bg) !important;
}

img {
  max-width: 100%;
  max-height: 100%;
}

/* TYPO GENERAL */
html,
body {
  font-size: clamp(1rem, 1rem + 0.6vw, 1.2rem);
  color: var(--fg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--fg);
  font-weight: normal;
  font-style: normal;
}

h2 {
  font-size: var(--s3);
  margin-bottom: 1rem;
}
h3 {
  font-size: var(--s3);
}
h4 {
  font-size: var(--s2);
}
h5 {
  font-size: var(--s1);
}
h6 {
  font-size: var(--s0);
}

a,
a:visited {
  color: var(--fg);
}

a:hover,
a:focus {
  text-decoration: none;
}

p {
  line-height: 1.4;
  font-size: var(--s0);
}

/* HEADER */
header.menu-temp {
  position: absolute;
  font-family: "Redaction_10-Bold-CVB";
  font-weight: normal;
  color: var(--bg);
  font-size: 5rem;
  -webkit-text-stroke: 0.01rem var(--fg);
  text-shadow: 0 0 var(--fg);
  transition:
    all var(--easing) var(--delay),
    text-shadow 0.25s ease;
}

header.menu-temp:hover {
  text-shadow:
    -0.1em 0.2rem 0 #00daaf,
    -0.2em 0.4rem 0 #0a78fe,
    -0.3em 0.6rem 0 #ae00e5,
    -0.4em 0.8rem 0 #ec015c;
  cursor: pointer;
}

header.menu-temp span {
  position: fixed;
  line-height: 0.5;
}

header.menu-temp a {
  color: var(--fg);
  transition: color var(--easing) var(--delay);
  text-decoration: none;
  -webkit-text-stroke: var(--stroke-width) var(--bg);
  margin: 0;
}

/* z-index dans cet ordre pour la version mobile */
header.menu-temp .nos {
  top: 0rem;
  left: 1rem;
  z-index: 1003;
}
header.menu-temp .futurs {
  top: 0rem;
  right: 1rem;
  z-index: 1002;
}
header.menu-temp .point {
  bottom: 0rem;
  left: 1rem;
  z-index: 1001;
}
header.menu-temp .net {
  bottom: 0rem;
  right: 1rem;
  z-index: 1000;
}

nav {
  position: fixed;
  bottom: 0;
  left: 0;

  width: 100%;
  background: transparent;
}

nav ul {
  font-size: var(--s2);
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: 3rem;
  margin: 0 auto;
  border-radius: 1em;
  padding: 1rem 2rem;

  max-width: 100%;
  text-align: center;
}

/* MAIN */
main {
  overflow-y: auto;
  height: 100%;
  font-size: var(--s0);
  scrollbar-color: var(--fg) var(--bg);
  scrollbar-width: auto;
}

#intro {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  padding: 2rem;
  padding-bottom: 0;
}

#toggle-popup,
#popup {
  font-family: "Young Serif";
  position: fixed;
  z-index: 10;
}

#toggle-popup {
  cursor: pointer;
  border: var(--border);
  font-size: var(--s5);
  background-color: var(--bg);
  text-align: center;
  height: calc(var(--s5) * 1.5);
  width: calc(var(--s5) * 1.5);
  border-radius: var(--s5);

  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%) scale(1);
}

#toggle-popup:focus-visible {
  outline-offset: 0.2rem;
}

#toggle-popup:active {
  transform: translateX(-50%) scale(0.99);
}

#popup {
  top: 25%;
  display: none;
  background-color: var(--bg);
  padding: 2rem;
  border: var(--border);
  width: calc(var(--rayon) * 4);
}

#popup.open {
  display: block;
}

#popup strong {
  display: inline-block;
  margin-block: 1.5rem 0.75rem;
  font-size: var(--s1);
}

h1 {
  font-family: "Young Serif", serif;
  font-size: var(--s5);
  position: fixed;
  bottom: 1rem;
  text-align: center;
  margin: auto;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  /* Transition hover définie dans le html pour le dynamisme */
  #fond div {
    background-color: var(--color);
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity ease-in-out calc(var(--delay) / 1.3);
  }
}

ul.articles-list-home {
  list-style: none;
  width: 100%;
  padding: calc(6rem + var(--gap) * 3) calc(var(--gap) * 2);

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.articles-list-home li {
  perspective: 1000px;
  aspect-ratio: 1 / 2;
  color: var(--fg);
  display: flex;
  flex-direction: column-reverse;
  justify-content: end;
}

.articles-list-home li ::selection {
  background: var(--fg-volet);
  color: var(--bg-volet) !important;
}

.articles-list-home li:first-of-type {
  transform: translateY(calc(var(--gap) * -3));
}

/* ----- FENÊTRE ----- */
.fenetre {
  position: relative;
  width: 100%;
  height: 100%;
}

.recto,
.recto .volet-devant,
.recto .volet-derriere,
.verso {
  border-radius: 60rem 60rem 1rem 1rem;
}

.recto,
.verso {
  position: absolute;
  inset: 0;
  border: var(--border);
}

/* RECTO */
.recto {
  transition: transform ease var(--delay);
  transform: rotateY(0deg);
  transform-style: preserve-3d;
  transform-origin: center left;
  z-index: 10;
  box-shadow: 0 0 1em var(--accent);
}

.volet-devant {
  display: none;
  pointer-events: none;
}

.blason {
  mix-blend-mode: multiply;
  flex: 1 1 auto;
  height: 90%;
  padding: 3rem 1rem 1rem 1rem;
}

.blason img {
  mix-blend-mode: multiply;
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: center;
}

.title {
  font-family: "Young Serif";
  text-align: center;
  transition: color ease var(--delay);
  margin-bottom: 0;
  font-size: var(--s1);
  font-weight: 700;
  text-transform: uppercase;
  border: var(--border);
  border-top: none;
  padding: 0.5rem;
  z-index: 1;
  background-color: var(--bg);
}

.title a:hover,
.title a:focus-within {
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
}

.time {
  font-family: "Young Serif";
  font-size: var(--s3);
  text-align: center;

  width: 100%;
  position: absolute;
  top: 1rem;
}

@media screen and (hover: hover) and (pointer: fine) {
  /* AUTOGESTION  */
  .articles-list-home li .volet-devant {
    --timing-function: cubic-bezier(0.33, 1, 0.68, 1);
    transform: scale(1);
    opacity: 1;
    transition:
      transform calc(var(--delay) / 2),
      opacity calc(var(--delay) / 2);
    transition-timing-function: var(--timing-function);
  }

  .articles-list-home li:hover .volet-devant,
  .articles-list-home li:focus-within .volet-devant {
    transform: scale(4);
    transition-timing-function: ease-in-out;
    pointer-events: none;
    opacity: 0;
  }
  .recto .volet-devant,
  .recto .volet-derriere {
    display: block;
    background-color: var(--bg);
    position: absolute;
    inset: 0;
    display: flex;
    flex-flow: column nowrap;
    -moz-backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .recto .volet-derriere {
    background-color: var(--bg-volet);
    transform: rotateY(180deg);
  }

  .time {
    margin: auto;
  }
}

@media screen and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  .articles-list-home li:hover .volet-devant,
  .articles-list-home li:focus-within .volet-devant {
    display: none;
  }
}

/* VERSO */
.verso {
  display: flex;
  flex-flow: column nowrap;
  color: var(--fg-volet);
  background-color: var(--bg-volet);
  padding: 1rem;
  gap: 1rem;
  justify-content: space-between;
}

.preview {
  height: 14rem;
}

.preview img {
  --radius: 9rem;
  border-radius: var(--radius) var(--radius) 0rem 0rem;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.content {
  margin-top: auto;
  overflow: auto;
}

#en-construction {
  cursor: not-allowed;
  margin-top: 1rem;
  font-size: var(--s0);
}

a {
  text-decoration: none;
}

a:hover,
a:focus,
a:active {
  border-color: transparent;
}

header a {
  border: none;
}

.stretched-link::after {
  content: " ";
  position: absolute;
  inset: 0;
  z-index: 20;
}

@media (max-width: 1100px), (max-height: 1000px), (hover: none) {
  :root {
    --stroke-width: 1px;
    --article-width: 20vmin;
    --rayon: 26vmin;
  }

  header.menu-temp a {
    font-size: 3.5rem;
  }

  #toggle-popup {
    top: initial;
    left: initial;
    margin-inline: auto;
    bottom: 1rem;
    transform: scale(1);
  }

  #toggle-popup:active {
    transform: scale(0.99);
  }

  #popup {
    position: fixed;
    transform: translate(0);
    max-width: calc(100% - 2rem);
    margin: 2rem 1rem;
    inset: 0 0 4rem 0;
    padding: 4rem 1rem;
  }
}

@media (max-width: 900px) {
  :root {
    --coef: 1.25;
  }

  header.menu-temp {
    display: flex;
    flex-direction: row;
    gap: 0;
    justify-content: center;
    width: 100%;
  }

  header.menu-temp span.lien-home {
    position: relative !important;
    top: initial !important;
    right: initial !important;
    bottom: initial !important;
    left: initial !important;
    font-size: 5rem;
  }

  ul.articles-list-home {
    padding: 4rem calc(var(--gap) / 2);
  }
}

@media (max-width: 500px) {
  header.menu-temp a {
    font-size: 2.5rem;
  }
}
