/* Voxel Racing, coming soon. The look is decided in .claude/design.md */

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/barlow-condensed-latin-700-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2");
}

:root {
  --ground: #0e0f0d;
  --text: #f1eee6;
  --muted: #d6d3ca;
  --pill-off: rgb(255 255 255 / 0.5);
  --pill-on: #fff;
  --edge: rgb(255 255 255 / 0.55);
  --dim: 0.4;
  --pad: clamp(16px, 3.4vw, 48px);
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ground);
  color: var(--text);
  font: 400 18px/1.4 var(--body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1,
h2,
p {
  margin: 0;
}

/* One screen. Wide or sideways: the clip fills it and the type sits on top. */

.screen {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.stage,
.dim {
  position: absolute;
  inset: 0;
}
.dim {
  background: var(--ground);
  opacity: var(--dim);
}

.vid,
.still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.vid.on,
.still {
  opacity: 1;
}

/* Player: ten pills, white where we are. */

.pills {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: var(--pad);
  right: var(--pad);
  z-index: 2;
  display: flex;
  gap: 6px;
}
.pill {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.bar {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--pill-off);
  /* A hairline of ground colour keeps the pill readable over pale sky. */
  box-shadow: 0 0 0 1px rgb(14 15 13 / 0.35);
}
.bar i {
  display: block;
  height: 100%;
  background: var(--pill-on);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

/* Type */

.copy {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: max(var(--pad), env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.name {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.wordmark {
  font: 700 clamp(64px, min(13vw, 20svh), 240px) / 0.86 var(--display);
  letter-spacing: -0.01em;
}

.soon {
  margin-top: 4px;
  font: italic 700 clamp(30px, min(4.4vw, 7svh), 64px) / 1 var(--display);
}

.place {
  font-size: clamp(15px, min(1.6vw, 2.6svh), 22px);
  font-weight: 500;
}

.meta {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}

.now {
  font-size: 18px;
  font-weight: 500;
}
.count {
  margin-right: 12px;
  font: 700 22px/1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.motion {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 500 15px/1 var(--body);
  cursor: pointer;
}
.motion[hidden] {
  display: none;
}
.motion:hover {
  border-color: var(--text);
}
.motion[data-on="true"] .i-play,
.motion[data-on="false"] .i-pause {
  display: none;
}

.domain {
  font-size: 15px;
  color: var(--muted);
}

/* Sideways phone and other short screens */

@media (max-height: 460px) {
  .name {
    gap: 2px;
  }
  .meta {
    gap: 6px;
  }
  .now {
    font-size: 15px;
  }
  .count {
    font-size: 18px;
  }
  .domain {
    font-size: 13px;
  }
}

/* Upright screens: show the whole 16:9 frame instead of cropping it to a sliver. */

@media (max-aspect-ratio: 1 / 1) {
  .screen {
    display: flex;
    flex-direction: column;
  }
  .stage {
    position: relative;
    inset: auto;
    order: 1;
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 4px;
  }
  .dim {
    display: none;
  }
  .pills {
    position: relative;
    inset: auto;
    order: 0;
    flex: none;
    margin: max(8px, env(safe-area-inset-top)) var(--pad) 0;
  }
  .copy {
    position: relative;
    inset: auto;
    order: 2;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    padding: 24px var(--pad) max(20px, env(safe-area-inset-bottom));
  }
  .wordmark {
    font-size: min(31vw, 14.5svh);
  }
  .soon {
    font-size: min(13vw, 6.4svh);
  }
  .place {
    font-size: clamp(14px, 4.6vw, 19px);
  }
  .meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    text-align: left;
  }
  .now {
    font-size: 16px;
  }
  .motion {
    grid-column: 2;
    grid-row: 1;
    justify-content: center;
    width: 44px;
    padding: 0;
  }
  .motion [data-motion-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .domain {
    grid-column: 1 / -1;
    font-size: 14px;
  }
}

@media (max-aspect-ratio: 1 / 1) and (max-height: 620px) {
  .copy {
    gap: 8px;
    padding-top: 12px;
  }
  .wordmark {
    font-size: min(31vw, 12svh);
  }
}
