/* FLYNT. Plum ground, coral fly, cream type. Every picture is a raster from tools/art.py. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/fonts/PressStart2P.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/assets/fonts/SpaceMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/assets/fonts/SpaceMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --plum: #4e434b;
  --panel: #42383f;
  --well: #3a3138;
  --coral: #fd7159;
  --cream: #fcf6ee;
  --cream-70: rgba(252, 246, 238, 0.72);
  --mute: #9d9498;
  --ink: #282026;
  --mono: "Space Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --pixel: "Press Start 2P", var(--mono);
  --cursor: url("/assets/img/cursor.png") 0 0, auto;
  --pointer: url("/assets/img/pointer.png") 10 2, pointer;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--plum); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font: 400 16px/1.6 var(--mono);
  background: var(--plum) url("/assets/img/ground.png") repeat;
  cursor: var(--cursor);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a, button, input, [role="tab"] { cursor: var(--pointer); }
input { cursor: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
code { font-family: var(--mono); }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* ------------------------------------------------------------------ keys (buttons) */
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 18px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  color: var(--cream);
  border: 6px solid transparent;
  border-image: url("/assets/img/plate-cream.png") 6 fill / 6px stretch;
  image-rendering: pixelated;
  white-space: nowrap;
  transition: transform 80ms steps(2);
}
.key:hover { border-image-source: url("/assets/img/plate-coral.png"); }
.key:active { transform: translateY(3px); }
.key-fill { color: var(--ink); border-image-source: url("/assets/img/plate-fill.png"); }
.key-fill:hover { border-image-source: url("/assets/img/plate-cream-fill.png"); }
.key-small { min-height: 36px; padding: 2px 12px; font-size: 14px; }
.key-mark { width: 48px; padding: 0; }
.key-brand img { margin-right: 2px; }
.key[aria-disabled="true"], .key:disabled {
  color: var(--mute);
  border-image-source: url("/assets/img/plate-mute.png");
  cursor: var(--cursor);
}
.key[aria-disabled="true"] img, .key:disabled img { opacity: 0.45; }
.key[aria-disabled="true"]:hover { border-image-source: url("/assets/img/plate-mute.png"); }
.key[aria-disabled="true"]:active { transform: none; }

/* ------------------------------------------------------------------ header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 20px;
  background: var(--plum);
}
.brand { display: flex; align-items: center; gap: 14px; }
.links { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ hero */
main { max-width: 920px; margin: 0 auto; padding: 0 20px 120px; }
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 0 72px;
}
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mote { position: absolute; width: 24px; height: 18px; opacity: 0.32; }
.m1 { left: 6%; top: 18%; animation: drift1 14s steps(28) infinite; }
.m2 { right: 8%; top: 30%; animation: drift2 18s steps(36) infinite; }
.m3 { left: 18%; bottom: 14%; animation: drift3 22s steps(44) infinite; }
@keyframes drift1 { 0% { transform: translate(0, 0); } 50% { transform: translate(96px, 40px); } 100% { transform: translate(0, 0); } }
@keyframes drift2 { 0% { transform: translate(0, 0); } 50% { transform: translate(-120px, 64px); } 100% { transform: translate(0, 0); } }
@keyframes drift3 { 0% { transform: translate(0, 0); } 50% { transform: translate(140px, -56px); } 100% { transform: translate(0, 0); } }

.fly-rig { position: relative; display: flex; flex-direction: column; align-items: center; width: 288px; }
.fly { position: relative; z-index: 1; animation: hover 1.2s steps(1) infinite; }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.fly.is-busy { animation: buzz 0.28s steps(1) infinite; }
@keyframes buzz {
  0% { transform: translate(0, 0); } 25% { transform: translate(8px, -8px); }
  50% { transform: translate(0, -16px); } 75% { transform: translate(-8px, -8px); } 100% { transform: translate(0, 0); }
}

/* the bracket from his banner: one coral cell tiled into lines */
.bracket { position: relative; width: 240px; height: 42px; }
.bracket > div { position: absolute; background: url("/assets/img/px-coral.png") repeat; }
.b-stem { left: 50%; top: 0; width: 3px; height: 21px; margin-left: -1.5px; }
.b-bar { left: 0; right: 0; top: 21px; height: 3px; }
.b-l { left: 0; top: 21px; width: 3px; height: 21px; }
.b-r { right: 0; top: 21px; width: 3px; height: 21px; }

.states { display: grid; gap: 6px; width: 100%; }
.states li {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 48px;
  padding: 0 18px;
  background: var(--panel);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cream-70);
  text-align: left;
}
.states .sq { flex: none; }
.states .tick { display: none; width: 18px; height: 14px; flex: none; }
.states li.is-on { color: var(--cream); }
.states li.is-on .sq { content: url("/assets/img/sq-coral.png"); animation: blink 0.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.states li.is-done .sq { display: none; }
.states li.is-done .tick { display: block; }
.states li.is-done { color: var(--cream); }

.kicker {
  margin-top: 40px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
}
.h1 {
  margin-top: 22px;
  max-width: 820px;
  font: 400 32px/1.6 var(--pixel);
  color: var(--cream);
}
.h1 em { font-style: normal; color: var(--coral); }
.lead { margin-top: 26px; font-size: 20px; font-weight: 700; }
.sub { margin-top: 10px; max-width: 560px; color: var(--cream-70); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }

/* ------------------------------------------------------------------ blocks */
.block { margin-top: 72px; }
.block > .kicker { margin: 0 0 18px; }

/* the terminal window, a nine-sliced plate with the fly sitting on its bar */
.term {
  position: relative;
  background: var(--panel);
  border: 6px solid transparent;
  border-image: url("/assets/img/plate-cream.png") 6 fill / 6px stretch;
}
.term-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 42px;
  padding: 0 16px;
  background: var(--well);
}
.term-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: url("/assets/img/sq-cream.png") repeat-x;
}
.dots { display: flex; gap: 6px; }
.term-title { font-size: 14px; color: var(--mute); }
.term-fly { position: absolute; right: 18px; bottom: 3px; }
.term-fly.is-busy { animation: sit 0.24s steps(1) infinite; }
@keyframes sit { 50% { transform: translateY(-4px); } }

.term-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
}
.term-tabs::-webkit-scrollbar { display: none; }
.tabs-label { margin-right: 12px; font-size: 14px; font-weight: 700; letter-spacing: 0.14em; color: var(--mute); }
.term-tabs [role="tab"] {
  position: relative;
  height: 48px;
  padding: 0 10px;
  color: var(--cream-70);
  white-space: nowrap;
}
.term-tabs [role="tab"]:hover { color: var(--cream); }
.term-tabs [role="tab"][aria-selected="true"] { color: var(--coral); }
.term-tabs [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 0;
  height: 3px;
  background: url("/assets/img/px-coral.png") repeat-x;
}
.term-tabs::after { content: none; }

.panes { padding: 16px 16px 8px; min-height: 176px; }
.cmt { color: var(--mute); margin-top: 12px; }
.cmt:first-child { margin-top: 0; }
.cmd { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding-top: 9px; }
.cmd-keys { margin-top: -5px; }
.ps { flex: none; color: var(--coral); font-weight: 700; }
.cmd code { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.cmd-keys { flex: none; display: flex; gap: 6px; }

.term-out {
  height: 200px;
  padding: 12px 16px;
  background: var(--well);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--mute) transparent;
}
.term-out::-webkit-scrollbar { width: 9px; }
.term-out::-webkit-scrollbar-track { background: transparent; }
.term-out::-webkit-scrollbar-thumb { background: var(--mute); }
.term-out::-webkit-scrollbar-button { display: none; }
.out-lines p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.o-mute { color: var(--mute); }
.o-cmd { color: var(--cream); font-weight: 700; }
.o-cmd::before { content: "$ "; color: var(--coral); }
.o-tag { display: inline-block; width: 11ch; color: var(--coral); }
.o-ok { color: var(--cream); }
.o-err { color: var(--coral); }
.o-lines p b { color: var(--coral); }

.term-in { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--well); }
.term-in::before { content: ""; position: absolute; }
#cli {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0;
  font: inherit;
  color: var(--cream);
  background: transparent;
  border: 0;
  caret-color: var(--coral);
}
#cli::placeholder { color: var(--mute); opacity: 1; }
#cli:focus-visible { outline: none; }
.term-in:focus-within { box-shadow: inset 0 -3px 0 var(--coral); }

.note { margin-top: 18px; color: var(--cream-70); }
.note code { padding: 1px 6px; color: var(--cream); background: var(--panel); }

/* ------------------------------------------------------------------ grids */
.grid { display: grid; gap: 6px; }
.does { grid-template-columns: repeat(3, 1fr); }
.does li { padding: 24px 22px 26px; background: var(--panel); }
.does h3 {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
}
.does p { margin-top: 10px; color: var(--cream-70); }

.with { grid-template-columns: repeat(4, 1fr); }
.with li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 12px 22px;
  background: var(--panel);
  text-align: center;
}
.with img { margin-bottom: 10px; }
.with b { font-size: 16px; }
.with span { font-size: 14px; color: var(--mute); }

/* ------------------------------------------------------------------ contract */
.ca-body { padding: 16px 16px 20px; }
.cmd-ca { min-height: 36px; }
.ca-line { margin-top: 4px; padding: 10px 14px; background: var(--well); overflow-wrap: anywhere; user-select: all; }
.ca-line.is-set { color: var(--cream); }
.ca-keys { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.copy-msg { min-height: 26px; margin-top: 8px; color: var(--coral); }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  .does { grid-template-columns: 1fr; }
  .with { grid-template-columns: repeat(2, 1fr); }
  .h1 { font-size: 24px; }
  .cmd { flex-wrap: wrap; }
  .cmd-keys { flex-basis: 100%; padding-left: 22px; margin-top: 4px; }
  .tabs-label { display: none; }
  .hero { padding-top: 24px; }
  .kicker { margin-top: 28px; }
  .cmd-keys .key { flex: 1 1 auto; }
  .fly { width: 144px; height: 108px; }
  .term-tabs { padding: 0 8px; }
  .tabs-label { margin-right: 6px; }
  main { padding-bottom: 80px; }
}
@media (max-width: 360px) {
  .h1 { font-size: 20px; }
  .with { grid-template-columns: 1fr; }
  .brand-word { display: none; }
  .term-tabs { gap: 0; }
  .term-tabs [role="tab"] { padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .fly, .fly.is-busy, .mote, .term-fly.is-busy, .states li.is-on .sq { animation: none; }
}
