/* ==========================================================================
   tbrule.fr — feuille de style principale
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --fg: #ffffff;
  --muted: #a6a6a6;
  --faint: #808080;
  --line: rgba(255, 255, 255, 0.1);
  --surface: #1a1a1a;
  --glass: rgba(255, 255, 255, 0.1);

  --font-main: "Epilogue", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;

  --gutter: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gutter);
  background: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img { width: 41px; height: 29px; object-fit: cover; }

.brand span {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 10px 10px;
}

.menu-toggle__labels {
  height: 16px;
  overflow: hidden;
  font-size: 16px;
  line-height: 16px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-align: right;
}

.menu-toggle__labels span {
  display: block;
  transition: transform 0.5s var(--ease);
}

.menu-toggle__lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: gap 0.4s var(--ease);
}

.menu-toggle__lines i {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--fg);
  transition: transform 0.4s var(--ease);
}

body.menu-open .menu-toggle__labels span { transform: translateY(-100%); }
body.menu-open .menu-toggle__lines { gap: 0; }
body.menu-open .menu-toggle__lines i:first-child { transform: translateY(0.5px) rotate(8deg); }
body.menu-open .menu-toggle__lines i:last-child { transform: translateY(-0.5px) rotate(-8deg); }

/* ---------- Menu overlay ---------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 120px var(--gutter) var(--gutter);
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}

body.menu-open .menu-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease), visibility 0s;
}

.menu-overlay nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-overlay nav li { overflow: hidden; }

.menu-overlay nav a {
  display: inline-block;
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  transform: translateY(100%);
  transition: transform 0.6s var(--ease), color 0.2s;
}

.menu-overlay nav a:hover,
.menu-overlay nav a[aria-current="page"] { color: var(--muted); }

.menu-overlay nav a .serif { text-transform: none; }

body.menu-open .menu-overlay nav a { transform: none; }
body.menu-open .menu-overlay nav li:nth-child(2) a { transition-delay: 0.05s; }
body.menu-open .menu-overlay nav li:nth-child(3) a { transition-delay: 0.1s; }
body.menu-open .menu-overlay nav li:nth-child(4) a { transition-delay: 0.15s; }

.menu-overlay__footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  font-size: 16px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

.lang-switch { display: flex; gap: 12px; }
.lang-switch a[aria-current="true"] { color: var(--fg); }
.lang-switch a:hover { color: var(--fg); }

/* ---------- Layout ---------- */

main { padding-top: 69px; }

.section-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 0 var(--gutter);
}

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 54px;
  max-width: 954px;
  width: 100%;
}

.hero-title img {
  flex: none;
  width: 206px;
  height: 179px;
  object-fit: cover;
}

.hero-title h1 {
  flex: 1;
  font-size: 100px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-align: center;
  text-transform: uppercase;
}


/* Apparition « blur-in » des mots du titre */
.reveal {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px) scale(0.95);
  animation: reveal 0.9s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes reveal {
  to { opacity: 1; filter: blur(0); transform: none; }
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.fade-up.is-visible { opacity: 1; transform: none; }

/* ---------- Ticker ---------- */

.section-ticker {
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 40px 0;
  transform: perspective(1200px) rotateX(20deg) rotateY(20deg);
}

.ticker {
  width: 160%;
  flex: none;
  overflow: hidden;
  opacity: 0;
  animation: fade-in 1.2s var(--ease) 0.4s forwards;
}

@keyframes fade-in { to { opacity: 1; } }

.ticker__track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: ticker 50s linear infinite;
}

.ticker:hover .ticker__track { animation-play-state: paused; }

@keyframes ticker {
  to { transform: translateX(calc(-50% - 10px)); }
}

/* ---------- Cartes projet ---------- */

.project-card {
  position: relative;
  display: block;
  flex: none;
  width: 427px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--surface);
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), filter 0.6s var(--ease);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.project-card:hover .project-card__overlay,
.project-card:focus-visible .project-card__overlay { opacity: 1; }

.project-card:hover img { transform: scale(1.04); filter: blur(2px); }

.h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* ---------- Section « details » ---------- */

.section-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 720px;
  min-height: 80vh;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: center;
}

.section-details .text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-details .h2 { text-wrap: balance; }

.lead {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-wrap: balance;
  font-feature-settings: "ss07" on;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ---------- Boutons (texte qui « roule » au survol) ---------- */

.btn {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  padding: 8px 16px;
  border-radius: 70px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.3s;
}

.btn:hover { background: rgba(255, 255, 255, 0.16); }

.btn__label { display: block; }

.btn__roll {
  position: relative;
  display: block;
  height: 1em;
  overflow: hidden;
}

.btn__roll span {
  display: block;
  transition: transform 0.45s var(--ease);
}

.btn__roll span + span {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  text-align: center;
}

.btn:hover .btn__roll span,
.btn:focus-visible .btn__roll span { transform: translateY(-100%); }

/* ---------- Pages intérieures ---------- */

.page-head {
  padding: 120px var(--gutter) 60px;
  text-align: center;
}

.page-title {
  font-size: clamp(56px, 10vw, 140px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.page-title .serif { text-transform: none; }

.page-head .lead {
  max-width: 640px;
  margin: 24px auto 0;
  color: var(--muted);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter) 120px;
}

.works-grid .project-card { width: 100%; }

.works-grid figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  font-size: 16px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.works-grid figcaption span:last-child { color: var(--faint); }

.works-grid figure { margin: 0; }

/* Étude de cas */
.case-hero {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.case-hero img {
  width: 100%;
  max-height: 80vh;
  object-fit: cover;
}

.case-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.case-body p {
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.case-body .h2 { margin-top: 24px; }

.case-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 40px var(--gutter) 120px;
}

/* Contact */
.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter) 160px;
}

.contact-links .big-link {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s, color 0.3s;
}

.contact-links .big-link:hover { border-color: var(--fg); }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 35px;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

.site-footer nav { display: flex; gap: 20px; }
.site-footer a:hover { color: var(--fg); }

/* ---------- 404 ---------- */

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  min-height: 80vh;
  padding: 0 var(--gutter);
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1199.98px) {
  .hero-title { max-width: 818px; }
  .hero-title h1 { font-size: 80px; }
  .hero-title img { width: 170px; height: 148px; }
  .project-card { width: 340px; }
}

@media (max-width: 809.98px) {
  .site-header .menu-toggle__labels { display: none; }

  .hero-title {
    flex-direction: column;
    gap: 10px;
  }

  .hero-title img { width: 169px; height: 144px; }

  .hero-title h1 {
    display: flex;
    flex-direction: column;
    font-size: 90px;
    line-height: 1.1;
  }

  .hero-title h1 .serif { font-size: 41px; }

  .project-card { width: 260px; }
  .ticker__track { animation-duration: 35s; }

  .section-details .h2 { max-width: 340px; margin: 0 auto; }
  .buttons { flex-direction: column; }
  .lead { font-size: 14px; }
  .btn { font-size: 14px; }

  .works-grid { grid-template-columns: 1fr; }

  .site-footer { padding: 35px var(--gutter); flex-direction: column-reverse; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ticker__track { animation: none; }
}
