/* Sophie Vendeville, book launch page. Colours sampled from the cover art. */

@font-face {
  font-family: "Shantell Sans";
  src: url("fonts/ShantellSans-400-800.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/Literata-normal-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --slate: #4E7598;
  --slate-deep: #2F4A63;
  --water: #99AEC3;
  --mustard: #ECC468;
  --blossom: #DF9F9A;
  --ink: #22364A;
  --white: #FFFFFF;
  --tint-water: #E8EEF4;
  --tint-blossom: #F9EAE8;
  --tint-mustard: #FBF1D9;
  --hand: "Shantell Sans", "Comic Sans MS", cursive;
  --book: "Literata", Georgia, serif;
  --wrap: 1180px;
}

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

html { scroll-padding-top: 88px; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--white);
  color: var(--ink);
  font-family: var(--book);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  font-family: var(--hand);
  font-weight: 700;
  line-height: 1.02;
  margin: 0;
  color: var(--ink);
}

p { margin: 0 0 1em; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
}
.skip:focus { top: 12px; }

/* ---------- Buttons: inked rectangles, pressed like a stamp ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--book);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--mustard { background: var(--mustard); }
.btn--slate { background: var(--slate); color: var(--white); }

/* ---------- Top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tint-water);
}
.bar__in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.bar__name {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.bar__nav { display: flex; gap: 26px; }
.bar__nav a {
  font-size: 16px;
  text-decoration: none;
  padding: 8px 0;
  background: linear-gradient(var(--mustard), var(--mustard)) 0 88% / 0 5px no-repeat;
  transition: background-size .2s ease-out;
}
.bar__nav a:hover,
.bar__nav a[aria-current],
.bar__name:hover { background-size: 100% 5px; }
.bar__name {
  background: linear-gradient(var(--mustard), var(--mustard)) 0 100% / 0 4px no-repeat;
  transition: background-size .2s ease-out;
}
.bar__name:active,
.bar__nav a:active,
.foot a:active { translate: 0 1px; }
.lang:active,
.menu-btn:active { translate: 1px 1px; }
.menu-btn:hover { background: var(--tint-water); }
.bar__end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bar__buy { min-height: 44px; font-size: 16px; padding: 0 16px; white-space: nowrap; }

.lang {
  min-width: 44px;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--book);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.lang:hover { background: var(--tint-water); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 64px 24px 104px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 72px;
  align-items: center;
}
.hero__book { position: relative; justify-self: center; width: min(400px, 100%); }
.hero__cover {
  position: relative;
  z-index: 2;
  width: 100%;
  border-radius: 2px 6px 6px 2px;
  transform: rotate(-2.5deg);
  box-shadow:
    0 34px 50px -24px rgba(34, 54, 74, .5),
    0 2px 6px rgba(34, 54, 74, .18),
    inset 4px 0 0 rgba(0, 0, 0, .05);
}
.hero__head { position: relative; padding-right: 128px; min-height: 104px; margin-bottom: 28px; }
.hero h1 { font-size: clamp(42px, 4.8vw, 68px); }
.hero__text p { max-width: 60ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 28px 0 40px; }

/* ---------- Pieces cut from the cover ---------- */

.piece { position: absolute; pointer-events: none; user-select: none; }
.piece--dog {
  z-index: 3;
  width: 96px;
  right: -26px;
  top: -34px;
  --r: 9deg;
  filter: drop-shadow(0 8px 12px rgba(34, 54, 74, .28));
}
.piece--stamp { width: 104px; top: -18px; right: 0; --r: -10deg; }
.piece { transform: rotate(var(--r, 0deg)); }

/* The one big moment: the drawings stick on, one after another. */
@media (prefers-reduced-motion: no-preference) {
  .hero__cover { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero .piece { animation: stick .55s cubic-bezier(.3, 1.5, .5, 1) both; }
  .piece--stamp { animation-delay: .7s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px) rotate(-2.5deg); }
  to { opacity: 1; transform: translateY(0) rotate(-2.5deg); }
}
@keyframes stick {
  from { opacity: 0; transform: scale(.35) rotate(calc(var(--r, 0deg) - 18deg)); }
  to { opacity: 1; transform: scale(1) rotate(var(--r, 0deg)); }
}

/* ---------- Chapters, as stickers ---------- */

.chapters {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 24px 120px;
  text-align: center;
}
.note {
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  color: var(--slate);
  margin: 0 0 6px;
  transform: rotate(-2deg);
  display: inline-block;
}
.note--light { color: var(--mustard); }
.chapters h2, .author h2, .guide h2, .contact h2 { font-size: clamp(34px, 3.8vw, 50px); }
.stickers {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 28px;
  text-align: left;
}
.sticker {
  position: relative;
  border: 7px solid var(--white);
  border-radius: 18px;
  padding: 24px 22px 22px;
  box-shadow: 0 0 0 1px rgba(34, 54, 74, .08), 0 14px 26px -16px rgba(34, 54, 74, .45);
  transform: rotate(var(--tilt, 0deg));
}
.sticker:nth-child(1) { --tilt: -1.6deg; }
.sticker:nth-child(2) { --tilt: 1.2deg; }
.sticker:nth-child(3) { --tilt: -.6deg; }
.sticker:nth-child(4) { --tilt: 1.8deg; }
.sticker:nth-child(5) { --tilt: 1deg; }
.sticker:nth-child(6) { --tilt: -1.4deg; }
.sticker:nth-child(7) { --tilt: 1.5deg; }
.sticker:nth-child(8) { --tilt: -.9deg; }
.sticker--blossom { background: var(--tint-blossom); }
.sticker--water { background: var(--tint-water); }
.sticker--mustard { background: var(--tint-mustard); }
.sticker svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--slate);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sticker h3 {
  margin: 16px 0 8px;
  font-size: 19px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--slate-deep);
}
.sticker p { font-size: 16px; line-height: 1.55; margin: 0; }

/* ---------- Author ---------- */

.author {
  background: var(--slate-deep);
  color: var(--white);
  padding: 112px 24px 96px;
}
.author h2 { color: var(--white); margin-bottom: 28px; }
.author :focus-visible { outline-color: var(--mustard); }
.author__in {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 80px;
  align-items: start;
}
.author__text p { max-width: 62ch; }
.print {
  position: relative;
  margin: 12px 0 0;
  background: var(--white);
  padding: 14px 14px 56px;
  transform: rotate(2.2deg);
  box-shadow: 0 30px 40px -24px rgba(0, 0, 0, .55);
}
.print__tape {
  position: absolute;
  z-index: 2;
  top: -18px;
  left: 50%;
  width: 132px;
  height: 36px;
  margin-left: -66px;
  background: rgba(236, 196, 104, .88);
  transform: rotate(-5deg);
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 55%, 100% 82%, 97% 100%, 2% 96%, 0 70%, 4% 45%, 0 18%);
}
.route {
  list-style: none;
  max-width: var(--wrap);
  margin: 88px auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  position: relative;
}
.route::before {
  content: "";
  position: absolute;
  top: 9px;
  left: calc(100% / 14);
  right: calc(100% / 14);
  border-top: 2px dashed rgba(255, 255, 255, .45);
}
.route li {
  position: relative;
  text-align: center;
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.route li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: var(--blossom);
  border: 3px solid var(--white);
}
.route li:last-child::before { background: var(--mustard); }
.route strong { font-family: var(--hand); font-weight: 600; font-size: 19px; line-height: 1.2; }
.route span { font-size: 15px; color: rgba(255, 255, 255, .82); }

/* ---------- Un livre, pas un guide ---------- */

.guide {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 128px 24px 150px;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 88px;
  align-items: center;
}
.guide__book { position: relative; justify-self: center; width: min(300px, 100%); }
.guide__cover {
  width: 100%;
  border-radius: 2px 6px 6px 2px;
  transform: rotate(3deg);
  box-shadow: 0 30px 44px -22px rgba(34, 54, 74, .5), 0 2px 6px rgba(34, 54, 74, .18);
}
.guide h2 { margin-bottom: 24px; }
.guide__text p { max-width: 60ch; }
.guide__text .btn { margin-top: 16px; }

/* ---------- Contact band, the skyline stands on it ---------- */

.contact {
  position: relative;
  background: var(--mustard);
  padding: 96px 24px 104px;
  text-align: center;
}
.contact__city {
  position: absolute;
  bottom: 100%;
  right: max(24px, calc(50% - 560px));
  width: 160px;
  pointer-events: none;
}
.contact h2 { margin-bottom: 20px; }
.contact p { max-width: 46ch; margin: 0 auto 36px; font-size: 19px; }

/* ---------- Footer ---------- */

.foot {
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
}
.foot__in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 36px 24px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
}
.foot__in p { margin: 0; }
.foot nav { display: flex; gap: 24px; }
.foot a { text-decoration: none; padding: 6px 0; }
.foot a:hover { text-decoration: underline; text-decoration-color: var(--mustard); text-underline-offset: 5px; }
.foot :focus-visible { outline-color: var(--mustard); }
.foot__name {
  margin: 0;
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(28px, 10.6vw, 170px);
  line-height: .8;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-align: center;
  color: var(--slate);
  transform: translateY(.12em);
}

/* ---------- Motion: preloader, glide, reveals, switches ---------- */

/* Preloader, first visit only: her Songdo stamp presses onto the page, then lifts away. */
.veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  place-items: center;
  background: var(--white);
  pointer-events: none;
}
.pre .veil[hidden] { display: grid; animation: veil-out .35s ease-in .7s forwards; }
.veil img { width: 132px; height: auto; }
.pre .veil img { animation: stamp-press .5s cubic-bezier(.3, 1.4, .5, 1) .05s both; }
@keyframes stamp-press {
  from { opacity: 0; transform: scale(1.7) rotate(-22deg); }
  60% { opacity: 1; transform: scale(.92) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(-10deg); }
}
@keyframes veil-out { to { opacity: 0; visibility: hidden; } }
.pre .hero__cover { animation-delay: .9s; }
.pre .piece--stamp { animation-delay: 1.6s; }

/* Menu links glide to their section. The room for the sticky bar is html's scroll-padding-top. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Scroll reveals: motion.js marks what starts below the screen and lifts it in. */
.js .rv { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .js .sticker.is-in .piece--dog { animation: stick .55s cubic-bezier(.3, 1.5, .5, 1) .35s both; }
}

/* Phone menu button, hidden on wide screens. */
.menu-btn,
.lang--menu { display: none; }

/* ---------- Smaller screens ---------- */

@media (max-width: 1080px) {
  .stickers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 40px; }
  .route::before { display: none; }
}

@media (max-width: 900px) {
  .hero, .guide, .author__in { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .hero { padding-top: 56px; }
  .hero__book { width: min(300px, 74%); }
  .author__in .print { width: min(320px, 80%); justify-self: center; }
  .guide { padding-top: 96px; padding-bottom: 170px; }
  .guide__book { width: min(240px, 62%); }
}

@media (max-width: 719px) {
  body { font-size: 17px; }
  .bar__in { gap: 12px; padding: 10px 16px; }
  .bar__name { font-size: 16px; }
  .bar__buy { font-size: 14px; padding: 0 10px; }
  .bar__end .lang { display: none; }
  .menu-btn {
    display: grid;
    place-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
  }
  .menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .25s cubic-bezier(.3, 1.3, .5, 1);
  }
  .bar.is-open .menu-btn span:first-child { transform: translateY(4px) rotate(45deg); }
  .bar.is-open .menu-btn span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .bar__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 20px 22px;
    background: var(--white);
    border-bottom: 2px solid var(--ink);
    box-shadow: 0 18px 30px -18px rgba(34, 54, 74, .35);
    visibility: hidden;
    opacity: 0;
    translate: 0 -8px;
    transition: opacity .2s ease-out, translate .25s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .25s;
  }
  .bar.is-open .bar__nav { visibility: visible; opacity: 1; translate: 0 0; transition-delay: 0s; }
  .bar__nav a {
    font-family: var(--hand);
    font-weight: 700;
    font-size: 24px;
    padding: 6px 0;
    opacity: 0;
    translate: -10px 0;
    transition: opacity .25s ease-out, translate .3s cubic-bezier(.2, .7, .2, 1), background-size .2s ease-out;
  }
  .bar.is-open .bar__nav a { opacity: 1; translate: 0 0; }
  .bar.is-open .bar__nav a:nth-child(2) { transition-delay: .05s, .05s, 0s; }
  .bar.is-open .bar__nav a:nth-child(3) { transition-delay: .1s, .1s, 0s; }
  .lang--menu { display: block; margin-top: 10px; }
  .hero { padding: 48px 20px 80px; gap: 48px; }
  .piece--dog { width: 84px; right: -14px; top: -30px; }
  .hero__head { padding-right: 96px; min-height: 84px; }
  .hero h1 { font-size: clamp(34px, 10.4vw, 42px); }
  .piece--stamp { width: 76px; top: -10px; }
  .chapters { padding: 16px 20px 96px; }
  .stickers { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .author { padding: 88px 20px 80px; }
  .route { grid-template-columns: minmax(0, 1fr); row-gap: 0; margin-top: 64px; }
  .route li { text-align: left; padding: 0 0 26px 40px; }
  .route li::before { left: 0; margin-left: 0; top: 4px; }
  .route li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 26px;
    bottom: 2px;
    border-left: 2px dashed rgba(255, 255, 255, .45);
  }
  .guide { padding: 88px 20px 200px; }
  .contact__city { width: 120px; right: 20px; }
  .contact { padding: 80px 20px 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar__nav, .bar__nav a, .menu-btn span { transition: none !important; }
}

@media (max-width: 380px) {
  .bar__in { gap: 8px; padding: 10px 12px; }
  .bar__end { gap: 8px; }
  .bar__name { font-size: 16px; white-space: normal; width: min-content; line-height: .95; }
  .bar__buy { font-size: 13px; padding: 0 8px; }
}
