/* LispM's website, in the films' keynote style: black ground, large tight
   headlines, grey text, the rainbow of the λ as the eyebrow, and screens
   floating as displays. */

:root {
  --ground: #000000;
  --raised: #111113;
  --raised-high: #1c1c1f;
  --line: #2b2b30;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #6e6e73;
  --link: #2997ff;
  --rainbow: linear-gradient(90deg, #5ebd3e 0%, #ffb900 22%, #f78200 40%, #e23838 58%, #973999 78%, #009cdf 100%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI",
    Roboto, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Monaco, "DejaVu Sans Mono", monospace;
  --width: 1080px;
  --gutter: clamp(16px, 5vw, 40px);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* The navigation bar, translucent over the page. */

.navigation {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(0 0 0 / 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.navigation nav {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--width);
  height: 52px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  font-size: 14px;
}

.navigation ul {
  display: flex;
  gap: 22px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.navigation a {
  color: var(--muted);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
  font-weight: 600;
  font-size: 17px;
}

@media (max-width: 640px) {
  .navigation ul {
    display: none;
  }

  .navigation .github {
    margin-left: auto;
  }
}

/* The headline and the film. */

.hero {
  padding: clamp(56px, 10vw, 112px) var(--gutter) 0;
  text-align: center;
}

.hero .logo {
  display: block;
  width: clamp(76px, 12vw, 112px);
  height: auto;
  margin: 0 auto 20px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(42px, 8vw, 88px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.summary {
  max-width: 680px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.4;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 980px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
}

.button:hover {
  border-color: var(--muted);
  text-decoration: none;
}

.button.primary {
  border-color: transparent;
  background: var(--text);
  color: var(--ground);
}

.button.primary:hover {
  background: #ffffff;
}

.stage {
  max-width: 1180px;
  margin: clamp(48px, 7vw, 80px) auto 0;
  scroll-margin-top: 76px;
}

/* A screen floating as a display: rounded, lit at its edge, its shadow deep. */
.film,
.screen {
  position: relative;
  overflow: hidden;
  border-radius: clamp(10px, 1.6vw, 18px);
  background: #0a0a0a;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.1),
    0 30px 80px -20px rgb(0 0 0 / 0.9),
    0 0 120px -40px rgb(151 57 153 / 0.35);
}

.film video,
.screen video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
}

.play {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 5%, 40px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 22px 0 14px;
  border: 0;
  border-radius: 980px;
  background: rgb(255 255 255 / 0.16);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  font: 600 17px var(--font);
  cursor: pointer;
  transform: translateX(-50%);
}

.play:hover {
  background: rgb(255 255 255 / 0.26);
}

.play {
  white-space: nowrap;
}

/* On a phone the button would cover the poster's title: it goes under the video. */
@media (max-width: 600px) {
  .play {
    position: static;
    display: flex;
    width: fit-content;
    margin: 12px auto;
    transform: none;
  }
}

.play-icon {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text);
}

.play-icon::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 9px;
  border-left: 11px solid var(--ground);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.length {
  color: var(--muted);
  font-weight: 500;
}

/* Sections. */

.section {
  max-width: var(--width);
  margin: 0 auto;
  padding: clamp(96px, 14vw, 160px) var(--gutter) 0;
}

.section > h2 {
  max-width: 820px;
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(19px, 2.3vw, 24px);
  line-height: 1.42;
}

.idea {
  text-align: center;
}

.idea > h2,
.idea .lead {
  margin-left: auto;
  margin-right: auto;
}

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

@media (max-width: 900px) {
  .points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .points {
    grid-template-columns: minmax(0, 1fr);
  }
}

.points li {
  padding: 26px 24px;
  border-radius: 18px;
  background: var(--raised);
}

.points h3 {
  font-size: 19px;
  line-height: 1.25;
}

.points p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

/* A step of a project's story: its words, and its clip. */
.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(48px, 7vw, 88px);
}

.story:nth-of-type(even) {
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
}

.story:nth-of-type(even) .words {
  order: 2;
}

.story h3 {
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.12;
}

.story p {
  margin: 12px 0 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .story,
  .story:nth-of-type(even) {
    grid-template-columns: minmax(0, 1fr);
  }

  .story:nth-of-type(even) .words {
    order: 0;
  }
}

.project .actions {
  justify-content: flex-start;
  margin-top: 40px;
}

/* Get started: LispM.app first, for everyone. */

.download {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 28px 40px;
  margin-top: 48px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: 24px;
  background: var(--raised);
}

.download .app {
  align-self: start;
  text-align: center;
}

.download .app img {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 14px;
}

.download .app h3 {
  font-size: 24px;
}

.download .app p {
  margin: 8px auto 0;
  max-width: 240px;
  color: var(--muted);
  font-size: 15px;
}

/* No wider than its column: the line to paste scrolls in its own box. */
.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

/* Each step numbered in a ring, its words beside the number. */
.steps li {
  position: relative;
  min-height: 32px;
  padding-left: 48px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: -2px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

/* A line as tall as the ring is round, less its border, so the two centre. */
.steps h4 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 28px;
}

.steps p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.steps .code {
  margin-top: 12px;
}

.steps .code pre {
  font-size: 14px;
}

.installer {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}

@media (max-width: 760px) {
  .download {
    grid-template-columns: minmax(0, 1fr);
  }
}

.own-emacs {
  margin-top: clamp(72px, 10vw, 112px);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
}

.installs {
  display: grid;
  gap: 16px;
  margin-top: 48px;
}

/* An install: who it is for on the left, its code on the right. */
.install {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: center;
  gap: 16px 32px;
  padding: 26px 24px;
  border-radius: 18px;
  background: var(--raised);
}

.install h3 {
  font-size: 22px;
}

.install p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

@media (max-width: 760px) {
  .install {
    grid-template-columns: minmax(0, 1fr);
  }
}

.code {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground);
}

.code figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.copy {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 980px;
  background: var(--raised-high);
  color: var(--text);
  font: 500 13px var(--font);
  cursor: pointer;
}

.copy:hover {
  background: var(--line);
}

.copy.settled {
  color: #5ebd3e;
}

.code pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font: 13px/1.6 var(--mono);
  color: var(--text);
}

.model {
  max-width: 720px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 16px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--text);
}

/* The footer. */

.footer {
  max-width: var(--width);
  margin: clamp(96px, 14vw, 160px) auto 0;
  padding: 40px var(--gutter) 56px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}

.footer .brand {
  font-size: 19px;
}

.footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.footer a {
  color: var(--muted);
}

.footer p {
  margin: 6px 0 0;
}

/* Sections rise into view where the browser ties animation to scrolling. */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .story,
    .points li,
    .install,
    .section > h2,
    .section > .lead {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 22%;
    }
  }
}

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

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

/* Without scripts, a plain page. */

.no-script {
  max-width: 680px;
  margin: 64px auto;
  padding: 0 var(--gutter);
}

/* A feature told at length: a panel lit along its edge in the λ's rainbow. */
.spotlight {
  position: relative;
  margin-top: clamp(48px, 7vw, 88px);
  padding: clamp(28px, 4vw, 48px);
  border-radius: 24px;
  background:
    linear-gradient(var(--raised), var(--raised)) padding-box,
    var(--rainbow) border-box;
  border: 1px solid transparent;
}

.spotlight > h3 {
  max-width: 720px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.spotlight > p {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}

.spotlight > .screen {
  margin-top: clamp(28px, 4vw, 40px);
}

.spotlight .points {
  margin-top: 32px;
}

.spotlight .points li {
  background: var(--ground);
}
