@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

/* --- Variables globales --- */
:root {
  --c-bg: #161616;
  --c-text: #ffffff;
  --pad: 2%;
  --accent: #a8a8a8;
  --fs-title: 2.5rem;
}

body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
}

/* --- Écran d'entrée (overlay) --- */
#EnterView {
  position: fixed;
  inset: 0;
  background: var(--c-bg);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  z-index: 999;
  pointer-events: none;
  overflow: hidden;
  gap: 1em;
}

.text1 {
  font-size: 1.5rem;
  font-weight: 100;
  color: white;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.text2 {
  font-size: 1.5rem;
  font-weight: 1000;
  color: white;
  opacity: 1;
  transition: opacity 0.8s ease;
}

/* --- Fond animé (canvas) --- */
#Background {
  position: fixed;
  z-index: 0;
  left: var(--pad);
  top: var(--pad);
  right: var(--pad);
  bottom: var(--pad);
  overflow: hidden;
  pointer-events: none;
  background: var(--c-bg);
}

#bg-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
}

/* --- Cadre rectangle animé --- */
.frame {
  position: fixed;
  z-index: 30;
  left: var(--pad); right: var(--pad);
  top: var(--pad); bottom: var(--pad);
  pointer-events: auto;
  mix-blend-mode: difference;
}
.frame_line {
  position: absolute;
  background: #ffffff;
  opacity: 0.5;
  transition: opacity 0.6s;
}
.frame_line-left   { left: 0; top: 0; width: 1px; height: 100%; }
.frame_line-right  { right: 0; top: 0; width: 1px; height: 100%; }
.frame_line-top    { left: 0; top: 0; width: 100%; height: 1px; }
.frame_line-bottom { left: 0; bottom: 0; width: 100%; height: 1px; }

/* --- Bouton burger (menu mobile) --- */
.burger-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  position: absolute;
  top: 3%;
  right: 3%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  z-index: 41;
  pointer-events: auto;
}

.burger-btn .bar {
  display: block;
  width: 30px;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  transition:
    transform 0.3s cubic-bezier(.76,0,.24,1),
    width 0.3s cubic-bezier(.76,0,.24,1),
    background 0.3s;
  transform-origin: center;
}

/* --- Animation burger ouvert --- */
.burger-btn.open .bar:nth-child(1) {
  transform: translateY(11px) rotateZ(45deg);
}
.burger-btn.open .bar:nth-child(2) {
  transform: translate3d(0px, 0px, 0) scale3d(0.3, 2, 0.3);
}
.burger-btn.open .bar:nth-child(3) {
  transform: translateY(-11px) rotateZ(-45deg);
}

/* --- Animation burger hover (ouvert et fermé) --- */
.burger-btn.open:hover .bar:nth-child(1),
.burger-btn:hover .bar:nth-child(1) {
  transform: translateY(10px) rotate(90deg);
  width: 30px;
}
.burger-btn.open:hover .bar:nth-child(2),
.burger-btn:hover .bar:nth-child(2) {
  transform: translate3d(10px, 10px, 0) scale3d(0.3, 2, 0.3);
}
.burger-btn.open:hover .bar:nth-child(3),
.burger-btn:hover .bar:nth-child(3) {
  transform: translateY(-12px) rotate(-180deg);
  width: 30px;
}

.frame > #burger svg rect { fill: #fff; }

@media (max-width: 600px) {
  .frame > #burger { right: 0; }
  .siteHeader { left: var(--pad); }
}

/* --- Header principal du site --- */
.siteHeader {
  position: fixed;
  z-index: 11;
  left: calc(var(--pad)*2);
  top: calc(var(--pad)*2);
  mix-blend-mode: difference;
  color: #fff;
}
.siteHeader_title {
  margin: 0 0 0.2em 0;
  font-size: var(--fs-title);
  font-weight: 600;
}
.siteHeader_label {
  margin: 0 0 1em 0;
  font-weight: 400;
}
.siteHeader_nav ol {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: 0;
}
.siteHeader_nav li {
  list-style: none;
  position: relative;
}
.siteHeader_nav ._dot {
  position: absolute; left: -20px; top: 2px; font-size: 10px; opacity: 0;
  transition: opacity 0.3s;
}
.siteHeader_nav li.is-selected ._dot {
  opacity: 1;
}
.siteHeader_nav ._text {
  color: inherit;
  text-decoration: none;
  font-size: 1.15em;
  opacity: 1;
  transition: opacity 0.4s;
}
.siteHeader_nav li.is-selected ._text {
  opacity: 0.3;
  pointer-events: none;
}
.siteHeader_nav ._text:hover {
  opacity: 0.25;
}

@media (max-width: 600px) {
  .siteHeader {
    max-width: 30vw;
    min-width: 150px;
    max-height: 38vh;
  }
  .siteHeader_title {
    font-size: 1.5rem;
    font-weight: 300;
  }
  .siteHeader_label {
    font-size: 0.9rem;
    font-weight: 100;
  }
}

/* --- Contenu principal (pages) --- */
.content {
  position: fixed;
  z-index: 20;
  left: calc(var(--pad) + 10px);
  bottom: calc(var(--pad) + 10px);
  max-width: 50%;
  min-width: 220px;
  height: 40em;
  color: var(--c-text, --c-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 0.7em;
  transition: max-width 0.2s, max-height 0.2s;
  padding-right: 7em;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: flex-end;
}
.content::-webkit-scrollbar {
  display: none;
}

/* --- Pages spécifiques --- */
.page_content.home,
.page_content.about,
.page_content.projects,
.page_content.contact {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.page_content.projects ul {
  width: 100%;
  text-align: left;
  padding-left: 0px;
  list-style: none;
}
.page_content.projects li {
  height: auto;
  margin: 4em 0;
}
.page_content.projects a {
  color: var(--c-text);
  text-decoration: none;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: pre-line;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(.7,0,.25,1);
}
.page_content.projects a:hover {
  transform: scale(1.1) skewX(-10deg) translateX(10%);
}
.page_content.projects a:hover + p {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
.page_content.projects p {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--accent);
  margin: 0.1em 0;
  transition: transform 0.3s cubic-bezier(.7,0,.25,1), opacity 0.3s;
}
.page_content.contact a {
  text-decoration: solid underline;
  color: var(--c-text);
  transition: color 0.3s;
}
.page_content.contact a:hover {
  text-decoration: none;
  color: var(--accent);
}

/* --- Responsive : Tablette et mobile --- */
@media (max-width: 900px) {
  .content {
    max-width: 30vw;
    min-width: 150px;
    max-height: 38vh;
    font-size: 0.90rem;
    padding: 1em;
  }
  .page_content.projects a {
    font-size: 2rem;
  }
}
@media (max-width: 600px) {
  .content {
    max-width: 30vw;
    min-width: 150px;
    max-height: 80vh;
    font-size: 0.70rem;
    padding: 1em;
  }
  .page_content.projects a {
    font-size: 1rem;
  }
}
/* Limite la hauteur du contenu sur petits écrans */
@media (max-height: 500px) {
  .content {
    max-height: 30vh;
  }
}

.page {
  display: none;
  width: 100%;
  text-align: left;
}

/* --- Menu latéral (side menu) --- */
.menu {
  position: fixed;
  z-index: 40;
  top: var(--pad);
  right: var(--pad);
  bottom: var(--pad);
  left: var(--pad);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  transition: transform 0.2s;
  background: transparent;
}
.menu.open {
  pointer-events: auto;
}
.menu ul {
  width: 100%;
  text-align: right;
  padding-right: 0px;
  list-style: none;
}
.menu li {
  overflow: hidden;
  height: calc(var(--pad) + 0.3em);
  margin: 0.3em 0;
}
.menu a {
  color: var(--c-text);
  position: relative;
  text-decoration: none;
  font-size: clamp(2.3rem, 10vw, 7.5rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 0.98;
  text-transform: uppercase;
  transform: translateY(-110%);
  transition: transform 0.4s cubic-bezier(.7,0,.25,1);
  white-space: pre-line;
  display: inline-block;
}
.menu.open a {
  transform: translateY(0);
}
/* Animation d'apparition échelonnée pour chaque item */
.menu.open li:nth-child(1) a { transition-delay: 0.07s; }
.menu.open li:nth-child(2) a { transition-delay: 0.13s; }
.menu.open li:nth-child(3) a { transition-delay: 0.19s; }
.menu.open li:nth-child(4) a { transition-delay: 0.25s; }

.menu a:hover {
  letter-spacing: 0.05em;
}

/* --- Responsive menu --- */
@media (max-width: 900px) {
  .menu {
    width: 130vw;
    right: calc(var(--pad));
    top: calc(var(--pad));
    left: auto;
    font-size: 1.5rem;
  }
  .menu a {
    font-size: 3rem;
    transform: translateY(-140%);
  }
}
@media (max-width: 600px) {
  .menu {
    width: 65vw;
    right: calc(var(--pad));
    top: calc(var(--pad));
    left: auto;
    font-size: 1.5rem;
  }
  .menu a {
    font-size: 1rem;
    transform: translateY(-170%);
  }
}
