* {
  box-sizing: border-box;
}
body {
  --bg: #f8f7f2;
  --paper: #fffefa;
  --ink: #202f28;
  --muted: #5e6861;
  --rule: #cbd0c6;
  --accent: #33573f;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.6 system-ui,
    sans-serif;
}
body.night {
  --bg: #161c1b;
  --paper: #202927;
  --ink: #edece2;
  --muted: #b8c6bb;
  --rule: #49554f;
  --accent: #bad3c1;
}
a {
  color: inherit;
  text-decoration: none;
}
header,
main {
  max-width: 1480px;
  padding-inline: 4vw;
  margin: auto;
}
header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.brand {
  font:
    650 23px Georgia,
    serif;
  letter-spacing: -0.07em;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
button[aria-pressed="true"],
.feature {
  color: var(--bg);
  background: var(--accent);
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #ba812c;
  outline-offset: 3px;
}
.intro {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  align-items: center;
  gap: 4vw;
  padding: 36px 0;
}
.intro h1 {
  font:
    550 clamp(40px, 5vw, 72px)/1.1 Georgia,
    AppleMyungjo,
    serif;
  letter-spacing: -0.08em;
  margin: 10px 0 15px;
}
.intro p,
.group p,
#count {
  color: var(--muted);
}
.overline {
  font-size: 13px;
  font-weight: 650;
}
.feature {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 5px;
  margin-top: 4px;
}
.scene {
  position: relative;
  aspect-ratio: 1.895;
  background: #111;
  border-radius: 9px;
}
.night .scene {
  background-position: center bottom;
}
.scene i {
  position: absolute;
  left: 30.65%;
  top: 19.9%;
  width: 38.6%;
  aspect-ratio: 16/9;
  background: linear-gradient(100deg, #476766, #9cc7a7, #eac977, #e9927c);
}
#library {
  border-top: 1px solid var(--rule);
  padding: 22px 0 44px;
}
.libhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.libhead h2 {
  font-size: 27px;
  letter-spacing: -0.07em;
  margin: 0;
}
.libhead label {
  font-size: 13px;
}
.libhead input {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 8px 10px;
  border-radius: 5px;
}
#filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
#filters button {
  font-size: 13px;
}
#count {
  font-size: 13px;
}
#groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.group,
.sheet {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 9px;
  padding: 18px;
}
.group h3 {
  font-size: 21px;
  margin: 12px 0 0;
  letter-spacing: -0.055em;
}
.group p {
  font-size: 13px;
  margin: 4px 0 12px;
}
.group a {
  display: block;
  padding: 8px 20px 8px 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.group a:hover {
  text-decoration: underline;
}
.group a:after {
  content: "↗";
  position: absolute;
  right: 0;
  color: var(--muted);
}
.sample {
  height: 38px;
  background: #44584e;
  border-radius: 4px;
}
.s0 {
  background: linear-gradient(
    90deg,
    #dfddd1 25%,
    #333e38 25% 50%,
    #ab6f61 50% 75%,
    #859884 75%
  );
}
.s1 {
  background: linear-gradient(90deg, #4c4f62, #8a91a6, #dbaf9b, #dfcd92);
}
.s2 {
  background: repeating-conic-gradient(#58625b 0 25%, #cfd7c9 0 50%) 0 0/8px 8px;
}
.s3 {
  background: repeating-linear-gradient(
    110deg,
    #32493d 0 26px,
    #a6bea6 27px 33px
  );
}
.s4 {
  background: repeating-linear-gradient(#475b54 0 2px, #c0c9ae 3px 5px);
}
.s5 {
  background: repeating-linear-gradient(90deg, #adbaa8 0 2px, #e0dfd5 3px 20px);
}
.back {
  color: var(--muted);
  display: inline-block;
  margin-top: 16px;
}
.sheets {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 15px;
  margin: 18px 0 38px;
}
.sheet h2 {
  font-size: 16px;
  margin: 0 0 9px;
}
.sheet p {
  margin: 6px 0;
  color: var(--muted);
}
.sheet output {
  display: block;
}
.sheet #log {
  border: 0;
  margin: 0;
  padding: 0;
}
.sheets small {
  color: var(--muted);
}
@media (max-width: 900px) {
  #groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sheets {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 650px) {
  .intro,
  .sheets,
  #groups {
    grid-template-columns: 1fr;
  }
  .intro {
    gap: 18px;
    padding: 20px 0;
  }
  .intro h1 br {
    display: none;
  }
  .libhead {
    align-items: flex-start;
    flex-direction: column;
  }
  .scene {
    width: 100%;
  }
  .libhead input {
    max-width: 68vw;
  }
}
#timing {
  margin-top: 12px;
  font-size: 13px;
}
#interval {
  margin-top: 4px;
}
#result:empty {
  display: none;
}
.sheet:has(#result) {
  border-top: 3px solid var(--accent);
}
.sheet #surface {
  display: block;
}
body:not(.night) {
  --bg: #f8f6f0;
  --paper: #f5f2eb;
  --rule: #d8d4c9;
  --ink: #1b3b2b;
  --accent: #1b3b2b;
}
header,
main {
  max-width: 1440px;
}
.group,
.sheet,
.feature,
.scene,
.photo,
button {
  border-radius: 4px;
}
.sheet h2,
.group h3 {
  font-family: Georgia, AppleMyungjo, serif;
}
.sheet h2 {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
}
.group:hover {
  border-color: var(--muted);
}
#surface,
#result,
#interval {
  font-variant-numeric: tabular-nums;
}
