@import url("https://fonts.googleapis.com/css2?family=Exo+2:wght@200;300&display=swap");

@font-face {
  font-family: "Hail Mary Sans";
  src: url("assets/fonts/HailMarySans.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --white: #fff7f7;
  --soft-white: rgba(255, 247, 247, 0.78);
  --muted: rgba(255, 247, 247, 0.58);
  --red: #ff3858;
  --deep-red: #170004;
  --panel: rgba(10, 0, 4, 0.42);
  --line: rgba(255, 247, 247, 0.16);
  --black: #050003;
}

* {
  box-sizing: border-box;
}

html {
  cursor: url("assets/astrophage-cursor.svg") 8 6, auto;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

a,
button,
summary,
[role="button"] {
  cursor: url("assets/astrophage-cursor.svg") 8 6, pointer;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background: var(--black);
  font-family: "Exo 2", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  isolation: isolate;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(rgba(5, 0, 3, 0.46), rgba(5, 0, 3, 0.68)),
    url("assets/red-cosmic-background.png") center center / cover no-repeat;
  content: "";
  pointer-events: none;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.32)),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 4px;
  content: "";
  opacity: 0.45;
  pointer-events: none;
}

#astrophage-field {
  position: fixed !important;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  opacity: 0.95;
  pointer-events: none;
  mix-blend-mode: screen;
}

.top-bar {
  position: fixed;
  top: 0.9rem;
  left: 50%;
  z-index: 10;
  display: flex;
  width: max-content;
  max-width: calc(100% - 2rem);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem;
  color: var(--soft-white);
  background: rgba(8, 0, 4, 0.48);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.topic-links a {
  color: inherit;
  text-decoration: none;
}

.topic-links {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.12rem;
}

.topic-links a {
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 300;
}

.topic-links a:hover,
.topic-links a:focus-visible {
  color: var(--white);
  background: rgba(255, 247, 247, 0.08);
  outline: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.6rem, 6vw, 4.6rem) 0 5rem;
  text-align: center;
}

.hero {
  min-height: min(560px, 74vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(0.7rem, 2.5vh, 1.6rem);
}

.kicker {
  margin: 0 0 0.85rem;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  position: relative;
  max-width: min(15ch, 100%);
  margin: 0 auto;
  color: var(--white);
  font-family: "Hail Mary Sans", "Exo 2", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.7rem, 6.4vw, 5.2rem);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.62),
    0 0 22px rgba(50, 255, 226, 0.26),
    0 0 34px rgba(255, 137, 49, 0.3);
}

h1::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  color: transparent;
  background: linear-gradient(90deg, #ff5d32 0%, #ffd15c 24%, #52ffe1 52%, #4bb7ff 74%, #ff61d8 100%);
  background-clip: text;
  content: attr(data-text);
  filter: blur(16px);
  opacity: 0.78;
  transform: scale(1.025);
  -webkit-background-clip: text;
  pointer-events: none;
}

.tagline {
  width: min(620px, 100%);
  margin: 1.8rem auto 0;
  color: var(--soft-white);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 300;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.book-meta > span {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  color: var(--soft-white);
  background: rgba(255, 247, 247, 0.04);
  backdrop-filter: blur(14px);
  font-size: 0.9rem;
  font-weight: 300;
}

.author-popover {
  position: relative;
  justify-content: center;
  cursor: url("assets/astrophage-cursor.svg") 8 6, pointer;
  outline: none;
}

.author-popover::after {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.36rem);
  width: 0.72rem;
  height: 0.72rem;
  background: rgba(8, 0, 4, 0.88);
  border-left: 1px solid rgba(255, 247, 247, 0.16);
  border-top: 1px solid rgba(255, 247, 247, 0.16);
  content: "";
  opacity: 0;
  transform: translate(-50%, 0.2rem) rotate(45deg);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  pointer-events: none;
}

.author-bio {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 50%;
  z-index: 4;
  width: min(18rem, calc(100vw - 2.5rem));
  border: 1px solid rgba(255, 247, 247, 0.16);
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  color: rgba(255, 247, 247, 0.82);
  background: rgba(8, 0, 4, 0.88);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    0 0 30px rgba(255, 73, 94, 0.12);
  font-size: 0.86rem;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 0.5rem);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.author-popover:hover::after,
.author-popover:focus-visible::after,
.author-popover:hover .author-bio,
.author-popover:focus-visible .author-bio {
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}

.author-popover:hover .author-bio,
.author-popover:focus-visible .author-bio {
  transform: translate(-50%, 0);
}

.author-popover:focus-visible {
  border-color: rgba(255, 247, 247, 0.34);
}

.content-section {
  scroll-margin-top: 5.5rem;
  margin: 0 auto 1.3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.35rem, 4vw, 2.35rem);
  color: var(--soft-white);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.content-section h2 {
  width: min(720px, 100%);
  margin: 0 auto 1rem;
  color: var(--white);
  font-size: clamp(2rem, 5vw, 3.65rem);
  font-weight: 200;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.content-section p {
  width: min(720px, 100%);
  margin: 0.85rem auto 0;
  font-size: 1rem;
}

.minimal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  width: min(760px, 100%);
  margin: 1.5rem auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.minimal-grid article {
  padding: 1.2rem;
  background: rgba(5, 0, 3, 0.42);
}

.character-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin: 0 0 1rem;
  border: 1px solid rgba(255, 247, 247, 0.16);
  border-radius: 6px;
}

.character-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 247, 247, 0.16);
  border-radius: 6px;
  background: var(--line);
}

.character-pair img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h3 {
  margin: 0;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.2;
}

.minimal-grid p {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.brief-list {
  width: min(720px, 100%);
  margin: 1.25rem auto 0;
  text-align: left;
}

.brief-item {
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 0.95rem 0;
  cursor: url("assets/astrophage-cursor.svg") 8 6, pointer;
  outline: none;
}

.brief-item:last-child {
  border-bottom: 1px solid var(--line);
}

.brief-item h3 {
  margin: 0;
  color: var(--white);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.35;
}

.brief-item p {
  width: 100%;
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-0.25rem);
  transition:
    max-height 0.28s ease,
    margin-top 0.22s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.brief-item:hover p,
.brief-item:focus p,
.brief-item:focus-within p {
  max-height: 16rem;
  margin-top: 0.65rem;
  opacity: 1;
  transform: translateY(0);
}

.brief-item:focus-visible {
  outline: 1px solid rgba(255, 247, 247, 0.34);
  outline-offset: 0.25rem;
}

em {
  color: var(--white);
  font-style: normal;
}

.final-pitch {
  color: var(--white);
  font-weight: 300;
}

@media (max-width: 680px) {
  body::before {
    background:
      linear-gradient(rgba(5, 0, 3, 0.42), rgba(5, 0, 3, 0.72)),
      url("assets/red-cosmic-background.png") center center / cover no-repeat;
  }

  .page-shell {
    width: min(100% - 1.1rem, 920px);
    padding-top: 4.35rem;
  }

  .top-bar {
    top: 0.55rem;
    max-width: calc(100% - 1rem);
    border-radius: 999px;
    padding: 0.28rem;
  }

  .topic-links {
    display: flex;
    justify-content: center;
  }

  .hero {
    min-height: 66vh;
    padding-top: 1rem;
  }

  .kicker {
    font-size: 0.68rem;
    letter-spacing: 0;
  }

  h1 {
    max-width: min(13ch, 100%);
    font-size: clamp(2.35rem, 12vw, 3.4rem);
    line-height: 1.22;
  }

  .book-meta > span {
    font-size: 0.82rem;
  }

  .minimal-grid {
    grid-template-columns: 1fr;
  }

  .brief-list {
    text-align: center;
  }
}
