/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  --bg:           #181a20;
  --surface:      #232734;
  --surface-soft: #272c38;
  --heading:      #6896db;
  --text:         #ffffff;

  --accent-green:       #3f7fdf;
  --accent-green-hover: #2a589e;
  --accent-blue:        #6896db;
  --accent-brown:       #9a7b5a;
  --accent-soft:        #a9b8c9;

  --accent:    var(--accent-green);
  --highlight: var(--accent-blue);
  --bg-card:   var(--surface);
  --card-desc: rgba(204, 204, 204, 0.85);
}

/* ===== LIGHT THEME ===== */
html.theme-light {
  --bg:           #ECEFF1;
  --surface:      #FFFFFF;
  --surface-soft: #F5F7F8;
  --heading:      #2F3033;
  --text:         #4b4848;

  --accent-green:       #7A90A6;
  --accent-green-hover: #90A2B5;
  --accent-blue:        #7A90A6;
  --accent-brown:       #8B6F4E;
  --accent-soft:        #A9B9C7;

  --bg-card:   var(--surface);
  --card-desc: #414346;
  --accent:    var(--accent-green);
  --highlight: var(--accent-blue);
}
html.theme-light .skill-icon-wrap {
  background: linear-gradient(135deg, #ffffff, #d9d9d9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
html.theme-light .section-subtitle { color: black; }
html.theme-light .hero-tagline { color: var(--accent-blue); opacity: 0.85; }

/* ===== BODY ===== */
body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4rem;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 1.25rem;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  margin: 0 auto 2rem auto;
  max-width: 1160px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: headerDrop 0.4s ease-out;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.site-header.header-hidden { transform: translateY(-140%); opacity: 0; }

@keyframes headerDrop {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.site-name {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--heading);
}
.site-role {
  margin-top: 0.1rem;
  color: var(--heading);
  opacity: 0.8;
  font-size: 0.85rem;
}
.header-right { display: flex; align-items: center; gap: 1rem; }
.site-title { line-height: 1.2; }
.site-link-home { text-decoration: none; color: inherit; display: block; }
.site-link-home:hover .site-name,
.site-link-home:hover .site-role { opacity: 0.9; }

/* SOCIAL + BUTTONS */
.social-icons a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  font-size: 0.9rem;
  background: transparent;
}
.btn-resume, .btn-back, .social-icons a {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}
.social-icons a:hover {
  background: var(--accent-soft); color: #101010;
  border-color: var(--accent-soft);
  transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,0.4);
}

.btn-resume {
  border-radius: 6px; border: 1px solid var(--accent-green);
  padding: 0.4rem 0.9rem; font-size: 0.9rem;
  text-decoration: none; color: #ffffff;
  background: var(--accent-green);
  font-family: "Poppins", sans-serif;
}
.btn-resume:hover {
  background: var(--accent-green-hover); border-color: var(--accent-green-hover);
  color: #ffffff; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,0.4);
}
.btn-resume:active, .btn-back:active, .social-icons a:active {
  transform: translateY(1px) scale(0.98); box-shadow: none;
}
.arrow-down { font-size: 0.7rem; }

.btn-back {
  display: inline-block; border-radius: 6px;
  border: 1px solid var(--accent-blue);
  padding: 0.45rem 0.9rem; font-size: 0.9rem;
  text-decoration: none; color: var(--accent-blue); background: transparent;
}
.btn-back:hover {
  background: var(--accent-soft); border-color: var(--accent-soft);
  color: #111; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,0.4);
}

/* ===== HERO ===== */
.hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}
.hero-avatar-wrap {
  width: 210px; height: 210px;
  border-radius: 50%; padding: 5px;
  border: 3px solid var(--accent-blue);
  display: flex; align-items: center; justify-content: center;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}
.hero-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* NEW: discipline tagline directly under the heading */
.hero-tagline {
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 0.2rem 0 0.9rem;
  letter-spacing: 0.02em;
  opacity: 0.95;
}

/* ===== SECTIONS ===== */
.section { margin-bottom: 2.5rem; }
.section-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.7rem; color: var(--accent-blue); margin-bottom: 1.2rem;
}
.section-subtitle {
  margin-top: -0.3rem; margin-bottom: 1.4rem;
  font-size: 0.98rem; color: rgba(255, 255, 255, 0.65);
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem;
}
.skill-card {
  background: var(--bg-card); border-radius: 1.4rem;
  padding: 1.4rem 1.6rem; box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; gap: 0.55rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.skill-card:hover {
  transform: translateY(-6px); box-shadow: 0 22px 45px rgba(0,0,0,0.65);
  background: var(--surface-soft);
}
.skill-icon-wrap {
  width: 48px; height: 48px; border-radius: 1rem; margin-bottom: 0.4rem;
  background: radial-gradient(circle at 0 0, #7b5cff, #2b3150);
  display: flex; align-items: center; justify-content: center;
}
.skill-icon-wrap img { width: 26px; height: 26px; object-fit: contain; }
.skill-title { margin: 0; font-family: "Poppins", sans-serif; font-size: 1.1rem; color: var(--heading); }
.skill-text { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--card-desc); }

/* ===== PROJECT GRID ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
}
.project-card {
  background: var(--bg-card); border-radius: 1.5rem;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover {
  transform: translateY(-6px); box-shadow: 0 22px 45px rgba(0,0,0,0.6);
}
.project-card-link {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
}
.project-image-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.project-image {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.35s ease-out;
}
.project-card:hover .project-image { transform: scale(1.06); }
.project-body {
  padding: 1.1rem 1.4rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}

/* NEW: date above title */
.project-card-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--accent-blue);
  opacity: 0.75;
  letter-spacing: 0.03em;
}
.project-card-date i { font-size: 0.65rem; }

.project-card-title {
  font-family: "Poppins", sans-serif; font-size: 1.2rem;
  margin: 0; color: var(--heading);
}
.project-card-desc {
  margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--card-desc);
}
.project-tags { margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.project-tag {
  font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  background: var(--surface-soft); border: 1px solid var(--accent-blue);
  color: #6b9ae0;
}

/* ===== EDUCATION ===== */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.edu-card { background: var(--bg-card); border-radius: 0.75rem; padding: 1.1rem 1.2rem; }
.edu-card:hover { transform: translateY(-3px); box-shadow: 0 16px 28px rgba(0,0,0,0.5); }
.edu-card, .detail-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.detail-card:hover { transform: translateY(-3px); box-shadow: 0 16px 28px rgba(0,0,0,0.5); }

/* ===== ABOUT SECTION ===== */
.about-section {
  background: var(--surface-soft); color: var(--text);
  padding: 2.5rem 1.8rem; margin-top: 3rem; border-radius: 0.85rem;
}
.about-inner h2 { font-family: "Poppins", sans-serif; margin-top: 0; color: var(--accent-blue); }
.about-inner p { line-height: 1.7; }

/* ===== PROJECT DETAIL ===== */
.project-hero { margin-top: 1rem; margin-bottom: 1.5rem; }
.project-hero-image {
  width: 100%; height: 230px; object-fit: cover;
  border-radius: 0.75rem; display: block;
}
.project-hero-title-wrap { margin-top: 0.5rem; }
.project-hero-title {
  font-family: "Poppins", sans-serif; font-size: 1.9rem;
  color: var(--accent-blue); margin: 0;
}
.feature-list { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.feature-list li { margin-bottom: 0.3rem; }
.section-detail-cards {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem;
}
.detail-card { background: var(--bg-card); border-radius: 0.75rem; padding: 1.2rem 1.3rem; }
.detail-card h2 { margin-top: 0; font-family: "Poppins", sans-serif; color: var(--accent-blue); }
.project-info-list { list-style: none; padding-left: 0; margin: 0; }
.project-info-list li { margin-bottom: 0.4rem; }

/* What I Learned content */
#detail-learned p  { line-height: 1.7; margin-bottom: 0.4rem; }
#detail-learned ul { padding-left: 1.4rem; margin: 0.4rem 0 0; }
#detail-learned li { margin-bottom: 0.3rem; line-height: 1.6; }

/* ===== CODE SNIPPET BLOCK ===== */
.code-snippet-wrap {
  border-radius: 0.75rem;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
}

/* always stays dark regardless of theme */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2d2d30;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  user-select: none;
}
.code-header-left { display: flex; align-items: center; gap: 0.65rem; }
.code-dots { display: flex; gap: 5px; }
.code-dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.code-dot-r { background: #ff5f56; }
.code-dot-y { background: #ffbd2e; }
.code-dot-g { background: #27c93f; }
.code-filename { font-size: 0.75rem; color: #cccccc; letter-spacing: 0.02em; }
.code-lang-badge {
  font-size: 0.62rem; font-weight: 600;
  padding: 0.15rem 0.55rem;
  background: rgba(104, 150, 219, 0.2);
  border: 1px solid rgba(104, 150, 219, 0.35);
  border-radius: 4px; color: #6896db;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.code-body {
  background: #1e1e1e;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 420px;
  padding: 0.6rem 0;
}
.code-body::-webkit-scrollbar { width: 8px; height: 8px; }
.code-body::-webkit-scrollbar-track { background: #1e1e1e; }
.code-body::-webkit-scrollbar-thumb { background: #424242; border-radius: 4px; }
.code-body::-webkit-scrollbar-corner { background: #1e1e1e; }

.code-line {
  display: flex;
  align-items: baseline;
  min-height: 1.55em;
  line-height: 1.55;
}
.code-line:hover { background: rgba(255, 255, 255, 0.03); }
.code-ln {
  width: 3.2rem; min-width: 3.2rem;
  text-align: right; padding-right: 1.2rem;
  color: #4a5568; user-select: none;
  font-size: 0.78rem; flex-shrink: 0;
}
.code-text {
  padding: 0 1.2rem; white-space: pre;
  font-size: 0.82rem; color: #d4d4d4; flex: 1;
}

/* Syntax colours (VS Code Dark+ palette) */
.syn-kw  { color: #569cd6; }   /* keywords */
.syn-str { color: #ce9178; }   /* strings */
.syn-cmt { color: #6a9955; font-style: italic; } /* comments */
.syn-num { color: #b5cea8; }   /* numbers */
.syn-fn  { color: #dcdcaa; }   /* functions / attributes */
.syn-cls { color: #4ec9b0; }   /* types / classes */

/* ===== ROUTE TRANSITION ===== */
.route-animate { animation: fadeInUp 0.35s ease-out; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== MEDIA GALLERY ===== */
.media-grid { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1rem; }
.media-thumb {
  border: none; padding: 0; background: none;
  cursor: pointer; flex: 0 0 260px; max-width: 260px;
}
.media-thumb-inner {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: 1rem; overflow: hidden;
  box-shadow: 0 16px 30px rgba(0,0,0,0.45);
}
.media-thumb img, .media-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.3s ease-out;
}
.media-thumb:hover img, .media-thumb:hover video { transform: scale(1.05); }
.media-thumb-video::after {
  content: "▶"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #fff;
  text-shadow: 0 0 10px rgba(0,0,0,0.7); pointer-events: none;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.78);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.lightbox-inner {
  background: transparent; max-width: 90vw; max-height: 90vh;
  padding: 0; display: flex; align-items: center; justify-content: center;
}
#lightbox-content img, #lightbox-content video {
  width: 100%; height: auto; max-height: 90vh;
  border-radius: 0.75rem; display: block;
  box-shadow: 0 18px 40px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: fixed; top: 1.5rem; right: 1.8rem;
  border: none; background: transparent; color: var(--text);
  font-size: 1.8rem; cursor: pointer; z-index: 10000; padding: 0; line-height: 1;
}
.lightbox-close:hover { transform: scale(1.1); color: #fff; }
.lightbox-close:active { transform: scale(0.95); }
.lightbox.hidden, .hidden { display: none; }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 1px solid rgba(128,128,128,0.35);
  background: transparent; color: #888; font-size: 0.85rem;
  cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  border-color: var(--accent-blue); color: var(--accent-blue);
  background: rgba(100,160,255,0.08);
}
.theme-toggle:active { transform: scale(0.93); }

/* ===== CONTACT BTN ===== */
.contact-btn {
  border-radius: 999px; border: 1px solid var(--accent-blue);
  background: transparent; color: var(--accent-blue);
  padding: 0.3rem 0.8rem; font-size: 0.8rem; cursor: pointer;
  font-family: "Poppins", sans-serif; transition: 0.2s ease;
}
.contact-btn:hover {
  background: var(--accent-soft); color: #101010;
  border-color: var(--accent-soft); transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* ===== CONTACT FORM ===== */
.contact-section { display: flex; flex-direction: column; align-items: center; text-align: center; }
.contact-form {
  display: flex; flex-direction: column; gap: 1rem;
  max-width: 500px; width: 100%; margin: 0 auto; text-align: left;
}
.contact-form input, .contact-form textarea {
  width: 100%; padding: 0.8rem; border-radius: 8px;
  border: 1px solid var(--accent-blue);
  background: var(--surface-soft); color: var(--text); font-size: 1rem;
}
.contact-form textarea { height: 150px; resize: none; }
.btn-send {
  border-radius: 6px; border: 1px solid var(--accent-green);
  padding: 0.6rem 1.2rem; font-size: 1rem;
  color: #fff; background: var(--accent-green); cursor: pointer; transition: 0.2s ease;
}
.btn-send:hover { background: var(--accent-green-hover); border-color: var(--accent-green-hover); }
.contact-status { font-size: 0.9rem; margin-top: 0.3rem; min-height: 1.2rem; }

/* ===== DOWNLOAD BUTTON ===== */
.btn-download {
  display: inline-block; border-radius: 999px;
  border: 1px solid var(--accent-green);
  padding: 0.55rem 1.4rem; font-size: 0.95rem;
  font-family: "Poppins", sans-serif; text-decoration: none;
  color: #fff; background: var(--accent-green); cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.btn-download:hover {
  background: var(--accent-green-hover); border-color: var(--accent-green-hover);
  transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .site-header {
    flex-direction: column; align-items: flex-start; gap: 0.5rem;
    padding: 0.6rem 1rem; margin-bottom: 1.2rem;
    top: 0.5rem; border-radius: 12px;
  }
  .site-name  { font-size: 1.6rem; }
  .site-role  { font-size: 0.9rem; }
  .header-right { gap: 0.5rem; }
  .theme-toggle, .contact-btn, .btn-resume { font-size: 0.75rem; padding: 0.25rem 0.7rem; }
  .social-icons a { width: 28px; height: 28px; }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.8rem; margin-bottom: 2rem;
  }
  .hero-left, .hero-right { justify-content: center; }
  .hero-avatar-wrap { width: 170px; height: 170px; margin: 0 auto; }
  .about-section.hero-about { margin-top: 0; }

  .section-detail-cards { grid-template-columns: 1fr; }
  .media-thumb { flex: 0 0 100%; max-width: 100%; }
}
