/* Flavour, rustic proposal: a used black board, chalk-white handwriting, beige paper and real photos.
   No red. Headings Young Serif, text Vollkorn. Rotations use the separate `rotate` property so the
   entrance movement (`translate`) never cancels them. */
:root {
  --board: #1c1b19;
  --chalk: #f1ece2;
  --text: #d9d0c0;
  --beige: #c6b48f;
  --ink: #2b241c;
  --print: #ece4d6;
  --line: rgba(241, 236, 226, .16);
  --serif: 'Young Serif', Georgia, serif;
  --body: 'Vollkorn', Georgia, serif;
  --gut: clamp(20px, 5vw, 72px);
  --cg: clamp(16px, 2.6vw, 40px);
}
html {
  background: var(--board) url(../img/taulu.webp) 0 0 / 1300px repeat;
  color: var(--text);
  font: 400 clamp(18px, 1rem + .25vw, 21px)/1.55 var(--body);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body { margin: 0; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--chalk); margin: 0; line-height: 1.02; letter-spacing: -.005em; }
p { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--chalk); outline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--chalk); color: var(--ink); padding: 8px 12px; }
html.menu-open body { overflow: hidden; }

/* the real handwritten logo, coloured like chalk */
.logo {
  display: block; aspect-ratio: 2160 / 1407; background: var(--chalk);
  -webkit-mask: url(../logo.svg) center / contain no-repeat; mask: url(../logo.svg) center / contain no-repeat;
}
.top { position: absolute; inset: 0 0 auto; z-index: 5; padding: 22px var(--gut); }
.top .logo { width: clamp(84px, 9vw, 124px); }

/* menu button: a small piece of the board */
.burger {
  position: fixed; top: 16px; right: 16px; z-index: 30; width: 56px; height: 56px; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--board) url(../img/taulu.webp) 40% 30% / 700px;
  border: 1px solid rgba(241, 236, 226, .14); box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.burger svg { width: 32px; fill: none; stroke: var(--chalk); stroke-width: 2.5; stroke-linecap: round; }
.burger .cross, .burger[aria-expanded='true'] .lines { display: none; }
.burger[aria-expanded='true'] .cross { display: inline; }
.menu {
  position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; justify-content: center;
  padding: 90px var(--gut) 60px; background: var(--board) url(../img/taulu.webp) 0 0 / 1300px;
}
.menu[hidden] { display: none; }
.menu a {
  font: 400 clamp(2rem, 1.2rem + 3.6vw, 4.2rem)/1.02 var(--serif); color: var(--chalk);
  text-decoration: none; padding: .24em 0; width: fit-content;
}
.menu a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .14em; }

/* hero: the handwriting and a handful of photos from different places */
.hero {
  min-height: 100svh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(96px, 12vh, 150px) var(--gut) clamp(40px, 7vh, 90px);
}
/* sized by both width and height so the words and all four photos fit the first screen */
.hand {
  --wh: clamp(96px, min(15vw, 21vh), 224px);
  display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: calc(var(--wh) * .16);
  width: min(1240px, 100%); margin: 0 auto; rotate: -2deg;
}
.hand img { height: var(--wh); width: auto; }
.hand .br { flex-basis: 100%; height: 0; }
.hand .w3 { margin: calc(var(--wh) * -.3) 0 0 calc(var(--wh) * .9); }
.hand .w4 { margin-top: calc(var(--wh) * -.3); }
.snaps {
  position: relative; width: min(1240px, 100%); margin: clamp(20px, 3vh, 40px) auto 0;
  height: clamp(260px, min(30vw, 42vh), 430px);
}
.snap {
  position: absolute; background: var(--print); padding: clamp(5px, .6vw, 9px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .5); rotate: var(--r);
}
.s1 { left: 0; top: 14%; width: 31%; }
.s2 { left: 28%; top: 0; width: 18%; }
.s3 { left: 49%; top: 17%; width: 22%; }
.s4 { left: 72%; top: 5%; width: 27%; }

/* the welcome letter on beige paper, with the host's photo clipped to the corner */
.letter { padding: clamp(80px, 12vw, 170px) var(--gut) clamp(40px, 6vw, 90px); display: grid; justify-items: center; }
.sheet {
  position: relative; box-sizing: border-box; width: min(700px, 100%); rotate: -1.2deg;
  background: #ebdfc8 url(../img/paperi.webp) center / cover; color: var(--ink);
  padding: clamp(40px, 7vw, 84px) clamp(26px, 6vw, 76px) clamp(30px, 5vw, 56px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
}
.sheet p { font-size: clamp(1.1rem, 1rem + .45vw, 1.32rem); line-height: 1.6; margin-bottom: .9em; }
.sheet .first {
  font: 400 clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem)/1.12 var(--serif); color: #1f1a14;
  padding-right: min(30%, 190px); margin-bottom: .7em;
}
.portrait {
  position: absolute; top: clamp(-90px, -7vw, -44px); right: clamp(-90px, -6vw, -12px); width: clamp(118px, 30%, 210px);
  background: var(--print); padding: 7px; rotate: 5deg; box-shadow: 0 12px 26px rgba(0, 0, 0, .35);
}
.sign { width: clamp(170px, 42%, 270px); margin: 1.1em 0 0 auto; rotate: -4deg; }

.ask {
  text-align: center; color: var(--beige); font-size: clamp(1.6rem, 1.1rem + 2.4vw, 3rem);
  margin: clamp(56px, 8vw, 120px) var(--gut) 0;
}

/* the four kinds of events, each laid out differently */
.cat { box-sizing: border-box; max-width: 1440px; margin: 0 auto; padding: clamp(56px, 7vw, 110px) var(--gut); }
.nw { white-space: nowrap; }
.cat h2 { font-size: clamp(2.6rem, 1.4rem + 5.4vw, 6.4rem); line-height: .98; max-width: 11em; }
.lede { font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem); line-height: 1.5; max-width: 30em; margin-top: .8em; }
.spots { list-style: none; padding: 0; margin: 1.2em 0 0; }
.spots li { padding: .9em 0; border-top: 1px solid var(--line); }
.spots li:last-child { border-bottom: 1px solid var(--line); }
.spots b {
  display: block; font: 400 clamp(1.35rem, 1.1rem + .8vw, 1.8rem)/1.15 var(--serif); color: var(--chalk); margin-bottom: .2em;
}

.trio { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cg); margin-top: clamp(40px, 6vw, 90px); align-items: start; }
.p1 { grid-column: 1 / 7; grid-row: 1; }
.p2 { grid-column: 8 / 13; grid-row: 1; margin-top: clamp(60px, 12vw, 200px); }
.p3 { grid-column: 5 / 9; grid-row: 2; margin-top: clamp(40px, 6vw, 100px); }
.place img { width: 100%; }
.place h3 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.7rem); margin: .55em 0 .25em; }
.place p { max-width: 26em; }

.meet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cg); }
.meet-text { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cg); align-items: start; }
.meet h2 { grid-column: 1 / 12; font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.8rem); max-width: 14em; }
.meet .lede { grid-column: 1 / 7; }
.meet .spots { grid-column: 8 / 13; margin-top: 1.1em; }
.meet-a { grid-column: 1 / 9; grid-row: 2; margin-top: clamp(40px, 6vw, 90px); }
.meet-b { grid-column: 7 / 13; grid-row: 3; margin-top: -11vw; z-index: 1; box-shadow: 0 20px 44px rgba(0, 0, 0, .5); }

.rooms { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cg); align-items: center; }
.rooms-img { grid-column: 1 / 8; }
.rooms-text { grid-column: 8 / 13; }
.rooms h2 { font-size: clamp(2.2rem, 1.2rem + 3vw, 4.2rem); }

.party { max-width: none; padding-top: 0; }
.party-img { margin: 0 calc(-1 * var(--gut)); position: relative; }
.party-img img { width: 100%; height: min(80vh, 64vw); object-fit: cover; object-position: 50% 40%; }
.party-img::after { content: ''; position: absolute; inset: auto 0 0; height: 50%; background: linear-gradient(rgba(28, 27, 25, 0), rgba(28, 27, 25, .96)); }
.party h2 {
  position: relative; z-index: 1; max-width: 1440px; margin: -.62em auto 0;
  font-size: clamp(3.6rem, 1.6rem + 10vw, 12rem); line-height: .9;
}
.party-text { max-width: 1440px; margin: clamp(20px, 3vw, 40px) auto 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cg); align-items: start; }
.party .lede { grid-column: 1 / 7; margin-top: 0; }
.party .spots { grid-column: 8 / 13; margin-top: 0; }

/* our places, plainly listed */
.places { box-sizing: border-box; max-width: 1440px; margin: 0 auto; padding: clamp(60px, 9vw, 130px) var(--gut); }
.places h2 { font-size: clamp(2.4rem, 1.4rem + 4vw, 5rem); }
.list { list-style: none; padding: 0; margin: clamp(28px, 4vw, 56px) 0 0; }
.list li {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: baseline; gap: 4px 24px;
  padding: clamp(14px, 1.8vw, 24px) 0; border-top: 1px solid var(--line);
}
.list li:last-child { border-bottom: 1px solid var(--line); }
.list a { font: 400 clamp(1.7rem, 1.2rem + 2vw, 3rem)/1.05 var(--serif); color: var(--chalk); text-decoration: none; width: fit-content; }
.list a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }

.contact { padding: clamp(80px, 12vw, 180px) var(--gut); text-align: center; }
.contact h2 { font-size: clamp(2.4rem, 1.3rem + 4.6vw, 5.6rem); max-width: 12em; margin: 0 auto; }
.contact p { max-width: 32em; margin: 1em auto 0; font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); }
.reach { display: flex; flex-direction: column; align-items: center; gap: .2em; }
.reach a { font: 400 clamp(1.8rem, 1.2rem + 2.6vw, 3.4rem)/1.2 var(--serif); color: var(--chalk); text-decoration: none; }
.reach a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }

.foot { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 40px var(--gut) 56px; border-top: 1px solid var(--line); color: var(--beige); }
.foot .logo { width: 64px; }
.foot p { font-size: .95rem; }

/* phones and narrow windows */
@media (max-width: 860px) {
  .hand { --wh: clamp(84px, 33vw, 150px); display: block; }
  .hand img { display: block; }
  .hand .br { display: none; }
  .hand .w2 { margin: calc(var(--wh) * -.32) 0 0 6%; }
  .hand .w3 { margin: calc(var(--wh) * -.32) 0 0 1%; }
  .hand .w4 { margin: calc(var(--wh) * -.32) 0 0 10%; }
  .snaps { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; align-items: start; }
  .snap { position: static; width: auto; }
  .s2 { margin-top: 22px; }
  .s3 { margin-top: -8px; }
  .s4 { margin-top: 12px; }
  .sheet { padding-top: calc(min(34%, 210px) * 1.25 - 40px); }
  .sheet .first { padding-right: 0; }
  .portrait { width: 34%; top: -64px; right: -6px; }
  .trio, .meet, .meet-text, .rooms, .party-text { display: block; }
  .place + .place { margin-top: 56px; }
  .p2 { margin-left: 12%; }
  .p3 { margin-right: 16%; }
  .meet .spots, .party .spots { margin-top: 1.4em; }
  .meet-a { margin-top: 40px; }
  .meet-b { margin: -40px 0 0 22%; position: relative; }
  .rooms-text { margin-top: 36px; }
  .party .lede { margin-top: 0; }
  .party h2 { font-size: 14vw; }
  .contact h2 { font-size: min(8.2vw, 4.4rem); } /* "suunnittelemassa" has to fit on one line */
  .list li { grid-template-columns: 1fr; }
}

/* timed entrances; nothing moves for people who ask the system for less motion */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; translate: 0 80px; transition: opacity 1.2s ease-out var(--d, 0s), translate 1.2s cubic-bezier(.2, .7, .2, 1) var(--d, 0s); }
  .js [data-rise].on { opacity: 1; translate: 0 0; }
  .js .hand img { clip-path: inset(-12% 100% -12% 0); }
  .js.ready .hand img { animation: write .75s cubic-bezier(.45, .05, .35, 1) forwards; animation-delay: calc(.3s + var(--i) * .62s); }
  .js .snap { opacity: 0; translate: 0 70px; }
  .js.ready .snap { animation: drop 1.1s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(2.6s + var(--i) * .2s); }
  .menu:not([hidden]) a { animation: drop .7s cubic-bezier(.2, .7, .2, 1) backwards; }
  .menu a:nth-child(2) { animation-delay: .07s; }
  .menu a:nth-child(3) { animation-delay: .14s; }
  .menu a:nth-child(4) { animation-delay: .21s; }
  .menu a:nth-child(5) { animation-delay: .28s; }
  .menu a:nth-child(6) { animation-delay: .35s; }
  @keyframes write { to { clip-path: inset(-12% 0 -12% 0); } }
  @keyframes drop { from { opacity: 0; translate: 0 70px; } to { opacity: 1; translate: 0 0; } }
}
