:root {
  --pure-black: #0a0a0a;
  --pure-white: #fff;
  --japan-red: #d1001f;
  --low-grey: #7a7a7a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  scroll-behavior: smooth;
}

body {
  background-color: var(--pure-white);
  color: var(--pure-black);
}

header {
  position: sticky;
  z-index: 1000;
  top: 0;

  background-color: var(--pure-white);
  border-bottom: 1px solid var(--low-grey);
  box-shadow: 0px 4px 4px rgba(10, 10, 10, 0.75);
  padding: 0.5rem;
}

header img {
  width: 50px;
  border-radius: 10px;
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

main {
  max-width: 1400px;
  margin: 4rem auto;
  padding: 0 2rem;
}

section {
  margin-bottom: 3rem;
}

h2 {
  font-weight: 500;
  margin-bottom: 1rem;
}

/* ===== Header ===== */

.whoAmI {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.text {
  display: flex;
  flex-direction: column;
}

.secondary-text {
  color: var(--low-grey);
}

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

a {
  text-decoration: none;
  color: var(--pure-black);
}

.link-btn {
  border: 2px solid var(--pure-black);
  border-radius: 10px;
  background-color: var(--pure-black);
  color: var(--pure-white);

  padding: 0.75rem;
}

.link-btn:hover {
  box-shadow: 4px 4px 4px rgba(10, 10, 10, 0.75);
  transition: 300ms ease-in-out;
}

/* ===== Présentation ===== */

.intro {
  font-size: 2rem;
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.intro img {
  width: 400px;
  border-radius: 50%;
}

.intro h3 {
  font-weight: normal;
}

.hr-image {
  border: none;
  width: 300px;
  height: auto;
  position: relative;
}

.hr-image::before {
  content: "";
  display: block;
  height: 20px;
  background-image: url("./assets/japan-waves.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

#landing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

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

#main-title {
  font-family: "Montserrat", sans-serif;
  font-size: 3rem;
}

.presentation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2em;
  font: inherit;
  line-height: 1;
}

.download-btn {
  border: 2px solid var(--japan-red);
  border-radius: 10px;
  background-color: var(--pure-white);
  color: var(--pure-black);
  padding: 0.75rem;
  cursor: pointer;
}

.download-btn:hover {
  box-shadow: 4px 4px 4px rgba(10, 10, 10, 0.75);
  transition: 300ms ease-in-out;
}

/* ===== Technologies ===== */

.techs {
  background-color: var(--pure-black);
  color: var(--pure-white);
  border-radius: 16px;
  padding: 2rem;

  display: grid;
  grid-template-columns: auto 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: 1.25rem;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.techs img {
  width: 50px;
  height: 50px;
  grid-column: 1;
  grid-row: 1;
}

.techs .name {
  grid-column: 2;
  grid-row: 1;
  align-self: center;

  font-size: 1.25rem;
  font-weight: 600;
}

.techs > p {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
}

.techs .stack {
  grid-column: 1/3;
  grid-row: 2;

  color: var(--pure-black);
  background-color: var(--pure-white);

  box-sizing: content-box;
  border: 2px solid var(--pure-white);
  border-radius: 10px;
  width: auto;
  padding: 1rem;

  display: flex;
  flex-direction: column;
  gap: 1em;
}

.techs .outils {
  background-color: transparent;
  border: 2px solid var(--japan-red);
  border-radius: 10px;
  width: auto;
  padding: 1rem;

  display: flex;
  flex-direction: column;
  gap: 1em;
}

.techs .hero-title {
  color: var(--low-grey);
}

.techs .hero-desc {
  font-weight: bold;
}

.techs hr {
  grid-column: 1/-1;
  width: 100%;
  background-color: var(--low-grey);
  opacity: 0.4;
}

.techs .signature {
  grid-column: 1/-1;
}

.techs .signature span {
  color: var(--japan-red);
}

/* ===== Compétences ===== */

#competences .hero-competences {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1rem;
}

#competences article {
  border: 1px solid var(--low-grey);
  border-radius: 10px;

  padding: 2em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: auto;
}

#competences article h3 {
  font-weight: normal;
  color: var(--low-grey);
  font-size: 1em;
}

#competences article p {
  font-weight: bold;
}

/* ===== Projets ===== */

#projets .hero-projets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1rem;
}

.hero-projets article {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--low-grey);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.hero-projets article hr {
  margin: 10px 0px;
}

.hero-projets article p {
  flex-grow: 1;
  color: var(--low-grey);
  margin-bottom: 1rem;
}

.hero-projets .presentation-btn {
  margin-top: auto;
}

.hero-projets article video,
.hero-projets article img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1rem;
}

.download-btn.is-disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
}

/* ===== Parcours ===== */

.timeline {
  position: relative;
  margin-top: 2rem;
  padding-left: 2rem;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--low-grey);
  opacity: 0.4;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--pure-white);
  border: 2px solid var(--japan-red);
}

.timeline time {
  font-size: 0.85rem;
  color: var(--low-grey);
}

.timeline .content {
  border: 2px solid var(--low-grey);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover .content {
  transform: translateX(4px);
  box-shadow: 4px 4px 8px rgba(10, 10, 10, 0.15);
}

.jobs,
.studies {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.city {
  font-style: italic;
  color: var(--low-grey);
  font-size: 0.9rem;
}

[role="tooltip"] {
  background-color: var(--pure-black);
  color: var(--pure-white);
  border: 1px solid var(--pure-black);
  visibility: hidden;
  position: absolute;
  box-shadow: 0px 4px 8px rgba(10, 10, 10, 0.5);

  top: -2rem;
  left: 20rem;

  padding: 0.5rem 1rem;
  border-radius: 10px;
  opacity: 0;

  width: 50%;
  transition: 0.5s;
}

.timeline-item:hover [role="tooltip"],
.timeline-item:focus-visible [role="tooltip"] {
  opacity: 1;
  visibility: visible;
}

/* ===== Contact ===== */

.hero-contact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  gap: 2rem;
}

.hero-contact article {
  border: 2px solid var(--low-grey);
  border-radius: 10px;
  padding: 1.5rem;
  width: 100%;
  margin-top: 10px;

  display: flex;
  flex-direction: column;
  gap: 1rem;

  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-contact article:hover {
  box-shadow: 4px 4px 8px rgba(10, 10, 10, 0.25);
  transform: translateY(-2px);
}

.hero-contact h3 {
  font-weight: 500;
  color: var(--low-grey);
}

.hero-contact a {
  font-weight: bold;
  color: var(--pure-black);
  word-break: break-word;
}

.hero-contact a:hover {
  color: var(--japan-red);
  text-decoration: none;
}

/* =========================
   ≤ 1024px — tablette / laptop
   ========================= */
@media (max-width: 1024px) {
  main {
    margin: 2rem auto;
  }

  #landing {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .intro {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .intro img {
    margin: 0 auto;
    width: 300px;
  }

  #competences .hero-competences {
    grid-template-columns: 1fr;
    row-gap: 1rem;
  }

  #projets .hero-projets {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 1.5rem;
  }

  #parcours .experiences {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================
   ≤ 768px — tablette / mobile
   ========================= */
@media (max-width: 768px) {
  header nav {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  #main-title {
    font-size: 2.2rem;
  }

  .presentation-btn {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .techs {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .techs img,
  .techs .name,
  .techs > p {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
  }

  .techs .stack,
  .techs .outils {
    width: 100%;
  }

  #projets .hero-projets {
    grid-template-columns: 1fr;
  }

  #parcours .experiences {
    grid-template-columns: 1fr;
  }
}

/* =========================
   ≤ 480px — mobile
   ========================= */
@media (max-width: 480px) {
  main {
    padding: 0 1rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  #main-title {
    font-size: 1.8rem;
  }

  .intro img {
    width: 220px;
  }

  .link-btn,
  .download-btn {
    width: 100%;
    text-align: center;
  }

  .hr-image {
    width: 100%;
  }
}

/* ===== Burger button ===== */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.burger span {
  width: 24px;
  height: 2px;
  background-color: var(--pure-black);
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===== Mobile menu ===== */
@media (max-width: 768px) {
  .burger {
    display: flex;
  }

  nav ul {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--pure-white);
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;

    transform: translateY(-200%);
    transition: transform 0.3s ease;
  }

  nav.is-open ul {
    transform: translateY(0);
  }

  /* Burger animation */
  nav.is-open .burger span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
  }

  nav.is-open .burger span:nth-child(2) {
    opacity: 0;
  }

  nav.is-open .burger span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
  }
}
