/* =========================================================
   AME BOOKS PAGE — DARK GLASS SYSTEM
   Matches Index / Vision / Subjects / Fitness / Nutrition / Discipline.
   ========================================================= */

html,
body {
  background: #02040a !important;
}

body {
  overflow-x: hidden;
}

.aurora {
  display: none !important;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block !important;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.045) 1px, transparent 1px);
  background-size: 86px 86px;
  opacity: 0.55;
}

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.books-main,
footer {
  position: relative;
  z-index: 1;
}

.books-main {
  padding-top: clamp(122px, 14vh, 156px);
}

.books-container {
  width: min(calc(100% - 48px), var(--max));
}

.books-hero {
  position: relative;
  padding: 0 0 clamp(44px, 7vh, 82px);
  isolation: isolate;
}

.books-hero-card,
.reading-card,
.library-card,
.books-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid rgba(255, 255, 255, 0.055);
  border-radius: clamp(24px, 2.2vw, 35px);
  background: rgba(8, 14, 28, 0.70);
}

.books-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
  gap: clamp(24px, 4vw, 62px);
  align-items: center;
  min-height: clamp(420px, 54vh, 610px);
  padding: clamp(30px, 5vw, 70px);
}

.books-kicker {
  margin: 0 0 clamp(18px, 2vw, 26px);
  color: rgba(142, 230, 255, 0.86);
  font-size: clamp(0.72rem, 0.82vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(0, 220, 255, 0.28);
}

.books-title {
  margin: 0;
  max-width: 920px;
  color: #f7fdff;
  font-size: clamp(2.35rem, 5.75vw, 7.3rem);
  line-height: 0.90;
  font-weight: 900;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  text-shadow:
    0 0 20px rgba(0, 240, 255, 0.10),
    0 0 52px rgba(0, 140, 255, 0.10);
}

.books-title span {
  display: block;
  background: linear-gradient(90deg, #ffffff 0%, #9dfbff 42%, #59b8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.books-title::after,
.books-section-head h2::after,
.reading-copy h2::after,
.library-card h2::after {
  content: "";
  display: block;
  width: min(720px, 88%);
  height: 3px;
  margin: clamp(24px, 3vw, 34px) 0 0;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.74), rgba(49, 255, 138, 0.30), transparent);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.18);
}

.books-copy-text,
.books-section-head p,
.reading-copy p,
.library-card p,
.books-cta p,
.knowledge-card p,
.category-card p {
  color: rgba(216, 232, 244, 0.76);
  font-weight: 650;
  line-height: 1.82;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.books-copy-text {
  max-width: 780px;
  margin: clamp(22px, 3vw, 32px) 0 0;
  font-size: clamp(0.9rem, 1.06vw, 1.08rem);
}

.books-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 3vw, 38px);
}

.books-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.16), rgba(58, 141, 255, 0.10));
  color: #f4fdff;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}

.books-btn::after {
  content: ">";
  margin-left: 10px;
}

.books-btn-muted {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.026);
  color: rgba(230, 244, 252, 0.84);
}

.books-btn:hover,
.books-btn:focus-visible {
  transform: translateY(-3px);
  outline: none;
  border-color: rgba(0, 240, 255, 0.62);
  box-shadow: 0 0 34px rgba(0, 240, 255, 0.18), 0 18px 46px rgba(0, 0, 0, 0.24);
}

.books-command {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: clamp(20px, 2vw, 35px);
  background: rgba(7, 17, 31, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.050), inset 0 0 44px rgba(0, 180, 255, 0.026);
}

.command-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.command-header span,
.command-header strong {
  color: rgba(142, 230, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.command-header strong {
  color: #31ff8a;
}

.books-core {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 2px solid rgba(0, 240, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.14), transparent 55%),
    rgba(255, 255, 255, 0.022);
  text-align: center;
  box-shadow: inset 0 0 50px rgba(0, 180, 255, 0.04);
}

.books-core span {
  color: rgba(142, 230, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.30em;
}

.books-core strong {
  margin-top: 8px;
  color: #f7fdff;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.books-core em {
  margin-top: 10px;
  color: rgba(49, 255, 138, 0.82);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.command-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.command-metrics div,
.knowledge-card,
.category-card,
.risk-grid div {
  border: 2px solid rgba(0, 240, 255, 0.10);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.024);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.command-metrics div {
  min-height: 96px;
  padding: 18px;
}

.command-metrics strong,
.command-metrics span {
  display: block;
  text-transform: uppercase;
}

.command-metrics strong {
  color: #f5fcff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.command-metrics span {
  margin-top: 8px;
  color: rgba(185, 210, 230, 0.70);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.10em;
}

.books-section {
  position: relative;
  padding: clamp(44px, 7vh, 86px) 0;
}

.books-section-head {
  max-width: 1040px;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.books-section-head h2,
.reading-copy h2,
.library-card h2,
.books-cta h2 {
  margin: 0;
  color: #f7fdff;
  font-size: clamp(1.9rem, 4.6vw, 5.25rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.books-section-head p,
.reading-copy p,
.library-card p {
  max-width: 960px;
  margin: clamp(18px, 2vw, 24px) 0 0;
}

.knowledge-grid,
.category-grid {
  display: grid;
  gap: 16px;
}

.knowledge-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.knowledge-card,
.category-card {
  position: relative;
  min-height: 250px;
  padding: 26px;
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.knowledge-card:hover,
.category-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 240, 255, 0.22);
  background: rgba(7, 17, 31, 0.54);
}

.knowledge-card span {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border: 1px solid rgba(0, 240, 255, 0.16);
  border-radius: 16px;
  color: #8eeeff;
  background: rgba(0, 240, 255, 0.045);
  font-size: 0.78rem;
  font-weight: 900;
}

.knowledge-card h3,
.category-card h3 {
  margin: 0;
  color: #f5fcff;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.knowledge-card p,
.category-card p {
  margin: 14px 0 0;
  font-size: 0.78rem;
}

.reading-card,
.library-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
  padding: clamp(30px, 4.5vw, 62px);
}

.library-board {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 26px;
  background: rgba(7, 17, 31, 0.46);
}

.library-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 12px;
}

.library-row span,
.library-row strong {
  color: rgba(237, 251, 255, 0.86);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.library-row strong {
  color: #8eeeff;
  text-align: right;
}

.library-row i {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.library-row i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--level);
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(58, 141, 255, 0.78), rgba(0, 240, 255, 0.82), rgba(49, 255, 138, 0.7));
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.16);
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.risk-grid div {
  min-height: 130px;
  padding: 20px;
}

.risk-grid strong,
.risk-grid span {
  display: block;
  text-transform: uppercase;
}

.risk-grid strong {
  color: #31ff8a;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.risk-grid span {
  margin-top: 14px;
  color: rgba(216, 232, 244, 0.78);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.65;
  letter-spacing: 0.09em;
}

.books-cta-wrap {
  padding: clamp(44px, 7vh, 82px) 0 clamp(92px, 10vh, 130px);
}

.books-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(30px, 4.4vw, 56px);
}

.books-cta h2 {
  max-width: 850px;
  font-size: clamp(1.65rem, 3.6vw, 4rem);
}

.books-cta p {
  max-width: 790px;
  margin: 14px 0 0;
}

.cta-actions {
  margin-top: 0;
  flex-shrink: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .books-hero-card,
  .reading-card,
  .library-card {
    grid-template-columns: 1fr;
  }

  .books-copy,
  .reading-copy,
  .library-card > div:first-child,
  .books-section-head {
    text-align: center;
    justify-self: center;
  }

  .books-title::after,
  .books-section-head h2::after,
  .reading-copy h2::after,
  .library-card h2::after {
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.74), rgba(49, 255, 138, 0.30), transparent);
  }

  .books-actions {
    justify-content: center;
  }

  .knowledge-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .books-command,
  .library-board,
  .risk-grid {
    width: min(760px, 100%);
    justify-self: center;
  }

  .books-cta {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 860px) {
  .books-main {
    padding-top: clamp(132px, 16vh, 178px);
  }

  .books-container {
    width: min(calc(100% - 28px), var(--max));
  }

  .books-hero-card,
  .reading-card,
  .library-card,
  .books-cta {
    padding: 34px 18px;
    border-radius: 24px;
  }

  .books-title {
    font-size: clamp(2.55rem, 12vw, 5.6rem);
    line-height: 0.92;
  }

  .books-copy-text,
  .books-section-head p,
  .reading-copy p,
  .library-card p,
  .books-cta p {
    font-size: 0.86rem;
    letter-spacing: 0.06em;
  }

  .knowledge-grid,
  .category-grid,
  .risk-grid {
    grid-template-columns: 1fr;
  }

  .library-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .library-row strong {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .books-main {
    padding-top: clamp(122px, 15vh, 154px);
  }

  .books-container {
    width: min(calc(100% - 22px), var(--max));
  }

  .books-hero-card,
  .reading-card,
  .library-card,
  .books-cta {
    padding: 30px 12px;
    border-radius: 20px;
  }

  .books-kicker {
    letter-spacing: 0.24em;
  }

  .books-title {
    font-size: clamp(2.25rem, 13vw, 4rem);
    letter-spacing: -0.065em;
  }

  .books-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .books-btn {
    width: 100%;
  }

  .command-metrics {
    grid-template-columns: 1fr;
  }

  .knowledge-card,
  .category-card,
  .risk-grid div {
    padding: 20px;
  }

  .library-board {
    padding: 18px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =========================================================
   BOOKS PAGE SPECIFIC OVERRIDES
   ========================================================= */

.knowledge-core {
  text-align: center;
}

.reading-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  padding: clamp(30px, 4.2vw, 62px);
}

.reading-flow {
  display: grid;
  gap: 12px;
}

.reading-flow div {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 16px 18px;
  border: 2px solid rgba(255, 255, 255, 0.055);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.022);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.reading-flow strong {
  color: #31ff8a;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.reading-flow span {
  color: rgba(237, 251, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.reading-flow i {
  position: relative;
  display: block;
  height: 24px;
}

.reading-flow i::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(49, 255, 138, 0.86);
  border-bottom: 2px solid rgba(49, 255, 138, 0.86);
  transform: translateY(-50%) rotate(45deg);
  filter: drop-shadow(0 0 8px rgba(49, 255, 138, 0.35));
}

.library-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  padding: clamp(30px, 4.2vw, 62px);
}

.library-card h2,
.reading-copy h2 {
  margin: 0;
  color: #f7fdff;
  font-size: clamp(1.75rem, 3.8vw, 4.8rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-wrap: balance;
}

.library-card h2::after,
.reading-copy h2::after {
  content: "";
  display: block;
  width: min(720px, 88%);
  height: 3px;
  margin: clamp(22px, 2.6vw, 32px) 0 0;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.72), rgba(49, 255, 138, 0.32), transparent 100%);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.16);
}

.library-card p,
.reading-copy p {
  margin: clamp(16px, 2vw, 24px) 0 0;
  color: rgba(216, 232, 244, 0.76);
  font-size: clamp(0.84rem, 0.96vw, 1rem);
  line-height: 1.78;
  font-weight: 650;
  letter-spacing: 0.074em;
  text-transform: uppercase;
}

.library-board {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 2.4vw, 30px);
  border: 2px solid rgba(0, 240, 255, 0.11);
  border-radius: clamp(20px, 2vw, 30px);
  background: rgba(7, 17, 31, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.library-row {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.library-row span,
.library-row strong {
  color: rgba(237, 251, 255, 0.86);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.library-row strong {
  color: #8eeeff;
  text-align: right;
}

.library-row i {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.library-row i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--level);
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(58, 141, 255, 0.78), rgba(0, 240, 255, 0.82), rgba(49, 255, 138, 0.7));
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.16);
}

@media (max-width: 1180px) {
  .reading-card,
  .library-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .reading-copy h2::after,
  .library-card h2::after {
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.72), rgba(49, 255, 138, 0.32), transparent);
  }

  .reading-flow,
  .library-board {
    width: min(720px, 100%);
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .reading-card,
  .library-card {
    padding: 34px 18px;
    border-radius: 24px;
  }

  .library-row {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
  }

  .library-row strong {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .reading-card,
  .library-card {
    padding: 30px 12px;
    border-radius: 20px;
  }

  .reading-flow div {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .reading-flow i::after {
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
  }
}
