/* Yumclip : le site. Jetons « Jaune d'œuf » (packages/yumclip_design_system, docs/DESIGN.md). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url(/assets/fonts/bricolage-800.woff2) format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(/assets/fonts/inter-400.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(/assets/fonts/inter-700.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffc62e;
  --surface: #fffdf6;
  --surface-muted: #f5eedc;
  --border: #e9dfc4;
  --ink: #1a1a17;
  --ink-muted: #6b6352;
  --tomato: #ee4b26;
  --tomato-text: #d23a15;
  --chive: #4e9a3a;
  --frame: #1a1a17;
  --frame-edge: #4a4237;
  /* The app's depth, never grey: a caramel contact line, an amber ambient shadow. The app's blur
     radius is a sigma of radius × 0.58 + 0.5; CSS blurs to twice the sigma. */
  --rest: 0 1px 3px rgb(107 58 0 / 0.12), 0 6px 22px rgb(154 106 0 / 0.18);
  --raised: 0 2px 6px rgb(107 58 0 / 0.15), 0 12px 33px rgb(154 106 0 / 0.22);
  /* the phone, held up: the app's floating, longer for its size */
  --phone-shadow: 0 3px 10px rgb(107 58 0 / 0.18), 0 30px 64px -12px rgb(154 106 0 / 0.34);
  --yolk: #ffc62e;
  --yolk-ink: #1a1a17;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --text: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 56px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--ink-muted) transparent;
}

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

body {
  margin: 0;
  background: var(--bg) url(/assets/img/grain.png);
  background-size: 96px;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.028em;
  color: var(--ink);
  text-wrap: balance;
}

p,
ul,
ol {
  margin: 0;
}

p {
  text-wrap: pretty;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 3px;
}

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

::selection {
  background: var(--ink);
  color: var(--bg);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 74rem);
  margin-inline: auto;
}

/* Header and footer */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font: 800 1.5rem/1 var(--display);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.logo img {
  width: 40px;
  height: 39px;
}

.top nav {
  display: flex;
  gap: 8px;
}

.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 16px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--rest);
  font-weight: 700;
  text-decoration: none;
}

.top nav a[aria-current] {
  background: var(--ink);
  color: var(--bg);
}

/* Small phones: the logo and both pills on one line, in every language */
@media (max-width: 400px) {
  .top {
    gap: 10px;
  }

  .logo {
    gap: 8px;
    font-size: 1.375rem;
  }

  .top nav {
    gap: 6px;
  }

  .top nav a {
    padding-inline: 12px;
  }
}

.foot {
  padding-block: 40px 48px;
  font-size: 0.9375rem;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  padding: 0;
  list-style: none;
}

.foot ul a {
  display: inline-block;
  padding-block: 10px;
  font-weight: 700;
}

.foot p {
  margin-top: 12px;
  max-width: 60ch;
}

/* The languages, each named in itself, under a rule */
.langs {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent);
}

.langs > svg {
  flex: none;
  margin-top: 9px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.foot .langs ul {
  gap: 0 2px;
}

.foot .langs a {
  padding: 8px 9px;
  border-radius: 999px;
  font-weight: 400;
  text-decoration: none;
}

.foot .langs a:hover {
  text-decoration: underline;
}

.foot .langs a[aria-current] {
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

/* The phone: drawn in CSS, the screen inside, the cutouts that leave it */

.stage {
  --pw: clamp(212px, 60vw, 290px);
  position: relative;
  width: var(--pw);
  margin: 0 auto;
}

.tilt {
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(1500px) rotateX(calc(var(--ty, 0) * -7deg)) rotateY(calc(var(--tx, 0) * 9deg));
  transition: transform 0.7s var(--ease-out);
}

.phone {
  position: relative;
  padding: calc(var(--pw) * 0.034);
  border-radius: calc(var(--pw) * 0.16);
  background: var(--frame);
  box-shadow: inset 0 0 0 1.5px var(--frame-edge), inset 0 0 0 4px var(--frame), var(--phone-shadow);
}

/* the side button */
.phone::before {
  content: "";
  position: absolute;
  right: -3px;
  top: 24%;
  width: 3px;
  height: 11%;
  border-radius: 0 3px 3px 0;
  background: var(--frame-edge);
}

/* the island */
.phone::after {
  content: "";
  position: absolute;
  top: calc(var(--pw) * 0.064);
  left: 50%;
  width: 29%;
  height: calc(var(--pw) * 0.082);
  border-radius: 999px;
  background: #000;
  translate: -50% 0;
}

/* The screen: the shot (or a clip's poster), the clip over it, in one grid cell. */
.screen {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: calc(var(--pw) * 0.128);
  background: var(--bg);
}

.screen > * {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
}

/* the home indicator, over the shot's last 34 pt */
.screen::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(var(--pw) * 0.019);
  width: 34%;
  height: calc(var(--pw) * 0.012);
  border-radius: 999px;
  background: var(--ink);
  translate: -50% 0;
}

/* A clip: shown once it plays, over its poster */
.screen video {
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.clip.is-on video {
  opacity: 1;
}

/* Its pause and play button (WCAG 2.2.2), on the frame's lower corner */
.play {
  position: absolute;
  z-index: 2;
  right: calc(var(--pw) * -0.05);
  bottom: calc(var(--pw) * 0.1);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--yolk);
  color: var(--yolk-ink);
  box-shadow: var(--rest);
  cursor: pointer;
}

.play[hidden] {
  display: none;
}

.play svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.play .i-play,
.clip.is-paused .i-pause {
  display: none;
}

.clip.is-paused .i-play {
  display: block;
}

/* A cutout starts on its element in the screen, at its size: --x, --y and --w, in phone widths, of
   its box, its soft shadow included (the app's own, rendered with it: nothing drawn over it),
   measured on the 780 × 1688 shot (0.034 + shot px × 0.932 / 780; the cutout is at 3×, the shot
   at 2×). Then it lifts: --dx and --dy past the frame, --f bigger, enough to keep its element
   hidden underneath (no ghost of it beside the cutout). */
.pop {
  position: absolute;
  z-index: 1;
  left: calc(var(--pw) * var(--x));
  top: calc(var(--pw) * var(--y));
  width: calc(var(--pw) * var(--w));
  transform: translate3d(calc(var(--pw) * var(--dx)), calc(var(--pw) * var(--dy)), var(--z, 50px)) rotate(var(--rot)) scale(var(--f));
}

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

/* Accueil: « Ce soir, on cuisine ? », the week since Monday, the first recipe added */
.pop--ce-soir {
  --x: 0.0054;
  --y: 0.4243;
  --w: 0.9894;
  --dx: -0.08;
  --dy: 0.01;
  --f: 1.2;
  --rot: -3deg;
  --z: 80px;
}

.pop--depuis-lundi {
  --x: 0.0308;
  --y: 0.7031;
  --w: 0.936;
  --dx: 0.1;
  --dy: 0.02;
  --f: 1.26;
  --rot: 2.5deg;
}

.pop--recette {
  --x: 0.0269;
  --y: 1.2169;
  --w: 0.4517;
  --dx: -0.06;
  --dy: 0.1;
  --f: 1.42;
  --rot: -5deg;
  --z: 90px;
}

/* Motion: one orchestrated moment on arrival, the hero's cutouts riding out of its screen, each
   one from its element, flat and at its size. Transform only; static under reduced motion. The
   clips of « Comment ça marche » play only while seen, and never by themselves under reduced motion. */
@keyframes leave-screen {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero .pop {
    animation: leave-screen 0.9s var(--ease-out) 0.3s both;
  }

  .hero .pop--depuis-lundi {
    animation-delay: 0.42s;
  }

  .hero .pop--recette {
    animation-delay: 0.54s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tilt {
    transform: none;
    transition: none;
  }
}

/* Hero */

.hero {
  display: grid;
  gap: 44px;
  padding-block: clamp(20px, 5vw, 48px) clamp(84px, 12vw, 120px);
}

.hero h1 {
  font-size: clamp(2.75rem, 11.5vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  max-width: 11ch;
}

.lead {
  margin-top: 20px;
  max-width: 36ch;
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 28px;
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 20px 6px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

.soon img {
  width: 34px;
  height: 33px;
}

.actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

.hero .stage {
  --pw: clamp(212px, 62vw, 300px);
}

/* The egg white: the sheet that holds the scenes, its top edge waving like the app's cards */

.sheet {
  padding-block: clamp(72px, 12vw, 136px);
  background: var(--surface);
}

.sheet,
.yolk {
  position: relative;
}

.yolk {
  background: var(--bg) url(/assets/img/grain.png);
  background-size: 96px;
}

.sheet::before,
.yolk::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 22px;
  background: inherit;
  -webkit-mask: url(/assets/img/vague.svg) repeat-x 0 0 / 520px 22px;
  mask: url(/assets/img/vague.svg) repeat-x 0 0 / 520px 22px;
}

.yolk::before {
  -webkit-mask-position: 330px 0;
  mask-position: 330px 0;
}

.scenes {
  display: grid;
  gap: clamp(96px, 16vw, 168px);
}

.scene {
  display: grid;
  gap: 48px;
  align-items: center;
}

.scene h3 {
  font-size: clamp(2.125rem, 7vw, 3.5rem);
  line-height: 1;
  max-width: 14ch;
}

/* « Comment ça marche »: its title, then the steps, in order, each numbered on a yolk */
.how-head {
  margin-bottom: clamp(64px, 10vw, 112px);
}

.how-head h2 {
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.how-head p {
  margin-top: 16px;
  max-width: 44ch;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  color: var(--ink-muted);
}

.step-n {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--yolk);
  color: var(--yolk-ink);
  font: 800 1.375rem/1 var(--display);
}

.scene p {
  margin-top: 18px;
  max-width: 40ch;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
}

.scene p + p {
  margin-top: 12px;
}

.scene p + p {
  color: var(--ink-muted);
}

/* Prices */

.plans {
  padding-block: clamp(80px, 12vw, 136px) 0;
}

.plans > h2 {
  font-size: clamp(2.125rem, 7vw, 3.5rem);
  line-height: 1;
}

.plan-grid {
  display: grid;
  gap: 20px;
  margin-top: 36px;
}

.plan {
  padding: 26px 24px 28px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--rest);
}

.plan h3 {
  font-size: 1.375rem;
  line-height: 1.2;
  color: inherit;
}

.price {
  margin-top: 10px;
  font: 800 clamp(2.75rem, 9vw, 3.5rem) / 1 var(--display);
  letter-spacing: -0.03em;
}

.price small {
  font: 700 1rem/1 var(--text);
  letter-spacing: 0;
}

.price-alt {
  margin-top: 6px;
  font-weight: 700;
}

.plan ul {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.plan li {
  position: relative;
  padding-left: 30px;
}

.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--chive);
  -webkit-mask: url(/assets/img/coche.svg) center / contain no-repeat;
  mask: url(/assets/img/coche.svg) center / contain no-repeat;
}

.plan--plus {
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--raised);
}

.plan--plus .price {
  color: var(--yolk);
}

.plan--plus ul {
  border-color: rgb(255 253 246 / 0.18);
}

.plan--plus li::before {
  background: var(--yolk);
}

.fine {
  margin-top: 22px;
  max-width: 60ch;
  font-weight: 700;
}

/* Closing */

.close {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-block: clamp(72px, 10vw, 112px) clamp(40px, 6vw, 64px);
  text-align: center;
}

.close img {
  width: 180px;
  height: 180px;
}

.close h2 {
  font-size: clamp(2.125rem, 7vw, 3.5rem);
  line-height: 1;
}

.close p {
  margin-top: 10px;
  max-width: 34ch;
}

.close a {
  font-weight: 700;
}

/* Reading pages: legal texts, help, 404 */

.doc .sheet {
  padding-block: clamp(56px, 9vw, 96px);
}

.prose {
  width: min(100% - 2 * var(--gutter), 44rem);
  margin-inline: auto;
}

.prose h1 {
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1.02;
}

.prose h2 {
  clear: both;
  margin-top: 2em;
  font-size: clamp(1.5rem, 4.4vw, 1.875rem);
  line-height: 1.15;
  scroll-margin-top: 24px;
}

.prose h3 {
  margin-top: 2em;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  scroll-margin-top: 24px;
}

.prose p,
.prose ul,
.prose ol,
.prose table,
.prose blockquote,
.prose figure {
  margin-top: 1em;
}

.prose h2 + p,
.prose h3 + p {
  margin-top: 0.6em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose li::marker {
  color: var(--ink-muted);
  font-weight: 700;
}

.prose a {
  color: var(--tomato-text);
  font-weight: 700;
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin-inline: 0;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--surface-muted);
}

.prose blockquote > :first-child {
  margin-top: 0;
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: 700;
}

.prose code {
  font-size: 0.9em;
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.toc {
  margin-top: 32px;
  padding: 20px 22px 22px;
  border-radius: 26px;
  background: var(--bg);
}

.toc h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.toc ul {
  margin-top: 10px;
  padding-left: 0;
  list-style: none;
}

.toc li + li {
  margin-top: 0;
}

.toc a {
  display: inline-block;
  padding-block: 5px;
  color: var(--ink);
}

.toc ul ul {
  display: none;
}

/* The import sheet, in the same phone as the home page's */
.figure-import {
  --pw: 168px;
  float: right;
  width: var(--pw);
  margin: 0.4em 0 1em 28px;
}

@media (max-width: 559px) {
  .figure-import {
    --pw: 150px;
    float: none;
    margin: 1.4em auto 0;
  }
}

/* Support: the address, as the one thing to touch */
.prose .mail a {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding-inline: 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.prose .mail a:hover {
  text-decoration: underline;
}

.lost {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.lost img {
  width: 160px;
  height: 160px;
}

/* Wider screens */

@media (min-width: 720px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 52rem;
  }

  .plan {
    padding: 32px 32px 34px;
  }
}

@media (min-width: 1024px) {
  .stage {
    --pw: 280px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 6.4vw, 5.75rem);
  }

  .hero .stage {
    --pw: 300px;
  }

  .scene {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
  }

  .scene:nth-child(even) .stage {
    order: -1;
  }
}
