/* CupelWorks landing site. One stylesheet for every page.
   The CSP forbids inline styles, so all styling lives here. */

@font-face {
  font-family: "Besley";
  src: url("fonts/besley-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ash: #e4e6e3;       /* page: the grey of a fired cupel */
  --bone: #f3f4f1;      /* light surfaces and text on slate */
  --slate: #1c2a35;     /* ink */
  --lead: #51606b;      /* secondary text */
  --litharge: #e2b13c;  /* the bead, and nothing else on a light surface */
  --rule: rgba(28, 42, 53, 0.2);

  --display: "Besley", Georgia, "Times New Roman", serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section: clamp(3rem, 8vw, 6rem);
}

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

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

body {
  margin: 0;
  background: var(--ash);
  color: var(--slate);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 560;
  line-height: 1.12;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
  letter-spacing: -0.005em;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.25;
}

p {
  margin: 0;
  max-width: 34em;
}

p + p {
  margin-top: 1em;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

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

.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Masthead */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.5rem;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.3125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2rem, 7vw, 5.5rem) var(--section);
}

.hero h1 {
  font-size: clamp(2.375rem, 6vw, 4.125rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
}

.lede {
  margin-top: 1.5rem;
  font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  line-height: 1.5;
  max-width: 30em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 3px;
  background: var(--slate);
  color: var(--bone);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: #0f1a22;
}

.cupel {
  margin: 0;
}

.cupel svg {
  display: block;
  width: 100%;
  height: auto;
}

.cupel figcaption {
  margin-top: 0.75rem;
  max-width: 26em;
  color: var(--lead);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* The one moment of motion: the bead brightens once, the way a real bead
   flashes when the last of the lead leaves it. */

.bead {
  fill: #f0cd72;
  animation: brighten 2.6s 0.5s ease-out both;
}

.glow {
  fill: #f0cd72;
  opacity: 0.4;
  transform-box: fill-box;
  transform-origin: center;
  animation: flash 2.6s 0.5s ease-out both;
}

@keyframes brighten {
  0% { fill: #7d878e; }
  45% { fill: #fff3cf; }
  100% { fill: #f0cd72; }
}

@keyframes flash {
  0% { opacity: 0; transform: scale(0.5); }
  45% { opacity: 0.95; transform: scale(1.25); }
  100% { opacity: 0.4; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .bead,
  .glow {
    animation: none;
  }
}

/* Sections */

.band {
  padding-block: var(--section);
  border-top: 1px solid var(--rule);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 4vw, 3.5rem);
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.9rem;
  color: var(--lead);
  font-family: var(--display);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1;
}

.steps p {
  margin-top: 0.5rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.band-dark {
  border-top: 0;
  background: var(--slate);
  color: var(--bone);
}

.band-dark a:focus-visible {
  outline-color: var(--litharge);
}

.colophon {
  padding-block: 1.75rem 2.5rem;
  color: var(--lead);
  font-size: 0.9375rem;
}

/* Not found page */

.notfound {
  padding-block: var(--section);
}

.notfound h1 {
  font-size: clamp(2.125rem, 5vw, 3.25rem);
  letter-spacing: -0.015em;
}

.notfound p {
  margin-top: 1.25rem;
}

/* Small screens */

@media (max-width: 46rem) {
  .hero,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .cupel svg {
    max-width: 22rem;
  }
}
