/* Proposition pour Les Bains du Rocher. Caractères et bleu-vert repris du nouveau site des Bains. */

@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-latin-wght-italic.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Jost';
  src: url('/fonts/jost-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --teal: oklch(0.426 0.071 200);
  --teal-deep: oklch(0.323 0.052 215);
  --ink: oklch(0.25 0.038 229);
  --ink-soft: oklch(0.42 0.03 222);
  --ring: oklch(0.654 0.108 197);

  --serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --sans: 'Jost', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.55;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
dl,
dd,
figure {
  margin: 0;
}

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

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--ink);
}
.skip:focus {
  top: 1rem;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h1 {
  max-width: 26ch;
  font-size: clamp(2.25rem, 5.2vw, 4rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2.125rem, 4.6vw, 3.5rem);
  line-height: 1.08;
}

.lead {
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.5vw, 1.3125rem);
  color: var(--ink-soft);
  text-wrap: balance;
}

.terms {
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  color: var(--ink);
  text-wrap: balance;
}

.quiet {
  max-width: 30rem;
  font-size: 1rem;
  color: var(--ink-soft);
  text-wrap: balance;
}

/* 1. Ouverture : le titre, une phrase, le film. */

.opening {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: clamp(3rem, 8vh, 5rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}

.opening .lead {
  max-width: 50rem;
}

.film {
  /* As wide as the page allows while the whole opening still fits in one screen. */
  width: min(100%, 73rem, max(34rem, calc((100svh - 25rem) * 16 / 9)));
  margin-top: clamp(1rem, 3vh, 2rem);
}

.film video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.875rem;
  background: var(--teal-deep);
  box-shadow: 0 2rem 4rem -2rem oklch(0.323 0.052 215 / 0.45);
}

.film figcaption {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

/* Les trois autres écrans. */

.block {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.25rem;
  min-height: 82svh;
  padding: clamp(4.5rem, 12vh, 8rem) var(--gutter);
}

/* 2. La démonstration */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-block: 1rem 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: inset 0 0 0 1.5px var(--teal);
  color: #fff;
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.25;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms var(--ease-out);
}

.button:hover {
  background: var(--teal-deep);
  box-shadow: inset 0 0 0 1.5px var(--teal-deep);
}

.button:active {
  transform: scale(0.98);
}

.button-quiet {
  background: transparent;
  color: var(--teal);
}

.button-quiet:hover {
  background: color-mix(in oklch, var(--teal) 8%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--teal);
}

@media (max-width: 30rem) {
  .actions {
    flex-direction: column;
    align-self: stretch;
    justify-self: stretch;
  }
}

/* 3. La proposition */

.terms {
  display: grid;
  gap: 2rem;
  width: 100%;
  max-width: 66rem;
  margin-block: clamp(1.5rem, 4vh, 3rem) clamp(1rem, 3vh, 2rem);
}

.terms dt {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  line-height: 1.05;
  white-space: nowrap;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
}

.terms dd {
  max-width: 16rem;
  margin: 0.4rem auto 0;
  color: var(--ink-soft);
  text-wrap: balance;
}

@media (min-width: 50rem) {
  .terms {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(2.75rem, 7vh, 4.5rem) 2rem;
  }
}

/* 4. Contact, au-dessus des crêtes. */

.closing {
  padding-bottom: clamp(11rem, 26vw, 19rem);
  background: url('/img/cretes.svg') bottom center / 100% clamp(9rem, 22vw, 17rem) no-repeat;
}

.mail {
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.mail a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 0.04em;
  text-underline-offset: 0.14em;
  text-decoration-color: color-mix(in oklch, var(--teal) 35%, transparent);
  transition: text-decoration-color 160ms ease;
}

.mail a:hover {
  text-decoration-color: var(--teal);
}

.signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
}

/* Entrées en douceur : une fois à l'ouverture, puis chaque écran en arrivant. */

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(1rem);
    }
  }

  .opening > * {
    animation: rise 800ms var(--ease-out) both;
  }
  .opening > .lead {
    animation-delay: 100ms;
  }
  .opening > .film {
    animation-delay: 240ms;
    animation-duration: 1000ms;
  }

  @supports (animation-timeline: view()) {
    .block > * {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
  }
}
