/* The public home page at watchmora.tv. Static and dependency-free. Type and accent
   colours mirror the dark theme in packages/design-system/src/tokens.css; the page's own
   background is a shade deeper than the app so its screenshots read as lit screens. */

@font-face {
  font-family: 'Space Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --night: #0d0a15;
  --band: #130f1e;
  --text: #f3effa;
  --muted: #b3a9c6;
  --rule: rgb(255 255 255 / 10%);
  --violet: #7c3aed;
  --violet-bright: #9461f5;
  --lilac: #c9b1ff;
  --focus: #4cd7f6;
  --display: 'Space Grotesk Variable', 'Space Grotesk', sans-serif;
  --body: 'Plus Jakarta Sans Variable', 'Plus Jakarta Sans', sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --wide: 76rem;
  --gap: clamp(5rem, 11vw, 10rem);
  color-scheme: dark;
}

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

html {
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 0.25rem;
}

/* One measure for the whole page: every block lines up on the same two edges. */
.site-header,
.hero,
.trio,
.scene,
.plain,
.beta,
.site-footer,
.not-found,
.anime > * {
  width: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 1.5rem;
}

.site-header__home {
  display: block;
  line-height: 0;
}

.site-header__home img {
  width: auto;
  height: 2rem;
}

.beta-tag {
  padding: 0.25rem 0.7rem;
  border: 1px solid rgb(201 177 255 / 45%);
  border-radius: 999px;
  color: var(--lilac);
  font: 600 0.8125rem/1.4 var(--body);
  white-space: nowrap;
}

.site-header__sign-in {
  margin-left: auto;
  font-weight: 600;
  text-decoration: none;
}

.site-header__sign-in:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Screenshots: the app's own screens, framed as lit panels on the darker page. */

.shot {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: clamp(0.6rem, 1.2vw, 1rem);
  background: #111116;
  box-shadow: 0 2.5rem 5rem -2.5rem rgb(0 0 0 / 80%);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  padding: 0.5rem 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Hero */

.hero {
  padding-top: clamp(2.5rem, 7vw, 5.5rem);
}

.hero__copy {
  max-width: 60rem;
}

.hero h1 {
  font: 600 clamp(2.6rem, 7.4vw, 5.75rem) / 0.98 var(--display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero__lead {
  max-width: 41rem;
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.25rem;
}

.hero__note {
  color: var(--muted);
  font-size: 0.9375rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 2rem;
  border-radius: 0.5rem;
  background: var(--violet);
  color: #fff;
  font: 600 1.0625rem/1 var(--body);
  text-decoration: none;
}

.button:hover {
  background: var(--violet-bright);
}

/* The one loud thing on the page is the product itself: a full-width screen of posters,
   lit from behind in the brand violet, arriving once as the page opens. */
.shot--hero {
  margin-top: clamp(2.75rem, 6vw, 4.5rem);
  box-shadow:
    0 0 0 1px rgb(201 177 255 / 8%),
    0 0 9rem -1rem rgb(124 58 237 / 38%),
    0 3rem 6rem -3rem rgb(0 0 0 / 90%);
  animation: arrive 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(1.75rem);
  }
}

/* Watch / Request / Run: the three jobs, each a link to its part of the page. */

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 4rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}

.trio__item {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

.trio__item h2 {
  font: 600 clamp(1.5rem, 2.6vw, 2.125rem) / 1.1 var(--display);
  letter-spacing: -0.025em;
}

.trio__item p {
  max-width: 22rem;
  margin-top: 0.6rem;
  color: var(--muted);
}

.trio__item:hover h2 {
  color: var(--lilac);
}

/* Scenes: words on one side, the screen that proves them on the other. */

.scene {
  /* How far a screen may run past the text measure, out to the edge of the window. */
  --bleed: max(var(--gutter), (100vw - var(--wide)) / 2);
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(0, 15fr);
  align-items: center;
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  margin-top: var(--gap);
  scroll-margin-top: 2rem;
}

.scene--flip {
  grid-template-columns: minmax(0, 15fr) minmax(0, 9fr);
}

.scene--flip > .scene__copy {
  order: 2;
}

/* The screen runs off the side of the window, so it can be shown large. */
.scene > .shot {
  width: calc(100% + var(--bleed));
  border-right: 0;
  border-radius: clamp(0.6rem, 1.2vw, 1rem) 0 0 clamp(0.6rem, 1.2vw, 1rem);
}

.scene--flip > .shot {
  margin-left: calc(-1 * var(--bleed));
  border-right: 1px solid var(--rule);
  border-left: 0;
  border-radius: 0 clamp(0.6rem, 1.2vw, 1rem) clamp(0.6rem, 1.2vw, 1rem) 0;
}

.scene h2,
.anime__intro h2,
.beta h2 {
  font: 600 clamp(1.9rem, 3.7vw, 3.125rem) / 1.04 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.scene__copy p {
  max-width: 31rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.scene__copy .scene__aside {
  color: var(--text);
  font-weight: 600;
}

/* Before and after, one above the other, running off the same side as a single screen. */
.pair {
  display: grid;
  gap: 1rem;
  width: calc(100% + var(--bleed));
}

.scene--flip > .pair {
  margin-left: calc(-1 * var(--bleed));
}

.scene--flip > .pair .shot {
  border-left: 0;
  border-radius: 0 clamp(0.6rem, 1.2vw, 1rem) clamp(0.6rem, 1.2vw, 1rem) 0;
}

/* Keeps each short sentence of a headline on one line where there is room for it. */
@media (min-width: 40rem) {
  .nb {
    white-space: nowrap;
  }
}

/* Anime gets a band of its own, because it is the part other apps get wrong. */

.anime {
  margin-top: var(--gap);
  padding-block: clamp(4rem, 9vw, 8rem);
  border-block: 1px solid var(--rule);
  background: var(--band);
}

.anime__intro h2 {
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  letter-spacing: -0.04em;
}

.anime__intro p {
  max-width: 38rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.shot--wide {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.anime__details {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(3.5rem, 7vw, 6rem);
}

.detail--filler {
  grid-column: span 7;
}

.detail--order {
  grid-column: span 5;
}

.detail--special {
  grid-column: span 12;
}

.detail h3 {
  margin-top: 1.5rem;
  font: 600 clamp(1.375rem, 2.2vw, 1.75rem) / 1.15 var(--display);
  letter-spacing: -0.02em;
}

.detail p {
  max-width: 34rem;
  margin-top: 0.6rem;
  color: var(--muted);
}

/* A breather with no picture at all: the point is what is absent. */

.plain {
  margin-top: var(--gap);
}

.plain h2 {
  font: 600 clamp(2.4rem, 7vw, 5.5rem) / 1 var(--display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.plain p {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

/* Beta */

.beta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem 3rem;
  margin-top: var(--gap);
  padding: clamp(1.75rem, 4.5vw, 3.5rem);
  border: 1px solid rgb(201 177 255 / 30%);
  border-radius: 1.25rem;
  background: var(--band);
  scroll-margin-top: 2rem;
}

.beta__copy p {
  max-width: 40rem;
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* Footer */

.site-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem 2.5rem;
  margin-top: var(--gap);
  padding-block: 1.75rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer__notes {
  max-width: 46rem;
  font-size: 0.8125rem;
}

.site-footer a {
  text-underline-offset: 0.3em;
}

/* Not found */

.not-found {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
  padding-block: clamp(3rem, 10vw, 7rem);
}

.not-found h1 {
  font: 600 clamp(2.25rem, 6vw, 4rem) / 1 var(--display);
  letter-spacing: -0.03em;
}

.not-found p {
  max-width: 30rem;
  color: var(--muted);
}

@media (max-width: 60rem) {
  .trio,
  .scene,
  .beta {
    grid-template-columns: minmax(0, 1fr);
  }

  .trio {
    gap: 1.75rem;
  }

  /* Stacked, the words always come before the screen they describe, and the screen
     sits inside the page again. */
  .scene--flip > .scene__copy {
    order: 0;
  }

  .scene > .shot,
  .scene--flip > .shot,
  .scene--flip > .pair .shot {
    width: 100%;
    margin-left: 0;
    border: 1px solid var(--rule);
    border-radius: clamp(0.6rem, 1.2vw, 1rem);
  }

  .pair,
  .scene--flip > .pair {
    width: 100%;
    margin-left: 0;
  }

  .beta {
    align-items: start;
    justify-items: start;
  }

  .detail--filler,
  .detail--order,
  .detail--special {
    grid-column: span 12;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  /* Too narrow for two sentences a line, so the headline becomes four short ones. */
  .hero .nb {
    display: block;
  }
}

@media (max-width: 30rem) {
  .beta-tag {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .shot--hero {
    animation: none;
  }
}

@media (forced-colors: active) {
  .button {
    border: 1px solid ButtonText;
  }
}

/* On a phone a whole desktop screen would be too small to read, so the two widest
   screens show their top-left corner at a larger size instead. */
@media (max-width: 40rem) {
  .shot--hero img,
  .shot--wide img {
    aspect-ratio: 1;
    object-fit: cover;
    object-position: left top;
  }
}
