/* ==========================================================================
   Antoine Visonneau — antoineviso.com v2 homepage
   Tokens & textstyles come from tokens.css (load it before this file).
   ========================================================================== */

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--ivory);
  color: var(--black);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

img { display: block; }

/* Desktop-only line break: hidden on mobile, shown at the 768px breakpoint. */
.br-desktop { display: none; }

.label {
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-leading);
  letter-spacing: var(--text-xs-tracking);
  text-transform: uppercase;
  text-align: center;
}

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

.site-header {
  padding-top: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-400);
}

.site-header .logo img { width: 80px; height: 56px; }
.site-header .label { color: var(--strong-grey); letter-spacing: 0.08em; }

/* Hero -------------------------------------------------------------------- */
/* HP-specific sizes ("Display HP" / "Display accent HP" in Figma) — larger
   than the standard Display tokens on both breakpoints. */

.hero {
  text-align: center;
  padding: 0 20px;
  margin-top: var(--space-1600);
}

.hero-title {
  font-size: 44px;
  line-height: 40px;
  letter-spacing: -0.021em;
  max-width: 350px;
  margin: 0 auto;
}

.hero-accent {
  font-size: 36px;
  line-height: 32px;
  letter-spacing: -0.011em;
  margin-top: 10px;
}

/* Case studies ------------------------------------------------------------ */

.cases {
  margin-top: var(--space-1600);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-800);
}

.cases .label { color: var(--black); }

.cases-row {
  display: flex;
  gap: var(--space-400);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cases-row::-webkit-scrollbar { display: none; }
/* Safe centering: keeps first card reachable when the row overflows */
.case-card:first-child { margin-left: auto; }
.case-card:last-child { margin-right: auto; }

.case-card {
  scroll-snap-align: center;
  flex-shrink: 0;
  width: 312px;
  min-height: 312px;
  background: var(--ivory-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-400) var(--space-400) var(--space-600);
  display: flex;
  flex-direction: column;
  gap: var(--space-400);
  color: inherit;
  text-decoration: none;
}

a.case-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* Each linked card morphs into its own case-study hero (transitions.css);
   names must be unique per document, so one per destination. */
a.case-card[href*="content-approval"] { view-transition-name: case-cover; }
a.case-card[href*="card-onboarding"] { view-transition-name: case-cover-onboarding; }
a.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.08);
}

.case-visual {
  position: relative;
  height: 188px;
  width: 100%;
  overflow: hidden;
}
.case-visual img { position: absolute; max-width: none; }

/* Image crops replicated from Figma */
.case-visual--onboarding img { height: 94.38%; width: 100.08%; left: -0.04%; top: 5.62%; }
.case-visual--approval img { height: 206.09%; width: 156.99%; left: -28.46%; top: -7.15%; }
.case-visual--ux { border-radius: var(--radius-sm); }
.case-visual--ux img { height: 379.86%; width: 456.43%; left: -355%; top: -125.07%; }

.case-text { min-height: 84px; }

/* Card titles keep the Mobile/Headline values on every breakpoint */
.case-title {
  font-size: 32px;
  line-height: 32px;
  letter-spacing: -0.021em;
}

/* = Mobile/Headline accent on every breakpoint */
.case-subtitle {
  font-size: 24px;
  line-height: 24px;
  letter-spacing: -0.015em;
}

/* Offers ------------------------------------------------------------------ */

.offers {
  position: relative;
  margin-top: var(--space-1600);
  padding-top: 189px;
  width: 100%;
  max-width: 840px;
}

.offers-photo {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 179px;
  height: 231px;
  object-fit: cover;
  z-index: 1;
}

.offers-panel {
  background: var(--ivory-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-1600) 20px var(--space-800);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1600);
}

.offers-title { text-align: center; }
.offers-title .display {
  font-size: var(--text-headline-size);
  line-height: var(--text-headline-leading);
  letter-spacing: var(--text-headline-tracking);
}
.offers-title .accent {
  font-size: var(--text-headline-accent-size);
  line-height: var(--text-headline-accent-leading);
  letter-spacing: var(--text-headline-accent-tracking);
}

.offer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-800);
  width: 100%;
}

.offer { display: flex; flex-direction: column; gap: var(--space-200); }

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

.offer-head svg { width: 24px; height: 24px; color: var(--coral); flex-shrink: 0; }

.offer-name {
  font-size: 24px;
  line-height: 28px;
  letter-spacing: -0.017em;
}

.offer-text {
  font-size: var(--text-md-size);
  line-height: var(--text-md-leading);
  letter-spacing: var(--text-md-tracking);
  color: var(--strong-grey);
}

/* Clients ----------------------------------------------------------------- */

.clients {
  padding: var(--space-1600) 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1600);
  overflow: hidden;
}

.clients-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-200);
  padding: 0 20px;
}

.clients-text .display {
  font-size: var(--text-headline-size);
  line-height: var(--text-headline-leading);
  letter-spacing: var(--text-headline-tracking);
}

.clients-text p {
  font-size: var(--text-md-size);
  line-height: var(--text-md-leading);
  letter-spacing: var(--text-md-tracking);
}

.marquee { width: 100%; overflow: hidden; position: relative; }

/* Logo fade at the marquee edges: opaque ivory→transparent curtains painted
   over the solid section background. Overlays rather than mask-image because
   Safari mis-renders masks on containers whose children animate via
   transform (same approach as v1 — see OLD/index.html). Width = the gutter
   outside the 840px content column, so the fade vanishes on narrow screens. */
.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  /* Never below the 20px page gutters; grows with the 840px-column gutter */
  width: max(20px, calc((100% - 840px) / 2));
  z-index: 1;
  pointer-events: none;
}
/* Mobile: the whole curtain is gradient (a 70% solid stop over 20px would
   read as a hard edge). Desktop restores the solid+fade profile below. */
.marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--ivory), transparent);
}
.marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--ivory), transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

.logo-set {
  display: flex;
  align-items: center;
  gap: 56px;
  padding-right: 56px;
}

.logo-set img { width: auto; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Contact — component styles live in contact.css. No extra margin: the
   64px above the footer comes from the clients section's bottom padding. */

/* Entrance reveal (light polish) ------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Desktop ≥ 768px (same breakpoint as the textstyles in tokens.css)
   ========================================================================== */

@media (min-width: 768px) {
  .br-desktop { display: inline; }

  .site-header { padding-top: 128px; }

  .hero { padding: var(--space-1600) 20px; margin-top: 0; }

  .hero-title {
    font-size: var(--text-display-size);   /* 72px */
    line-height: var(--text-display-leading);
    letter-spacing: -0.02em;
    max-width: none;
  }

  /* "Display accent HP": 56/58, larger than the standard 44/48 token */
  .hero-accent {
    font-size: 56px;
    line-height: 58px;
    letter-spacing: -0.015em;
    margin-top: 0;
  }

  .cases { margin-top: 0; }
  .cases-row { scroll-snap-type: none; }

  .offers { margin-top: var(--space-1600); }

  .offer-list {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: var(--space-400);
  }

  .offer {
    flex: 1 1 0;
    background: var(--ivory);
    border-radius: var(--radius-lg);
    padding: var(--space-800) var(--space-400) var(--space-400);
    gap: var(--space-800);
  }

  .offer-head { flex-direction: column; justify-content: center; }

  /* = Mobile/Headline values, kept fixed on desktop */
  .offer-name { font-size: 32px; line-height: 32px; letter-spacing: -0.021em; }

  .clients-text { gap: var(--space-400); }

  /* Wide gutters: solid over the outer 70%, fade over the 30% nearest the
     content column (v1 profile). */
  .marquee::before { background: linear-gradient(to right, var(--ivory) 70%, transparent); }
  .marquee::after { background: linear-gradient(to left, var(--ivory) 70%, transparent); }
}
