/* ===================================================================
   Home / cover page
   =================================================================== */
@use '../mixins' as m; 

// ===== Cover hero =====
.cover-hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cover-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(90, 14, 14, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(120, 20, 20, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(20, 8, 8, 1) 0%, transparent 60%),
    var(--bg);

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='4' seed='8'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
    opacity: 0.5;
  }

  .brush {
    position: absolute;
    left: -5%;
    right: -5%;
    top: 56%;
    height: 220px;
    pointer-events: none;
    opacity: 0.55;
  }
}

.cover-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 120px 32px 40px;

  @include m.bp(m.$bp-tablet, min) {
    padding: 140px 80px 60px;
  }
}

.cover-titleblock {
  align-self: center;
  max-width: 1100px;
}

.cover-eyebrow {
  @include m.mono-label(12px, 0.4em);
  color: var(--accent);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;

  &::before {
    content: "";
    width: 32px;
    height: 1px;
    background: var(--accent);
  }
}

.cover-title {
  font-family: var(--font-display);
  font-size: clamp(72px, 11vw, 168px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--paper);
  margin-bottom: 32px;
  text-wrap: balance;

  em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent-bright);
    display: block;
  }
}

.cover-tagline {
  @include m.display-italic(clamp(20px, 2vw, 26px));
  color: var(--ink-dim);
  max-width: 540px;
  line-height: 1.4;
  margin-bottom: 48px;
}

.cover-meta {
  display: flex;
  align-items: center;
  gap: 32px;
  @include m.mono-label(11px, 0.25em);
  color: var(--ink-dim);

  .pip { color: var(--accent); }
}

.cover-bottom {
  align-self: end;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: end;
  padding-top: 60px;
  border-top: 1px solid var(--rule);

  @include m.bp(m.$bp-tablet, min) {
    grid-template-columns: auto 1fr auto;
    gap: 60px;
  }
}

.cover-cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  @include m.mono-label(12px, 0.3em);
  color: var(--paper);
  text-decoration: none;
  padding: 18px 28px;
  border: 1px solid var(--accent);
  background: rgba(185, 28, 28, 0.08);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;

  &:hover {
    background: rgba(185, 28, 28, 0.2);
    border-color: var(--accent-bright);
    transform: translateX(4px);
  }

  .arr { color: var(--accent); }
}

.cover-warning {
  @include m.mono-label(10px, 0.25em);
  color: var(--ink-faint);
  line-height: 1.8;
  max-width: 280px;
  text-align: left;

  @include m.bp(m.$bp-tablet, min) {
    text-align: right;
  }

  .label {
    color: var(--accent);
    display: block;
    margin-bottom: 6px;
  }
}

.cover-stamp {
  @include m.mono-label(10px, 0.25em);
  color: var(--ink-faint);
  line-height: 1.8;
}

// ===== Chapter index =====
.index-section {
  position: relative;
  padding: 100px 32px;
  background: var(--bg-2);
  border-top: 1px solid var(--rule);

  @include m.bp(m.$bp-tablet, min) {
    padding: 160px 80px 120px;
  }
}

.index-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 60px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;

  @include m.bp(m.$bp-tablet, min) {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-bottom: 100px;
  }

  h2 {
    font-family: var(--font-display);
    font-size: clamp(56px, 7vw, 96px);
    font-style: italic;
    font-weight: 300;
    line-height: 1;
    color: var(--paper);
    letter-spacing: -0.02em;
  }

  .text {
    @include m.display-italic(22px);
    color: var(--ink-dim);
    line-height: 1.5;
    max-width: 36ch;
    align-self: end;
  }
}

.index-list {
  max-width: 1400px;
  margin: 0 auto;
  list-style: none;

  li {
    border-top: 1px solid var(--rule);

    &:last-child { border-bottom: 1px solid var(--rule); }
  }

  a {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: center;
    gap: 20px;
    padding: 36px 24px;
    text-decoration: none;
    color: var(--ink);
    transition: padding 0.4s, background 0.4s;
    position: relative;

    &:hover {
      background: rgba(185, 28, 28, 0.06);
      padding-left: 48px;

      &::before { width: 3px; }

      .index-title { color: var(--accent-bright); }
      .index-arrow { color: var(--accent-bright); transform: translateX(8px); }
    }

    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 0;
      background: var(--accent);
      transition: width 0.4s;
    }

    @include m.bp(m.$bp-tablet, min) {
      grid-template-columns: 100px 1fr 200px 80px;
      gap: 40px;
    }
  }
}

.index-num {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.index-title {
  @include m.display-italic(clamp(28px, 3vw, 42px));
  font-weight: 400;
  line-height: 1.1;
  color: var(--paper);
}

.index-meta {
  @include m.mono-label(11px, 0.2em);
  color: var(--ink-faint);
  display: none;

  @include m.bp(m.$bp-tablet, min) {
    display: block;
  }
}

.index-arrow {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  transition: color 0.3s, transform 0.3s;
}

// ===== Footer =====
.cover-footer {
  padding: 80px 32px 60px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  @include m.mono-label(10px, 0.25em);
  color: var(--ink-faint);

  .center { color: var(--accent); text-align: left; }
  .right { text-align: left; }

  @include m.bp(m.$bp-tablet, min) {
    padding: 80px 80px 60px;
    grid-template-columns: 1fr auto 1fr;

    .center { text-align: center; }
    .right { text-align: right; }
  }
}

// Floating numerals in cover bg
.cover-numerals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;

  span {
    position: absolute;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    color: rgba(185, 28, 28, 0.05);
    user-select: none;

    &:nth-child(1) { font-size: 320px; top: 8%; left: -40px; }
    &:nth-child(2) { font-size: 200px; top: 60%; right: 6%; color: rgba(232, 226, 214, 0.025); }
  }
}
