/* The app's colors and shapes (src/styles.css in the app). */
:root {
  --bg: #000000;
  --text: #f5f5f4;
  --muted: #8e8e96;
  --surface-1: #161618;
  --line: rgba(255, 255, 255, 0.08);
  --coach-rgb: 255, 90, 54;
  --coach-text: #ff7a5c;
  --fill: rgba(var(--coach-rgb), 0.18);
  --fill-hover: rgba(var(--coach-rgb), 0.26);
  --radius-button: 16px;
  --gutter: 20px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

@font-face {
  font-family: "Trivis Display";
  src: url("/fonts/trivis-display-extrabold-latin.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- The screen ---------- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) var(--gutter) max(32px, env(safe-area-inset-bottom));
  text-align: center;
}

.hero > * {
  width: min(100%, 400px);
}

/* The logo the opening lands on: the icon tile and the wordmark. */
.welcome-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 56px;
}

.welcome-brand img {
  width: 56px;
  height: 56px;
  border-radius: 13px;
}

.welcome-word {
  display: block;
  width: 108px;
  height: 40px;
  background: var(--text);
  -webkit-mask: url("/icons/trivis-wordmark.svg") center / contain no-repeat;
  mask: url("/icons/trivis-wordmark.svg") center / contain no-repeat;
}

.hero-title {
  margin: 40px 0 12px;
  font-family: "Trivis Display", var(--sans);
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 17px;
  text-wrap: balance;
}

/* ---------- The waitlist ---------- */
/* Tall enough for the open box, the button and a line, so nothing above moves when it opens. */
.waitlist {
  display: flex;
  flex-direction: column;
  min-height: 156px;
}

/* The email box opens above the button on the first tap. */
.waitlist-field {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease-out;
}

.waitlist.is-open .waitlist-field {
  max-height: 56px;
  margin-bottom: 10px;
  opacity: 1;
}

.waitlist input[type="email"] {
  appearance: none;
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  text-align: center;
  outline: none;
}

.waitlist input[type="email"]::placeholder {
  color: var(--muted);
}

.waitlist input[type="email"]:focus-visible {
  border-color: rgba(var(--coach-rgb), 0.6);
}

.waitlist-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.waitlist-go {
  appearance: none;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--fill);
  color: var(--coach-text);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.16s ease-out,
    opacity 0.16s ease-out;
}

.waitlist-go:active {
  transform: scale(0.97);
}

.waitlist-go:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (hover: hover) {
  .waitlist-go:hover:not(:disabled) {
    background: var(--fill-hover);
  }
}

.waitlist-note {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.waitlist-note.is-error {
  color: var(--coach-text);
}

/* Joined: the form gives way to the line. */
.waitlist.is-done .waitlist-field,
.waitlist.is-done .waitlist-go {
  display: none;
}

.waitlist.is-done .waitlist-note {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- The opening (src/styles.css in the app) ---------- */
.opening {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  color: var(--text);
  cursor: pointer;
}

.no-opening .opening {
  display: none;
}

/* The page's own logo waits under the intro, so there are never two. */
.opening.is-playing ~ .hero .welcome-brand {
  visibility: hidden;
}

.op-bg {
  position: absolute;
  inset: 0;
  background: var(--bg);
  will-change: opacity;
}

.op-mark,
.op-word {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform, opacity;
}

.op-inner,
.op-part {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
}

.op-part svg {
  display: block;
  width: 100%;
  height: 100%;
}

.op-ink {
  fill: currentColor;
}

.op-r {
  stroke: currentColor;
}

.op-line {
  fill: none;
  stroke: currentColor;
}

.op-hole {
  fill: var(--bg);
  stroke: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  .opening {
    display: none;
  }

  .waitlist.is-done .waitlist-note {
    animation: none;
  }

  .waitlist-field {
    transition: none;
  }
}
