/* Layout: the book cover as a single screen, top to bottom: byline, the burning 22,
   the emblem (the link to the soundtrack), then the title block. */
:root {
  --void: #060505;
  --stripe: rgba(255, 244, 232, 0.07);
  --bone: #ece6dc;
  --ash: #948b82;
  --hairline: rgba(236, 230, 220, 0.22);
  --ember: #ec7a2c;
  --glow: rgba(160, 34, 14, 0.6);

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;

  color-scheme: dark;
  box-sizing: border-box;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--void);
}

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

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--void);
  /* The cover's soft vertical bars. */
  background-image: linear-gradient(90deg, transparent 0 16%, var(--stripe) 40% 56%, transparent 80% 100%);
  background-size: clamp(56px, 8.7vw, 118px) 100%;
  background-position: center top;
  color: var(--bone);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

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

.cover {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3.5vh, 40px);
  min-height: 100%;
  overflow: hidden;
  padding-block: clamp(28px, 6vh, 80px) clamp(28px, 6vh, 64px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  text-align: center;
}

/* The fire is drawn across the whole page, behind the text. */
#fire {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.byline, .novel, .truth {
  margin: 0;
  font-weight: 650;
  font-stretch: 115%;
  text-transform: uppercase;
}
.byline {
  font-size: clamp(13px, 3.4vw, 22px);
  letter-spacing: 0.42em;
  padding-inline-start: 0.42em; /* tracking adds space after the last letter */
}

/* Holds the place where the 22 is drawn. A dark halo knocks the stripes back behind it. */
.art-slot {
  position: relative;
  width: min(100%, 760px, 62vh);
  max-width: 100%;
  aspect-ratio: 1.55;
  margin: 0;
  font-size: inherit;
}
.art-slot::before {
  content: "";
  position: absolute;
  inset: -10% -8%;
  z-index: -2;
  background: radial-gradient(closest-side, var(--void) 58%, transparent);
}

.soundtrack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 6px 14px 10px;
  color: var(--bone);
  text-decoration: none;
  border-radius: 6px;
}
.soundtrack::before {
  content: "";
  position: absolute;
  inset: -36% -50%;
  z-index: -2;
  background: radial-gradient(closest-side, var(--void) 55%, transparent);
}
.soundtrack::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: clamp(200px, 50vw, 290px);
  aspect-ratio: 1;
  translate: -50% -22%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  opacity: 0.7;
  animation: breathe 5s ease-in-out infinite;
  pointer-events: none;
}
.soundtrack:focus-visible { outline: 1px solid var(--ember); outline-offset: 6px; }

.emblem {
  display: block;
  width: clamp(104px, 27vw, 150px);
  height: auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  transition: transform 0.35s ease, color 0.35s ease;
}
.ring { stroke-width: 1.6; }
.ring-inner { stroke-width: 1.1; opacity: 0.85; }
.ticks { stroke-width: 1.6; }
.bars, .plus { stroke-width: 3.6; }
.plus { transition: stroke 0.35s ease; }

/* The emblem draws itself in when the page opens. */
.ring-outer { stroke-dasharray: 327; animation: draw 1.6s 0.5s cubic-bezier(0.3, 0.6, 0.2, 1) backwards; }
.ring-inner { stroke-dasharray: 286; animation: draw 1.6s 0.75s cubic-bezier(0.3, 0.6, 0.2, 1) backwards; }
.ticks, .bars, .plus { animation: appear 0.8s 1.4s ease-out backwards; }

.soundtrack-label {
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 650;
  font-stretch: 115%;
  letter-spacing: 0.34em;
  padding-inline-start: 0.34em;
  padding-bottom: 7px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
  transition: color 0.35s ease, border-color 0.35s ease;
  animation: appear 0.8s 1.2s ease-out backwards;
}
.soundtrack:hover .emblem { transform: scale(1.04); }
.soundtrack:hover .plus { stroke: var(--ember); }
.soundtrack:hover .soundtrack-label { color: var(--ember); border-color: var(--ember); }

.title-block { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.6vh, 14px); }
.novel {
  font-size: clamp(24px, 7vw, 46px);
  letter-spacing: 0.5em;
  padding-inline-start: 0.5em;
}
.truth {
  font-size: clamp(11px, 3vw, 18px);
  letter-spacing: 0.3em;
  padding-inline-start: 0.3em;
}

.byline { animation: appear 1s 0.1s ease-out backwards; }
.title-block { animation: appear 1s 0.9s ease-out backwards; }

@keyframes draw { from { stroke-dashoffset: 327; } }
@keyframes appear { from { opacity: 0; transform: translateY(6px); } }
@keyframes breathe { 50% { opacity: 1; scale: 1.08; } }

@media (prefers-reduced-motion: reduce) {
  .byline, .title-block, .soundtrack-label, .ring-outer, .ring-inner, .ticks, .bars, .plus,
  .soundtrack::after { animation: none; }
  .emblem, .soundtrack-label, .plus { transition: none; }
}

/* Short, wide screens (small laptops): tighten up so the whole cover fits. */
@media (max-height: 760px) and (min-width: 600px) {
  .art-slot { width: min(100%, 56vh); }
  .emblem { width: 118px; }
  .soundtrack { gap: 12px; }
}
