:root {
  --bg: #e7eadf;
  --paper: #fdfbf6;
  --ink: #5f7553;
  --ink-text: #4c6042;
  --ink-soft: #8a9a7b;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--ink-text);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
p, h1 { margin: 0; }

.card {
  position: relative;
  width: min(100%, 440px, calc((100svh - 110px) / 1.6));
  min-width: 280px;
  aspect-ratio: 400 / 640;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(60, 70, 50, .08), 0 18px 40px -18px rgba(60, 70, 50, .35);
  container-type: inline-size;
  overflow: hidden;
}
.layer { position: absolute; inset: 0; }
.layer > svg, .art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* drawing */
.f { fill: var(--paper); stroke: var(--ink); stroke-width: .85; stroke-linejoin: round; }
.h { fill: none; stroke: var(--ink); stroke-width: .5; stroke-linecap: round; }
.hair { stroke-width: .35; }
.k { fill: var(--ink); stroke: none; }
.s { fill: none; stroke: var(--ink); stroke-width: 1.15; stroke-linecap: round; }
.frame { fill: none; stroke: var(--ink-soft); stroke-width: .8; }
.bot { opacity: 0; transform: scale(.15); transform-box: fill-box; transform-origin: center; }
.play .bot { animation: grow .8s cubic-bezier(.2, .8, .3, 1.15) forwards; animation-delay: var(--d); }
.play .draw { animation: draw var(--t, 2s) ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes grow { to { opacity: 1; transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* intro layer */
#intro { cursor: pointer; transition: opacity .7s ease, transform .9s ease; outline: none; }
#intro:focus-visible { box-shadow: inset 0 0 0 2px var(--ink-soft); }
.open #intro { opacity: 0; transform: scale(1.04); pointer-events: none; }
#main { pointer-events: none; }
.open #main { pointer-events: auto; }

/* staggered content */
.content > * { opacity: 0; transform: translateY(6px); }
.open .content > * { animation: rise .9s ease forwards; animation-delay: calc(var(--base, 1.3s) + var(--i, 0) * .2s); }
.content > :nth-child(2) { --i: 1; }
.content > :nth-child(3) { --i: 2; }
.content > :nth-child(4) { --i: 3; }
.content > :nth-child(5) { --i: 4; }
.content > :nth-child(6) { --i: 5; }
.content > :nth-child(7) { --i: 6; }
.content > :nth-child(8) { --i: 7; }
.content > :nth-child(9) { --i: 8; }

.caps { text-transform: uppercase; letter-spacing: .3em; padding-left: .3em; }

/* calendar CTA */
.cta { position: relative; width: 92%; min-height: 10.5cqw; display: grid; place-items: center; }
.cta button, .cta a { font-family: var(--serif); color: var(--ink-text); text-decoration: none; cursor: pointer; }
.cta > button {
  width: 100%;
  padding: 2.6cqw 2cqw;
  background: transparent;
  border: 1px solid var(--ink-soft);
  outline: 1px solid var(--ink-soft);
  outline-offset: 2px;
  font-size: 3.4cqw;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  transition: background .25s, color .25s, opacity .3s;
}
.cta > button:hover, .cta > button:focus-visible { background: var(--ink); color: var(--paper); }
.options {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 1.6cqw;
  opacity: 0; pointer-events: none; transition: opacity .35s ease .1s;
}
.options a { font-size: 3.9cqw; font-style: italic; padding: 1.4cqw 1.6cqw; border-bottom: 1px solid transparent; }
.options a:hover, .options a:focus-visible { border-bottom-color: var(--ink-soft); outline: none; }
.options i { color: var(--ink-soft); font-style: normal; font-size: 3cqw; }
.cta.show > button { opacity: 0; pointer-events: none; }
.cta.show .options { opacity: 1; pointer-events: auto; }

.hint {
  font-size: 13px;
  letter-spacing: .34em;
  padding-left: .34em;
  text-transform: uppercase;
  color: var(--ink-text);
  opacity: 0;
  animation: fade 1s ease var(--hint-delay, 2.6s) forwards, pulse 2.4s ease-in-out calc(var(--hint-delay, 2.6s) + 1s) infinite;
  background: none; border: 0; font-family: var(--serif); cursor: pointer;
}
.opened .hint { animation: none; opacity: 0 !important; pointer-events: none; transition: opacity .4s; }

.back {
  position: fixed; top: 12px; left: 12px;
  font: 400 13px/1 var(--serif); letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; padding: 8px;
}
.back:hover { color: var(--ink-text); }

@media (prefers-reduced-motion: reduce) {
  .bot, .content > * { opacity: 1; transform: none; animation: none !important; }
  .draw { stroke-dashoffset: 0 !important; animation: none !important; }
  .hint { opacity: 1; animation: none; }
}
