/*
 * collier.club. The layout follows petals.dev and the colours follow the
 * interface palette in src/gui/shell/theme.zig. Sizes stay in pt where
 * petals sets them in pt.
 */

@font-face {
  font-family: "Martian Mono";
  src: url("MartianMonoVF.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  /* Block, not swap: text stays invisible until the face is ready
     instead of flashing the fallback stack on a fresh load. */
  font-display: block;
}

:root {
  color-scheme: dark;
  --bg: #141414; /* wave_bg: the window background */
  --trough: #2d2d2d; /* trough_dark: fields and buttons at rest */
  --border: #777777; /* border_gray */
  --muted: #8a8a8a; /* fill_blue: the grey active fill */
  --soft: #b0b0b0; /* row_dim */
  --text: #ffffff; /* text_white */
  --cursor: #264d69; /* row_cursor: the track list cursor */
  --font: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

.lga-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  /* Fainter behind the content column, fuller at the edges. */
  -webkit-mask-image: radial-gradient(ellipse at center, rgb(0 0 0 / 0.3) 25%, #000 75%);
  mask-image: radial-gradient(ellipse at center, rgb(0 0 0 / 0.3) 25%, #000 75%);
  pointer-events: none;
  image-rendering: pixelated;
}

::selection {
  color: var(--text);
  background: var(--cursor);
}

a {
  color: var(--text);
  text-decoration-color: var(--border);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
}

/*
 * Petals puts a box with px-5 and m-md-4 around a col-xl-6 col-lg-8
 * column of at most 700px with p-md-3. Phones get a narrower gutter and a
 * small gap above the logo.
 */
.page {
  margin: 1rem 1.25rem 0;
  text-align: center;
}

.column {
  max-width: 700px;
  margin: 0.25rem auto;
}

@media (min-width: 576px) {
  .page {
    margin: 1rem 3rem 0;
  }
}

@media (min-width: 768px) {
  .page {
    margin: 1.5rem 4.5rem;
  }

  .column {
    padding: 1rem;
  }
}

@media (min-width: 992px) {
  .column {
    width: 66.666667%;
  }
}

@media (min-width: 1200px) {
  .column {
    width: 50%;
  }
}

main p {
  margin: 0 0 1rem;
  font-size: 10.5pt;
}

/* The logo sits beside the name from 768px and above it on phones. */
.brand .logo {
  display: block;
  width: auto;
  height: 100px;
  margin: 0 auto;
}

.brand h1 {
  margin: 0 0 0.5rem;
  font-size: 39pt;
  font-weight: 700;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .brand .logo {
    margin: 0 1.5rem 0 0;
  }

  .brand h1 {
    margin: 0;
  }
}

.lead {
  margin: 1rem 0 1.5rem;
  padding-top: 1rem;
  font-size: 11pt;
}

.feature-list {
  margin: 0 0 1rem;
  padding: 0.5rem 0 0;
}

.feature-list li {
  position: relative;
  margin: 0 0 1rem;
  padding-left: 1.5em;
  font-size: 9pt;
  text-align: left;
  list-style: none;
}

/* Petals draws a leaf here. collier uses a plain dash on the first line. */
.feature-list li::before {
  content: "-";
  position: absolute;
  top: 0;
  left: 0;
}

.subscription-success h2 {
  margin: 0;
  padding-top: 1.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.subscription-success p {
  margin: 0;
  padding: 1.5rem 0;
}

.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 9.5pt;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  transition:
    color 0.15s ease-in-out,
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}

/* As in the interface: the trough on hover, the grey fill while pressed. */
.btn-fill {
  color: var(--bg);
  background: var(--muted);
  border-color: var(--muted);
}

.btn-fill:hover {
  background: var(--soft);
  border-color: var(--soft);
}

.btn-fill:active {
  background: var(--text);
  border-color: var(--text);
}

.btn-outline {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--trough);
  border-color: var(--muted);
}

.btn-outline:active {
  color: var(--bg);
  background: var(--muted);
  border-color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1.5rem;
  margin-bottom: 0.25rem;
}

.actions .btn {
  margin: 0.5rem 0 1.5rem;
}

main .platforms {
  margin-bottom: 0.25rem;
  padding-top: 1rem;
  font-size: 9.5pt;
}

.signup {
  margin-bottom: 1.5rem;
  scroll-margin-top: 2rem;
}

.signup-form {
  display: flex;
  gap: 0.5rem;
  margin: 0 auto;
}

@media (min-width: 1200px) {
  .signup-form {
    width: 66.666667%;
  }
}

.signup-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 9.5pt;
  line-height: 1.5;
  color: var(--text);
  background: var(--trough);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}

.signup-form input::placeholder {
  color: var(--soft);
  opacity: 1;
}

.signup-form input:focus {
  border-color: var(--muted);
  outline: none;
  box-shadow: 0 0 0 0.25rem rgb(138 138 138 / 25%);
}

main .signup-status {
  margin: 0.5rem 0 0;
  font-size: 8.5pt;
  color: var(--muted);
}

main .signup-status[data-state="failed"] {
  color: var(--text);
}

main .acknowledgements {
  padding-top: 1.5rem;
  font-size: 8.5pt;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The demo capture: wide as the column, framed like a window. */
.demo {
  margin: -0.25rem 0 1.5rem;
}

.demo-video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--trough);
  border: 1px solid var(--trough);
  border-radius: 0.5rem;
}

/* A click shows the capture at 90% of the browser window, over a dark
   backdrop. The capture is 4:3, so a wide window limits it by height.
   demo.js keeps the figure at its old height, so the page does not move. */
.demo.is-expanded::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgb(0 0 0 / 0.8);
}

.demo.is-expanded .demo-video {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 11;
  width: min(90vw, calc(90vh * 4 / 3));
  transform: translate(-50%, -50%);
  animation: demo-expand 160ms ease-out;
}

@keyframes demo-expand {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
}

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

  .btn {
    transition: none;
  }

  .demo.is-expanded .demo-video {
    animation: none;
  }
}
