/* dancansayidofor.life */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --soft: #6f6f6f;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --ink: #f4f4f4;
    --soft: #9a9a9a;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

main {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

/* Shown as plain text only if the script cannot run. */
.mark {
  margin: 0;
  font-size: clamp(2rem, 9vw, 6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.mark span {
  display: block;
}

.dates {
  margin: 1.2rem 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  font-weight: 700;
}

.hint {
  display: none;
  position: fixed;
  right: 0;
  bottom: max(3.9rem, calc(env(safe-area-inset-bottom) + 3.15rem));
  left: 0;
  margin: 0;
  padding: 0 1rem;
  color: var(--soft);
  font-size: 0.82rem;
  text-align: center;
}

.hint .touch {
  display: none;
}

@media (hover: none) {
  .hint .mouse {
    display: none;
  }

  .hint .touch {
    display: inline;
  }
}

/* The footer: the date and the two names. */
.foot {
  position: fixed;
  right: 0;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: 0;
  margin: 0;
  padding: 0 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Like the dates line, the small print keeps a patch of paper behind it so anything wandering past goes behind. */
.foot > span,
.hint span {
  padding: 0.1em 0.6em;
  border-radius: 999px;
  background: var(--paper);
}

.foot > span {
  display: inline-block;
}

.foot .when {
  margin-right: 0.6em;
}

.foot .heart {
  margin: 0 0.55em;
  color: #e8456b;
}

.foot .web {
  margin-top: 0.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* The way home from the page for addresses that do not exist. */
.home {
  position: fixed;
  right: 0;
  bottom: max(4.3rem, calc(env(safe-area-inset-bottom) + 3.5rem));
  left: 0;
  margin: 0;
  text-align: center;
}

.home a {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  pointer-events: auto;
}

.home a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

#stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Once the script is running the canvas draws the sign. The heading stays for screen readers. */
.js .mark {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The text layer sits above the canvas and lets every click and touch fall through to it. */
.js main {
  z-index: 2;
  pointer-events: none;
}

/* While a scene is rolling the small print sits on the dark bar at the foot of the frame. */
.foot > span,
.hint span {
  transition: color 0.25s, background-color 0.25s;
}

.js.filming .foot > span,
.js.filming .hint span {
  background: transparent;
  color: var(--paper);
}

/* While Dan has the whole page over his head the words go up with it. */
.js.lifting main {
  transform: translateY(var(--lift, 0px));
}

.js .dates {
  position: fixed;
  top: var(--dates-top, 12%);
  right: 0;
  left: 0;
  margin: 0;
  padding: 0 1rem;
}

/* The one line that matters stays readable: flying letters pass behind it. */
.js .dates span {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background: var(--paper);
}

.js .hint {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .js .hint {
    display: none;
  }
}
