/* Family tools: shared type, colour, buttons, header, footer, records and sleeves. */

@font-face {
  font-family: "Nunito Round";
  src: url("/family-tools/assets/fonts/nunito-rounded.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Soft";
  src: url("/family-tools/assets/fonts/fraunces-soft-black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Soft";
  src: url("/family-tools/assets/fonts/fraunces-soft-black-italic.woff2") format("woff2");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #fbf3e4;
  --paper-deep: #f3e6cd;
  --card: #fffaf0;
  --ink: #123b38;
  --teal: #145b56;
  --teal-deep: #0c3a37;
  --sun: #f8c331;
  --sun-soft: #ffe394;
  --coral: #ed665b;
  --tangerine: #f3873f;
  --mint: #cfe7e1;
  --blush: #ffd9cc;
  --vinyl: #1c1917;
  --muted: #5d6360;
  --on-dark: #fbf3e4;
  --on-dark-muted: #b9d3cd;
  --line: rgba(18, 59, 56, 0.16);
  --display: "Fraunces Soft", Georgia, "Times New Roman", serif;
  --sans: "Nunito Round", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
  --gutter: clamp(20px, 5vw, 56px);
  --measure: 34rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 600 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

ul,
ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

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

.on-dark :focus-visible {
  outline-color: var(--sun);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Type */

.display {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.display--roman {
  font-style: normal;
}

.lede {
  font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.3125rem);
  line-height: 1.5;
  font-weight: 700;
  max-width: var(--measure);
  text-wrap: pretty;
}

.small {
  font-size: 0.875rem;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.on-dark {
  color: var(--on-dark);
}

.on-dark .muted {
  color: var(--on-dark-muted);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--on-dark);
  font-weight: 900;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  transition:
    transform 0.25s var(--ease-spring),
    background-color 0.2s,
    box-shadow 0.25s;
  box-shadow: 0 4px 0 rgba(12, 58, 55, 0.22);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(12, 58, 55, 0.22);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(12, 58, 55, 0.22);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--sun {
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.btn--sun:hover {
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
}

.btn--coral {
  background: var(--coral);
  color: #fff8ee;
}

.btn--quiet {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 2px currentColor;
}

.btn--quiet:hover,
.btn--quiet:active {
  box-shadow: inset 0 0 0 2px currentColor;
}

.btn--small {
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.9375rem;
}

.link {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
}

.text-button {
  min-height: 2.75rem;
  padding: 0.4rem 0.2rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
}

/* Header and footer */

.ft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  max-width: 82rem;
  margin: 0 auto;
}

.ft-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 1000;
  font-size: 1.375rem;
  letter-spacing: -0.04em;
  text-decoration: none;
  line-height: 1;
}

.ft-brand__spark {
  color: var(--coral);
}

.ft-brand__sub {
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.ft-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 800;
}

.ft-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  text-decoration: none;
}

.ft-nav a:hover {
  background: rgba(18, 59, 56, 0.08);
}

.on-dark .ft-nav a:hover {
  background: rgba(251, 243, 228, 0.12);
}

.ft-footer {
  background: var(--teal-deep);
  color: var(--on-dark);
  padding: 3rem var(--gutter) 2.5rem;
}

.ft-footer__inner {
  max-width: 76rem;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

.ft-footer__about {
  max-width: 30rem;
  color: var(--on-dark-muted);
}

.ft-footer__about strong {
  color: var(--on-dark);
}

.ft-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-weight: 800;
  font-size: 0.9375rem;
}

.ft-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

.ft-footer__links a:hover {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.ft-footer__fine {
  color: var(--on-dark-muted);
  font-size: 0.8125rem;
  max-width: 44rem;
}

@media (min-width: 768px) {
  .ft-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .ft-footer__fine {
    grid-column: 1 / -1;
  }
}

/* A vinyl record. Size it with width; --label and --label-ink colour the centre. */

.vinyl {
  --label: var(--coral);
  --label-ink: #fff8ee;
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 17.5%, rgba(255, 255, 255, 0.05) 17.6% 18.2%, transparent 18.3%),
    conic-gradient(
      from 20deg,
      transparent 0 8%,
      rgba(255, 255, 255, 0.16) 12%,
      transparent 17% 50%,
      rgba(255, 255, 255, 0.12) 56%,
      transparent 62%
    ),
    repeating-radial-gradient(circle, #1c1917 0 1.1px, #2b2623 1.2px 2.3px);
  box-shadow:
    0 0 0 1px #0f0d0c,
    0 18px 34px -14px rgba(0, 0, 0, 0.55);
  flex: none;
}

.vinyl__spin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: vinyl-spin 2.6s linear infinite;
  animation-play-state: paused;
}

.is-playing .vinyl__spin,
.vinyl.is-spinning .vinyl__spin {
  animation-play-state: running;
}

.vinyl__label {
  position: absolute;
  inset: 32.5%;
  border-radius: 50%;
  background: var(--label);
  color: var(--label-ink);
  display: grid;
  place-content: center;
  text-align: center;
  container-type: inline-size;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.vinyl__label::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 200deg, rgba(255, 255, 255, 0.22), transparent 30% 70%, rgba(0, 0, 0, 0.1));
}

.vinyl__label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.vinyl__title {
  position: relative;
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: 12cqw;
  line-height: 1;
  padding: 0 9cqw 30cqw;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

@keyframes vinyl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* A record sleeve: a square of colour, shapes, and the family's line in big type. */

.sleeve {
  --bg: var(--sun);
  --a: var(--coral);
  --b: var(--teal);
  --fg: var(--ink);
  --hook: 11;
  position: relative;
  aspect-ratio: 1;
  container-type: inline-size;
  background: var(--bg);
  color: var(--fg);
  border-radius: clamp(4px, 1.6cqw, 12px);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 24px 44px -20px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.12);
  isolation: isolate;
  flex: none;
}

/* Top to bottom: who, their line, a band of shapes, the label. Nothing overlaps, so the line
   stays readable on every colourway. */
.sleeve__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 30cqw auto;
}

.sleeve__family {
  padding: 6.5cqw 7cqw 0;
  font-weight: 1000;
  font-size: 4.3cqw;
  line-height: 1.15;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.sleeve__hook {
  padding: 3cqw 7cqw 0;
  overflow: hidden;
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: calc(var(--hook) * 1cqw);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.sleeve__art {
  width: 100%;
  height: 100%;
}

.sleeve__foot {
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  padding: 2.6cqw 7cqw 3cqw;
  font-weight: 900;
  font-size: 2.9cqw;
  line-height: 1.2;
}

/* Ring wear and paper tooth: what makes a flat colour read as a card sleeve. */
.sleeve::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 58% 50%, transparent 0 40%, rgba(0, 0, 0, 0.05) 41% 42%, transparent 43%),
    linear-gradient(105deg, rgba(255, 255, 255, 0.14), transparent 30% 70%, rgba(0, 0, 0, 0.07));
  mix-blend-mode: multiply;
}

/* An album: the sleeve with its record part-way out. */

.album {
  position: relative;
  width: 100%;
  display: block;
}

.album > .vinyl {
  position: absolute;
  top: 3%;
  left: 3%;
  width: 94%;
  transform: translateX(var(--out, 34%));
  transition: transform 0.9s var(--ease-out);
}

.album > .sleeve {
  position: relative;
  width: 100%;
  z-index: 1;
}

.album--closed {
  --out: 4%;
}

.album--open {
  --out: 46%;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
