/* ------------------------------
  External fonts
------------------------------ */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Rubik:wght@500;700&family=Poppins:wght@600;800&family=Merriweather:wght@300;400;700&family=DM+Sans:wght@400;500&family=JetBrains+Mono:wght@400;700&display=swap");

@import url("https://fonts.googleapis.com/icon?family=Material+Icons+Round");

/* ------------------------------
   Global Variables (Dark Mode Default)
------------------------------ */
:root {
  --bg-dark: #05060a;
  --bg-light: #f5f5f8;

  --accent-1: #3b0bce;
  --accent-2: #e0a458;
  --accent-3: #2dd4bf;
  --accent-4: #ff4f9a;
  --accent-5: #1e3a8a;
  --accent-6: #6d9dfc;
  --accent-7: #00d4f5;

  --text-light: #f9fafb;
  --text-dark: #111827;

  --transition: 0.35s ease;

  --font-sans: 'Inter';
  --font-display: 'Poppins', 'Rubik';
  --font-serif: 'Merriweather';
  --font-ui: 'DM Sans';
  --font-mono: 'JetBrains Mono';
}

/* ------------------------------
   Light Mode Overrides
   Add class="light-mode" to <html>
------------------------------ */
html.light-mode {
  --bg-dark: #ffffff;
  --bg-light: #f0f2f5;

  --text-light: #111827;
  --text-dark: #05060a;

  --accent-1: #5a32ff;
  --accent-2: #c27a2f;
  --accent-3: #1fbfa8;
  --accent-4: #e63f88;
  --accent-5: #0f2a7a;
  --accent-6: #4a7df0;
  --accent-7: #00b8d8;
}


/* ------------------------------
   Smooth Theme Transition
------------------------------ */
html, body, .section, .site-header, .hero, .about, .skills, .projects, .journal, .contact, .site-footer {
  transition:
    background-color 0.45s ease,
    color 0.45s ease,
    border-color 0.45s ease,
    box-shadow 0.45s ease,
    backdrop-filter 0.45s ease;
}

:root, html.light-mode {
  transition: color 0.45s ease, background-color 0.45s ease, filter 0.45s ease;
}


/* ------------------------------
   Base Reset / Typography
------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  background: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
}

h1, h2, h3 {
  letter-spacing: 0.02em;
  margin-bottom: 0.4em;
}

p {
  margin-bottom: 1em;
}

.section {
  padding: 120px 10%;
  position: relative;
}

/* ------------------------------
   Sticky Header
------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 16px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(5,6,10,0.95), rgba(12,8,30,0.78));
  border-bottom: 1px solid rgba(127,90,240,0.08);
  z-index: 1000;
}

.logo {
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu a {
  margin-left: 24px;
  color: var(--text-light);
  text-decoration: none;
  position: relative;
  font-size: 0.95rem;
}

.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--accent-1);
  transition: var(--transition);
}

.menu a:hover::after {
  width: 100%;
}

.spellbook-trigger {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  display: none;
}

@media (max-width: 768px) {
  .spellbook-trigger {
    display: block;
    position: relative;
    z-index: 1001;
  }
}

.subtle-glow:hover {
  color: var(--accent-7);
  text-shadow: 0 0 12px var(--accent-1);
}

/* ------------------------------
   Material Icon Theme Toggle
------------------------------ */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.8rem;
  color: var(--text-light);
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle .material-icons-round {
  position: absolute;
  transition: opacity 0.45s ease, transform 0.45s ease;
  font-size: 1.8rem;
}

/* Default (dark mode): show moon */
.icon-sun {
  opacity: 0;
  transform: scale(0.6) rotate(-20deg);
}

.icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Light mode: show sun */
html.light-mode .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html.light-mode .icon-moon {
  opacity: 0;
  transform: scale(0.6) rotate(20deg);
}


/* ------------------------------
   Hero Section
------------------------------ */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at 50% 20%, var(--accent-1), transparent 70%);
}

.hero-inner {
  max-width: 700px;
  padding: 0 16px;
}

.hero h1 {
  font-size: clamp(0.9rem, 4vw, 2.5rem);
  font-family: var(--font-display);
  font-weight: 800;
}

.hero p {
  font-size: 0.85rem;
  opacity: 0.85;
}

.cta {
  margin-top: 36px;
  padding: 12px 28px;
  background: var(--accent-1);
  border: none;
  border-radius: 999px;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  min-width: 220px;
}

.cta:hover {
  box-shadow: 0 0 20px var(--accent-1);
  transform: translateY(-1px);
}

.cta-warning {
  margin-top: 10px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.cta-warning.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------
   About Section
------------------------------ */
.about {
  background: var(--bg-light);
  color: var(--text-dark);
  display: flex;
  justify-content: center;
}

.about-inner {
  display: flex;
  gap: 40px;
  max-width: 980px;
  width: 100%;
  align-items: center;
}

.about-text p {
  max-width: 420px;
}

.shimmer-border {
  width: 260px;
  height: 260px;
  border-radius: 18px;
  background: linear-gradient(135deg, #d1d5db, #e5e7eb);
  position: relative;
  overflow: hidden;
}

.shimmer-border::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 12px;
  background: #111827;
}

.shimmer-border::after {
  content: "";
  position: absolute;
  top: -100%;
  left: -100%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 5s ease-in-out infinite;
  opacity: 0.55;
  filter: blur(6px);
}

.about-image {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 16px;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

@keyframes shimmer {
  0% { transform: translate(-120%, -120%); }
  100% { transform: translate(120%, 120%); }
}

/* Variant C */
.shimmer-border.variant-c::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent);
  animation: shimmer-opacity 5s ease-in-out infinite;
  opacity: 0;
  filter: blur(6px);
}

@keyframes shimmer-opacity {
  0%, 48%, 100% { opacity: 0; }
  50% { opacity: 0.75; }
}

/* Variant B */
.shimmer-border.variant-b::after {
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer-b 6s ease-in-out infinite;
  opacity: 0;
  filter: blur(1px);
  box-shadow: 0 8px 18px rgba(255,255,255,0.04);
}

@keyframes shimmer-b {
  0% { transform: translate(-120%, -120%); opacity: 0; }
  40% { transform: translate(-10%, -10%); opacity: 0.4; }
  50% { transform: translate(0, 0); opacity: 0.5; }
  60% { transform: translate(10%, 10%); opacity: 0.3; }
  100% { transform: translate(120%, 120%); opacity: 0; }
}

/* ------------------------------
   Skills Section
------------------------------ */
.skills {
  background: radial-gradient(circle at top, rgba(45,212,191,0.1), transparent 60%);
}

.section-title {
  margin-bottom: 32px;
  font-family: var(--font-display);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.skill-card {
  background: rgba(255,255,255,0.05);
  padding: 24px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

.skill-card:hover {
  transform: translateY(-6px);
  font-weight: 500;
  border-color: rgba(127,90,240,0.28);
  box-shadow: 0 14px 40px rgba(127,90,240,0.28);
  background: linear-gradient(135deg, rgba(127,90,240,0.08), rgba(127,90,240,0.03));
}

.skills-grid:hover .skill-card {
  color: #4b5563;
}

.skills-grid:hover .skill-card:hover {
  color: var(--accent-3);
  box-shadow: 0 18px 44px rgba(127,90,240,0.32);
  background: linear-gradient(135deg, rgba(127,90,240,0.12), rgba(127,90,240,0.04));
}

/* ------------------------------
   Projects Section
------------------------------ */
.projects {
  background: radial-gradient(circle at bottom, rgba(255,79,154,0.12), transparent 60%);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.project-card {
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px 22px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: var(--transition);
}

.project-card:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: 0 0 25px var(--accent-4);
}

/* ------------------------------
   Journal Section
------------------------------ */
.journal {
  background: var(--bg-light);
  color: var(--text-dark);
}

.journal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.journal-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.15);
  transition: var(--transition);
}

.journal-card:hover {
  transform: translateY(-6px);
}

.published-date {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 8px;
}

.journl-read-more {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--accent-5);
  text-decoration: none;
  font-weight: 500;
}

/* ------------------------------
   Contact Section
------------------------------ */
.contact {
  background: radial-gradient(circle at top, rgba(109,157,252,0.12), transparent 60%);
}

.contact-form {
  max-width: 520px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(15,23,42,0.75);
  color: var(--text-light);
  font-size: 0.95rem;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-6);
  box-shadow: 0 0 0 1px var(--accent-6);
}

#formStatus {
  margin-top: 1rem;
  font-weight: bold;
}

/* ------------------------------
   Scroll Fade Animations
------------------------------ */
.fade-in,
.card-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: 0.8s ease-out;
}

.fade-in.visible,
.card-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------
   Spellbook Navigation Drawer
------------------------------ */
.spellbook-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: 0.4s ease;
  z-index: 2000;
}

.spellbook-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.site-header.menu-yank {
  z-index: 3000;
}

.site-header.menu-yank .menu {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 18px;
  pointer-events: auto;
}

.site-header .menu a {
  opacity: 0;
  transform: translateX(120%);
}

@keyframes yankIn {
  0% { transform: translateX(120%); opacity: 0; }
  70% { transform: translateX(-6%); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes yankOut {
  0% { transform: translateX(0); opacity: 1; }
  70% { transform: translateX(-6%); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

.site-header.menu-yank .menu a {
  animation: yankIn 720ms cubic-bezier(.2,.9,.3,1) forwards;
}

.site-header.menu-yank-reversing .menu a {
  animation: yankOut 520ms cubic-bezier(.2,.9,.3,1) forwards;
}

.site-header.menu-yank .spellbook-trigger {
  display: inline-block;
  opacity: 0;
  transform: translateX(120%);
  animation: yankIn 720ms cubic-bezier(.2,.9,.3,1) forwards;
  animation-delay: 0.28s;
}

.site-header.menu-yank-reversing:not(.toggle-visible) .spellbook-trigger {
  animation: yankOut 520ms cubic-bezier(.2,.9,.3,1) forwards;
}

.site-header.toggle-visible .spellbook-trigger {
  display: inline-block;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

@media (max-width: 768px) {
  .site-header.menu-yank {
    height: 72px;
  }
}

.spellbook {
  position: absolute;
  right: -400px;
  top: 0;
  height: 100%;
  width: 320px;
  background: linear-gradient(135deg, #111827, #020617);
  border-left: 2px solid var(--accent-1);
  box-shadow: -4px 0 25px var(--accent-1);
  padding: 40px 30px;
  transition: 0.5s ease;
  overflow: hidden;
}

.spellbook-overlay.active .spellbook {
  right: 0;
}

.spellbook-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.spellbook-close:hover {
  color: var(--accent-1);
}

.spellbook-menu {
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.spell-link {
  color: var(--text-light);
  font-size: 1.2rem;
  text-decoration: none;
  position: relative;
  padding-left: 8px;
  transition: var(--transition);
}

.spell-link::before {
  content: "✶";
  position: absolute;
  left: -12px;
  opacity: 0.7;
  font-size: 0.85rem;
  color: var(--accent-1);
}

.spell-link:hover {
  color: var(--accent-7);
  text-shadow: 0 0 10px var(--accent-1);
}

.spellbook-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.4) 2px, transparent 2px),
    radial-gradient(circle, rgba(255,255,255,0.25) 2px, transparent 2px),
    radial-gradient(circle, rgba(255,255,255,0.15) 2px, transparent 2px);
  background-size: 4px 4px, 3px 3px, 2px 2px;
  animation: particleFloat 12s linear infinite;
  opacity: 0.4;
  mix-blend-mode: screen;
}

@keyframes particleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-200px); }
}

.rune-circle {
  position: absolute;
  bottom: 40px;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translateX(-50%) scale(0);
  background: radial-gradient(circle, rgba(127,90,240,0.25), transparent 60%);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(127,90,240,0.8);
  opacity: 0;
  transition: 0.5s ease;
  pointer-events: none;
}

.rune-circle::before {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.6);
}

.rune-circle::after {
  content: "";
  position: absolute;
  inset: 36%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.9);
}

.rune-circle.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: spinRune 3s linear infinite;
}

@keyframes spinRune {
  from { transform: translateX(-50%) scale(1) rotate(0deg); }
  to { transform: translateX(-50%) scale(1) rotate(360deg); }
}

/* ------------------------------
   TRUE ANIMATED STARFIELD
------------------------------ */
.experience {
  position: relative;
  overflow: hidden;
}

.experience .starfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.experience .starfield span {
  position: absolute;
  display: block;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: starFloat linear infinite;
}

.starfield.layer1 span { animation-duration: 18s; opacity: 0.6; }
.starfield.layer2 span { animation-duration: 28s; opacity: 0.4; }
.starfield.layer3 span { animation-duration: 40s; opacity: 0.25; }

@keyframes starFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-800px); }
}

/* ------------------------------
   Vertical Timeline
------------------------------ */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 40px;
  z-index: 2;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--accent-1), transparent);
  opacity: 0.6;
}

.timeline-item {
  position: relative;
  margin-bottom: 60px;
}

.timeline-dot {
  position: absolute;
  left: -2px;
  top: 4px;
  width: 16px;
  height: 16px;
  background: var(--accent-1);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-1);
}

.timeline-content {
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 24px 28px;
  border-radius: 18px;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 0 35px rgba(0,0,0,0.45);
  transition: var(--transition);
}

.timeline-content:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 45px rgba(127,90,240,0.65);
}

.timeline-content .meta {
  opacity: 0.75;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.timeline-content ul {
  padding-left: 1.2rem;
  line-height: 1.6;
}

/* ------------------------------
   Responsive
------------------------------ /
@media (max-width: 900px) {
  .about-inner {
    flex-direction: column;
    text-align: center;
  }

  .about-text p {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 100px 6%;
  }

  .desktop-menu {
    display: none;
  }

  .spellbook-trigger {
    display: block;
  }
}

/* ------------------------------
   SITE FOOTER
------------------------------ */
.site-footer {
  padding: 2rem 1rem;
  background: #111;
  color: #ccc;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: #ccc;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  max-width: 700px;
  margin: 1rem auto;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #aaa;
}

.footer-nav {
  margin-top: 1rem;
}

.footer-nav span {
  margin: 0 0.5rem;
  color: #555;
}
