@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #111111;
  --ink-2: #1a1917;
  --paper: #f7f5f1;
  --muted: rgba(247, 245, 241, 0.48);
  --gold: #c9ae7a;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mx: 50%;
  --my: 50%;
  --light: 220px;
}

[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
}

body {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Film grain */
#grain {
  position: fixed;
  inset: -50%;
  opacity: 0.06;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: screen;
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-7%, 4%); }
  40% { transform: translate(5%, -6%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(8%, 2%); }
  100% { transform: translate(0, 0); }
}

/* The light that follows you */
.dark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle var(--light) at var(--mx) var(--my),
    rgba(201, 174, 122, 0.08),
    rgba(201, 174, 122, 0.02) 55%,
    transparent 100%
  );
  z-index: 1;
}

.whispers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(circle var(--light) at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, 0.4) 45%, transparent 75%);
  mask-image: radial-gradient(circle var(--light) at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, 0.4) 45%, transparent 75%);
}
.whispers span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 30px);
  color: var(--gold);
  opacity: 0.55;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

/* Frame */
.top,
.bottom {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: max(22px, env(safe-area-inset-top)) clamp(20px, 4vw, 48px) 0;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.bottom {
  padding: 0 clamp(20px, 4vw, 48px) max(22px, env(safe-area-inset-bottom));
}

.socials {
  display: flex;
  gap: 20px;
}
.socials a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}
.socials a:hover,
.socials a:focus-visible {
  color: var(--paper);
}

/* Stage */
.stage {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.mark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(88px, 19vw, 260px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  display: flex;
  align-items: baseline;
}
.mark .name {
  background: linear-gradient(100deg, var(--paper) 0%, var(--paper) 40%, #fff 50%, var(--paper) 60%, var(--paper) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 9s ease-in-out 3s infinite;
}

.stop {
  all: unset;
  cursor: pointer;
  color: var(--gold);
  position: relative;
  padding: 0 0.04em;
  border-radius: 50%;
  animation: pulse 3.2s ease-in-out infinite;
}
.stop::after {
  /* a wider, invisible touch target */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.08em;
  width: 64px;
  height: 64px;
  transform: translate(-50%, 25%);
}
.stop:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

.meaning {
  margin: 14px 0 0;
  max-width: 30ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.meaning .word {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--paper);
}
.meaning .pos {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
}
.meaning em {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--gold);
}

.cta {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.btn {
  display: inline-block;
  padding: 15px 30px;
  border: 1px solid rgba(201, 174, 122, 0.5);
  border-radius: 999px;
  color: var(--paper);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.btn:hover,
.btn:focus-visible {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  outline: none;
}
.hint {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  transition: opacity 0.6s;
}
.hint.gone {
  opacity: 0;
}

/* Entrance */
.reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px);
  animation: in 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) forwards;
}

@keyframes in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes pulse {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(201, 174, 122, 0);
  }
  50% {
    text-shadow: 0 0 28px rgba(201, 174, 122, 0.75);
  }
}
@keyframes sheen {
  0%,
  70% {
    background-position: 100% 0;
  }
  100% {
    background-position: -50% 0;
  }
}

@media (max-width: 560px) {
  .top .coords {
    display: none;
  }
  .bottom {
    flex-direction: column-reverse;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .meaning {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
  .stop,
  #grain,
  .mark .name {
    animation: none;
  }
}
