/* velkom.app teaser. One sentence, one red box, one moving field.
   Display: Jost Black Italic (Futura lineage, Life-style box) with
   EB Garamond Italic for the lead-in. Labels: system monospace, figure-card
   corners. Both fonts SIL OFL, self-hosted. */

@font-face {
  font-family: "Jost";
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url("/fonts/jost-latin-900-italic.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/eb-garamond-latin-500-italic.woff2") format("woff2");
}

:root {
  --ink: #0b0b0b;
  --paper: #f4f1ea;
  --red: #e4002b;
  --mute: rgba(244, 241, 234, 0.64);
  --hair: rgba(244, 241, 234, 0.16);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --edge: max(18px, 2.4vmin);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

body {
  font-family: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

#hyper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Fine dot grid, like a drawing sheet. */
.dots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(244, 241, 234, 0.13) 0.6px, transparent 1.1px);
  background-size: 22px 22px;
  background-position: 11px 11px;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 18%, #000 75%);
  mask-image: radial-gradient(ellipse at center, transparent 18%, #000 75%);
}

/* Film grain, so the black never looks flat. */
.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 8vmin 6vmin;
  pointer-events: none;
}

.ask {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-align: left;
}

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

.line-1 {
  font-family: "EB Garamond", "Garamond", "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 7.6vw, 8.6rem);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.06em;
  padding-left: 0.06em;
}

.line-2 {
  font-size: clamp(3rem, 13.2vw, 15rem);
}

/* The Life-style box: solid red, white type, tight to the letters. */
.mark {
  display: inline-block;
  background: var(--red);
  color: #fff;
  padding: 0.04em 0.2em 0.1em 0.08em;
  margin-right: 0.06em;
  letter-spacing: -0.05em;
  box-shadow: 0 0 0 0.02em var(--red), 0 0.06em 0.6em rgba(228, 0, 43, 0.35);
}

/* Entrance */
.line { opacity: 0; transform: translateY(0.35em) skewX(-6deg); animation: rise 0.9s cubic-bezier(.16, 1, .3, 1) forwards; }
.line-1 { animation-delay: 0.15s; }
.line-2 { animation-delay: 0.32s; }
.mark { clip-path: inset(0 100% 0 0); animation: wipe 0.7s cubic-bezier(.77, 0, .18, 1) 0.6s forwards; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes wipe { to { clip-path: inset(-0.3em -0.4em -0.3em -0.2em); } }

/* Figure-card corners: small monospace labels at the four corners. */
.corner {
  position: fixed;
  z-index: 3;
  font: 400 0.78rem/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--mute);
  pointer-events: none;
  opacity: 0;
  animation: rise 0.8s ease 1.1s forwards;
}
.corner.tl { top: var(--edge); left: var(--edge); }
.corner.tr { top: var(--edge); right: var(--edge); font-variant-numeric: tabular-nums; }
.corner.bl { bottom: var(--edge); left: var(--edge); }
.corner.br { bottom: var(--edge); right: var(--edge); }
.corner .num {
  display: inline-block;
  min-width: 1.3em;
  color: var(--paper);
  margin-right: 0.9em;
  text-align: center;
  transition: transform 0.45s cubic-bezier(.7, 0, .2, 1), color 0.3s;
}
.corner .num.bump { animation: bump 0.45s cubic-bezier(.2, 1.6, .4, 1); color: #fff; }
.corner .num.turn { transform: rotate(90deg) scale(1.25); color: var(--red); }
.corner .num.flat { font-size: 1.35em; line-height: 0.8; vertical-align: -0.08em; }
@keyframes bump { 0% { transform: scale(1.9); color: var(--red); } 100% { transform: scale(1); } }
.corner.tr #readout { color: var(--paper); }
.corner.tl::before, .corner.tr::before, .corner.bl::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 0.8em;
  vertical-align: 0.1em;
}

/* Pause control (moving content must be pausable). */
.controls { display: flex; gap: 1.4em; }
.motion {
  pointer-events: auto;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  padding: 0.35em 0;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.motion:hover { color: var(--paper); border-color: var(--mute); }
.motion:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; color: var(--paper); }

/* ------------------------------------------------ singularity stage */
#hyper { touch-action: none; }
body.collapsing .dots { opacity: 0.35; transition: opacity 1.5s; }
body.space .grain { opacity: 0.08; }
body.space main { visibility: hidden; }
body.space .ask { position: absolute; }

/* After the collapse the corners return. */
body.hud .corner { animation: rise 0.9s ease 0.1s forwards; }

.caption {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 70%;
  width: min(34rem, 86vw);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.caption p { margin: 0; }
.caption-label {
  font: 400 0.7rem/1 var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.9rem !important;
}
.caption-line {
  font-family: "EB Garamond", Garamond, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  line-height: 1.2;
  color: var(--paper);
}
.caption.show .caption-label { animation: fadeUp 0.9s ease both; }
.caption.show .caption-line { animation: fadeUp 1.2s ease 0.35s both; }

.card {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: calc(var(--edge) + 2.6rem);
  width: min(30rem, 88vw);
  transform: translateX(-50%);
  padding: 1rem 1.2rem 1.1rem;
  background: rgba(11, 11, 11, 0.72);
  border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.card::before, .card::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--red);
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.card p, .card h2 { margin: 0; }
.card-meta {
  font: 400 0.66rem/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.6rem !important;
}
.card-title {
  font-weight: 900;
  font-style: italic;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem !important;
}
.card-text {
  font-family: "EB Garamond", Garamond, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.3;
  color: rgba(244, 241, 234, 0.85);
}
.card.show { animation: cardIn 0.6s cubic-bezier(.16, 1, .3, 1) both; }
.card.show .card-meta { animation: fadeUp 0.5s ease 0.1s both; }
.card.show .card-title { animation: wipeIn 0.7s cubic-bezier(.77, 0, .18, 1) 0.15s both; }
.card.show .card-text { animation: fadeUp 0.7s ease 0.35s both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(0.6em); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translate(-50%, 1.2rem) scale(0.97); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes wipeIn { from { clip-path: inset(-0.2em 100% -0.2em -0.1em); } to { clip-path: inset(-0.2em -0.4em -0.2em -0.1em); } }

/* Invisible buttons over each drop and structure, for keyboard users. */
.hits { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.hit {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
}
.hit:focus-visible { outline: 2px solid var(--red); outline-offset: 6px; }

/* ---------------------------------------------------------- theatre */
/* The film takes one half of the screen, with no frame: its edges fade
   into the dark. The featured structure sits in the other half. */
.theatre {
  --fw: min(46vw, 860px, calc((100vh - 18rem) * 16 / 9));
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.theatre .frame {
  position: absolute;
  top: 50%;
  width: var(--fw);
  transform: translateY(-50%);
  pointer-events: auto;
}
.theatre.right .frame { left: calc(75vw - var(--fw) / 2 - 1.5vw); }
.theatre.left .frame { left: calc(25vw - var(--fw) / 2 + 1.5vw); }
/* The finale: centred and larger. */
.theatre.center { --fw: min(66vw, 1080px, calc((100vh - 17rem) * 16 / 9)); }
.theatre.center .frame { left: 50%; transform: translate(-50%, -50%); }
.theatre.center .reel-film { -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent); }
.reel-film {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
  mask-composite: intersect;
}
.theatre p, .theatre h2, .theatre h3 { margin: 0; }
.reel-copy {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 0 1.8rem;
  margin-top: 0.4rem;
  padding: 0 4%;
}
.reel-meta, .reel-when {
  font: 400 0.66rem/1.3 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.45rem !important;
}
.theatre.future .reel-meta, .theatre.future .reel-when { color: #7fd4ff; }
.reel-when { color: var(--mute); }
.reel-title {
  font-weight: 900;
  font-style: italic;
  font-size: clamp(1.7rem, 2.8vw, 2.7rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem !important;
}
.reel-moment {
  font-weight: 900;
  font-style: italic;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem !important;
}
.reel-line, .reel-text {
  font-family: "EB Garamond", Garamond, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.32;
  color: rgba(244, 241, 234, 0.85);
}
.reel-next {
  margin-top: 0.6rem !important;
  font-weight: 900;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.15;
  color: #fff;
}
.reel-next::before { content: ""; display: inline-block; width: 1.4em; height: 2px; background: var(--red); margin-right: 0.5em; vertical-align: 0.3em; }
.reel-actions {
  display: flex;
  gap: 1.2em;
  margin-top: 1rem;
  padding: 0 4%;
  font: 400 0.7rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--mute);
}
.theatre.show .reel-film { animation: filmIn 1s cubic-bezier(.16, 1, .3, 1) both; }
.theatre.show .reel-title { animation: wipeIn 0.7s cubic-bezier(.77, 0, .18, 1) 0.25s both; }
.theatre.show .reel-meta, .theatre.show .reel-line { animation: fadeUp 0.7s ease 0.35s both; }
.theatre.show .reel-b, .theatre.show .reel-actions { animation: fadeUp 0.9s ease 1.4s both; }
@keyframes filmIn { from { opacity: 0; transform: scale(0.94); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

@media (max-width: 760px), (orientation: portrait) and (max-width: 1000px) {
  .theatre .frame {
    top: calc(var(--edge) + 1.6rem);
    left: var(--edge);
    right: var(--edge);
    width: auto;
    transform: none;
    max-height: 62vh;
    overflow: auto;
  }
  .reel-copy { grid-template-columns: 1fr; padding: 0; }
  .reel-b { margin-top: 0.6rem; }
  .reel-actions { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .theatre.show, .theatre.show * { animation: none !important; }
  .caption.show *, .card.show, .card.show * { animation: none !important; }
  .grain { animation: none; }
  .line, .mark, .corner { animation: none; opacity: 1; transform: none; clip-path: none; }
}

@media (max-width: 640px) {
  .line { white-space: normal; }
  .corner { font-size: 0.62rem; }
  .corner.bl { max-width: 52vw; }
  .card { bottom: calc(var(--edge) + 3.6rem); padding: 0.8rem 0.9rem 0.9rem; }
  .card-text { font-size: 1rem; }
}

/* ------------------------------------------------------ quiet stage */
/* Empty corners disappear, and so do the counters once the stage opens. */
.corner:empty, .corner.bl:empty { display: none; }
body.hud .corner.tr { display: none; }
.card-meta:empty, .reel-meta:empty { display: none; }

/* Readability: upright text for anything longer than a line. */
.card-text, .reel-text {
  font-style: normal;
  font-weight: 400;
  font-size: 1.12rem;
  line-height: 1.42;
  color: rgba(244, 241, 234, 0.9);
}
.reel-line, .caption-line { font-size: 1.14rem; line-height: 1.35; }
.caption-line { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.reel-meta, .reel-when { font-size: 0.72rem; letter-spacing: 0.16em; }
.reel-actions { font-size: 0.78rem; }
.reel-next { font-size: 1.12rem; }
@media (max-width: 640px) {
  .corner { font-size: 0.7rem; }
  .card-text, .reel-text { font-size: 1.04rem; }
}

/* Cards without a box, like the theatre: text on a soft shadow. */
.card {
  background: radial-gradient(ellipse at center, rgba(11, 11, 11, 0.75), rgba(11, 11, 11, 0) 72%);
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 1.6rem 2rem;
  text-align: center;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}
.card::before, .card::after { display: none; }

/* The infinity sign: a quiet link once the stage is open. On hover it turns
   back into the 8 it came from. */
.corner .num { font: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; }
.corner .num:disabled { cursor: default; }
body.hud .corner.tl .num:not(:disabled) { pointer-events: auto; cursor: pointer; }
body.hud .corner.tl .num:not(:disabled):hover { color: var(--red); transform: rotate(90deg); }
.corner .num:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
