/* Fonts */
@font-face {
  font-family: 'Suisse Intl';
  src: url('/assets/fonts/SuisseIntl-Book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Intl';
  src: url('/assets/fonts/SuisseIntl-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Variables */
:root {
  --color-black: #0B0B0B;
  --color-white: #fff;
  --color-placeholder: rgba(11, 11, 11, 0.15);
  --columns: 3;
  --gap: 64px;
  --padding: 64px;
  --transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Text selection */
::selection {
  background: #1C24FF;
  color: #fff;
}

::-moz-selection {
  background: #1C24FF;
  color: #fff;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  background: var(--color-white);
}

body {
  font-family: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  background: var(--color-white);
  color: var(--color-black);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation */
.navigation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 40px;
  height: 144px;
  padding: 0 var(--padding);
  background: var(--color-white);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navigation.hidden {
  transform: translateY(-100%);
}

.navigation nav {
  display: flex;
  gap: 40px;
}

/* Spacer for fixed nav */
.nav-spacer {
  height: 144px;
}

.logo {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.logo img {
  width: 90px;
  height: 20px;
}

/* Logo shimmer effect */
.logo::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 35%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 255, 255, 0.5) 65%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0;
}

/* Shimmer on page load */
.logo.shimmer::after {
  animation: logoShimmer 0.6s linear forwards;
}

/* Shimmer on hover - infinite loop */
.logo:hover::after {
  animation: logoShimmer 0.6s linear infinite;
}

@keyframes logoShimmer {
  0% {
    left: -80%;
    opacity: 1;
  }
  100% {
    left: 180%;
    opacity: 1;
  }
}

.nav-link {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.03em;
  /* Improved contrast: 0.6 instead of 0.5 for better accessibility */
  opacity: 0.65;
  transition: opacity 0.2s ease;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}

.nav-link:hover {
  opacity: 0.9;
}

.nav-link:focus-visible {
  opacity: 0.9;
}

.nav-link:focus:not(:focus-visible) {
  opacity: 0.65;
}

.nav-link-disabled {
  cursor: not-allowed;
  /* Improved contrast for accessibility */
  opacity: 0.55;
}

.nav-link-disabled:hover,
.nav-link-disabled:focus {
  opacity: 0.55;
}

.nav-link-soon {
  font-size: 10px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #1C24FF !important;
  vertical-align: super;
  margin-left: 4px;
  opacity: 1;
}

/* Masonry Grid */
.masonry {
  position: relative;
  width: calc(100% - var(--padding) * 2);
  margin: 0 var(--padding) var(--padding);
  /* Optimisations pour les performances de redimensionnement */
  contain: layout;
}

.item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.93);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity, filter;
}

.item.visible {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.item-link {
  display: block;
  -webkit-user-drag: none;
  transform-origin: center center;
}

.item-link:focus {
  outline: none;
}

.item-link .item {
  position: relative;
  transform: none !important;
}

/* Image */
.image {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.image img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-link:hover .image img,
.item-link:focus-visible .image img {
  transform: scale(1.05);
}

/* Sponsor badge */
.item__sponsor-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-white);
  background: rgba(11, 11, 11, 0.6);
  padding: 0 5px;
}

/* Data */
.data {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 400;
  opacity: 0.4;
  text-transform: uppercase;
}

.description {
  font-family: "EB Garamond", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 28px;
  line-height: 32px;
  letter-spacing: 0;
  color: var(--color-black);
}

/* Loading */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.loading-indicator.visible {
  opacity: 1;
}

.loading-indicator::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-placeholder);
  border-top-color: var(--color-black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 11, 11, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  /* Prevent scroll propagation */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  max-width: 600px;
  width: 100%;
  background: var(--color-white);
  border-radius: 40px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.3s ease-out;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-content {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

.modal-label {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.5);
}

.modal-text {
  font-size: 20px;
  line-height: 30px;
  letter-spacing: -0.03em;
  color: var(--color-black);
}

.modal-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.5);
}

.modal-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Modal buttons */
.modal-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.03em;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.3s ease-out;
}

/* Secondary Button */
.secondaryBtn {
  background: rgba(11, 11, 11, 0.03);
  color: rgba(11, 11, 11, 0.5);
}

.secondaryBtn:hover {
  background: rgba(11, 11, 11, 0.06);
}

.secondaryBtn:active {
  transform: scale(0.97);
}

.modal-btn.secondaryBtn {
  margin-bottom: -12px; /* Reduce gap from 24px to 8px */
}

/* Primary Button */
.primaryBtn {
  background: var(--color-black);
  color: var(--color-white);
}

.primaryBtn:hover {
  opacity: 0.95;
}

.primaryBtn:active {
  transform: scale(0.97);
}

/* Body scroll lock when modal is open */
body.modal-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
  /* top is set dynamically via JS to preserve scroll position */
}

/* Lock all scrollable content when modal is open */
body.modal-open .content,
body.modal-open .masonry,
body.modal-open .navigation {
  pointer-events: none;
}

body.modal-open .modal-overlay {
  pointer-events: auto;
}

/* Load More CTA */
.load-more-cta {
  display: flex;
  justify-content: center;
  margin-top: var(--gap);
  padding: 0 var(--padding);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.load-more-cta.visible {
  opacity: 1;
  transform: translateY(0);
}

.load-more-cta.hidden {
  display: none;
}

.btn-load-more {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.03em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.3s ease-out;
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  margin-top: 120px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.footer.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer Data Section */
.footer-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 64px;
}

.footer-data-left {
  display: flex;
  flex-direction: column;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
}

.footer-logo-img {
  height: 20px;
  width: auto;
  display: block;
}

.footer-btns {
  display: flex;
}

/* Footer Button */
.footer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.footer-btn:hover {
  background: rgba(11, 11, 11, 0.04);
}

.footer-btn span {
  font-family: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  color: #0B0B0B;
  text-transform: uppercase;
}

.footer-btn svg {
  flex-shrink: 0;
}

/* Footer Reassurance */
.footer-reassurance {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.5);
}

/* Footer Newsletter */
.footer-data-right {
  display: flex;
  align-self: flex-start;
}

.footer-newsletter {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 320px;
  height: 40px;
  padding-left: 20px;
  padding-right: 4px;
  background: rgba(11, 11, 11, 0.03);
  border-radius: 20px;
  border: none;
}

.newsletter-input {
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  font-family: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: #0B0B0B;
  outline: none;
}

.newsletter-input::placeholder {
  color: rgba(11, 11, 11, 0.5);
}

.newsletter-btn {
  padding: 0 12px;
  height: 32px;
  border: none;
  border-radius: 16px;
  background: transparent;
  font-family: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: #0B0B0B;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.newsletter-btn:hover {
  background: #ffffff;
  box-shadow: 0 0.5px 1px 0.5px rgba(0, 0, 0, 0.1);
}

/* Footer Bottom Section */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 64px;
  border-top: 1px solid rgba(11, 11, 11, 0.1);
}

.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.5);
}

.footer-separator {
  color: rgba(11, 11, 11, 0.5);
}

.footer-legal {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.5);
  transition: color 0.2s ease;
}

.footer-legal:hover {
  color: rgba(11, 11, 11, 0.8);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.5);
}

.footer-collection-label {
  color: rgba(11, 11, 11, 0.5);
}

.footer-author-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
  height: 32px;
  border: none;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.footer-author-btn:hover {
  background: rgba(11, 11, 11, 0.04);
}

.footer-author-btn:hover span {
  opacity: 1;
  color: #0B0B0B;
}

.footer-author-btn span {
  font-family: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.5);
  transition: opacity 0.2s ease;
}

.footer-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  :root {
    --columns: 2;
    --gap: 40px;
    --padding: 40px;
  }
  
  .navigation {
    height: 120px;
    gap: 32px;
  }
  
  .navigation nav {
    gap: 32px;
  }
  
  .nav-spacer {
    height: 120px;
  }

  .footer-data {
    padding: 40px;
  }

  .footer-bottom {
    padding: 24px 40px;
  }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  :root {
    --columns: 1;
    --gap: 32px;
    --padding: 24px;
  }

  .navigation {
    height: 96px;
    gap: 24px;
  }

  .navigation nav {
    gap: 24px;
  }

  .nav-spacer {
    height: 96px;
  }

  .nav-link {
    font-size: 16px;
  }

  .footer-data {
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px;
  }

  .footer-data-left {
    width: 100%;
    align-items: center;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    height: auto;
    gap: 16px;
  }

  .footer-btns {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-reassurance {
    text-align: center;
  }

  .footer-data-right {
    align-self: center;
    width: 100%;
  }

  .footer-newsletter {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
  }

  .footer-bottom-left {
    order: 2;
  }

  .footer-bottom-right {
    order: 1;
  }
}

/* Legal Page */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--padding) var(--padding);
  padding-bottom: 144px;
}

.legal-card {
  max-width: 600px;
  width: 100%;
  background: var(--color-white);
  border-radius: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border: 1px solid rgba(11, 11, 11, 0.08);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 24px;
  margin-bottom: 0;
  transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              margin-bottom 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-card.visible {
  opacity: 1;
  padding: 24px;
  margin-bottom: 48px;
  max-height: 1000px;
}

.legal-card-content {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

.legal-card-content .modal-label,
.legal-card-content .modal-text {
  visibility: hidden;
  height: 0;
  margin: 0;
  overflow: hidden;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-card-content .modal-label.typing,
.legal-card-content .modal-text.typing {
  visibility: visible;
  height: auto;
}

.legal-card .modal-btn.secondaryBtn {
  margin-bottom: 0;
  opacity: 0;
  filter: blur(12px);
  transform: translateY(16px);
  height: 0;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-card .modal-btn.secondaryBtn.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  height: auto;
  padding: 12px 24px;
}

.legal-title {
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-bottom: 40px;
}

.legal-section {
  margin-bottom: 32px;
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.93);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity, filter;
}

.legal-section.visible {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.legal-section h2 {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-bottom: 12px;
}

.legal-section p {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.7);
  margin-bottom: 8px;
}

.legal-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal-section li {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.03em;
  color: rgba(11, 11, 11, 0.7);
  margin-bottom: 4px;
  padding-left: 16px;
  position: relative;
}

.legal-section li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(11, 11, 11, 0.3);
}

.legal-section a {
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.legal-section a:hover {
  opacity: 0.7;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.03em;
  background: var(--color-black);
  color: var(--color-white);
  margin-bottom: 40px;
  transition: opacity 0.2s ease, transform 0.3s ease-out;
  text-decoration: none;
}

.back-link:hover {
  opacity: 0.95;
}

.back-link:active {
  transform: scale(0.97);
}

/* Responsive - Legal Page */
@media (max-width: 640px) {
  .legal-title {
    font-size: 24px;
    line-height: 32px;
    margin-bottom: 32px;
  }

  .legal-section {
    margin-bottom: 24px;
  }

  .legal-content {
    padding-bottom: 96px;
  }

  .legal-card {
    border-radius: 32px;
    padding: 0 20px;
  }

  .legal-card.visible {
    padding: 20px;
    margin-bottom: 32px;
  }

  .legal-card-content {
    padding: 12px;
    gap: 12px;
  }
}

