/* ===========================================================
   THEME COLORS
   =========================================================== */
:root {
  --bg-color: #f5f5f5;
  --text-color: #1a1a1a;
  --card-bg: #fff;
  --card-border: #e0e0e0;
  --btn-bg: #222;
  --btn-text: #f5f5f5;
  --footer-text: #999;
  --link-color: #333;
}

/* Dark Mode Overrides */
body.dark-mode {
  --bg-color: #121212;
  --text-color: #f0f0f0;
  --card-bg: #1e1e1e;
  --card-border: #333;
  --btn-bg: #f0f0f0;
  --btn-text: #121212;
  --footer-text: #aaa;
  --link-color: #ddd;
}

/* ===========================================================
   Base Reset
   =========================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===========================================================
   Body
   =========================================================== */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: var(--text-color);
  background-color: var(--bg-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  letter-spacing: -0.01em;
  padding: 40px 10px;
  transition: background 0.4s ease, color 0.4s ease;
}


/* ===========================================================
   Header (kept for structure)
   =========================================================== */
header {
  position: absolute;
  top: 30px;
  left: 40px;
  right: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===========================================================
   Main Section
   =========================================================== */
main {
  text-align: center;
  margin-top: 0;
  padding: 0 20px;
  max-width: 700px;
}

h1, h2, h3 {
  font-family: inherit;
  color: var(--text-color);
  transition: color 0.3s ease;
}

h1 {
  margin-top: 30px;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 1.4rem;
  color: var(--text-color);
  margin-top: 0.4em;
  font-weight: 400;
  text-transform: lowercase;
  border-bottom: 2px solid var(--card-border);
  display: inline-block;
  padding-bottom: 0.3em;
}

.subtext {
  margin-top: 1em;
  color: var(--footer-text);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  line-height: 1.5;
}

/* ===========================================================
   Links
   =========================================================== */
.links {
  margin-top: 1.5em;
}

.links a {
  color: var(--link-color);
  text-decoration: none;
  margin: 0 15px;
  font-weight: 400;
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.3s ease;
}

.links a:hover {
  opacity: 1;
}

/* ===========================================================
   Blog & Projects Cards
   =========================================================== */
.blog-section {
  margin-top: 80px;
  text-align: center;
  max-width: 650px;
}

.posts {
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: center;
}

.post-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 20px 25px;
  width: 100%;
  max-width: 600px;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, color 0.3s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.post-card a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.05rem;
}

.post-card p {
  margin-top: 0.5em;
  color: var(--footer-text);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===========================================================
   Buttons
   =========================================================== */
.home-buttons {
  margin-top: 2em;
  display: flex;
  gap: 1.2em;
  justify-content: center;
  align-items: center;
}

.btn, .back-btn {
  text-decoration: none;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 12px 36px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  width: 150px;
  text-align: center;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover, .back-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ===========================================================
   Code Section
   =========================================================== */
.about-section {
  margin-top: 3em;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.9rem;
  padding: 40px;
  padding-bottom: 10px;
  padding-top: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  white-space: pre-wrap;        /* keeps code formatting */
  word-break: break-word;       /* breaks long words */
  overflow-x: hidden;           /* prevents horizontal scroll */
  overflow-y: visible;          /* allow vertical scroll if needed */
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  transition: transform 0.3s ease, font-size 0.3s ease, opacity 0.3s ease;
  transform-origin: top center;
}

/* This ensures that any <code> or <pre> inside the about section wraps properly */
.about-section pre,
.about-section code {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-x: hidden !important;
  display: block;
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 992px) {
  h1 { font-size: 2.6rem; }
  main { padding: 0 30px; }
  .about-section { width: 95%; font-size: 0.85rem; }
}

@media (max-width: 600px) {
  body { padding-top: 40px; }
  main { padding: 0 12px; }
  h1 { font-size: 1.9rem; margin-top: 0; }
  .links {
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
    display: flex;
  }
  .home-buttons {
    flex-direction: column;
    gap: 0.7em;
    align-items: center;
    width: 100%;
  }
  .btn, .back-btn {
    width: 80%;
    max-width: 280px;
  }
}

/* ===========================================================
   🌙 Theme Toggle Responsive Position — Desktop & Mobile
   =========================================================== */

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, background 0.3s ease, top 0.3s ease, right 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.theme-toggle img.theme-icon {
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: invert(0);
  transition: filter 0.3s ease;
}

/* Dark mode */
body.dark-mode .theme-toggle img.theme-icon {
  filter: invert(1);
}

/* ======= Mobile View (moves above the name, centered) ======= */
@media (max-width: 600px) {
  .theme-toggle {
    position: static;
    margin: 10px auto 0 auto;
    display: block;
    transform: scale(0.9);
    margin-bottom: 25px;
  }
}

#typed-title::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: var(--text-color);
}

@keyframes blink {
  50% { opacity: 0; }
}

