@font-face {
  font-family: Fraunces;
  src: url('../../assets/fraunces-light.ttf') format('truetype');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url('../../assets/fraunces-light-italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 300;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #211916;
  --ink: #f8ecdb;
  --soft: #ceb8a3;
  --line: #60483b;
  --gold: #f4bb7b;
  --serif: Fraunces, Georgia, serif;
  --mono: ui-monospace, 'Menlo', 'Consolas', monospace;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.masthead,
main {
  width: min(100% - 5rem, 1280px);
  margin-inline: auto;
}

.masthead {
  min-height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  font: 0.73rem/1.6 var(--mono);
  color: var(--soft);
}

.masthead a {
  text-decoration: none;
}
.masthead a:hover,
.method:hover {
  color: var(--gold);
}
.masthead-divider {
  margin-inline: 0.5rem;
  color: var(--gold);
}

.intro {
  display: grid;
  grid-template-columns: 1fr minmax(250px, 340px);
  align-items: end;
  column-gap: 1.6rem;
  padding: clamp(1.65rem, 4vw, 3.7rem) 0 2rem;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font: 0.72rem/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.intro .eyebrow {
  grid-column: 1 / -1;
}

.mark {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  margin: 0 0.34rem 0.08rem 0;
  background: var(--gold);
  box-shadow: 0 0 10px #ed9e6890;
}

h1 {
  margin: 0.16em 0 0 -0.035em;
  font-size: clamp(3.2rem, 8vw, 8.1rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.072em;
}

h1 em {
  color: var(--gold);
  font-weight: inherit;
}

.lede {
  max-width: 29ch;
  margin: 0 0 0.05rem;
  color: var(--soft);
  font-size: clamp(1.03rem, 1.5vw, 1.26rem);
  line-height: 1.45;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(225px, 264px);
  align-items: start;
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-bottom: 2.4rem;
}

figure {
  margin: 0;
}

.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #251813;
}

.stage > * {
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
}

canvas {
  visibility: hidden;
}
[data-ready='true'] canvas {
  visibility: visible;
}
[data-ready='true'] .fallback {
  visibility: hidden;
}

figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  color: var(--soft);
  font: 0.7rem/1.5 var(--mono);
}

.controls {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.modes {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.78rem;
}

.modes button {
  flex: 1;
  cursor: pointer;
  min-height: 2.7rem;
  background: none;
  border: 1px solid var(--line);
  color: var(--soft);
  font: 0.75rem/1.4 var(--mono);
}

.modes button[aria-pressed='true'] {
  color: #28190e;
  background: var(--gold);
  border-color: var(--gold);
}

.modes button:enabled:hover {
  border-color: var(--gold);
}
.modes button:disabled {
  cursor: default;
}
.level {
  margin-top: 1.2rem;
}

.label-line {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  color: var(--soft);
  font: 0.72rem/1.4 var(--mono);
}

input[type='range'] {
  width: 100%;
  margin: 0.35rem 0 0;
  min-height: 2rem;
  accent-color: var(--gold);
}

input[type='range']:disabled {
  opacity: 0.55;
}

.mode-note {
  margin: 0.55rem 0 0;
  min-height: 3.7rem;
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.43;
}

.print-tools {
  margin-top: 1.05rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

dl {
  margin: 0.55rem 0 1.1rem;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  border-bottom: 1px solid #49372e;
  padding: 0.58rem 0;
  font: 0.71rem/1.4 var(--mono);
}

dt {
  color: var(--soft);
}
dd {
  margin: 0;
  text-align: right;
}

.download {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem;
  border: 1px solid #a97758;
  color: var(--ink);
  text-decoration: none;
  font: 0.73rem/1.45 var(--mono);
}

.download span:last-child {
  color: var(--gold);
}
.download:hover {
  background: #3c2a21;
}

.method {
  display: inline-block;
  margin-top: 0.8rem;
  font: 0.68rem/1.5 var(--mono);
  color: var(--soft);
  text-underline-offset: 0.23em;
}

@media (max-width: 860px) {
  .masthead,
  main {
    width: min(100% - 2.5rem, 1280px);
  }
  .intro {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .lede {
    max-width: 48ch;
  }
  .workbench {
    grid-template-columns: minmax(0, 1fr);
  }
  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
  }
  .print-tools {
    margin: 0;
    padding: 0;
    border: 0;
  }
}

@media (max-width: 510px) {
  .masthead,
  main {
    width: calc(100% - 1.65rem);
  }
  .masthead {
    min-height: 3.6rem;
  }
  .masthead > span {
    text-align: right;
  }
  .masthead-divider {
    display: none;
  }
  .intro {
    padding-bottom: 1.3rem;
  }
  .stage {
    aspect-ratio: 1.15;
  }
  .stage > * {
    object-fit: cover;
  }
  h1 {
    font-size: clamp(2.6rem, 13vw, 4.1rem);
  }
  .controls {
    grid-template-columns: 1fr;
  }
  .print-tools {
    border-top: 1px solid var(--line);
    padding-top: 1.1rem;
  }
}
