/* --- Reset & base --- */
:root {
  --highlight: hsl(270, 30%, 88%);
}

/* --- Progressive loading animations --- */
.page-load-hidden {
  opacity: 0 !important;
  transform: translateY(20px);
  pointer-events: none;
}

.page-load-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding-top: 6.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #000;
  background-color: #fff;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
  padding: 0.1em 0.2em;
  margin: 0 -0.2em;
  background-color: transparent;
  font-family: "Playfair Display", serif;
  font-weight: 300;
}

a:hover {
  text-decoration: none;
  background-color: var(--highlight);
  transition: background-color 1s ease;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 3rem;
  height: 6.5rem;
  min-height: 6.5rem;
  max-width: 1400px;
  margin: 0 auto;
  background-color: transparent;
  box-sizing: border-box;
}

.logo {
  padding: 0;
  margin: 0;
  display: inline-block;
  position: relative;
  line-height: 0;
}

.logo:hover {
  text-decoration: none;
  background-color: transparent;
}

.logo__img {
  display: block;
  height: 33px;
  width: auto;
}

.page--project .header {
  justify-content: space-between;
}

.page--home .nav__link--work,
.page--project .nav__link--work {
  display: none;
}

.page--about .nav__link--work {
  display: none;
}

.nav {
  display: flex;
  gap: 2.5rem;
}

.nav a {
  position: relative;
  padding: 0.1em 0.2em;
  margin: 0 -0.2em;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.125rem, 2vw + 0.5rem, 1.875rem);
  font-weight: 500;
}

.nav a:hover {
  text-decoration: none;
  background-color: transparent;
  color: var(--highlight);
  transition: color 1s ease;
}

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12rem 2rem 12rem;
  min-height: auto;
}

.hero__title {
  margin: 0 0 1.5rem;
  font-family: "Poppins", sans-serif;
  font-size: clamp(2.25rem, 7vw + 0.5rem, 5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.hero__subtitle {
  margin: 0;
  max-width: 60ch;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.05rem, 2.2vw + 0.55rem, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  color: #000;
}

.page--home .hero {
  padding: 5rem 2rem 3rem;
}

/* --- Projects (two projects below hero) --- */
.projects {
  display: flex;
  flex-direction: column;
  gap: 6rem;
  padding: 0 3rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.project__link {
  display: block;
  padding: 0;
  margin: 0;
}

.project__link:hover {
  background-color: transparent;
}

.project__img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

.project__meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: baseline;
  margin-top: 1.5rem;
  font-size: 24px;
}

.project__company {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  text-align: left;
  color: #000;
}

.project__name {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  text-align: center;
  color: #000;
}

.project__date {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  text-align: right;
  color: #000;
}

/* --- Studio layout (identity + cards) --- */
.page--studio {
  padding-top: 0;
}

.studio {
  display: grid;
  grid-template-columns: minmax(260px, 24rem) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 2.25rem 2.5rem 5rem;
  flex: 1;
}

.page--home .studio {
  grid-template-columns: minmax(0, 1fr);
  max-width: 46rem;
  margin-left: 0;
  margin-right: auto;
  gap: 6.75rem;
  padding: 0 max(clamp(1.75rem, 5vw, 4rem), env(safe-area-inset-right, 0px)) 5rem max(clamp(0.875rem, 2.5vw, 2rem), env(safe-area-inset-left, 0px));
}

.page--home .studio__aside {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 0;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) 0 0.75rem;
  background-color: transparent;
}

.page--home .about-panel {
  max-width: none;
  padding-top: 0;
}

.studio__aside {
  position: sticky;
  top: 2.25rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4.5rem);
  padding-bottom: 1rem;
}

.studio__identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.15rem;
}

.studio__title {
  margin: 0.35rem 0 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.85rem, 2.2vw + 0.4rem, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #000;
}

.studio__intro {
  margin: 0;
  max-width: 36ch;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  color: #000;
}

.studio__intro a {
  font-family: "Playfair Display", serif;
  font-weight: 400;
}

.studio__nav {
  margin-top: 2.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.page--home .studio__social {
  margin-top: 2.75rem;
}

.studio__social {
  margin-top: auto;
  padding-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.studio__link {
  padding: 0.1em 0.2em;
  margin: 0 -0.2em;
  font-family: "Poppins", sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.45;
}

.studio__link:hover {
  background-color: transparent;
  color: var(--highlight);
  transition: color 1s ease;
}

.studio__link--current {
  color: #000;
}

.studio__main {
  min-width: 0;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 28rem;
  padding: 0;
  margin: 0;
  border-radius: 2rem;
  overflow: hidden;
  background-color: #f3f2ef;
  color: inherit;
  font-family: inherit;
}

.card:hover {
  background-color: #f3f2ef;
}

.card--visual {
  background-color: #111;
}

.card--visual:hover {
  background-color: #111;
}

.card--visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease;
}

.card--visual:hover img {
  transform: scale(1.035);
}

.card--text {
  padding: 1.75rem 1.85rem 1.6rem;
  transition: background-color 1s ease;
}

.card--text:hover {
  background-color: var(--highlight);
}

.card__go {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  color: #000;
}

.card--text:hover .card__go {
  border-color: rgba(0, 0, 0, 0.45);
}

.card__title {
  margin: 0 2.5rem 1rem 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.5rem, 2vw + 0.6rem, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.card__body {
  margin: 0;
  max-width: 28ch;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.05rem, 1.1vw + 0.7rem, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  color: #3a3a3a;
}

.card__meta {
  margin: auto 0 0;
  padding-top: 2rem;
  font-family: "Playfair Display", serif;
  font-size: 1rem;
  font-weight: 400;
  color: #7a7a7a;
}

.about-panel {
  max-width: 42rem;
  padding-top: 0.35rem;
}

.about-panel__title {
  margin: 0 0 1.5rem;
  font-family: "Poppins", sans-serif;
  font-size: clamp(2rem, 4vw + 0.4rem, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.title-flipboard {
  display: inline-block;
  min-height: 1.15em;
}

.title-flipboard__line {
  display: block;
}

.title-flipboard__cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background-color: currentColor;
  margin-left: 2px;
  vertical-align: baseline;
  animation: blink 1s step-end infinite;
}

.title-flipboard__cursor.hidden {
  display: none;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  50.01%, 100% {
    opacity: 0;
  }
}

.page--studio .about-content__text {
  max-width: none;
}

@media (max-width: 1100px) {
  .studio {
    grid-template-columns: minmax(220px, 20rem) minmax(0, 1fr);
    gap: 2.25rem;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }

  .page--home .studio {
    padding-left: max(clamp(0.875rem, 2.5vw, 2rem), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(1.75rem, 5vw, 4rem), env(safe-area-inset-right, 0px));
  }

  .card {
    min-height: 24rem;
  }
}

@media (max-width: 900px) {
  .studio {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding: 1.35rem 1.35rem 3.25rem;
  }

  .page--home .studio {
    padding: 0 max(clamp(1.75rem, 6vw, 3rem), env(safe-area-inset-right, 0px)) 3.25rem max(clamp(0.875rem, 3vw, 1.5rem), env(safe-area-inset-left, 0px));
  }

  .studio__aside {
    position: static;
    min-height: 0;
    padding-bottom: 0;
  }

  .page--home .studio__aside {
    position: sticky;
    top: 0;
    padding: 1.25rem 0 0.75rem;
  }

  .page--home .footer,
  .page--home.page--studio .footer {
    padding-left: max(clamp(0.875rem, 3vw, 1.5rem), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(1.75rem, 6vw, 3rem), env(safe-area-inset-right, 0px));
  }

  .studio__nav {
    margin-top: 1.75rem;
  }

  .studio__social {
    display: none;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .card {
    min-height: 22rem;
    border-radius: 1.65rem;
  }

  .card--visual {
    min-height: 20rem;
    aspect-ratio: 4 / 3;
  }

  .about-panel__title {
    margin-bottom: 1.15rem;
  }
}

/* --- Gallery (zone images) --- */
.gallery {
  padding: 4rem 3rem 6rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery__placeholder {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #ccc;
  border-radius: 8px;
  color: #666;
  font-size: 0.9375rem;
}

.gallery__placeholder p {
  margin: 0;
}

/* --- Responsive (optionnel pour desktop-first) --- */
@media (max-width: 768px) {
  body {
    padding-top: 4.75rem;
  }

  .header {
    padding: 1rem 1.25rem;
    height: 4.75rem;
    min-height: 4.75rem;
  }

  .logo__img {
    height: 26px;
  }

  .nav {
    gap: 1.25rem;
  }

  .hero {
    padding: 4rem 1.25rem 4rem;
  }

  .page--home .hero {
    padding: 2.5rem 1.25rem 1.75rem;
  }

  .hero__title {
    margin-bottom: 1rem;
    max-width: none;
  }

  .projects {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    gap: 3rem;
  }

  .project__meta {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    text-align: left;
    gap: 0.25rem;
    font-size: clamp(1rem, 3.5vw, 1.25rem);
  }

  .project__name {
    text-align: left;
  }

  .project__date {
    text-align: left;
  }

  .gallery {
    padding: 3rem 1.25rem 4rem;
  }

  .hero--project {
    padding: 5rem 1.25rem 2rem;
  }

  .hero__subtitle--project {
    font-size: clamp(1.15rem, 4vw, 1.75rem);
  }

  .project-hero-image,
  .project-context,
  .project-gallery {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .project-context__text,
  .project-gallery__caption {
    font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  }

  .page--home .footer,
  .page--home.page--studio .footer {
    padding: 2.5rem max(clamp(1.75rem, 6vw, 3rem), env(safe-area-inset-right, 0px)) 2.5rem max(clamp(0.875rem, 3vw, 1.5rem), env(safe-area-inset-left, 0px));
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: clamp(1.85rem, 9.5vw, 2.5rem);
  }

  .card {
    min-height: 20rem;
  }

  .card--visual {
    min-height: 16.5rem;
  }

  .card__title {
    font-size: 1.5rem;
  }
}

/* --- Project page --- */
.hero--project {
  padding: 12rem 2rem 3rem;
}

.hero__title--project {
  margin-bottom: 0.75rem;
}

.hero__subtitle--project {
  font-family: "Playfair Display", serif;
  font-size: 33px;
  font-weight: 400;
}

.project-hero-image {
  padding: 0 3rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.project-hero-media {
  position: relative;
  width: 100%;
}

.project-hero-media [itemscope] {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.project-hero-media__iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.project-hero-image__img {
  width: 100%;
  height: auto;
  display: block;
}

.project-context {
  padding: 0 3rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.project-context__inner {
  max-width: 85ch;
  margin: 0 auto;
}

.project-context__text {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.6;
  color: #000;
  white-space: pre-line;
}

.project-gallery {
  padding: 0 3rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.project-gallery__inner {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.project-gallery__item {
  margin: 0;
}

.project-gallery__img {
  width: 100%;
  height: auto;
  display: block;
}

.project-gallery__caption {
  margin: 0.75rem 0 0;
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: #000;
}

@media (max-width: 768px) {
  .hero--project {
    padding: 8rem 1.5rem 2rem;
  }

  .project-hero-image,
  .project-context,
  .project-gallery {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .project-gallery {
    padding-bottom: 3rem;
  }
}

/* --- About page --- */
.hero--about {
  padding: 6rem 2rem 3rem;
}

.hero__title--about {
  margin-bottom: 0.75rem;
}

.hero__subtitle--about {
  font-family: "Poppins", sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.about-content {
  padding: 0 3rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.about-content__inner {
  max-width: 85ch;
  margin: 0 auto;
}

.about-content__text {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.05rem, 2.2vw + 0.55rem, 1.5rem);
  font-weight: 400;
  line-height: 1.6;
  color: #000;
}

.about-content__text + .about-content__text {
  margin-top: 1.25rem;
}

.about-content__cta {
  margin: 2.5rem 0 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.125rem, 2vw + 0.5rem, 1.5rem);
  font-weight: 500;
  color: #000;
}

.about-content__cta a {
  font-family: "Poppins", sans-serif;
  font-weight: 500;
}

.about-content__image {
  margin: 2.5rem 0 0;
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .hero--about {
    padding: 3.5rem 1.25rem 1.5rem;
  }

  .about-content {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 3rem;
  }

  .footer {
    padding: 2.5rem 1.25rem;
  }

  .footer__copyright {
    font-size: 0.667rem;
  }

  .footer__social {
    gap: 1.5rem;
  }
}

/* --- Footer --- */
.footer {
  margin-top: auto;
  position: relative;
  isolation: isolate;
  overflow: visible;
  background-color: #fff;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer__shader {
  display: none;
}

/* Fallback when WebGL2 is unavailable */
.footer__shader--fallback {
  background:
    linear-gradient(to bottom, #ffffff 10%, transparent 100%),
    linear-gradient(to bottom, #ffffff 0%, var(--highlight) 100%);
  background-color: var(--highlight);
}

.footer__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.page--home .footer,
.page--home.page--studio .footer {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 3rem max(clamp(1.75rem, 5vw, 4rem), env(safe-area-inset-right, 0px)) 3rem max(clamp(0.875rem, 2.5vw, 2rem), env(safe-area-inset-left, 0px));
}

.page--home .footer__content {
  align-items: flex-start;
}

.page--home .footer__social {
  justify-content: flex-start;
}

.footer__copyright {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 0.667rem;
  font-weight: 500;
  color: #000;
}

.footer__social {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

.footer__icon {
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.footer__icon:hover {
  background-color: transparent;
  opacity: 0.8;
}

.footer__icon svg {
  display: block;
  width: 24px;
  height: 24px;
}
