/* Extracted styles from original index.html */
:root {
  --header-height: 72px;
  --bg: #f7f9fb;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #0b5fff;
  --accent-dark: #0846c6;
  --border: #e6e9ee;
  --radius: 10px;
  --shadow: 0 6px 18px rgba(11,95,255,0.08);
  --max-width: 1100px;
  --gap: 24px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: #111827;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

body.no-transition {
  transition: none !important;
}

/* Page container */
.wrap{
  max-width:var(--max-width);
  margin:40px auto;
  padding:24px;
  /* reserve space for the fixed header so content isn't hidden underneath */
  padding-top: calc(var(--header-height) + 24px);
}

/* Top navigation */
/* Fixed, translucent header that overlays content but pushes page down via .wrap padding */
header.header,
header.site-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:1000;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  background: rgba(255,255,255,0.85);
  /* subtle blur for nicer overlay effect on supported browsers */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom:1px solid var(--border);
  padding:12px 24px;
  box-shadow: 0 6px 18px rgba(11,95,255,0.04);
  min-height: var(--header-height);
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:inherit;
}
.brand .logo{
  width:56px;
  height:56px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--accent),var(--accent-dark));
  display:flex;
  align-items:center;
  justify-content:center;
  color:white;
  font-weight:700;
  box-shadow:var(--shadow);
}
nav.nav{
  display:flex;
  gap:8px;
  align-items:center;
}
nav a{
  text-decoration:none;
  color:var(--muted);
  padding:8px 12px;
  border-radius:8px;
  font-weight:600;
  transition:all .18s ease;
}
nav a:hover, nav a:focus{
  color:var(--accent-dark);
  transform:translateY(-2px);
  background:rgba(11,95,255,0.06);
}
.cta{
  background:var(--accent);
  color:white;
  box-shadow:var(--shadow);
}
.cta:hover{background:var(--accent-dark)}

/* Hero / Home */
.hero{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:var(--gap);
  align-items:center;
  margin-top:12px;
}
.hero .card{
  background:transparent;
  padding:6px;
}
.intro{
  background:linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.6));
  border-radius:var(--radius);
  padding:28px;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  position: relative;
}
.intro h1{
  margin:0 0 6px 0;
  font-size:28px;
  letter-spacing:-0.4px;
}
.meta{
  color:var(--muted);
  font-weight:600;
  margin-bottom:14px;
}
.welcome{
  color:#374151;
  margin:14px 0 0 0;
}
.links{
  margin-top:18px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content: flex-end;
}

/* Profile photo card */
.profile-card{
  background:var(--card);
  border-radius:12px;
  padding:18px;
  border:1px solid var(--border);
  text-align:center;
  box-shadow:var(--shadow);
}
.profile-card img{
  width:140px;
  height:140px;
  object-fit:cover;
  border-radius:50%;
  border:6px solid rgba(11,95,255,0.06);
  transition:transform .35s ease;
}
.profile-card img:hover{transform:scale(1.03)}
.profile-card .name{
  margin-top:12px;
  font-weight:700;
}
.profile-card .small{
  color:var(--muted);
  font-size:14px;
}

/* Sections common */
section.section{
  margin-top:28px;
  display:block;
}
.section .section-inner{
  background:var(--card);
  border-radius:12px;
  padding:22px;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
}
h2{margin:0 0 8px 0;font-size:20px}
p.lead{color:var(--muted);margin:0 0 12px 0}

/* Grid for projects and CV */
.grid{
  display:grid;
  gap:16px;
  grid-template-columns:repeat(3,1fr);
  align-items: start;
}
.card{
  background:linear-gradient(180deg, #fff,#fbfdff);
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  transition:transform .22s ease, box-shadow .22s ease;
  position: relative;
  min-height: 280px;
  height: auto;
}
.card:hover{transform:translateY(-6px);box-shadow:0 12px 30px rgba(10,20,40,0.06)}
.project-img{
  width:100%;
  height:140px;
  object-fit:cover;
  border-radius:8px;
  background:#eef3ff;
  display:block;
  margin-bottom:10px;
}
.project-title{font-weight:700;margin:0 0 6px 0}
.hover-hint{color:#000000;font-size:14px;margin:0;text-align:center}
.dark-mode .hover-hint{color:#ffffff}
.card.card-hovered .hover-hint{display:none}
.project-desc{color:var(--muted);font-size:14px;margin:0;max-height:0;overflow:hidden;transition:max-height 0.3s ease}
.card.card-hovered .project-desc{max-height:200px;z-index:3}
.project-buttons{position:absolute;bottom:14px;left:14px;right:14px;z-index:2;transition:all 0.3s ease}
.card.card-hovered .project-buttons{position:relative;bottom:auto;left:auto;right:auto}

/* CV layout */
.cv-grid{
  display:grid;
  gap:12px;
  grid-template-columns: 1fr 320px;
}
.skills{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.chip{
  background:#f1f5f9;
  color:#0f172a;
  padding:6px 10px;
  border-radius:999px;
  font-weight:600;
  font-size:13px;
}

/* Footer */
footer.footer{
  margin-top:40px;
  text-align:center;
  color:var(--muted);
  font-size:14px;
}

/* Responsive adjustments */
@media (max-width:980px){
  .hero{grid-template-columns:1fr 280px}
  .grid{grid-template-columns:repeat(2,1fr)}
  .cv-grid{grid-template-columns:1fr}
}
@media (max-width:640px){
  .wrap{margin:18px 16px;padding:8px;padding-top:calc(56px + 16px)}
  header.header, header.site-header{padding:8px 12px;min-height:56px}
  .hero{grid-template-columns:1fr}
  nav.nav{display:none} /* mobile shows hamburger below */
  .mobile-nav{
    display:flex;
    gap:8px;
    margin-top:12px;
  }
  .grid{grid-template-columns:1fr}
  .profile-card img{width:120px;height:120px}
}

/* Small animated underline for nav active state */
nav a.active{
  position:relative;
  color:var(--accent-dark);
}
nav a.active::after{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  bottom:-6px;
  height:3px;
  border-radius:6px;
  background:linear-gradient(90deg,var(--accent),var(--accent-dark));
  transform-origin:left center;
  animation:slideIn .5s ease both;
}
@keyframes slideIn{from{transform:scaleX(0)}to{transform:scaleX(1)}}

/* Buttons utility classes for consistent appearance */
.btn{display:inline-block;padding:10px 14px;border-radius:8px;text-decoration:none;border:none;cursor:pointer;font-weight:700}
.btn-primary{background:var(--accent);color:#fff;box-shadow:var(--shadow)}
.btn-primary:hover{background:var(--accent-dark)}
.btn-secondary{background:#f8fafc;color:var(--accent-dark);border:1px solid var(--border)}
.btn-ghost{background:transparent;color:var(--accent-dark);border:1px solid transparent;padding:8px 12px;font-weight:700}
.btn-outline{background:transparent;color:#63a4ff;border:2px solid #63a4ff;padding:8px 12px;border-radius:8px;font-weight:700}
.btn-outline:hover{background:rgba(99,164,255,0.08);color:#1e6fe8;border-color:#1e6fe8}
.btn-sm{padding:6px 10px;font-weight:600;border-radius:7px;font-size:14px}
.file-list{margin-top:10px;padding-left:0;list-style:none}
.file-item{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;border-radius:8px;background:#f8fafc;border:1px solid var(--border);margin-bottom:8px}
.file-item button{background:transparent;border:none;color:var(--accent-dark);cursor:pointer;font-weight:700;padding:6px 8px}

/* Collapsible details block with smooth transition */
.collapsible{
  max-height:0;
  overflow:hidden;
  opacity:0;
  transition: max-height 350ms ease, opacity 200ms ease;
}
.collapsible.open{
  opacity:1;
}

/* Dark mode styles */
.dark-mode{
  --bg: #000000;
  --card: #1e293b;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --border: #334155;
  --shadow: 0 6px 18px rgba(0,0,0,0.3);
  color: #ffffff;
}
.dark-mode body{background:var(--bg);color:#ffffff}
.dark-mode .intro{background:linear-gradient(180deg, rgba(30,41,59,0.9), rgba(30,41,59,0.7))}
.dark-mode .card{background:linear-gradient(180deg, #1e293b,#1e293b)}
.dark-mode .profile-card{background:var(--card)}
.dark-mode .section .section-inner{background:var(--card)}
.dark-mode .chip{background:#334155;color:#f1f5f9}
.dark-mode header.header,
.dark-mode header.site-header{
  background: rgba(0,0,0,0.85);
}
.dark-mode nav a{color:#ffffff}
.dark-mode nav a:hover, .dark-mode nav a:focus{color:#ffffff;background:rgba(255,255,255,0.05)}
.dark-mode .btn-secondary{background:#334155;color:#f1f5f9;border-color:var(--border)}
.dark-mode .btn-ghost{color:#f1f5f9}
.dark-mode .btn-outline{color:#60a5fa;border-color:#60a5fa}
.dark-mode .btn-outline:hover{background:rgba(255,255,255,0.05);color:#ffffff;border-color:#ffffff}

/* Dark mode for CV page tiles */
.dark-mode .cv-grid aside div{
  background: var(--card) !important;
  color: #ffffff !important;
}
.dark-mode .cv-grid aside div p{
  color: #ffffff !important;
}

/* Page-scoped dark overrides for the source viewer */
.dark-source{
  background:#0b0f14;
  color:#e6eefc;
}
.dark-source header.header,
.dark-source header.site-header{
  background: rgba(6,10,18,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #ffffff;
}
.dark-source nav a{
  color: rgba(230,238,252,0.9);
}
.dark-source nav a:hover, .dark-source nav a:focus{
  color: #ffffff;
  background: rgba(255,255,255,0.03);
  transform: translateY(-2px);
}
.dark-source .section .section-inner{
  background:#071023;
  border-color: rgba(255,255,255,0.04);
  color:#e6eefc;
}
.dark-source .btn-primary{background:linear-gradient(90deg,#2563eb,#1d4ed8);color:white}
.dark-source .btn-ghost{color:rgba(230,238,252,0.9)}
.dark-source pre.code-block{ /* darker-gray code panel, allow Prism token colors to show */
  background: #0f1724; /* dark gray, not pure black */
  border: 1px solid rgba(255,255,255,0.04);
  color: inherit; /* don't override Prism token colors */
}
.dark-source code{color:inherit}
.dark-source .btn-outline{color:#9fc7ff;border-color:rgba(159,199,255,0.28)}
.dark-source .btn-outline:hover{background:rgba(255,255,255,0.04);color:#ffffff;border-color:rgba(255,255,255,0.28)}

/* Tweak Prism line-number appearance for dark source view */
.dark-source pre.line-numbers{
  position: relative;
}
.dark-source .line-numbers-rows{
  background: transparent;
}
.dark-source .line-numbers-rows > span{
  color: rgba(230,238,252,0.45);
}
.dark-source pre.line-numbers[data-start]{
  counter-reset: linenumber var(--line-start, 0);
}

/* Dark mode toggle button */
.theme-toggle{
  background:none;
  border:none;
  cursor:pointer;
  padding:12px;
  border-radius:8px;
  transition:background .2s ease;
  color:var(--muted);
  font-size: 20px;
}
.theme-toggle:hover{background:rgba(11,95,255,0.1);color:var(--accent)}
.dark-mode .theme-toggle{color:#f1f5f9}
.dark-mode .theme-toggle:hover{background:rgba(255,255,255,0.1)}

.btn-back {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  display: inline-block;
  transition: background-color 0.3s;
}

.btn-back:hover {
  background-color: #0056b3;
}

/* Loading animations */
.fade-in{
  opacity:0;
  transform:translateY(20px);
  transition:opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible{
  opacity:1;
  transform:translateY(0);
}
