:root {
  --ink: #050505;
  --paper: #fcf9f4;
  --wool: #ffffff;
  --nav: 4.25rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.lang {
  display: flex;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang button {
  padding: 0;
  border: 0;
  background: none;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.site-nav {
  position: fixed;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  height: var(--nav);
  padding: 0 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid rgba(5, 5, 5, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.site-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-mark {
  position: relative;
  width: 3.5rem;
  height: 2.7rem;
  flex: none;
  overflow: hidden;
}

.nav-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.site-nav .links {
  display: flex;
  gap: 1.75rem;
}

.site-nav .links a.is-current {
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.site-nav .lang {
  margin-left: auto;
}

.opening {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 4.5rem 1.5rem 4rem;
}

.opening .lang {
  position: absolute;
  top: 1.35rem;
  right: 1.5rem;
}

.sheep {
  position: relative;
  width: min(68vh, 34rem, 86vw);
}

.sheep-still {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}

.sheep-moving {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  visibility: hidden;
}

.sheep.is-moving .sheep-moving {
  visibility: visible;
}

.sheep.is-moving .sheep-still {
  visibility: hidden;
}

.wordmark {
  width: min(78vw, 36rem);
  margin-top: 1.75rem;
  opacity: 0;
}

.wordmark img {
  display: block;
  width: 100%;
  height: auto;
}

.opening.is-settled .wordmark,
.opening.is-reduced .wordmark {
  opacity: 1;
}

/* Le mot apparaît en fondu (0,4 s). */
.opening.is-settled .wordmark {
  transition: opacity 0.4s ease-in-out;
}

.caret {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-left: -2.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
}

.caret::before {
  content: "";
  box-sizing: border-box;
  width: 1.6rem;
  height: 1.6rem;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: translateY(-0.45rem) rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .opening.is-settled .caret::before {
    animation: caret-bounce 3s 1.1s infinite;
  }
}

/* Deux rebonds, le second plus petit (1 s), puis 2 s de pause. */
@keyframes caret-bounce {
  0% {
    translate: 0 0;
    animation-timing-function: ease-out;
  }
  10% {
    translate: 0 -0.9rem;
    animation-timing-function: ease-in;
  }
  20% {
    translate: 0 0;
    animation-timing-function: ease-out;
  }
  27% {
    translate: 0 -0.5rem;
    animation-timing-function: ease-in;
  }
  33.333%,
  100% {
    translate: 0 0;
  }
}

.opening.is-settled .caret,
.opening.is-reduced .caret {
  opacity: 1;
  visibility: visible;
}

/* Le caret arrive 0,3 s après la fin du fondu du mot (0,4 s + 0,3 s). */
.opening.is-settled .caret {
  transition: opacity 0.4s ease 0.7s, visibility 0s linear 0.7s;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.section {
  width: min(40rem, calc(100% - 3rem));
  margin: 0 auto;
  padding: 5.5rem 0 1rem;
}

.section h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.section p {
  margin: 0 0 1.35rem;
}

.subtitle {
  margin-top: -0.8rem;
  font-weight: 600;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(5, 5, 5, 0.28);
  border-radius: 2px;
  background: transparent;
}

.contact-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.contact-form button {
  justify-self: start;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.site-footer {
  width: min(40rem, calc(100% - 3rem));
  margin: 0 auto;
  padding: 3rem 0 2.5rem;
}

.site-footer p {
  margin: 0 0 0.35rem;
}

@media (max-width: 720px) {
  .site-nav {
    gap: 0.75rem;
    padding: 0 0.9rem;
    font-size: 0.92rem;
  }

  .site-nav .links {
    gap: 0.8rem;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: 0.45rem;
    padding: 0 0.7rem;
    font-size: 0.8rem;
  }

  .site-nav .links,
  .lang {
    gap: 0.45rem;
  }
}
