/* hypium.xyz: the door to Oculus. One centred oculus: the eye in the light, the coffered dome
   around it, the maker's inscription over it, the name and one door below. */

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

:root {
  color-scheme: dark;
  --night: #0c0e11;
  --ink: #111418;
  --bone: #e4decf;
  --sky: #f5f0e6;
  --dim: #9a968c;
  --face: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --k: 1;
  --lift: 60px;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--face);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* The oculus centre: whole pixels (set by door.js), so the hairlines fall on the pixel grid. */
.stage {
  --cx: 50%;
  --cyp: calc(50% - var(--lift));
  position: relative;
  height: 100%;
  min-height: 620px;
  overflow: hidden;
}

.halo, .halo-up { position: absolute; inset: 0; pointer-events: none; }
.halo {
  background: radial-gradient(circle at var(--cx) var(--cyp), rgb(228 222 207 / .13) 0, rgb(228 222 207 / .045) calc(260px * var(--k)), rgb(228 222 207 / 0) calc(680px * var(--k)));
  animation: rise 2.4s ease-out both;
}
.halo-up {
  background: radial-gradient(circle at var(--cx) var(--cyp), rgb(228 222 207 / .12) 0, rgb(228 222 207 / .04) calc(200px * var(--k)), rgb(228 222 207 / 0) calc(480px * var(--k)));
  opacity: 0;
  transition: opacity .7s ease;
}

/* Drawn at its final size, so every line is vector-sharp. */
.dome {
  position: absolute;
  left: var(--cx);
  top: var(--cyp);
  width: calc(2200px * var(--k));
  height: calc(2200px * var(--k));
  margin-left: calc(-1100px * var(--k));
  margin-top: calc(-1100px * var(--k));
  shape-rendering: geometricPrecision;
  pointer-events: none;
}
.rings { opacity: .8; transition: opacity .7s ease; }
.rim { opacity: .35; transition: opacity .7s ease; }
.rings path, .rim { vector-effect: non-scaling-stroke; }
.open { transform-box: fill-box; transform-origin: center; animation: open 1.6s cubic-bezier(.2, .7, .2, 1) .15s both; }
.reach { transform-box: fill-box; transform-origin: center; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.inscription {
  font-family: var(--face);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .36em;
  fill: var(--bone);
  opacity: .5;
  animation: carve 1.4s ease 1s both;
}

main {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--cyp) + 200px * var(--k));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(48px * var(--k));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1 {
  margin: 0;
  font-size: calc(26px * var(--k));
  font-weight: 500;
  line-height: 1;
  letter-spacing: .42em;
  padding-left: .42em;
  text-transform: uppercase;
}
.signin {
  min-width: 220px;
  height: 52px;
  box-sizing: border-box;
  padding: 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  background: var(--bone);
  color: var(--night);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .3s ease;
}
.signin:hover { background: var(--sky); }
.signin:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }

footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-left: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right, 0px));
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.clock { display: flex; gap: 20px; min-height: 1em; }
[hidden] { display: none !important; }

/* Aiming at the door: the light swells, the rays reach out, the coffers catch more of it. */
body:has(.signin:is(:hover, :focus-visible)) .halo-up { opacity: 1; }
body:has(.signin:is(:hover, :focus-visible)) .reach { transform: scale(1.08); }
body:has(.signin:is(:hover, :focus-visible)) .rings { opacity: 1; }
body:has(.signin:is(:hover, :focus-visible)) .rim { opacity: .6; }

@keyframes open { from { opacity: .25; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes rise { from { opacity: .3; } to { opacity: 1; } }
@keyframes carve { from { opacity: .12; } to { opacity: .5; } }

@media (max-width: 640px), (max-height: 760px) { :root { --k: .78; } }
@media (max-width: 420px) { :root { --k: .62; --lift: 40px; } }
@media (prefers-reduced-motion: reduce) {
  .open, .halo, .inscription { animation: none; }
  .reach, .halo-up, .rings, .rim { transition: none; }
  body:has(.signin:is(:hover, :focus-visible)) .reach { transform: none; }
}
