/* ==========================================================================
   Cradle Of Grace — Exordium
   Static recreation of https://cradleofgrace.info
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-rule: rgba(17, 17, 17, 0.2);
  --color-button: #111111;
  --color-button-hover: rgba(17, 17, 17, 0.85);
  --color-button-text: #ffffff;
  --color-focus: #686868;

  --content-width: 645px;
  --wide-width: 1340px;
  --gutter: clamp(30px, 5vw, 50px);

  --space-20: 10px;
  --space-50: clamp(30px, 5vw, 50px);
  --space-60: clamp(30px, 7vw, 70px);
  --block-gap: 1.2rem;

  --radius: 19px;
  --shadow: 6px 6px 9px rgba(0, 0, 0, 0.2);

  --text-medium: clamp(1rem, calc(1rem + ((1vw - 0.2rem) * 0.196)), 1.125rem);
  --text-large: clamp(1.125rem, calc(1.125rem + ((1vw - 0.2rem) * 0.392)), 1.375rem);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  padding-inline: var(--gutter);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-large);
  font-weight: 300;
  letter-spacing: -0.1px;
  line-height: 1.4;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

p {
  margin: 0;
  font-weight: 300;
  text-wrap: pretty;
}

a {
  color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.1em;
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 8px;
  z-index: 100;
  padding: 15px 23px 14px;
  background-color: #eeeeee;
  color: #444444;
  font-size: 1rem;
  line-height: normal;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 8px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

main {
  padding-top: calc(var(--space-60) * 2);
  padding-bottom: var(--space-60);
}

.content {
  max-width: var(--wide-width);
  margin-inline: auto;
}

/* Most blocks sit in the narrow, centred text column… */
.content > * {
  max-width: var(--content-width);
  margin-inline: auto;
}

/* …while the separators can stretch to the wide measure. */
.content > .rule {
  max-width: var(--wide-width);
}

.content > * + * {
  margin-top: var(--block-gap);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tagline {
  margin-block: var(--block-gap) 0;
  font-size: var(--text-large);
  font-weight: 400;
  letter-spacing: -0.1px;
  line-height: 1.125;
  text-align: center;
  text-wrap: pretty;
}

.lede {
  padding-top: 1.4em;
  text-align: center;
}

.centered {
  text-align: center;
}

/* --------------------------------------------------------------------------
   Track artwork gallery
   -------------------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--block-gap);
  row-gap: calc(var(--block-gap) + 20px);
  padding-block: var(--space-20);
}

.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  box-shadow: var(--shadow);
}

@media (min-width: 600px) {
  .gallery {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Rules
   -------------------------------------------------------------------------- */

.content > .rule {
  width: 100%;
  margin-block: var(--space-50);
  border: 0;
  border-top: 1px solid var(--color-rule);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.button {
  display: inline-block;
  max-width: 100%;
  padding: 16px 36px;
  border: 0;
  border-radius: 9999px;
  background-color: var(--color-button);
  color: var(--color-button-text);
  font-family: inherit;
  font-size: var(--text-medium);
  font-weight: 300;
  letter-spacing: inherit;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.button:hover,
.button:focus-visible {
  background-color: var(--color-button-hover);
  color: var(--color-button-text);
  text-decoration: none;
}

.spacer {
  height: 30px;
}

/* --------------------------------------------------------------------------
   Track listing
   -------------------------------------------------------------------------- */

.tracklist {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--text-medium);
}

/* The original table sits flush against the spacer above it. */
.content > .tracklist-wrap {
  margin-top: 0;
}

.tracklist td {
  width: 50%;
  padding: 0.5em;
  border: 0;
  vertical-align: top;
}

.tracklist td:first-child {
  text-align: right;
}

.tracklist td:last-child {
  text-align: left;
}

.tracklist ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: track 0;
}

.tracklist ol.is-second-half {
  counter-reset: track 5;
}

.tracklist li {
  counter-increment: track;
}

.tracklist li::before {
  content: counter(track) ". ";
}

/* --------------------------------------------------------------------------
   Artwork
   -------------------------------------------------------------------------- */

.artwork {
  margin-inline: auto;
}

.artwork--cd {
  max-width: 405px;
}

.artwork--rear {
  max-width: 385px;
}

.artwork--rear img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------------
   Contact / footer
   -------------------------------------------------------------------------- */

.contact {
  text-align: right;
}

.contact > * + * {
  margin-top: var(--block-gap);
}

.contact .label {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

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