/* scorch.sh: one page, black, and the flame. The colours are the panel's
   own (ui/src/app.css); nothing here comes from anywhere but this folder. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --frame: #060607;
  --canvas: #0b0b0d;
  --raised: #17171a;
  --line: rgb(255 255 255 / 0.07);
  --ink: #ededf0;
  --dim: #9a9aa3;
  --faint: #777780;
  --ok: #5ee6a8;
  /* What the fire is drawn in, hottest first (main.js reads these). */
  --cone-2: #4f7ff5;
  --cone-1: #9cc0ff;
  --flame-8: #d93f1c;
  --flame-7: #e84a1c;
  --flame-6: #f55f1f;
  --flame-5: #ff7a2a;
  --flame-4: #ff8f24;
  --flame-3: #ffab2e;
  --flame-2: #ffc94d;
  --flame-1: #ffe27a;
  --flare: #ffe27a;
  --heat: #ff7a2a;
  --deep: #c8431a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--frame);
  color: var(--ink);
  color-scheme: dark;
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
}

img {
  display: block;
}

::selection {
  background: rgb(107 155 255 / 0.3);
}

/* The bar: the mark, the name, and how far along it is. */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 clamp(20px, 4vw, 40px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  image-rendering: pixelated;
}
.state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 13px;
}
.state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--heat);
  box-shadow: 0 0 0 3px rgb(255 122 42 / 0.16);
}

/* The first screen: the flame, one sentence, and the fire along its floor. */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(100dvh, 920px);
  padding: 120px 24px 34vh;
  overflow: hidden;
  text-align: center;
}
.fire {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: -1;
  image-rendering: pixelated;
  pointer-events: none;
  /* It burns out towards the edges of the page rather than ending at them. */
  mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--line);
}

/* The lit mark: three drawings of the same flame, shown in turn. A cell of
   it is a whole number of pixels at every size it is given. */
.flame {
  position: relative;
  width: 96px;
  height: 96px;
  animation: arrive 0.7s var(--ease) both;
}
.flame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.flame img:nth-child(1) {
  animation: flame-0 1.2s steps(1) infinite;
}
.flame img:nth-child(2) {
  opacity: 0;
  animation: flame-1 1.2s steps(1) infinite;
}
.flame img:nth-child(3) {
  opacity: 0;
  animation: flame-2 1.2s steps(1) infinite;
}
@keyframes flame-0 {
  0%,
  50% {
    opacity: 1;
  }
  30%,
  75% {
    opacity: 0;
  }
}
@keyframes flame-1 {
  0%,
  50% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
}
@keyframes flame-2 {
  0% {
    opacity: 0;
  }
  75% {
    opacity: 1;
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

h1 {
  margin: 40px 0 0;
  font-size: clamp(40px, 7.2vw, 76px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
  animation: arrive 0.7s 0.08s var(--ease) both;
}
.lead {
  max-width: 30em;
  margin: 22px 0 0;
  color: var(--dim);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.5;
  text-wrap: balance;
  animation: arrive 0.7s 0.16s var(--ease) both;
}

/* What it does: four things, a hairline between each. */
.parts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1240px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.parts article {
  padding: 44px clamp(20px, 2.6vw, 36px) 48px;
  border-left: 1px solid var(--line);
}
.parts article:first-child {
  border-left: 0;
}
.parts h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.parts p {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.6;
}
code {
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--raised);
  color: var(--ink);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.9em;
  white-space: nowrap;
}

/* The panel itself, as it is. */
.look {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px clamp(20px, 4vw, 40px) 96px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  width: fit-content;
  margin: 0 auto 28px;
  padding: 2px;
  border-radius: 9px;
  background: var(--raised);
}
.tabs button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition:
    color 0.14s ease-out,
    background-color 0.14s ease-out;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button[aria-selected="true"] {
  background: #222226;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  color: var(--ink);
}
.tabs button:focus-visible {
  outline: 2px solid #6b9bff;
  outline-offset: 2px;
}
.screen {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--canvas);
  box-shadow: 0 40px 120px -40px rgb(255 122 42 / 0.16);
}
.screen img {
  width: 100%;
  height: auto;
  transition: opacity 0.2s ease-out;
}
.screen img.leaving {
  opacity: 0;
}

footer {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}
footer img {
  image-rendering: pixelated;
}
footer .quiet {
  margin-left: auto;
  color: var(--faint);
}

@media (max-width: 900px) {
  .parts {
    grid-template-columns: repeat(2, 1fr);
  }
  .parts article:nth-child(odd) {
    border-left: 0;
  }
  .parts article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 520px) {
  .hero {
    padding-bottom: 30vh;
  }
  .flame {
    width: 80px;
    height: 80px;
  }
  .parts {
    grid-template-columns: 1fr;
  }
  .parts article {
    padding: 28px 24px 30px;
    border-left: 0;
  }
  .parts article + article {
    border-top: 1px solid var(--line);
  }
  .look {
    padding-top: 48px;
    padding-bottom: 64px;
  }
  footer .quiet {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .flame img:nth-child(n + 2) {
    opacity: 0;
  }
}
