/* Reusable visual utilities shared by every page. */
.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 1020;
  pointer-events: none;
  background: radial-gradient(
    460px circle at var(--mx, 70%) var(--my, 20%),
    rgba(155, 197, 59, 0.2) 0%,
    rgba(155, 197, 59, 0.11) 34%,
    rgba(155, 197, 59, 0.035) 62%,
    transparent 78%
  );
  mix-blend-mode: screen;
  transition: background 120ms ease-out;
}
html {
  scroll-padding-top: 88px;
}

.bg-gradient-brand {
  background: var(--gradient-brand) !important;
}
.bg-gradient-brand-soft {
  background: var(--gradient-brand-soft) !important;
}
.bg-gradient-dark {
  background: var(--gradient-dark) !important;
}
.bg-gradient-dark-header {
  background: linear-gradient(
    90deg,
    rgba(9, 12, 8, 0.24) 0%,
    rgba(13, 17, 10, 0.24) 100%
  ) !important;
}
.bg-gradient-academic {
  background: var(--gradient-academic-page) !important;
}

/* A subtle dot texture for dark sections. */
.bg-dots-soft {
  position: relative;
  isolation: isolate;
}
.bg-dots-soft::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background-image: radial-gradient(
    rgba(177, 215, 112, 0.32) 0.8px,
    transparent 0.9px
  );
  background-size: 20px 20px;
  opacity: 0.2;
  pointer-events: none;
  mask-image: linear-gradient(115deg, #000 0%, transparent 78%);
}

.text-gradient-brand {
  color: var(--brand-primary);
  background: var(--gradient-brand);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.surface-gradient-brand {
  border: 1px solid rgba(155, 197, 59, 0.22);
  background: var(--gradient-brand-soft);
}

/* Keep header navigation and action typography identical across every page. */
.header,
.site-drawer {
  font-family: var(--font-urbanist);
}

/* Fixed top navigation with a subtle glass edge and theme accent. */
.header.fixed-top {
  z-index: 1030;
}
.header .navbar {
  min-height: 76px;
  padding: 0.8rem 0;
  /* border-bottom: 1px solid rgba(180, 218, 104, 0.22); */
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  transition:
    min-height 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}
.header .navbar-brand img {
  filter: drop-shadow(0 0 10px rgba(155, 197, 59, 0.12));
}
.desktop-navigation .navbar-nav .nav-link {
  transition:
    color 180ms ease,
    background-color 180ms ease;
}
.desktop-navigation .navbar-nav .nav-link:hover,
.desktop-navigation .navbar-nav .nav-link:focus-visible {
  color: #c8eb7f;
}
/* Open the existing Bootstrap navigation dropdowns on hover and keyboard focus on desktop. */
@media (min-width: 992px) {
  .desktop-navigation .nav-item.dropdown > .nav-link::after {
    display: block !important;
    margin: 0;
    border: 0;
  }
  .desktop-navigation .nav-item.dropdown:hover > .dropdown-menu,
  .desktop-navigation .nav-item.dropdown:focus-within > .dropdown-menu {
    display: block;
  }
  .desktop-navigation .nav-item.dropdown:hover > .nav-link,
  .desktop-navigation .nav-item.dropdown:focus-within > .nav-link {
    color: #c8eb7f;
  }
  .desktop-navigation .nav-item.dropdown:hover > .nav-link::after,
  .desktop-navigation .nav-item.dropdown:focus-within > .nav-link::after {
    transform: scaleX(1);
  }
  .desktop-navigation .nav-item.dropdown > .dropdown-menu::before {
    position: absolute;
    inset: -0.75rem 0 auto;
    height: 0.75rem;
    content: "";
  }
}
@media (max-width: 991.98px) {
  .header .navbar {
    min-height: 68px;
    padding: 0.65rem 0;
  }
}

/* Homepage video hero: keep the footage full-bleed and content in one clear column. */
.home-section {
  position: relative;
  display: flex;
  /* height: clamp(42rem, calc(100svh - 7rem), 70rem); */
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 4rem 0 3rem;
  background: var(--gradient-academic-page);
  /* margin-top: -75px; */
}
.home-section > .home-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
}
.home-section .home-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      transparent 68%,
      rgba(0, 0, 0, 0.72) 88%,
      var(--bg-primary) 100%
    ),
    linear-gradient(
      90deg,
      rgba(5, 10, 5, 0.9) 0%,
      rgba(7, 13, 7, 0.72) 23%,
      rgba(7, 11, 6, 0.3) 100%
    ),
    linear-gradient(180deg, rgba(5, 10, 5, 0.16), rgba(3, 7, 3, 0.35));
}
.home-section > .home-content {
  position: relative;
  z-index: 2;
  width: 100%;
}
/* .home-section .home-copy {
  max-width: 54rem;
} */
.home-section .home-title {
  position: relative;
  max-width: 14ch;
  margin: 0 0 1.25rem;
  /* padding-left: 0.32em; */
  color: var(--text-white);
  font-size: clamp(3.2rem, 6.5vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.02;
  text-wrap: balance;
}
/* .home-section .home-title::before {
  position: absolute;
  top: 0.12em;
  bottom: 0.12em;
  left: 0;
  width: max(3px, 0.055em);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    #d8ed9a 0%,
    #9bc53b 48%,
    rgba(155, 197, 59, 0.24) 100%
  );
  box-shadow: 0 0 20px rgba(155, 197, 59, 0.3);
  content: "";
} */
.home-section .home-title__lead {
  display: inline-block;
  color: #9bc53b;
  font-weight: 700;
  text-shadow: 0 0 24px rgba(155, 197, 59, 0.18);
}
.home-section .home-copy > p {
  max-width: 43rem;
  margin: 0 0 2rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.65;
  letter-spacing: 0.01em;
}
.home-section .home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}
.home-section.radial-gradient-bottom::after {
  z-index: 1;
  width: min(60%, 55rem);
  height: 70%;
  opacity: 0.16;
  pointer-events: none;
}

/* Keep the opening frame full-screen and let the next section peek into view. */
.home-section {
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: clamp(6rem, 14vh, 9rem);
  padding-bottom: clamp(4rem, 9vh, 6rem);
}

.home-section > .home-video {
  object-fit: cover;
  object-position: center 46%;
}

.info-section .content-head {
  margin-top: 0;
  z-index: 2;
  /* border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0; */
  background-color: transparent;
}

/* Move the section boundary itself so the top preview remains inside its visible area. */
.info-section {
  margin-top: clamp(-4.5rem, -7svh, -3.5rem);
}

@media (max-width: 768px) {
  .home-section {
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    padding: 7rem 0 5rem;
  }

  .home-section .home-actions {
    gap: 0.75rem;
  }

  .home-section > .home-video {
    object-position: 58% center;
  }
}

@media (max-width: 576px) {
  .home-section {
    padding: 6.5rem 0 4rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .home-section {
    padding-top: 5.5rem;
    padding-bottom: 2rem;
  }

  .home-section .home-title {
    font-size: clamp(2.5rem, 8vh, 4rem);
  }
}

/* Use these shared button styles for consistent project-wide actions. */
.btn-primary-refread,
.btn-secondary-refread {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}
.btn-primary-refread {
  border-color: var(--brand-primary);
  color: #11160a;
  background: var(--brand-primary);
  box-shadow: 0 6px 20px rgba(155, 197, 59, 0.16);
}
.btn-primary-refread:hover,
.btn-primary-refread:focus-visible {
  border-color: #b0d755;
  color: #11160a;
  background: #b0d755;
  box-shadow: 0 8px 24px rgba(155, 197, 59, 0.24);
  transform: translateY(-1px);
}
.btn-secondary-refread {
  border-color: rgba(155, 197, 59, 0.68);
  color: var(--text-primary);
  background: rgb(61 90 0 / 31%);
}
.btn-secondary-refread:hover,
.btn-secondary-refread:focus-visible {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(155, 197, 59, 0.1);
}
.header .find-library-header-btn,
.site-drawer .find-library-header-btn {
  gap: 0.6rem;
  padding: 0.48rem 0.9rem 0.48rem 0.55rem;
  border: 1px solid rgba(155, 197, 59, 0.44);
  /* border-radius: 0.9rem; */
  color: #edf4e3;
  background: linear-gradient(
    145deg,
    rgba(155, 197, 59, 0.09),
    rgba(8, 13, 8, 0.48)
  );
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  letter-spacing: 0.01em;
}
.find-library-header-btn > i {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 1.85rem;
  place-items: center;
  border: 1px solid rgba(155, 197, 59, 0.18);
  border-radius: 50%;
  color: #c8ff7f;
  background: rgba(155, 197, 59, 0.14);
  font-size: 0.78rem;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}
.find-library-header-btn > span {
  white-space: nowrap;
}
.header .find-library-header-btn:hover,
.header .find-library-header-btn:focus-visible,
.site-drawer .find-library-header-btn:hover,
.site-drawer .find-library-header-btn:focus-visible {
  border-color: rgba(200, 255, 127, 0.8);
  color: #fff;
  background: linear-gradient(
    145deg,
    rgba(155, 197, 59, 0.18),
    rgba(8, 13, 8, 0.68)
  );
  box-shadow:
    0 0 0 3px rgba(155, 197, 59, 0.1),
    0 8px 22px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}
.find-library-header-btn:hover > i,
.find-library-header-btn:focus-visible > i {
  border-color: rgba(200, 255, 127, 0.45);
  color: #0d1408;
  background: #84c52f;
  transform: scale(1.04);
}
.btn-primary-refread:focus-visible,
.btn-secondary-refread:focus-visible {
  outline: 3px solid rgba(155, 197, 59, 0.35);
  outline-offset: 3px;
}
.btn-primary-refread:disabled,
.btn-secondary-refread:disabled,
.btn-primary-refread[aria-disabled="true"],
.btn-secondary-refread[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

/* Featured home-page link: a one-time story highlight with a calm hover orbit. */
@property --story-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.story-watch-btn {
  position: relative;
  isolation: isolate;
  min-height: 54px;
  gap: 0.7rem;
  padding: 0.45rem 1.1rem 0.45rem 0.5rem;
  overflow: hidden;
  border-color: transparent;
  color: #f4f7ef;
  background:
    linear-gradient(rgba(7, 13, 8, 0.88), rgba(7, 13, 8, 0.88)) padding-box,
    linear-gradient(
        115deg,
        rgba(155, 197, 59, 0.6),
        rgba(155, 197, 59, 0.18),
        rgba(200, 255, 127, 0.68)
      )
      border-box;
  box-shadow:
    0 8px 26px rgba(0, 0, 0, 0.2),
    0 0 22px rgba(155, 197, 59, 0.08);
  white-space: nowrap;
}
.story-watch-btn::before {
  position: absolute;
  z-index: 0;
  inset: -1px;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--story-border-angle),
    transparent 0deg 275deg,
    rgba(200, 255, 127, 0.25) 305deg,
    #d8ff9b 333deg,
    transparent 360deg
  );
  content: "";
  opacity: 0;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: story-border-pass 2.2s cubic-bezier(0.22, 1, 0.36, 1) 450ms both;
}
.story-watch-btn > * {
  position: relative;
  z-index: 1;
}
.story-watch-icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 2.25rem;
  place-items: center;
  border: 1px solid rgba(221, 255, 167, 0.72);
  border-radius: 50%;
  color: #101608;
  background: var(--brand-primary);
  box-shadow: 0 0 0 0 rgba(155, 197, 59, 0.3);
  animation: story-icon-glow 950ms ease-out 650ms 1;
}
.story-watch-icon .fa-play {
  margin-left: 2px;
  font-size: 0.78rem;
}
.story-watch-arrow {
  margin-left: 0.1rem;
  color: #c8ff7f;
  font-size: 0.82rem;
  transition: transform 180ms ease;
}
.story-watch-btn:hover,
.story-watch-btn:focus-visible {
  border-color: transparent;
  color: #fff;
  background:
    linear-gradient(rgba(12, 20, 10, 0.96), rgba(12, 20, 10, 0.96)) padding-box,
    linear-gradient(115deg, #9bc53b, #d8ff9b, #9bc53b) border-box;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.26),
    0 0 26px rgba(155, 197, 59, 0.22);
  transform: translateY(-2px);
}
.story-watch-btn:hover::before,
.story-watch-btn:focus-visible::before {
  opacity: 1;
  animation: story-border-orbit 2.8s linear infinite;
}
.story-watch-btn:hover .story-watch-icon,
.story-watch-btn:focus-visible .story-watch-icon {
  background: #c8ff7f;
}
.story-watch-btn:hover .story-watch-arrow,
.story-watch-btn:focus-visible .story-watch-arrow {
  transform: translateX(3px);
}
@keyframes story-border-pass {
  0% {
    --story-border-angle: 0deg;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  84% {
    --story-border-angle: 360deg;
    opacity: 0.85;
  }
  100% {
    --story-border-angle: 360deg;
    opacity: 0;
  }
}
@keyframes story-border-orbit {
  to {
    --story-border-angle: 360deg;
  }
}
@keyframes story-icon-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(155, 197, 59, 0.38);
  }
  100% {
    box-shadow: 0 0 0 9px rgba(155, 197, 59, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .story-watch-btn::before,
  .story-watch-icon {
    animation: none;
  }
  .story-watch-btn:hover::before,
  .story-watch-btn:focus-visible::before {
    opacity: 0.55;
  }
}

/* Reusable entrance animations. Add the class to any element as needed. */
.animate-fade-up {
  animation: common-fade-up 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.animate-fade-in {
  animation: common-fade-in 700ms ease both;
}
.animate-soft-scale {
  animation: common-soft-scale 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Shared gradient and dot treatment for the site-wide footer. */
.footer {
  position: relative;
  isolation: isolate;
  background-color: var(--bg-secondary);
  background-image:
    radial-gradient(rgba(192, 222, 137, 0.16) 0.15px, transparent 0.9px),
    radial-gradient(ellipse at 12% 0%, rgba(81, 114, 48, 0.3), transparent 52%),
    linear-gradient(115deg, #121b11 0%, #080c08 54%, #172316 100%);
  background-size:
    22px 22px,
    100% 100%,
    100% 100%;
  border-top: 1px solid rgba(177, 215, 112, 0.3);
}
.footer .container {
  position: relative;
  z-index: 1;
}
.footer .footer-divider {
  border-color: rgba(190, 217, 145, 0.2);
}
.footer .social-icons a {
  border: 1px solid rgba(177, 215, 112, 0.18);
  background: rgba(255, 255, 255, 0.065);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}
.footer .social-icons a:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: #11160a;
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .header .navbar,
  .footer .social-icons a {
    transition: none;
  }
}
.animation-delay-1 {
  animation-delay: 120ms;
}
.animation-delay-2 {
  animation-delay: 240ms;
}
.animation-delay-3 {
  animation-delay: 360ms;
}

@keyframes common-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes common-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes common-soft-scale {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-fade-up,
  .animate-fade-in,
  .animate-soft-scale {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

.scroll-to-top {
  position: fixed;
  z-index: 1040;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(217, 244, 152, 0.8);
  border-radius: 50%;
  color: #101700;
  background: #9bc53b;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
  font-size: 1.15rem;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.scroll-to-top[hidden] {
  display: none !important;
}

.scroll-to-top:hover {
  background: #b5db54;
  box-shadow: 0 0.75rem 1.8rem rgba(0, 0, 0, 0.42);
  transform: translateY(-2px);
}

.scroll-to-top:focus-visible {
  outline: 3px solid rgba(198, 235, 115, 0.85);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: none;
  }
}
