/* Squiggly's site. Warm paper, Young Serif, and the app itself: every picture on the page is
   Squiggly running against Navidrome's demo server. */

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/young-serif-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/familjen-grotesk-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  color-scheme: light dark;
  --ground: #d6c7a6;
  --surface: #ddd0b4;
  --ink: #1c1b18;
  --soft: #514a3a;
  --accent: #6e4025;
  --line: color-mix(in srgb, var(--ink) 16%, transparent);
  --line-2: color-mix(in srgb, var(--ink) 32%, transparent);
  --serif: "Young Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Familjen Grotesk", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wide: 84rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1d1913;
    --surface: #26211a;
    --ink: #ebe7dd;
    --soft: #b3a993;
    --accent: #eda43a;
  }
}

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

html {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-size: 1.0625rem;
  font-variation-settings: "wght" 430;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
figure,
ul,
ol,
dl,
dd {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: var(--line-2);
}

a:hover {
  text-decoration-color: currentColor;
}

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

kbd {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--soft);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

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

.skip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--ground);
  border-radius: 4px;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.mark {
  width: auto;
  flex: none;
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem max(var(--gutter), calc((100% - var(--wide)) / 2 + var(--gutter))) 0.9rem;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  will-change: transform;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.5rem;
}

.lockup .mark {
  height: 1.05rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-variation-settings: "wght" 520;
}

.nav-links a {
  text-decoration: none;
  color: var(--soft);
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Grid */

.hero,
.part,
.download,
.foot {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.hero,
.part,
.download {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 2.5rem);
  align-items: start;
}

/* Hero: the headline, then the app */

.hero {
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
}

.hero h1 {
  grid-column: 1 / 8;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 1.2rem + 4vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.hero-side {
  grid-column: 8 / 13;
}

.lede {
  max-width: 34rem;
  color: var(--soft);
  text-wrap: pretty;
}

.cta {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.55rem 1.15rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  font-variation-settings: "wght" 570;
  color: var(--ink);
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.btn.primary {
  background: var(--ink);
  color: var(--ground);
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ground);
}

.small {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  color: var(--soft);
  max-width: 34rem;
}

.small code {
  color: var(--ink);
}

.hero-shot {
  grid-column: 1 / 13;
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* Pictures of the app */

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.55);
  background: #2a1a17;
}

.shot figcaption {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--soft);
  max-width: 44rem;
}

/* Parts */

.part {
  padding-top: clamp(4rem, 8vw, 6.5rem);
  align-items: center;
}

.part-text {
  grid-column: 1 / 6;
}

.part-text h2,
.download h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.part-text p {
  margin-top: 1rem;
  color: var(--soft);
  max-width: 30rem;
  text-wrap: pretty;
}

.shot-deck {
  grid-column: 8 / 11;
}

.part-lyrics .shot-lyrics,
.part-palette .shot-palette {
  grid-row: 1;
}

.shot-lyrics {
  grid-column: 1 / 8;
}

.part-lyrics .part-text {
  grid-column: 9 / 13;
}

.part-queue .part-text {
  grid-column: 1 / 5;
}

.shot-queue {
  grid-column: 5 / 13;
}

.shot-palette {
  grid-column: 1 / 8;
}

.part-palette .part-text {
  grid-column: 8 / 13;
}

.part-phone .part-text {
  grid-column: 1 / 6;
}

.shot-phone {
  grid-column: 8 / 11;
}

.shot-phone img {
  border-radius: 22px;
}

/* Download */

.download {
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  row-gap: 2.5rem;
}

.download-lead {
  grid-column: 1 / 6;
}

.download-lead p:not(.cta) {
  margin-top: 1.25rem;
  color: var(--soft);
  max-width: 28rem;
}

.files {
  grid-column: 7 / 13;
  border-top: 1.5px solid var(--ink);
}

.files div {
  display: flex;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.files dt {
  font-variation-settings: "wght" 560;
  white-space: nowrap;
}

.files dt a {
  text-decoration: none;
}

.files dt a:hover {
  text-decoration: underline;
}

.files dd {
  color: var(--soft);
  font-size: 0.9375rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.files dd code {
  font-size: 0.85em;
}

.notes {
  grid-column: 7 / 13;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  color: var(--soft);
  font-size: 0.9375rem;
  max-width: 36rem;
}

/* Footer */

.foot {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.foot .mark {
  height: 0.8rem;
  color: var(--ink);
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.foot-nav a {
  text-decoration: none;
}

.foot-nav a:hover {
  text-decoration: underline;
}

/* Motion: the hero rises in once. */

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

.js .hero > * {
  animation: rise 700ms var(--ease) both;
}

.js .hero > :nth-child(2) { animation-delay: 90ms; }
.js .hero > :nth-child(3) { animation-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Narrow */

@media (max-width: 64rem) {
  .hero h1,
  .hero-side,
  .part-text,
  .part-lyrics .part-text,
  .part-queue .part-text,
  .part-palette .part-text,
  .part-phone .part-text,
  .shot-lyrics,
  .shot-queue,
  .shot-palette,
  .shot-phone,
  .download-lead,
  .files,
  .notes {
    grid-column: 1 / 13;
  }
  .hero-side {
    margin-top: 1.5rem;
  }
  .shot-deck,
  .shot-phone {
    grid-column: 1 / 13;
    max-width: 20rem;
  }
  .part-lyrics .shot-lyrics,
  .part-palette .shot-palette {
    grid-row: 2;
  }
  .shot-deck,
  .shot-lyrics,
  .shot-queue,
  .shot-palette,
  .shot-phone {
    margin-top: 2rem;
  }
  .files {
    margin-top: 0;
  }
}

@media (max-width: 40rem) {
  .hero h1 {
    font-size: clamp(2.5rem, 1rem + 9vw, 3.5rem);
  }
  .cta .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
  .files div {
    flex-direction: column;
    gap: 0.2rem;
  }
  .files dd {
    text-align: left;
  }
  .nav-links a:first-child {
    display: none;
  }
}
