@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&family=Space+Mono&display=swap');

:root {
  --bg-gradient: linear-gradient(160deg, #0B3078 0%, #412B78 100%);
  --text-light: #f3f3f3;
  --accent-blue: #90d3ff;
  --accent-pink: #ff9ace;
  --muted: #a8a6d1;
  --bar-bg: rgba(255, 255, 255, 0.15);
  --bar-glow: rgba(255, 255, 255, 0.3);
}

/* ---------- Base Layout ---------- */
html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  text-align: center;
}

/* ---------- Header ---------- */
header {
  margin-bottom: 2rem;
}

img.profile {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid var(--accent-blue);
  box-shadow: 0 0 25px var(--accent-pink);
  object-fit: cover;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 25px var(--accent-pink); }
  50% { box-shadow: 0 0 35px var(--accent-blue); }
}

h1 {
  font-size: 2.3rem;
  margin: 1rem 0 0.3rem;
}

h1.justified {
  text-align: justify;
}

h2 {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 0;
}

/* ---------- Navigation ---------- */
nav {
  margin-top: 1.2rem;
  margin-bottom: 2.4rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

nav a,
form button,
.back-btn {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  transition: all 0.3s ease;
  font-family: 'Space Mono', monospace;
}

nav a:hover,
form button:hover,
.back-btn:hover {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink));
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* ---------- Section + Text ---------- */
section {
  max-width: 650px;
}

section p {
  text-align: left;
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

/* ---------- XP Bars ---------- */
.xp-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.xp-container {
  background: var(--bar-bg);
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  height: 22px;
  margin: 0.8rem auto 1.6rem auto; /* better spacing between bars */
  overflow: hidden;
  box-shadow: 0 0 10px var(--bar-glow);
}

.xp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink));
  width: 0%;
  animation: fillBar 2s ease-out forwards;
}

@keyframes fillBar {
  from { width: 0%; }
  to { width: var(--target-width); }
}

/* ---------- Headings ---------- */
h3 {
  font-family: 'Space Mono', monospace;
  margin-top: 2.5rem; /* clear space before new sections */
  margin-bottom: 1rem;
  color: var(--text-light);
}

/* ---------- Forms ---------- */
form {
  width: 100%;
  max-width: 400px;
  margin: 1.5rem auto 2.5rem auto;
  text-align: left;
}

form label {
  display: block;
  font-weight: 600;
  margin-top: 1.2rem;
  margin-bottom: 0.3rem;
}

form input,
form textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
}

form button {
  margin-top: 1.2rem;
}

/* ---------- Blog Preview ---------- */
.blog-preview {
  margin-top: 3rem;
  text-align: left;
  max-width: 650px;
}

.blog-preview h3 {
  font-family: 'Space Mono', monospace;
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.blog-preview article h2 {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
  color: var(--text-light);
}

.preview-snippet {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.read-more {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 0.4rem 1rem;
  color: var(--text-light);
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  transition: all 0.3s ease;
}

.read-more:hover {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink));
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  color: #fff;
}

/* ---------- Spotify Placeholder ---------- */
.spotify-placeholder {
  margin-top: 3rem;
  font-style: italic;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 1rem;
}

/* ---------- Footer ---------- */
footer {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3rem;
  opacity: 0.7;
}

/* ---------- Fine-tuned spacing adjustments ---------- */

/* Adds breathing room after writing progress bars */
.xp-container:last-of-type {
  margin-bottom: 2.5rem; /* increase space before newsletter section */
}

/* Makes the form feel more structured and readable */
form {
  max-width: 420px;
  margin: 2rem auto 3rem auto; /* more space before/after form */
}

/* Adds more space above and below labels */
form label {
  display: block;
  font-weight: 600;
  margin-top: 1.2rem; /* adds space above each label */
  margin-bottom: 0.4rem; /* adds breathing room before input */
}

/* Slightly increase spacing between inputs */
form input,
form textarea {
  margin-bottom: 1rem; /* space between fields */
}

/* Add more space before the submit button */
form button {
  margin-top: 1.5rem;
}

/* Adds visual separation before the "How to Stay in the Know" heading */
h3 {
  margin-top: 3rem; /* creates space above new sections */
  margin-bottom: 1.2rem;
}

article {
  max-width: 700px;
  text-align: left;
  line-height: 1.7;
}

article h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

article .date {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.teaser {
  color: var(--accent-blue);
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
}

.subscribe-box {
  margin-top: 2.5rem;
  padding: 1.4rem 1.2rem;
  background: var(--bar-bg);
  border-radius: 12px;
  box-shadow: 0 0 20px var(--bar-glow) inset;
  text-align: left;
}

.subscribe-box h3 {
  margin-top: 0;
  color: var(--accent-pink);
}

.subscribe-box form label {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--muted);
}

.reading-meta {
  font-family: 'Space Mono', monospace;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.next-post {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.3);
  color: var(--muted);
  font-style: italic;
  text-align: center;
}
