
/* =========================================
   1. GLOBAL STYLES
   ========================================= */

body {
  background-color: #171320;
  color: #ede5f5;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;

  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* =========================================
   2. TYPOGRAPHY
   ========================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #d9b8ff;
  line-height: 1.3;
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 650;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.35rem;
}

h4,
h5,
h6 {
  font-size: 1.1rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

b,
strong {
  font-weight: 700;
}

article {
  overflow-wrap: break-word;
}

/* =========================================
   3. LINKS
   ========================================= */

a {
  color: #b99ae8;
  text-decoration: none;
  border-bottom: 2px solid #b99ae8;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: #e0c4ff;
  border-color: #e0c4ff;
}

article a {
  overflow-wrap: anywhere;
}

/* =========================================
   4. LISTS
   ========================================= */

ul,
ol {
  padding-left: 30px;
}

article li {
  margin-bottom: 0.4rem;
}

/* =========================================
   5. CODE AND CODE BLOCKS
   ========================================= */

code {
  background-color: #30283b;
  border-radius: 6px;
  color: #d4b2ff;
  padding: 0.4em 0.6em;
  font-family: "Courier New", monospace;
}

pre {
  background-color: #30283b;
  border-radius: 6px;
  padding: 1em;
  overflow: auto;
  box-shadow: 2px 2px 6px #000;
  line-height: 1.6;
  font-size: 0.9rem;
}

pre code {
  padding: 0;
  background-color: transparent;
  border-radius: 0;
}

/* =========================================
   6. BLOCKQUOTES
   ========================================= */

blockquote {
  background-color: #241c30;
  border-left: 4px solid #a98ac9;
  padding-left: 2em;
  margin-left: 0;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  padding-right: 0.5em;
  color: #ded3e9;
  font-style: italic;
}

/* =========================================
   7. IMAGES
   ========================================= */

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 3px solid #30283b;
  box-shadow: 3px 3px 6px #000;
  box-sizing: border-box;
}

/* =========================================
   8. HEADER AND NAVIGATION
   ========================================= */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0 20px;
  border-bottom: 1px solid #493b57;
}

.site-brand {
  color: #ede5f5;
  border-bottom: none;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 1.15rem;
  white-space: nowrap;
}

.site-brand:hover {
  color: #d9b8ff;
  border-bottom: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px 24px;
}

.site-header nav a {
  color: #ede5f5;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: #e0c4ff;
  border-bottom-color: #e0c4ff;
}

.site-header a:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid #e0c4ff;
  outline-offset: 4px;
}

/* =========================================
   9. MAIN CONTENT
   ========================================= */

#main-content {
  padding: 16px 0 36px;
}

/* =========================================
   10. FOOTER
   ========================================= */

.site-footer {
  border-top: 1px solid #493b57;
  padding: 16px 0 8px;
  color: #bfb2cb;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

/* =========================================
   11. SCROLLBARS
   ========================================= */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #171320;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: #30283b;
  border-radius: 6px;
  border: 3px solid #171320;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #493b57;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #30283b #171320;
}

::-webkit-scrollbar-corner {
  background: #171320;
}

/* =========================================
   12. RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 540px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-header nav {
    justify-content: flex-start;
    gap: 12px 20px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  body {
    padding: 16px;
  }
}

/* =========================================
   13. REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
}

/* =========================================
   14. IMAGE REFINEMENTS
   ========================================= */

article img {
  display: block;
  max-width: 100%;
  height: auto;

  border-radius: 10px;
  border: 1px solid #493b57;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);

  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

article img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* =========================================
   15. BLOCKQUOTE REFINEMENTS
   ========================================= */

article blockquote {
  background-color: #241c30;
  border-left: 3px solid #d9b8ff;

  margin: 24px 0;
  padding: 18px 24px;

  border-radius: 0 8px 8px 0;

  color: #e6dbef;
  font-style: italic;
  line-height: 1.75;
  font-size: 1.05rem;
}

/* =========================================
   16. SMALL SCREEN ADJUSTMENTS
   ========================================= */

@media (max-width: 540px) {
  article blockquote {
    padding: 14px 18px;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  article img {
    transition: none;
  }

  article img:hover {
    transform: none;
  }
}

/* Quote attribution immediately after a blockquote */

article blockquote + p {
  margin-top: -12px;
  margin-bottom: 24px;

  color: #a99bb7;
  font-size: 0.9rem;
  font-style: italic;

  text-align: right;
}

/* =========================================
   17. SECTION HEADING REFINEMENTS
   ========================================= */

article h2 {
  padding-bottom: 10px;
  border-bottom: 1px solid #493b57;
  margin-top: 48px;
}

article h3 {
  margin-top: 28px;
  color: #b99ae8;
}

article h2 + h3 {
  margin-top: 24px;
}

/* =========================================
   18. SUBTLE INTERACTIONS
   ========================================= */

/* Smooth link transitions */

a {
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

/* Content links */

article a:hover {
  color: #e0c4ff;
  border-bottom-color: #e0c4ff;
}

/* Navigation links */

.site-header nav a {
  transition:
    color 0.2s ease,
    border-bottom-color 0.2s ease;
}

.site-header nav a:hover {
  color: #e0c4ff;
  border-bottom-color: #e0c4ff;
}

/* Brand interaction */

.site-brand {
  transition: color 0.2s ease;
}

.site-brand:hover {
  color: #d9b8ff;
}

/* Accessible keyboard focus */

a:focus-visible {
  outline: 2px solid #e0c4ff;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Project and learning links */

article p a {
  text-underline-offset: 4px;
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
  a,
  .site-brand,
  .site-header nav a {
    transition: none;
  }
}

