/* The front door (public/gate/index.html). One dark screen: the hall, the lit board, a few words.
   The picture's geometry here is mirrored by gate.js, which reads the picture's own box to place the lamps. */
@font-face {
  font-family: "Vaultless Dot";
  src: url("/fonts/vaultless-dot.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Vaultless Dot Display";
  src: url("/fonts/vaultless-dot-display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  --night: #050506;
  --cream: #efe8d8;
  --cream-2: #a9a79e;
  --cream-3: #77756d;
  --gold: #e9b45c;
  --rule: rgba(239, 232, 216, 0.16);
  --board-at: 44; /* where the board's middle sits on a tall screen, in hundredths of its height */
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gate {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  isolation: isolate;
}

/* ---- the hall ---- */
.hall {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--night);
}
.hall img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 114%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  animation: hall-in 1.2s ease-out both;
}
.hall canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* light adds to the picture: the lamps bloom over the brass and the floor instead of sitting on them */
  mix-blend-mode: screen;
}
/* the room breathing with the lamps: one soft pool of amber over the board, moved by opacity only */
.breath {
  position: absolute;
  left: var(--bx, 50%);
  top: var(--by, 50%);
  width: var(--bw, 60vw);
  aspect-ratio: 2.6;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 150, 50, 0.2), rgba(255, 130, 40, 0.07) 55%, transparent);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
.lit .breath {
  animation: breathe 5.5s ease-in-out infinite;
}
.scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, rgba(5, 5, 6, 0.8) 42%, var(--night) 86%);
  pointer-events: none;
}
@keyframes hall-in {
  from {
    opacity: 0;
  }
}
@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* a tall screen: the tall picture as wide as the screen, the board near the middle, the floor fading to night */
@media (max-aspect-ratio: 118/100) {
  .hall img {
    left: 0;
    bottom: auto;
    top: min(0px, calc(var(--board-at) * 1vh - 94.1vw));
    top: min(0px, calc(var(--board-at) * 1svh - 94.1vw));
    width: 100%;
    height: auto;
    object-fit: fill;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 99%);
    mask-image: linear-gradient(to bottom, #000 70%, transparent 99%);
  }
  .scrim {
    height: 46%;
    background: linear-gradient(to bottom, transparent, rgba(5, 5, 6, 0.74) 40%, var(--night) 84%);
  }
}
/* a short phone: the board higher, the words closer together */
@media (max-aspect-ratio: 118/100) and (max-height: 700px) {
  :root {
    --board-at: 34;
  }
  .foot {
    gap: 9px;
    padding-top: 14px;
  }
  .line {
    font-size: 16px;
  }
}
@media (min-width: 900px) {
  .line br {
    display: none;
  }
  .fine {
    max-width: 120ch;
  }
}

/* ---- words ---- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(22px, env(safe-area-inset-top)) clamp(18px, 4vw, 44px) 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cream);
}
.word {
  font-family: "Vaultless Dot", "Geist Mono", monospace;
  font-weight: 900;
  font-size: 23px;
  letter-spacing: -0.01em;
  text-transform: lowercase;
}
.soon {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-2);
  padding: 9px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(5, 5, 6, 0.45);
}
.soon i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px 2px rgba(240, 160, 60, 0.7);
  animation: breathe 2.4s ease-in-out infinite;
}

.say {
  align-self: end;
  text-align: center;
  padding: 0 20px;
}
/* the headline is the board itself; these words are for readers that cannot see it, and for a browser with no script */
.say h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.line {
  margin: 0;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.4;
  font-weight: 500;
  color: var(--cream);
  text-wrap: balance;
}
.x {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  background: linear-gradient(#f6f0e2, #e3dccb);
  color: #15140f;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 8px 24px rgba(0, 0, 0, 0.5);
}
.x[hidden] {
  display: none;
}
.x:hover {
  filter: brightness(1.05);
}

.foot {
  display: grid;
  justify-items: center;
  gap: 11px;
  padding: 18px clamp(18px, 4vw, 44px) max(20px, env(safe-area-inset-bottom));
  text-align: center;
}
.eco {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 34px;
}
.eco-i {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eco-w {
  font-size: 12px;
  color: var(--cream-2);
  white-space: nowrap;
}
.eco img {
  display: block;
}

.door {
  font-size: 13px;
  color: var(--cream-3);
}
.door summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: underline;
  text-decoration-color: rgba(239, 232, 216, 0.25);
  text-underline-offset: 4px;
}
.door summary::-webkit-details-marker {
  display: none;
}
.door summary:hover,
.door[open] summary {
  color: var(--cream-2);
}
.door form {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.door input {
  width: min(240px, 58vw);
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(5, 5, 6, 0.7);
  color: var(--cream);
  font: 500 15px "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  outline: none;
}
.door input:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(233, 180, 92, 0.22);
}
.door button {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--cream);
  font: 600 14px "Geist", system-ui, sans-serif;
  cursor: pointer;
}
.door button:hover {
  border-color: var(--cream-2);
}
.no {
  margin: 10px 0 0;
  color: #f0a488;
}
.fine {
  margin: 0;
  max-width: 76ch;
  font-size: 11px;
  line-height: 1.5;
  color: var(--cream-3);
  text-wrap: balance;
}
.fine.tm {
  font-size: 10px;
  margin-top: -8px;
}
summary:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* no script: the board cannot light, so the headline stands in the hall as type */
@media (scripting: none) {
  .say h1 {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    white-space: normal;
    margin: 0 0 18px;
    font: 800 clamp(34px, 6vw, 78px) / 1.05 "Vaultless Dot Display", "Geist", sans-serif;
  }
  .say h1 em {
    display: block;
    font-style: normal;
    color: var(--gold);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hall img,
  .lit .breath,
  .soon i {
    animation: none;
  }
  .lit .breath {
    opacity: 0.8;
  }
}
