@font-face {
  font-family: 'Fahkwang';
  src: url('./assets/fahkwang-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('./assets/bricolage-grotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('./assets/dm-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #fffaf0;
  --gold: #f5de91;
  --deep: #103a3c;
  --inset: clamp(1.5rem, 6.15vw, 7.5rem);
  --display: 'Bricolage Grotesque', 'DM Sans', Arial, sans-serif;
  font-family: 'DM Sans', Arial, sans-serif;
  color: var(--paper);
  background: var(--deep);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
button { font: inherit; }

.cover {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100svh;
  padding-inline: var(--inset);
  overflow: hidden;
}

.cover-photo, .cover::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cover-photo {
  z-index: -2;
  object-fit: cover;
  object-position: 50% 57%;
}

.cover::before {
  z-index: -1;
  content: '';
  background:
    linear-gradient(180deg, rgb(4 27 32 / .48), transparent 24%),
    linear-gradient(90deg, rgb(3 28 33 / .71), rgb(3 28 33 / .44) 29%, transparent 62%);
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 5.3rem;
  border-bottom: 1px solid rgb(255 250 240 / .36);
}

.wordmark {
  color: inherit;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.078em;
  text-decoration: none;
}

.wordmark span { color: var(--gold); }

.category {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-align: right;
}

.cover-content {
  display: grid;
  justify-items: start;
  align-content: center;
  padding-block: clamp(6rem, 23vh, 15rem) clamp(2.75rem, 7vh, 8rem);
}

h1 {
  font: 700 clamp(3rem, 5.9vw, 7.75rem)/.92 'Fahkwang', 'DM Sans', sans-serif;
  letter-spacing: -.043em;
}

.title-accent {
  display: block;
  color: var(--gold);
  font-size: 1.1em;
}

.cover-details {
  display: grid;
  justify-items: start;
  gap: 1.4rem;
  margin-top: clamp(1.6rem, 4vh, 2.5rem);
}

.cover-details p {
  max-width: 27ch;
  font-size: clamp(1rem, 1.4vw, 1.24rem);
  line-height: 1.42;
  text-wrap: pretty;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  min-height: 3.15rem;
  padding: .75rem 1.15rem;
  border: 0;
  border-radius: 3rem;
  color: #153134;
  background: var(--gold);
  font-size: .93rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.action span { font-size: 1.1rem; line-height: 1; }

@media (hover: hover) {
  .action:hover { background: #fff0bc; }
}

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

dialog {
  width: min(32rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgb(255 250 240 / .34);
  border-radius: .75rem;
  color: var(--paper);
  background: var(--deep);
}

dialog::backdrop { background: rgb(5 24 27 / .72); }

dialog h2 {
  font: 800 clamp(2rem, 5vw, 3rem)/.97 var(--display);
  letter-spacing: -.025em;
}

dialog p { margin-block: 1.15rem 1.5rem; line-height: 1.55; }

@media (max-width: 640px) {
  .cover-photo { object-position: 55% 50%; }

  .cover::before {
    background: linear-gradient(
      180deg,
      rgb(5 32 37 / .64),
      rgb(5 32 37 / .35) 30%,
      transparent 51%,
      transparent 65%,
      rgb(5 32 37 / .78) 93%
    );
  }

  .masthead { min-height: 4.25rem; }
  .wordmark { font-size: 1.75rem; }
  .category { font-size: .61rem; letter-spacing: .1em; }

  .cover-content {
    align-content: space-between;
    gap: clamp(9rem, 29svh, 18rem);
    padding-block: clamp(4.5rem, 16svh, 9rem) max(1.6rem, env(safe-area-inset-bottom));
  }

  h1 { font-size: clamp(2.3rem, 11.6vw, 4.75rem); }

  .cover-details { gap: .85rem; margin-top: 0; }
}

@media (max-width: 640px) and (max-height: 720px) {
  .cover-content { gap: clamp(5.75rem, 20svh, 12rem); }
}

@media (prefers-reduced-motion: reduce) {
  .action { transition: none; }
}
