@import url("https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap");

/* 
=====================================================
    TABLE OF CONTENTS - GLOBAL CSS
=====================================================
    1.  Variables (:root)
    2.  Reset & Base Styles
    3.  Typography & Selection
    4.  Navigation Bar
    5.  Footer
    6.  Contact Overlay (A4 Card)
    7.  Helpers
=====================================================
*/

/* 
=====================================================
    1. Variables (:root)
=====================================================
*/
:root {
  /* Colors */
  --My-white: #ffffff;
  --My-gray: #f5f5f3;
  --My-gray-on-black: #414141;
  --My-black: #181818;
  --My-orange: #ff520d;
  --My-orange-hover: #b33c0d;
  --My-gray-Stroke: #cccccc;
  --My-gray-Text: gray;

  /* Fonts */
  --font-geist: "Geist", sans-serif;
  --font-mono: "Geist Mono", "Roboto Mono", monospace;

  /* Typography Scale */
  --size-display: 96px;
  --size-heading-contact: 68px;
  --size-subheading: 56px;
  --size-subheading-2: 24px;
  --size-body: 14px;
  --size-micro: 12px;

  /* interlignage */
  --body-height: 1.4rem;
}

/* 
=====================================================
    2. Reset & Base Styles
=====================================================
*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: var(--My-black);
}

body {
  background-color: var(--My-gray);
  color: var(--My-black);
  font-size: var(--size-body);
  font-family: var(--font-mono);
}

/* 
=====================================================
    3. Typography & Selection
=====================================================
*/
::selection {
  background-color: var(--My-orange);
  color: var(--My-white);
}

.orange-text {
  color: var(--My-orange);
}

/* 
=====================================================
    4. Navigation Bar
=====================================================
*/

nav {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  padding: 2rem 4rem;
  text-transform: uppercase;
  background-color: var(--My-gray);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  min-width: 1024px;
  white-space: nowrap;
}

nav ul {
  list-style: none;
  display: flex;
}

nav a {
  text-decoration: none;
  color: var(--My-black);
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--My-gray-Text);
}

.nav-link::before {
  content: "[ ";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.3s ease;
}

.nav-link::after {
  content: " ]";
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.nav-link:hover::before {
  transform: translateX(-6px);
}

.nav-link:hover::after {
  transform: translateX(6px);
}

/* Sliding Text Animation */
.nav-text-wrapper {
  display: inline-block;
  height: 1.25em;
  line-height: 1.25em;
  overflow: hidden;
  vertical-align: text-bottom;
  position: relative;
}

.nav-text-slide {
  display: block;
  height: 1.25em;
  line-height: 1.25em;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover .nav-text-slide,
.name:hover .nav-text-slide {
  transform: translateY(-1.25em) rotate(-4deg);
}

/* Button Slide Animation sans rotation */
.btn:hover .nav-text-slide,
.btn-all-projects:hover .nav-text-slide,
.login:hover .nav-text-slide {
  transform: translateY(-1.25em);
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes slide-up {
  0% {
    transform: translateY(45vh) skewY(7deg);
    filter: brightness(2);
    scale: 1.1;
    word-spacing: 10px;
  }
  100% {
    transform: translateY(0) skewY(0);
    filter: brightness(1);
    scale: 1;
    word-spacing: normal;
  }
}
.page-transition-content {
  will-change: transform, filter;
  animation: fade-in 0.5s ease-out forwards,
    slide-up 0.9s cubic-bezier(0.06, 0.77, 0.17, 0.97) forwards;
}

nav > ul:first-child a {
  margin-left: 0;
}

nav ul:nth-child(2) {
  color: var(--My-gray-Text);
  gap: 1.75rem;
}

#time {
  color: var(--My-orange);
  margin-left: 0.5rem;
}

.name {
  display: inline-block;
}

.nav-right-col {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

/* 
=====================================================
    5. Footer
=====================================================
*/
footer {
  width: 100%;
  min-height: calc(100vh - 8.7rem);
  background-color: var(--My-black);
  display: flex;
  flex-direction: column;
  padding: 8rem 4rem 2.5rem 4rem;
  white-space: nowrap;
  position: relative;
  margin-top: calc(8rem + 3.5rem);
}

footer .shape-tab-row {
  position: absolute;
  bottom: 100%;
  margin-bottom: -1px;
  width: 25%;
  right: 0;
  min-width: 300px;
}

footer .tab-content {
  width: calc(100% - 98px);
  background-color: var(--My-black);
  color: var(--My-white);
  border-top: none;
}

.footer-content {
  color: var(--My-white);
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* rempli l'espace disponible */
}

.footer-content a {
  text-decoration: none;
  color: var(--My-white);
}

.footer-content h1 {
  padding-bottom: 4rem;
}

.footer-contact {
  display: flex;
  gap: 1rem;
  border-top: 1px solid var(--My-gray-on-black);
  padding-top: 2rem;
}

.footer-contact .btn:last-child {
  margin-left: auto;
}

.footer-bottom {
  display: flex;
  gap: 2rem;
  margin-top: auto; /* Push to bottom */
}

.footer-bottom p:nth-child(2) {
  margin-left: auto;
}

.login:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* 
=====================================================
    6. Contact Overlay (A4 Card)
=====================================================
*/
.A4 {
  height: calc(100vh - 2rem);
  width: 100%;
  max-width: 800px; /*A4 width (~21cm) */
  padding: 4rem;
  overflow-y: auto; /* scroller a l'intérieur de la carte */
  scrollbar-width: none;

  position: fixed;
  bottom: 0;
  left: 50%;
  translate: -50% 120vh;
  rotate: -15deg;
  transform: scale(1.2);

  transition: translate 0.9s cubic-bezier(1, 0, 0.25, 0.995),
    rotate 1.4s cubic-bezier(0.42, 0, 0.52, 1),
    transform 0.9s cubic-bezier(1, 0, 0.25, 0.995), visibility 0s linear 0.9s;
  background-color: white;
  z-index: 1002;
  border: 1px solid var(--My-gray-Stroke);
  border-bottom: none;
  border-radius: 4px;
  visibility: hidden;
}

.A4.is-open {
  translate: -50% 0%;
  rotate: 0deg;
  transform: scale(1);
  visibility: visible;
  transition: translate 0.9s cubic-bezier(0.07, 0.98, 0.21, 1),
    rotate 1.325s cubic-bezier(0.07, 0.98, 0.21, 1),
    transform 0.9s cubic-bezier(0.07, 0.98, 0.21, 1), visibility 0s linear 0s;
}

.A4 h2 {
  font-family: var(--font-geist);
  font-size: var(--size-subheading);
  font-weight: 500;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Placeholder style */
.form-group input::placeholder,
.form-group textarea::placeholder {
  font-family: var(--font-mono);
  font-size: var(--size-body);
  color: var(--My-gray-Text);
}

/* Hide placeholder on focus */
.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
  color: lightgray;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--My-gray-Stroke);
  font-family: var(--font-geist);
  font-size: var(--size-subheading-2);
  color: var(--My-black);
  border-radius: 0;
  outline: none;
}

#message {
  border: 1px solid var(--My-gray-Stroke);
  border-radius: 4px;
  resize: none;
  margin-top: 2rem;
  padding: 1rem;
  height: 8rem;
  font-family: var(--font-mono);
  font-size: var(--size-body);
}

.contact-form .btn {
  align-self: flex-end;
  margin-top: 1rem;
}

/* 
=====================================================
    7. Helpers
=====================================================
*/
.display-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

/* 
=====================================================
    8. Manual Responsive Breakpoints (Desktop)
=====================================================
*/

/* 1. Ecrans Geants (> 1600px) : On agrandit tout */
@media screen and (min-width: 1600px) {
  :root {
    --size-display: 120px; /* 96px -> 120px */
    --size-heading-contact: 84px; /* 68px -> 84px */
    --size-subheading: 72px; /* 56px -> 72px */
    --size-subheading-2: 32px; /* 24px -> 32px */
    --size-body: 18px; /* 14px -> 18px */
    /* Ajustement espacement lignes geantes */
    --body-height: 1.6rem;
  }
}

/* 2. Petits Laptops (< 1200px) : On reduit un peu pour pas que ca depasse */
@media screen and (max-width: 1200px) {
  :root {
    --size-display: 80px; /* 96px -> 80px */
    --size-heading-contact: 56px; /* 68px -> 56px */
    --size-subheading: 48px; /* 56px -> 48px */
  }
}

@media screen and (max-width: 1200px) {
  :root {
    --size-display: 80px; /* 96px -> 80px */
    --size-heading-contact: 56px; /* 68px -> 56px */
    --size-subheading: 48px; /* 56px -> 48px */
  }
}

@media screen and (max-width: 876px) {
  .work-list-container.container-grid-toggle {
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
  }
}

.input-error {
  border-bottom: 2px solid red !important;
}

#contact-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#contact-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
