/* LOOPER site. Everything is drawn from the app's 12-slot palette (the LOOK
   button swaps these, like tapping LOOPER in the app) and its 5x7 font.
   Font pixel = font-size / 10, so sizes stay multiples of 10px. */
@font-face {
  font-family: 'Looper 5x7';
  src: url('../fonts/looper-5x7.ttf') format('truetype');
  font-display: block;
}

:root {
  --black: #000000;
  --navy: #14143c;
  --panel: #3a3aa8;
  --blue: #2222ff;
  --cyan: #00ffff;
  --green: #33ff33;
  --yellow: #ffff00;
  --orange: #e87a1a;
  --red: #ff3333;
  --magenta: #ff00ff;
  --grey: #777777;
  --white: #ffffff;
  --gutter: 16px;
  --px: 2px; /* one font pixel at body size */
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  color: var(--white);
  background-color: var(--black);
  /* the app's dither: navy dots on black */
  background-image: radial-gradient(var(--navy) 1px, transparent 1.2px);
  background-size: 4px 4px;
  font: 20px/30px 'Looper 5x7', ui-monospace, monospace;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  overflow-x: hidden;
}

a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  color: var(--black);
  background: var(--cyan);
}
:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 2px;
}
img,
canvas {
  image-rendering: pixelated;
}
p {
  margin: 0 0 30px;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.dim {
  color: var(--grey);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
/* the skip link shows up when it gets keyboard focus */
a.sr:focus {
  z-index: 20;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  clip: auto;
  padding: 0 6px;
}

/* ---------------------------------------------------------- top bar (the app's header) */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--black);
  border-bottom: 2px solid var(--navy);
}
.bar .row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 50px;
}
.badge {
  display: inline-block;
  padding: 0 6px;
  color: var(--yellow);
  background: var(--blue);
  box-shadow: inset 0 0 0 2px var(--panel), 2px 2px 0 var(--black);
  line-height: 30px;
}
.badge:hover,
.badge:focus-visible {
  color: var(--yellow);
  background: var(--panel);
}
.meter {
  display: flex;
  flex-direction: column;
  line-height: 20px;
  color: var(--cyan);
}
.meter small {
  font-size: 10px;
  line-height: 10px;
  color: var(--grey);
}
.count {
  font-size: 40px;
  line-height: 40px;
  color: var(--yellow);
}
.clock {
  margin-left: auto;
  text-align: right;
  line-height: 20px;
}
.clock .state {
  display: block;
  color: var(--green);
}
.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 2px solid var(--navy);
}
.tabs a,
.tabs button {
  flex: none;
  padding: 0 10px;
  font: inherit;
  color: var(--cyan);
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.tabs a.on {
  color: var(--black);
  background: var(--yellow);
}
.tabs button {
  margin-left: auto;
  color: var(--magenta);
}
.tabs button:hover,
.tabs button:focus-visible {
  color: var(--black);
  background: var(--magenta);
}

/* ---------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: min(820px, 94vh);
}
#floor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero .wrap {
  position: relative;
  width: 100%;
  padding-top: 40px;
  padding-bottom: 300px; /* the floor shows below the content */
}
.kicker {
  color: var(--cyan);
}
.kicker b {
  color: var(--black);
  background: var(--magenta);
  font-weight: normal;
  padding: 0 4px;
}
.logo {
  margin: 0 0 30px;
  font-weight: normal;
  font-size: 70px;
  line-height: 90px;
}
.logo span {
  display: inline-block;
  padding: 7px 14px 0;
  color: var(--yellow);
  background: var(--blue);
  box-shadow: inset 0 0 0 7px var(--panel), 14px 14px 0 var(--black);
  text-shadow: 7px 7px 0 var(--black);
}
.tag {
  max-width: 34ch;
  font-size: 20px;
}
.tag,
.kicker {
  width: fit-content;
  background: var(--black);
  box-shadow: 0 0 0 6px var(--black);
}
.tag em {
  font-style: normal;
  color: var(--yellow);
}

/* ---------------------------------------------------------- dock keys (buttons) */
.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.key {
  --c: var(--grey);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 16px;
  font: inherit;
  color: var(--black);
  background-color: var(--c);
  background-image: radial-gradient(rgb(0 0 0 / 0.22) 1px, transparent 1.2px);
  background-size: 4px 4px;
  border: 0;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.35), 4px 4px 0 var(--black), 4px 4px 0 2px var(--navy);
  cursor: pointer;
  text-decoration: none;
}
.key:hover,
.key:focus-visible {
  color: var(--black);
  background-color: var(--white);
}
.key:active,
.key.down {
  transform: translate(2px, 2px);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.35), 2px 2px 0 var(--black);
}
.key.green { --c: var(--green); }
.key.red { --c: var(--red); }
.key.yellow { --c: var(--yellow); }
.key.orange { --c: var(--orange); }
.key.cyan { --c: var(--cyan); }
.key.magenta { --c: var(--magenta); }
.key.blue { --c: var(--blue); color: var(--yellow); }
.key.off {
  --c: var(--navy);
  color: var(--grey);
  cursor: default;
}
.key.off:hover {
  background-color: var(--navy);
  color: var(--grey);
}

/* ---------------------------------------------------------- ticker */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  color: var(--white);
  background: var(--blue);
  border-top: 2px solid var(--panel);
  border-bottom: 2px solid var(--panel);
}
.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: tick 38s linear infinite;
}
@keyframes tick {
  to {
    transform: translateX(-100%);
  }
}

/* ---------------------------------------------------------- sections */
section {
  padding: 90px 0 60px;
}
.label {
  display: inline-block;
  margin: 0 0 30px;
  padding: 0 6px;
  font-size: 20px;
  font-weight: normal;
  color: var(--black);
  background: var(--yellow);
}
h2,
.h2 {
  margin: 0 0 30px;
  font-size: 40px;
  line-height: 50px;
  font-weight: normal;
  color: var(--white);
}
h2 em,
.h2 em {
  font-style: normal;
  color: var(--yellow);
}

/* ---------------------------------------------------------- panels (the app's track cards) */
.panel {
  --c: var(--yellow);
  position: relative;
  background: var(--black);
  border: 4px solid var(--c);
  box-shadow: 6px 6px 0 var(--blue);
}
.panel > h3 {
  margin: 0;
  padding: 0 8px;
  font-size: 20px;
  line-height: 30px;
  font-weight: normal;
  color: var(--black);
  background: var(--c);
}
.panel > h3 b {
  font-weight: normal;
}
.panel .body {
  padding: 16px;
}
.panel .body p:last-child {
  margin-bottom: 0;
}
.panel.red { --c: var(--red); }
.panel.orange { --c: var(--orange); }
.panel.yellow { --c: var(--yellow); }
.panel.green { --c: var(--green); }
.panel.cyan { --c: var(--cyan); }
.panel.magenta { --c: var(--magenta); }
.panel.grey { --c: var(--grey); }

.grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.grid .panel {
  transition: transform 0.08s steps(2);
}
.grid .panel:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--blue);
}

/* ---------------------------------------------------------- TRY IT: the pads */
.deck {
  --c: var(--panel);
  max-width: 760px;
}
.deck .body {
  padding: 20px;
}
.lcd {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 0 10px;
  color: var(--yellow);
  background: var(--black);
  border: 2px solid var(--magenta);
}
.lcd .hint {
  color: var(--grey);
}
.pads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.pad {
  --c: var(--red);
  position: relative;
  aspect-ratio: 25 / 16;
  padding: 0;
  font: inherit;
  color: var(--black);
  background: var(--c);
  border: 0;
  cursor: pointer;
  box-shadow: inset 4px 4px 0 rgb(255 255 255 / 0.4), inset -4px -4px 0 rgb(0 0 0 / 0.35), 4px 4px 0 var(--black);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.pad canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.pad .name {
  position: absolute;
  left: 10px;
  top: 4px;
  text-align: left;
  line-height: 20px;
}
.pad .name b {
  font-weight: normal;
  margin-right: 6px;
}
.pad.mute {
  background: color-mix(in srgb, var(--c) 22%, var(--black));
  color: color-mix(in srgb, var(--c) 70%, var(--black));
  box-shadow: inset 4px 4px 0 rgb(255 255 255 / 0.08), inset -4px -4px 0 rgb(0 0 0 / 0.35), 4px 4px 0 var(--black);
}
.pad:active {
  transform: translate(2px, 2px);
}
.pad:nth-child(1) { --c: var(--red); }
.pad:nth-child(2) { --c: var(--orange); }
.pad:nth-child(3) { --c: var(--yellow); }
.pad:nth-child(4) { --c: var(--green); }
.pad:nth-child(5) { --c: var(--cyan); }
.pad:nth-child(6) { --c: var(--magenta); }

/* ---------------------------------------------------------- phones (screens + the real app) */
.strip {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  padding: 0 var(--gutter) 30px;
  margin: 0 calc(-1 * var(--gutter));
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--panel) var(--black);
}
.phone {
  flex: none;
  margin: 0;
  scroll-snap-align: start;
}
.phone .frame {
  width: 234px;
  padding: 8px;
  background: var(--navy);
  border: 4px solid var(--panel);
  box-shadow: 6px 6px 0 var(--blue);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}
.phone figcaption {
  margin-top: 16px;
}
.phone figcaption b {
  font-weight: normal;
  color: var(--black);
  background: var(--yellow);
  padding: 0 4px;
}

.real {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.device {
  width: 406px;
  max-width: 100%;
  padding: 8px;
  background: var(--navy);
  border: 4px solid var(--panel);
  box-shadow: 8px 8px 0 var(--blue);
}
.device .screen {
  position: relative;
  aspect-ratio: 390 / 844;
  background: var(--black) url('../img/loops.png') center / cover no-repeat;
}
.device iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.device .boot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.55);
}

/* ---------------------------------------------------------- get it */
.get .keys .key {
  min-width: 260px;
}

/* ---------------------------------------------------------- footer */
footer {
  padding: 60px 0 90px;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
footer .legal {
  margin-top: 20px;
}
.made {
  margin: 60px auto 40px;
}
.made .label {
  margin-bottom: 20px;
}
.made p {
  max-width: 60ch;
}
.made .who {
  margin: 0;
  font-size: 30px;
  line-height: 40px;
  color: var(--white);
}

/* ---------------------------------------------------------- prose (privacy page) */
.prose {
  max-width: 820px;
}
.prose h2 {
  font-size: 20px;
  line-height: 30px;
  color: var(--yellow);
  margin-top: 30px;
}
.prose ul {
  padding-left: 0;
  list-style: none;
}
.prose li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
}
.prose li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--cyan);
}

/* ---------------------------------------------------------- wider screens */
@media (min-width: 720px) {
  .logo {
    font-size: 120px;
    line-height: 150px;
  }
  .logo span {
    padding: 12px 24px 0;
    box-shadow: inset 0 0 0 12px var(--panel), 24px 24px 0 var(--black);
    text-shadow: 12px 12px 0 var(--black);
  }
  .tag {
    font-size: 30px;
    line-height: 40px;
  }
  .pads {
    gap: 24px;
  }
}
@media (min-width: 980px) {
  .real {
    grid-template-columns: 430px 1fr;
  }
}
@media (min-width: 720px) {
  .pad .name {
    top: 8px;
    left: 14px;
  }
  .pad .name b {
    display: block;
    font-size: 40px;
    line-height: 40px;
  }
}
@media (max-width: 480px) {
  .bar .meter,
  .wide {
    display: none;
  }
  .get .keys .key {
    min-width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .ticker span {
    animation: none;
    padding-left: var(--gutter);
  }
}
