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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4px 16px 64px;
}

section {
  margin-bottom: 60px;
  scroll-margin-top: 60px;
}

/* =========================================================
   HEADER
========================================================= */

header {
  position: relative;
  overflow: hidden;

  max-width: 1100px;
  padding: 72px 16px 64px;

  text-align: left;
}

.header-inner {
  position: relative;
  width: min(1180px, 92%);

  text-align: left;
}

/* =========================================================
   HEADER TEXT
========================================================= */

header h1 {
  position: relative;

  max-width: 768px;
  margin-bottom: 18px;

  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;

  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #dbeafe 45%,
    #93c5fd 100%
  );

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  text-shadow:
    0 0 10px rgba(147, 197, 253, 0.10),
    0 2px 12px rgba(96, 165, 250, 0.08);

  opacity: 0;
  transform: translateY(10px);

  animation: headerTextReveal 1.4s ease forwards;
  animation-delay: 0.25s;
}

header p {
  position: relative;

  max-width: 760px;
  margin: 0 0 14px;

  color: #b4bcc6;
  font-size: 15px;
  line-height: 1.8;

  opacity: 0;
  transform: translateY(8px);

  animation: headerTextReveal 1.4s ease forwards;
  animation-delay: 0.45s;
}

/* =========================================================
   TYPOGRAPHY
========================================================= */

h2 {
  font-size: 22px;
  color: #ffffff;
}

h3 {
  margin: 22px 0 6px;

  font-size: 17px;
  color: #c7d2fe;
}

p,
ul {
  font-size: 14px;
  color: #d1d5db;
}

ul {
  padding-left: 20px;
}

ul li,
.toc li {
  margin-bottom: 8px;
}

/* =========================================================
   BOXES
========================================================= */

.box {
  margin: 16px 0;
  padding: 16px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.box.hero {
  display: inline-block;
  vertical-align: top;

  width: auto;
  max-width: calc(100% - 442px);
}

/* =========================================================
   TEXT STATES
========================================================= */

.tip {
  color: #93c5fd;
}

.warn {
  color: #fbbf24;
}

/* =========================================================
   LINKS
========================================================= */

.text-link {
  color: #93c5fd;
  text-decoration: none;

  border-bottom: 1px dashed rgba(147, 197, 253, 0.5);

  transition: all 0.2s ease;
}

.text-link:hover {
  color: #60a5fa;
  border-bottom: 1px solid #60a5fa;
}

.text-link:active {
  opacity: 0.7;
}

/* =========================================================
   IMAGE WRAPPER
========================================================= */

.img-wrapper {
  position: relative;
  overflow: hidden;

  float: left;

  width: min(420px, 48%);
  margin: 8px 22px 16px 0;

  aspect-ratio: 16 / 9;

  background: rgba(255, 255, 255, 0.04);

  border-radius: 16px;
}

.section-img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  opacity: 0;
  transform: scale(0.98);

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

/* =========================================================
   IMAGE LOADING
========================================================= */

.img-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;

  background: linear-gradient(
    110deg,
    #1f2937 25%,
    #374151 37%,
    #1f2937 63%
  );

  background-size: 200% 100%;

  animation: shimmer 1.4s infinite;
}

.img-wrapper.loaded .img-skeleton {
  display: none;
}

.img-wrapper.loaded .section-img {
  opacity: 1;
  transform: scale(1);
}

/* =========================================================
   CLEAR FIX
========================================================= */

.intro::after,
section::after {
  content: "";
  display: block;
  clear: both;
}

/* =========================================================
   TABLE OF CONTENTS
========================================================= */

.toc {
  margin: 24px 0 40px;
  padding: 16px;

  background: rgba(255, 255, 255, 0.04);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.toc h3 {
  margin: 0 0 10px;

  font-size: 15px;
  color: #93c5fd;
}

.toc ul {
  margin: 0;
  padding: 0;

  list-style: none;
}

.toc a {
  color: #cbd5f5;
  font-size: 13.5px;
 text-decoration: none;
  transition: 0.2s ease;
}

.toc a:hover {
  color: #60a5fa;
  transform: translateX(4px);
}

/* =========================================================
   META
========================================================= */

.date {
  display: block;

  margin-bottom: 14px;

  color: #94a3b8;
  font-size: 13px;

  opacity: 0.9;
}

/* =========================================================
   RELATED SECTION
========================================================= */

.related {
  margin-top: 60px;
}

.related h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.related-card {
  display: flex;
  gap: 14px;

  padding: 12px;

  background: rgba(255, 255, 255, 0.04);

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

  transition: 0.25s ease;
}

.related-card:hover {
  transform: translateY(-4px);

  border-color: rgba(96, 165, 250, 0.5);

  box-shadow: 0 10px 25px rgba(96, 165, 250, 0.15);
}

.related-card img {
  width: 110px;
  height: 70px;

  object-fit: cover;

  border-radius: 10px;
}

.related-content h3 {
  margin-bottom: 4px;

  font-size: 14px;
  color: #e5e7eb;
}

.related-content p {
  font-size: 12px;
  color: #9ca3af;
}

/* =========================================================
   INLINE ICON
========================================================= */

.inline-icon {
  width: 16px;
  height: auto;

  margin-left: 4px;

  vertical-align: -4px;

  opacity: 0.85;
}

/* =========================================================
   IMAGE SOURCE
========================================================= */

.image-source {
  margin: 8px 0 22px;

  color: #b0b0b0;
  font-size: 12px;
  line-height: 1.5;

  text-align: left;
}

.image-source a {
  color: #d6b36a;
  text-decoration: none;

  transition: 0.3s ease;
}

.image-source a:hover {
  color: #ffe29a;
  text-decoration: underline;
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes headerGlowReveal {
  0% {
    opacity: 0;
    transform: scale(0.72);
    filter: blur(60px);
  }

  45% {
    opacity: 1;
    transform: scale(1.06);
    filter: blur(26px);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(18px);
  }
}

@keyframes headerTextReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {
  .img-wrapper {
    float: none;

    width: 100%;
    margin: 18px 0;
  }

  .box.hero {
    display: block;
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-card {
    flex-direction: column;
  }

  .related-card img {
    width: 100%;
    height: 120px;
  }
}