:root {
  --ink: #4a4743;
  --ink-dim: rgb(74 71 67 / 0.6);
  --base: #9e9a94;
  --tint: #9e9a94;
  --pad-x: clamp(20px, 5vw, 88px);
  --pad-y: clamp(20px, 4.2vh, 44px);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: color-mix(in oklab, var(--tint) 10%, var(--base));
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  transition: background-color 2.4s var(--ease);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Frame */

.top,
.bottom {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--pad-y) var(--pad-x);
  pointer-events: none;
}

.top { top: 0; }
.bottom {
  bottom: 0;
  padding-bottom: max(var(--pad-y), env(safe-area-inset-bottom));
}

.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 1.9vw, 30px);
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1;
}

.role {
  color: var(--ink-dim);
}

.role span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0.5em;
}

/* Click zones sit under everything; the stage lets clicks through */

.zones {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
}

.zone {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  cursor: inherit;
}

/* Stage */

.stage {
  position: fixed;
  inset: calc(var(--pad-y) * 2 + 30px) var(--pad-x);
  z-index: 1;
  pointer-events: none;
}

.stage img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  will-change: opacity, filter, clip-path, transform;
  -webkit-user-drag: none;
}

/* Caption */

.caption {
  display: flex;
  align-items: baseline;
  gap: 1.4em;
  transition: opacity 0.7s var(--ease), filter 0.7s var(--ease);
}

.caption.is-out {
  opacity: 0;
  filter: blur(6px);
}

.title {
  font-family: var(--serif);
  font-size: clamp(20px, 1.6vw, 26px);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}

.date { color: var(--ink-dim); }

.counter {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  font-variant-numeric: tabular-nums;
}

.counter .sep,
#total { color: var(--ink-dim); }

.progress {
  position: relative;
  width: 64px;
  height: 1px;
  margin-left: 1em;
  align-self: center;
  background: rgb(74 71 67 / 0.2);
  overflow: hidden;
}

#bar {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(0);
}

body.is-paused .progress { opacity: 0.35; }

/* Cursor: dot on the exact click point + label beside it, pointer devices only */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.cursor-dot {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.35);
}

.cursor-label {
  position: absolute;
  top: 14px;
  left: 10px;
  white-space: nowrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.cursor.is-flipped .cursor-label {
  left: auto;
  right: 10px;
}

body.has-label .cursor-label { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  body.has-pointer .cursor { opacity: 1; }
}

/* Intro */

.top, .bottom {
  animation: intro 1.6s var(--ease) 0.2s both;
}

@keyframes intro {
  from { opacity: 0; }
}

/* Mobile */

@media (max-width: 640px) {
  .role span { display: block; height: 0; overflow: hidden; }
  .role { text-align: right; line-height: 1.5; max-width: 9em; }
  .stage { inset: 96px 16px 104px; }
  .caption { flex-direction: column; gap: 0.6em; }
  .progress { width: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

/* Contact */

.to-contact {
  position: relative;
  pointer-events: auto;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0 0 3px;
  cursor: inherit;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: right bottom;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease);
}

/* Generous hit area around the small label */
.to-contact::before {
  content: '';
  position: absolute;
  inset: -16px -20px;
}

.to-contact:hover {
  background-size: 100% 1px;
  background-position: left bottom;
}

.contact {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.2vh;
  text-align: center;
}

.contact-kicker { color: var(--ink-dim); }

.contact-mail {
  pointer-events: auto;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(38px, 8.4vw, 150px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-mail .line { display: block; white-space: nowrap; }

/* Letters develop one by one, like a print in the tray */
.contact-mail .ch {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transition:
    opacity 1.4s var(--ease),
    filter 1.4s var(--ease),
    font-style 0.01s allow-discrete;
  transition-delay: calc(var(--i) * 45ms + 350ms);
}

.contact.is-on .contact-mail .ch {
  opacity: 1;
  filter: blur(0);
}

/* On hover the address stands upright, letter by letter */
.contact-mail:hover .ch {
  font-style: normal;
  transition-delay: calc(var(--i) * 18ms);
}

.contact-copy {
  pointer-events: auto;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--ink-dim);
  background: none;
  border: 0;
  cursor: inherit;
  transition: color 0.4s var(--ease);
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 2.4em;
}

.contact-ig {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.4s var(--ease);
}

.contact-ig svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  transition: transform 0.6s var(--ease);
}

.contact-ig svg .fill {
  fill: currentColor;
  stroke: none;
}

.contact-ig:hover { color: var(--ink); }
.contact-ig:hover svg { transform: rotate(-8deg); }

.contact-copy:hover,
.contact-copy.is-done { color: var(--ink); }

@media (max-width: 640px) {
  .top .role { display: none; }
  .contact-mail { font-size: 11.5vw; }
}
