:root {
  --paper: #ffffff;     /* page */
  --charcoal: #23221f;  /* text, button */
  --graphite: #6d6a64;  /* secondary text */
  --rule: #d9d5cd;      /* hairlines */
  --faint: rgba(35, 34, 31, 0.3);  /* tertiary: footer */

  /* 4 px base */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;
  --s9: 8rem;

  /* Type: 13 / 17 px; title grows from 38 px at 375 wide to 48 px at 1024 */
  --text-small: 0.8125rem;
  --text-body: 1.0625rem;
  --text-title: clamp(2.375rem, 2.014rem + 1.541vw, 3rem);

  --wide: 39rem;  /* desktop image and lower section */
  --margin: clamp(1.5rem, 5vw, 6rem);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

p,
h1,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
}

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

/* Hero: one centered column, 64 px from the top */

.hero {
  display: grid;
  justify-items: center;
  gap: var(--s6);
  padding: var(--s8) var(--margin) var(--s6);
}

/* Intro */

/* Gaps: h1 to CTA 24, CTA to price 12; the hero's bottom padding puts the subheadline 32 below */
.intro {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
}

h1 {
  max-width: 12ch;
  font-size: var(--text-title);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  display: grid;
  gap: var(--s3);
  align-content: start;
  color: var(--graphite);
  text-wrap: pretty;
}

.buy {
  display: grid;
  justify-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
}

.button {
  padding: var(--s3) var(--s5);
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  background: #000;
}

.price {
  font-size: var(--text-small);
  color: var(--graphite);
  text-wrap: balance;
}

/* Product: a square render on phones, 2:1 on desktop; transparent, so the paper shows through */

.product {
  display: block;
  width: min(100%, 24rem);
}

.product img {
  display: block;
  width: 100%;
  height: auto;
}

/* Detail: subheadline then specs; side by side on desktop */

.detail {
  display: grid;
  gap: var(--s7);
  width: min(100% - 2 * var(--margin), 24rem);
  margin: 0 auto;
  padding-bottom: var(--s9);
}

.specs {
  border-top: 1px solid var(--rule);
}

.specs div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule);
}

.specs dt {
  color: var(--graphite);
}

.specs dd {
  text-align: right;
}

/* Footer */

.footer {
  padding: 0 var(--margin) var(--s6);
  color: var(--faint);
  font-size: var(--text-small);
  text-align: center;
}

/* Larger screens: 128 px on top, a wide 2:1 image, subheadline and specs side by side, both --wide */

@media (min-width: 64rem) {
  .hero {
    padding-top: var(--s9);
    padding-bottom: var(--s8);
  }

  .product {
    width: min(100%, var(--wide));
  }

  .detail {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--s7);
    align-items: start;
    width: min(100% - 2 * var(--margin), var(--wide));
  }

  .specs {
    border-top: 0;
  }

  /* First row starts level with the subheadline */
  .specs div:first-child {
    padding-top: 0;
  }
}
