.library-body {
  background:
    radial-gradient(circle at 8% 18%, rgba(54, 157, 255, .22), transparent 28rem),
    radial-gradient(circle at 92% 46%, rgba(255, 215, 119, .1), transparent 24rem),
    linear-gradient(145deg, #020a2b 0%, #061851 52%, #092b72 100%);
}

.library-header { border-bottom: 1px solid var(--line); }
.main-nav a[aria-current="page"] { color: var(--gold); }

.library-hero {
  width: min(1180px, calc(100% - 3rem));
  min-height: 34rem;
  margin: 0 auto;
  padding: 5rem 0 4.5rem;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 5rem;
  align-items: center;
}

.library-hero h1,
.article-hero h1 {
  margin: 0;
  color: var(--pearl);
  font: 400 clamp(3.7rem, 7vw, 7.2rem)/.88 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.library-hero h1 em { color: var(--gold); font-weight: 400; }
.library-hero > div > p:last-child { max-width: 43rem; margin: 2rem 0 0; color: #c4d3ef; font-size: 1.08rem; line-height: 1.8; }

.library-hero__seal {
  width: min(100%, 20rem);
  aspect-ratio: 1;
  justify-self: end;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 215, 119, .52);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 132, 255, .34), rgba(3, 18, 62, .16) 65%);
  box-shadow: 0 0 0 1.1rem rgba(255, 255, 255, .018), 0 0 0 1.2rem rgba(65, 160, 255, .11), 0 0 80px rgba(36, 139, 255, .2);
}

.library-hero__seal::before,
.library-hero__seal::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(221, 235, 255, .35);
  border-radius: 50%;
  animation: spin 32s linear infinite;
}

.library-hero__seal::after { inset: 25%; border-style: solid; border-color: rgba(255, 215, 119, .28); animation-direction: reverse; }
.library-hero__seal span { color: var(--gold); font: 400 6.3rem/.9 Georgia, serif; }
.library-hero__seal small { margin-top: .7rem; color: #d7e4ff; letter-spacing: .34em; }

.library-index {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto 7rem;
  padding: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
}

.library-index span { padding: .55rem .9rem; color: #c6d6f3; font-size: .78rem; border: 1px solid rgba(192, 218, 255, .15); border-radius: 999px; }
.library-content { width: min(1180px, calc(100% - 3rem)); margin: 0 auto; }
.library-group { margin-bottom: 7rem; }
.library-group__title { margin-bottom: 2rem; display: grid; grid-template-columns: 2.2rem auto 1fr; gap: .85rem; align-items: center; }
.library-group__title > span { height: 1px; background: var(--gold); box-shadow: 0 0 12px rgba(255, 215, 119, .55); }
.library-group__title h2 { margin: 0; font: 400 1.4rem Georgia, serif; }
.library-group__title b { justify-self: end; color: #7894c8; font-size: .7rem; letter-spacing: .15em; }

.branch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.branch-card {
  min-width: 0;
  border: 1px solid rgba(182, 214, 255, .18);
  border-radius: 1.45rem;
  background: linear-gradient(145deg, rgba(11, 48, 119, .64), rgba(3, 19, 65, .76));
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 6, 30, .2), inset 0 1px rgba(255, 255, 255, .05);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  animation: cardIn .65s both;
  animation-delay: var(--delay);
}

.branch-card:hover { transform: translateY(-7px); border-color: rgba(255, 215, 119, .46); box-shadow: 0 32px 75px rgba(0, 6, 30, .35), 0 0 35px rgba(35, 140, 255, .1); }
.branch-card__visual { aspect-ratio: 16 / 9; border-bottom: 1px solid rgba(255, 255, 255, .12); transition: transform .55s ease, filter .35s ease; }
.branch-card:hover .branch-card__visual { transform: scale(1.035); filter: saturate(1.08) brightness(1.05); }
.branch-card__body { min-height: 18.5rem; padding: 1.5rem; display: flex; flex-direction: column; }
.branch-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #97aed9; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.branch-card__meta b { color: var(--gold); font: 400 1.35rem Georgia, serif; }
.branch-card h3 { margin: 1.35rem 0 .8rem; font: 400 1.75rem/1.08 Georgia, serif; text-wrap: balance; }
.branch-card p { margin: 0; color: #afc0e1; font-size: .91rem; line-height: 1.7; }
.branch-card__link { margin-top: auto; padding-top: 1.25rem; color: var(--gold); font-size: .78rem; font-weight: 700; }
.branch-card__link b { margin-left: .45rem; transition: margin .2s ease; }
.branch-card:hover .branch-card__link b { margin-left: .8rem; }

.branch-visual {
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-color: #0a2b7d;
}
.atlas-1 { background-image: url("astrovip-atlas-1.webp"); }
.atlas-2 { background-image: url("astrovip-atlas-2.webp"); }
.atlas-3 { background-image: url("astrovip-atlas-3.webp"); }
.tile-1 { background-position: 0% 0%; }
.tile-2 { background-position: 50% 0%; }
.tile-3 { background-position: 100% 0%; }
.tile-4 { background-position: 0% 100%; }
.tile-5 { background-position: 50% 100%; }
.tile-6 { background-position: 100% 100%; }

.library-cta,
.article-cta {
  width: min(1180px, calc(100% - 3rem));
  margin: 1rem auto 4rem;
  padding: clamp(2.3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
  border: 1px solid rgba(255, 215, 119, .34);
  border-radius: 2rem;
  background: radial-gradient(circle at 80% 120%, rgba(48, 159, 255, .34), transparent 42%), linear-gradient(135deg, rgba(9, 43, 112, .98), rgba(3, 18, 60, .98));
}

.library-cta h2,
.article-cta h2 { margin: 0; font: 400 clamp(2.5rem, 4.5vw, 4.5rem)/.98 Georgia, serif; letter-spacing: -.04em; }
.library-cta h2 em,
.article-cta h2 em { color: var(--gold); font-weight: 400; }
.library-cta p:last-child,
.article-cta p:last-child { max-width: 42rem; color: #bdcdea; }
.library-footer { border-top: 1px solid var(--line); }

.library-teaser { padding: 7.5rem 0 8.5rem; }
.library-teaser__heading { margin-bottom: 3.2rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: 5rem; align-items: end; }
.library-teaser__heading h2 { margin: 0; font: 400 clamp(2.8rem, 5vw, 5rem)/.98 Georgia, serif; letter-spacing: -.045em; }
.library-teaser__heading h2 em { color: var(--gold); font-weight: 400; }
.library-teaser__heading > p { margin: 0; color: #bdccea; line-height: 1.75; }
.library-teaser__grid { grid-template-columns: repeat(3, 1fr); }
.library-teaser__more { width: fit-content; margin: 2rem 0 0 auto; display: flex; align-items: center; gap: .7rem; color: var(--gold); font-size: .88rem; font-weight: 700; }
.library-teaser__more span { font-size: 1.2rem; transition: transform .2s ease; }
.library-teaser__more:hover span { transform: translateX(5px); }

/* Article pages */
.breadcrumbs { width: min(1180px, calc(100% - 3rem)); margin: 2rem auto 0; display: flex; flex-wrap: wrap; gap: .55rem; color: #91a8d4; font-size: .76rem; }
.breadcrumbs a:hover { color: var(--gold); }
.article-hero { width: min(1180px, calc(100% - 3rem)); margin: 0 auto; padding: 4.3rem 0 5.5rem; display: grid; grid-template-columns: 1fr .88fr; gap: 5rem; align-items: center; }
.article-hero h1 { font-size: clamp(3.5rem, 6vw, 6.3rem); }
.article-hero__copy > p:not(.eyebrow) { max-width: 44rem; margin: 1.8rem 0 0; color: #c4d3ef; font-size: 1.06rem; line-height: 1.8; }
.article-author { margin-top: 2rem; padding-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; border-top: 1px solid var(--line); color: #9fb4dd; font-size: .72rem; }
.article-author span { color: var(--gold); letter-spacing: .15em; }
.article-hero__visual { min-height: 31rem; border: 1px solid rgba(255, 215, 119, .28); border-radius: 1.7rem; box-shadow: 0 35px 90px rgba(0, 7, 33, .42), 0 0 55px rgba(31, 139, 255, .14); }

.article-layout { width: min(1180px, calc(100% - 3rem)); margin: 0 auto 7rem; display: grid; grid-template-columns: 18rem 1fr; gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.article-aside { position: sticky; top: 1.5rem; padding: 1.6rem; border: 1px solid rgba(180, 214, 255, .18); border-radius: 1.35rem; background: rgba(5, 27, 82, .62); }
.article-aside__symbol { width: 3.3rem; height: 3.3rem; display: grid; place-items: center; color: #231400; background: linear-gradient(135deg, #fff1b7, #e5a72e); border-radius: 50%; font: 400 1.55rem Georgia, serif; }
.article-aside p { margin: 1.2rem 0; color: #b5c6e6; font-size: .86rem; line-height: 1.7; }
.article-aside a { color: var(--gold); font-size: .78rem; font-weight: 700; }
.article-content { min-width: 0; }
.article-content > section { padding: 1rem 0 4.7rem; }
.article-content > section + section { padding-top: 4.7rem; border-top: 1px solid var(--line); }
.article-content .section-number { margin: 0 0 1rem; color: var(--gold); font-size: .68rem; font-weight: 700; letter-spacing: .17em; }
.article-content h2 { margin: 0 0 1.7rem; font: 400 clamp(2.25rem, 4vw, 3.85rem)/1 Georgia, serif; letter-spacing: -.035em; }
.article-content section > p:not(.section-number) { margin: 0 0 1.25rem; color: #c2d0eb; font-size: 1.02rem; line-height: 1.86; }
.article-list { margin: .5rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; list-style: none; }
.article-list li { min-height: 4.4rem; padding: 1rem; display: flex; align-items: flex-start; gap: .75rem; color: #cfdbf3; background: rgba(255, 255, 255, .035); border: 1px solid rgba(182, 213, 255, .13); border-radius: .85rem; }
.article-list span { color: var(--gold); }
.limits { margin: 0 -1.5rem; padding-inline: 1.5rem !important; border: 1px solid rgba(255, 215, 119, .25) !important; border-radius: 1.25rem; background: linear-gradient(135deg, rgba(255, 215, 119, .08), rgba(8, 45, 113, .22)); }

.article-faq { border-top: 1px solid var(--line); }
.article-faq details { border-bottom: 1px solid var(--line); }
.article-faq summary { padding: 1.45rem 3rem 1.45rem 0; position: relative; cursor: pointer; list-style: none; font: 400 1.25rem Georgia, serif; }
.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary span { position: absolute; right: .15rem; top: 1.2rem; width: 2rem; height: 2rem; display: grid; place-items: center; color: var(--gold); border: 1px solid rgba(255, 215, 119, .3); border-radius: 50%; font-family: system-ui, sans-serif; transition: transform .25s ease; }
.article-faq details[open] summary span { transform: rotate(45deg); }
.article-faq p { margin: -.15rem 3rem 1.35rem 0; color: #aebfe1; line-height: 1.75; }

.article-next { width: min(1180px, calc(100% - 3rem)); margin: 0 auto 5rem; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 1.25rem; overflow: hidden; }
.article-next a { padding: 1.5rem; display: flex; flex-direction: column; gap: .45rem; background: rgba(255, 255, 255, .025); transition: background .2s ease; }
.article-next a + a { border-left: 1px solid var(--line); text-align: right; }
.article-next a:hover { background: rgba(37, 134, 255, .12); }
.article-next small { color: #879fcf; }
.article-next strong { color: var(--gold); font: 400 1.2rem Georgia, serif; }

@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .branch-grid { grid-template-columns: repeat(2, 1fr); }
  .library-teaser__grid { grid-template-columns: repeat(2, 1fr); }
  .library-hero { grid-template-columns: 1fr .55fr; gap: 3rem; }
  .article-hero { grid-template-columns: 1fr; gap: 3rem; }
  .article-hero__visual { min-height: 28rem; }
  .article-layout { grid-template-columns: 14rem 1fr; gap: 3rem; }
}

@media (max-width: 760px) {
  .library-hero { grid-template-columns: 1fr; min-height: auto; padding: 4rem 0; }
  .library-hero__seal { width: 14rem; justify-self: center; }
  .library-hero__seal span { font-size: 4.6rem; }
  .library-index { margin-bottom: 5rem; border-radius: 1.2rem; }
  .branch-grid { grid-template-columns: 1fr; }
  .library-teaser__heading { grid-template-columns: 1fr; gap: 1.2rem; }
  .library-teaser__grid { grid-template-columns: 1fr; }
  .branch-card__body { min-height: 16rem; }
  .library-cta, .article-cta { grid-template-columns: 1fr; gap: 2rem; }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .article-list { grid-template-columns: 1fr; }
  .article-next { grid-template-columns: 1fr; }
  .article-next a + a { border-top: 1px solid var(--line); border-left: 0; text-align: left; }
}

@media (max-width: 560px) {
  .library-hero,
  .library-content,
  .library-index,
  .breadcrumbs,
  .article-hero,
  .article-layout,
  .article-next,
  .library-cta,
  .article-cta { width: min(100% - 2rem, 1180px); }
  .library-hero h1, .article-hero h1 { font-size: clamp(3rem, 15vw, 4.7rem); }
  .article-hero { padding-top: 3rem; }
  .article-hero__visual { min-height: 23rem; }
  .library-group { margin-bottom: 5rem; }
  .branch-card__body { padding: 1.25rem; }
  .article-content > section { padding-bottom: 3.8rem; }
  .article-content > section + section { padding-top: 3.8rem; }
  .article-content section > p:not(.section-number) { font-size: 1rem; }
  .limits { margin-inline: 0; padding-inline: 1rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  .branch-card { animation: none; }
}
