@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --jaune: #ffd21f;
  --encre: #16131c;
  /* encre posée sur le jaune, pour le texte secondaire : reste au-dessus de 4.5:1 */
  --encre-douce: #3d3424;
  --gutter: clamp(1rem, 4vw, 4.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: only light;
}

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

html {
  background: var(--jaune);
  color: var(--encre);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--jaune);
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--encre);
  color: var(--jaune);
}

:focus-visible {
  outline: 3px solid var(--encre);
  outline-offset: 5px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ mise en page */

.page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "copy sign";
  column-gap: clamp(1.5rem, 4vw, 5rem);
  padding: var(--gutter);
  background: var(--jaune);
  overflow: hidden;
}

.copy {
  grid-area: copy;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-block: 2rem;
}

/* ------------------------------------------------------------------ le signe */

.sign {
  grid-area: sign;
  align-self: center;
  justify-self: start;
  /* Plus large que sa colonne, mais avec une vraie marge à droite : couper le bras du ب
     rend le signe illisible, et le frôler fait accidentel. 47vw le garde loin de la phrase. */
  width: min(88vh, 47vw);
  margin-left: calc(var(--gutter) * -0.6);
  padding: 0;
  border: 0;
  background: none;
  color: var(--encre);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sign:focus-visible {
  outline-offset: -2px;
  border-radius: 50%;
}

.sign__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: currentColor;
}

.sign__a,
.sign__mouth {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.sign__a {
  transform-origin: 50% 100%;
}

/* ------------------------------------------------------------------ le texte */

.wordmark {
  margin: 0 0 clamp(2.5rem, 7vh, 4.5rem);
  line-height: 0;
}

.wordmark__svg {
  display: block;
  width: clamp(7.5rem, 11vw, 11rem);
  height: auto;
  overflow: visible;
  fill: var(--encre);
}

.wordmark__dot {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* Les titres gardent la coupe « display » du logotype, quelle que soit leur taille. */
.hook,
.contact__mail {
  font-optical-sizing: none;
  font-variation-settings: "opsz" 96;
}

.hook {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.6rem, 1.2rem + 4.4vw, 5.75rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hook__line {
  display: block;
}

.about {
  max-width: 34ch;
  margin: clamp(1.25rem, 3vh, 2rem) 0 0;
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem);
  color: var(--encre-douce);
  text-wrap: pretty;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: clamp(2rem, 6vh, 3.5rem);
}

.contact__mail {
  font-weight: 800;
  font-size: clamp(1.375rem, 1rem + 1.3vw, 2.125rem);
  letter-spacing: -0.02em;
  color: var(--encre);
  text-decoration-line: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
  transition: text-decoration-thickness 0.25s var(--ease-out), text-underline-offset 0.25s var(--ease-out);
}

.contact__mail:hover {
  text-decoration-thickness: 0.2em;
  text-underline-offset: 0.12em;
}

.contact__copy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem 0.5rem 0.875rem;
  border: 2px solid var(--encre);
  border-radius: 999px;
  background: transparent;
  color: var(--encre);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.contact__copy:hover {
  background: var(--encre);
  color: var(--jaune);
}

.contact__copy:active {
  transform: scale(0.96);
}

.contact__icon {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* ------------------------------------------------------------------ téléphone */

@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "sign"
      "copy";
    align-content: center;
    padding: var(--gutter);
    padding-top: max(var(--gutter), env(safe-area-inset-top));
    padding-bottom: max(var(--gutter), env(safe-area-inset-bottom));
  }

  /* Sur téléphone, le signe est limité par la largeur de l'écran (390 px ≈ 35vh de haut) :
     plus grand, il faudrait le couper des deux côtés. Sur tablette, il grandit jusqu'à 58svh. */
  .sign {
    justify-self: start;
    width: min(100%, 58svh);
    margin: 0;
  }

  .copy {
    align-self: start;
    padding-block: 1.5rem 0;
  }

  .wordmark {
    margin-bottom: 1.5rem;
  }

  .wordmark__svg {
    width: clamp(6.5rem, 18vw, 9rem);
  }
}

/* Petits téléphones : l'adresse et le bouton doivent tenir sans défiler. */
@media (max-width: 760px) and (max-height: 700px) {
  .sign {
    width: min(100%, 33svh);
  }

  .copy {
    padding-top: 1rem;
  }

  .wordmark {
    margin-bottom: 1rem;
  }

  .about {
    margin-top: 0.75rem;
  }

  .contact {
    margin-top: 1.25rem;
    gap: 0.5rem 1rem;
  }
}

/* ------------------------------------------------------------------ ouverture
   La classe .intro est posée dans le <head> seulement si l'animation est permise.
   Elle masque la page le temps que main.js lance l'ouverture (et se retire seule
   au bout de 2,5 s si le script ne vient pas). */

html.intro,
html.intro body {
  background: var(--encre);
}

html.intro .page {
  clip-path: circle(0 at 75% 50%);
}

html.opening,
html.opening body {
  background: var(--encre);
}

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