/* =========================
   GLOBAL LAYOUT
========================= */

body {
  background: linear-gradient(
    130deg,
    #050014,
    #020018 40%,
    #000010
  );

  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-y: scroll;
}

header {
  position: fixed;
  width: 100%;
  z-index: 70;
}

body::before {

  content: "";

  position: fixed;
  inset: -30%;

  background:
    radial-gradient(600px circle at 30% 40%, rgba(70,0,160,0.35), transparent 70%),
    radial-gradient(700px circle at 70% 60%, rgba(0,90,200,0.30), transparent 70%),
    radial-gradient(500px circle at 60% 20%, rgba(0,150,120,0.25), transparent 70%);

  animation: auroraMove 20s ease-in-out infinite alternate;

  pointer-events: none;
  z-index: 0;

  will-change: transform;
}

body::after {

  content: "";

  position: fixed;
  inset: -20%;

  background:
    radial-gradient(800px circle at 20% 70%, rgba(90,0,200,0.25), transparent 70%),
    radial-gradient(700px circle at 80% 30%, rgba(0,140,255,0.20), transparent 70%);

  transform: translate3d(-80px,40px,0) scale(1.1);

  pointer-events: none;
  z-index: 0;
}

body::before,
body::after {
  transform: translateZ(0);
}

html {
  overflow-x: hidden;
}

main {
  position: relative;
  z-index: 1;
}


/* =========================
   SECTIONS
========================= */

.home-intro,
.home-user {
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  word-wrap: break-word;
}

.home-intro__main-article,
.home-user__presentation-article,
.home-user__booklist-article {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* =========================
   INTRO SECTION
========================= */

.home-intro__main-citation {
  flex: 2;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  max-width: 550px;
  width: 90%;
}

.home-intro__main-citation__q {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.home-intro__main-citation__cite {
  align-self: end;
}

.home-intro__text {
  flex: 3;
  margin: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
}


/* =========================
   LICENSE SECTION
========================= */

.home-license {
	min-height: calc(100vh - var(--header-height));
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

.home-license__article {
  max-width: 900px;
  width: 100%;
}

.home-license__title {
  font-size: 2.5rem;
}

.home-license__description {
  opacity: 0.85;
  margin-bottom: 20px;
}

.home-license__badges {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.home-license__github {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 14px;

  background: rgba(0,0,0,0.35);
  border-radius: 6px;

  text-decoration: none;
  color: white;

  transition: transform 0.2s ease;
}

.home-license__github:hover {
  transform: scale(1.05);
}

.home-license__badge {
	display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 14px;

  background: rgba(255,255,255,0.15);
  border-radius: 6px;

  text-decoration: none;
  color: white;
}

.home-license__details summary {
  cursor: pointer;
  margin-bottom: 10px;
}

.home-license__text {
  white-space: pre-wrap;
  background: rgba(0,0,0,0.25);
  padding: 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  overflow-x: auto;
}


/* =========================
   HOW SECTION
========================= */

.home-how {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 80px 20px;
}

.home-how__article {
  max-width: 900px;
  width: 100%;
}

.home-how__title {
  font-size: 2.5rem;
  margin-bottom: 60px;
  text-align: center;
}

.home-how__timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.home-how__line {
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.home-how__step {
  display: flex;
  gap: 20px;
  position: relative;
  padding-left: 70px;
  align-items: flex-start;
  transition: transform 0.5s ease, opacity 0.5s ease;
  opacity: 0;
}

.home-how__icon {
  position: absolute;
  left: 14px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.home-how__content h4 {
  margin: 0 0 6px 0;
  font-size: 1.3rem;
}

.home-how__content p {
  margin: 0;
  opacity: 0.85;
  line-height: 1.5;
}

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


/* =========================
   FEATURES SECTION
========================= */

.home-features {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 100px 20px;
}

.home-features__article {
  max-width: 1200px;
  width: 100%;
}

.home-features__title {
  text-align: center;
  font-size: 2.6rem;
  margin-bottom: 70px;
}

.home-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
  gap: 30px;
}

.home-features__card {
  background: rgba(0,0,0,0.6);
  border-radius: 14px;
  padding: 30px;
  backdrop-filter: blur(10px);

  border: 1px solid rgba(255,255,255,0.08);

  transition: 
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border 0.35s ease;

  cursor: default;
}

.home-features__card:hover {

  transform: translateY(-6px);

  border: 1px solid rgba(255,255,255,0.2);

  box-shadow:
  0 10px 30px rgba(0,0,0,0.6),
  0 0 20px rgba(255,255,255,0.08);

}

.home-features__icon {

  font-size: 1.8rem;

  width: 45px;
  height: 45px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  margin-bottom: 15px;

  background: rgba(255,255,255,0.08);
}

.home-features__card h4 {

  margin: 0 0 10px 0;
  font-size: 1.3rem;

}

.home-features__card p {

  margin: 0;
  opacity: 0.85;
  line-height: 1.5;

}


/* =========================
   PREVIEW SECTION
========================= */

.home-preview {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 120px 20px;
}

.home-preview__article {
  max-width: 1100px;
  width: 100%;
}

.home-preview__title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 60px;
}

.home-preview__mockup {
  background: rgba(0,0,0,0.5);
  border-radius: 16px;
  padding: 40px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
  0 10px 40px rgba(0,0,0,0.6);
}

.preview-book {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.preview-book__header h4 {
  font-size: 1.8rem;
  margin: 0;
}

.preview-book__header span {
  opacity: 0.7;
  font-size: 0.9rem;
}

.preview-book__summary,
.preview-book__critic {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 10px;
}

.preview-book__summary h5,
.preview-book__critic h5 {
  margin: 0 0 10px 0;
}

.preview-chapters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-chapter {
  background: rgba(255,255,255,0.04);
  padding: 15px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s ease;
}

.chapter-number {
  font-weight: bold;
  font-size: 0.9rem;
  opacity: 0.7;
}


/* =========================
   USER SECTION
========================= */

.home-user__presentation-article__title {
  font-size: 3rem;
}


/* =========================
   BOOK LIST
========================= */

.home-user__booklist-ul {
  list-style: none;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  margin: 0 20px 0 20px;
  padding: 20px;
  display: flex;
  justify-content: start;
  flex-wrap: wrap;
  gap: 30px;

  width: 100%;
  max-width: 1000px;

  overflow-y: auto;
  overflow-x: hidden;
  perspective: 1000px;
  background: rgba(0, 0, 0, 0.6);
}

.home-user__booklist-li {
  margin-bottom: 16px;
  height: 60px;
  max-width: 100%;

  transform-origin: center;
  transform: rotateX(40deg) translateZ(-50px);
  opacity: 0.4;

  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
}


/* =========================
   BOOK LINK
========================= */

.home-user__booklink {
  height: 100%;
  font-size: 1.1rem;

  display: flex;
  align-items: center;
  justify-content: start;

  text-decoration: none;
  color: white;

  cursor: pointer;
  border: none;
  background: transparent;

  transition:
    opacity 0.3s ease,
    transform 0.5s ease;
}

.home-user__booklink:hover {
  transform: rotateY(12deg) scale(1.05);
}

.home-user__booklink__svg {
  height: 60px;
  width: 60px;
  flex-shrink: 0;
}

.home-user__booklink__span {
  display: flex;
  align-items: center;
  justify-content: start;
  overflow: hidden;
}

.home-user__booklink__span > span {
  font-size: 2.3rem;
  font-style: italic;
  word-wrap: break-word;

  opacity: 0;
  transform: translateX(-100px);

  transition:
    transform 0.5s ease,
    opacity 0.5s 0.1s ease;
}

.home-user__booklink:hover .home-user__booklink__span > span {
  opacity: 1;
  transform: translateX(0);
}


/* =========================
   MEDIA QUERY
========================= */

@media (hover: none) {

  .home-user__booklink__span > span {
    opacity: 1;
    transform: translateX(0);
  }

}

@media all and (max-width: 574px) {
  .home-user__booklist-ul {
    margin: 0;
  }
}

@media (max-width: 768px) {

  .home-how,
  .home-features,
  .home-preview,
  .home-license {
    padding: 60px 16px;
  }

  .home-how__title,
  .home-features__title,
  .home-preview__title,
  .home-license__title {
    font-size: 2rem;
  }

  .home-features__grid {
    grid-template-columns: 1fr;
  }

  .home-preview__mockup {
    padding: 25px;
  }

  .preview-book__header h4 {
    font-size: 1.4rem;
  }

}

@media (max-width: 480px) {

  .home-intro__main-citation {
    width: 100%;
  }

  .home-intro__text {
    text-align: center;
  }

  .home-user__booklink__span > span {
    font-size: 1.5rem;
  }

}

@media (prefers-reduced-motion: reduce) {

  body::before,
  body::after {
    animation: none;
    transform: none;
  }

}

@media (max-width: 768px) {

  body::before {
    animation-duration: 45s;
  }

  body::before,
  body::after {

    inset: -60%;
    
  }

}


/* =========================
   KEYFRAMES
========================= */

@keyframes auroraMove {

  0% {
    transform: translate3d(-160px,-120px,0) scale(1);
  }

  50% {
    transform: translate3d(60px,180px,0) scale(1.18);
  }

  100% {
    transform: translate3d(180px,-100px,0) scale(1.22);
  }

}


/* =========================
   SCROLL REVEAL ANIMATION
========================= */

.reveal {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(40px);

  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    filter 0.6s ease;
}

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