/* portfolio.css - Raju Prasai portfolio
   Design tokens and visual language match nepdate-docs exactly.
*/

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .25em; }

/* Design Tokens */
:root {
  --bg:            #ffffff;
  --bg-alt:        #f7f8fa;
  --bg-elev:       #ffffff;
  --text:          #111827;
  --text-muted:    #4b5563;
  --text-subtle:   #6b7280;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --accent:        #dc3f10;
  --accent-hover:  #b3300a;
  --accent-soft:   #ffece4;
  --accent-border: #fbb39a;
  --shadow-sm:     0 1px 2px rgba(17,24,39,.06), 0 1px 3px rgba(17,24,39,.08);
  --shadow-md:     0 4px 6px -1px rgba(17,24,39,.08), 0 2px 4px -2px rgba(17,24,39,.08);
  --shadow-lg:     0 12px 24px -8px rgba(17,24,39,.14), 0 4px 10px -4px rgba(17,24,39,.08);
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --header-h:      64px;
  --content-max:   1280px;
}

[data-theme="dark"] {
  --bg:            #0b1020;
  --bg-alt:        #0f172a;
  --bg-elev:       #111827;
  --text:          #e5e7eb;
  --text-muted:    #9ca3af;
  --text-subtle:   #6b7280;
  --border:        #1f2937;
  --border-strong: #374151;
  --accent:        #fb7045;
  --accent-hover:  #fda07a;
  --accent-soft:   rgba(251,112,69,.14);
  --accent-border: rgba(251,112,69,.38);
  --shadow-sm:     0 1px 2px rgba(0,0,0,.4);
  --shadow-md:     0 4px 8px -2px rgba(0,0,0,.5);
  --shadow-lg:     0 18px 40px -12px rgba(0,0,0,.65);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* -------- Header -------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--content-max); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; color: var(--text);
  letter-spacing: -.02em; white-space: nowrap;
}
.brand:hover { color: var(--text); }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #dc2626 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.nav-main { display: flex; align-items: center; gap: 4px; margin-left: 16px; }
.nav-main a {
  color: var(--text-muted); padding: 8px 12px; border-radius: 8px;
  font-weight: 500; font-size: .94rem; transition: all .15s ease; white-space: nowrap;
}
.nav-main a:hover { background: var(--bg-alt); color: var(--text); }
.nav-main a.active { color: var(--accent); background: var(--accent-soft); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 8px; color: var(--text-muted); transition: all .15s ease;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
.hamburger { display: none; }

/* -------- Mobile nav -------- */
.mobile-nav {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px;
  background: var(--bg-elev); border-left: 1px solid var(--border);
  z-index: 200; transform: translateX(100%); transition: transform .28s ease;
  overflow-y: auto; padding: 72px 20px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-nav.show { transform: translateX(0); }
.mobile-nav a {
  display: block; padding: 12px 16px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 1rem; transition: background .15s ease;
}
.mobile-nav a:hover { background: var(--bg-alt); color: var(--accent); }
.overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .28s ease;
}
.overlay.show { opacity: 1; pointer-events: all; }

/* -------- Container & Section -------- */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }
.section-bg-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 48px; }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent); margin-bottom: 14px;
  padding: 4px 12px; background: var(--accent-soft); border-radius: 4px;
  border-left: 3px solid var(--accent);
}
.section-title { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin-bottom: 12px; }
.section-title::after {
  content: ""; display: block; width: 40px; height: 3px;
  background: var(--accent); border-radius: 2px; margin-top: 12px;
}
.section-sub { color: var(--text-muted); font-size: 1rem; margin: 0; }

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px;
  font-weight: 600; font-size: .95rem;
  transition: all .18s ease; border: 1px solid transparent; white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 55%, transparent);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-alt); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: .88rem; border-radius: 8px; }

/* -------- Hero -------- */
.hero-portfolio {
  padding: 100px 0 92px; position: relative; overflow: hidden;
  min-height: 540px; display: flex; align-items: center;
}
.hero-portfolio::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 15% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(500px 260px at 85% 20%, color-mix(in srgb, #dc2626 10%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-portfolio .container { position: relative; z-index: 1; width: 100%; }
.hero-layout {
  display: grid; grid-template-columns: auto 1fr;
  gap: 100px; align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 6px 14px; border-radius: 20px; margin-bottom: 20px;
}
.hero-name {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.05; letter-spacing: -.03em; margin-bottom: 16px;
}
.hero-name .grad {
  background: linear-gradient(90deg, var(--accent), #dc2626);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 520px; margin-bottom: 24px; line-height: 1.7;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .82rem; font-weight: 500;
  padding: 5px 12px; border-radius: 20px;
}
.hero-tag i { color: var(--accent); }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-photo-wrap { flex-shrink: 0; }
.hero-photo {
  width: 300px; height: 300px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-soft), 0 0 0 3px var(--accent-border);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* -------- About -------- */
.about-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
.about-photo {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius-lg);
  overflow: hidden;
  /* box-shadow: var(--shadow-md); */
  border: 1px solid var(--border);
}
.about-photo img { width: 100%; height: 104%; object-fit: contain; }
.about-name { font-size: 1.6rem; margin-bottom: 4px; }
.about-title { color: var(--accent); font-weight: 600; font-size: 1rem; margin-bottom: 16px; }
.about-bio { color: var(--text-muted); line-height: 1.75; margin-bottom: 20px; }
.about-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 24px;
}
.about-meta-item {
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.about-meta-item .label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent); margin-bottom: 3px;
}
.about-meta-item .value { font-weight: 600; color: var(--text); font-size: .95rem; }
.skills-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.skill-tag {
  background: var(--accent-soft); color: var(--accent);
  font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--accent-border);
}

/* -------- Resume -------- */
.resume-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }
.timeline-section h3 {
  font-size: 1.15rem; margin-bottom: 28px;
  display: flex; align-items: center; gap: 10px; color: var(--text);
}
.timeline-section h3 i { color: var(--accent); font-size: 1.2rem; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline li { position: relative; padding-left: 36px; margin-bottom: 28px; }
.timeline > li::before {
  content: ""; position: absolute; left: 4px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-soft); z-index: 1;
}
.timeline .year {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; display: block;
}
.timeline .tl-title { font-weight: 700; font-size: .97rem; margin-bottom: 2px; color: var(--text); }
.timeline .tl-org {
  font-size: .85rem; color: var(--text-muted); margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}
.timeline .tl-body { font-size: .88rem; color: var(--text-muted); line-height: 1.6; }
.timeline .tl-body ul { margin: 4px 0 0; padding-left: 0; list-style: none; }
.timeline .tl-body li { margin-bottom: 3px; list-style: none; padding-left: 1em; position: relative; }
.timeline .tl-body li::before { content: "–"; position: absolute; left: 0; color: var(--accent); }
.timeline .tl-link { margin-bottom: 4px; }
.timeline .tl-link a { font-size: .85rem; display: inline-flex; align-items: center; gap: 5px; }
.awards-ed { margin-top: 40px; }

/* -------- Projects -------- */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px;
}
.project-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.project-card:hover { transform: translateY(-8px); border-color: var(--accent-border); box-shadow: var(--shadow-lg); }
.project-img { aspect-ratio: 3/2; overflow: hidden; background: var(--bg-alt); position: relative; }
.project-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.45) 0%, transparent 55%);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.project-card:hover .project-img::after { opacity: 1; }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.project-card:hover .project-img img { transform: scale(1.06); }
.project-body { padding: 22px 24px; flex: 1; display: flex; flex-direction: column; }
.project-tag {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent); margin-bottom: 8px;
}
.project-title { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.project-desc { font-size: .9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; flex: 1; }
.project-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: .85rem; font-weight: 600;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); transition: all .15s ease;
}
.project-link:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.project-link-primary { background: var(--accent); color: #fff; border-color: transparent; }
.project-link-primary:hover { background: var(--accent-hover); color: #fff; border-color: transparent; }

/* -------- Project Status Badge -------- */
.project-status-badge {
  position: absolute; bottom: 12px; right: 12px; z-index: 2;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 11px; border-radius: 20px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.project-status-down {
  background: rgba(239,68,68,.18); color: #fca5a5;
  border: 1px solid rgba(239,68,68,.35);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* -------- Project Modal -------- */
.project-modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.project-modal-backdrop.open { opacity: 1; pointer-events: all; }
.project-modal {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); max-width: 960px; width: 100%;
  max-height: 90vh; overflow-y: auto; position: relative;
  transform: translateY(28px) scale(.95);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 28px 80px rgba(0,0,0,.4);
}
.project-modal-backdrop.open .project-modal { transform: translateY(0) scale(1); }
.project-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; transition: background .15s ease, transform .15s ease;
}
.project-modal-close:hover { background: rgba(0,0,0,.85); transform: scale(1.08); }
.project-modal-img { line-height: 0; }
.project-modal-img img { width: 100%; height: auto; display: block; }
.project-modal-content { padding: 28px 30px 32px; }
.project-modal-title { font-size: 1.45rem; margin-bottom: 10px; color: var(--text); }
.project-modal-desc { font-size: .95rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 24px; }

/* -------- Footer -------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-col h4 {
  font-size: .88rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-subtle); margin-bottom: 16px;
}
.footer-col p { font-size: .9rem; color: var(--text-muted); margin: 0; }
.social-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.social-links a {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: color .15s ease;
}
.social-links a:hover { color: var(--accent); }
.social-links i { font-size: 1.1rem; width: 20px; text-align: center; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: .85rem; color: var(--text-subtle); margin: 0; }
.footer-bottom a { color: var(--text-muted); font-size: .85rem; }
.footer-bottom a:hover { color: var(--accent); }

/* -------- Nav Product Buttons -------- */
.nav-products { display: flex; align-items: center; gap: 6px; }
.nav-product-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 20px;
  font-size: .82rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  border: 1.5px solid var(--accent-border);
  transition: all .15s ease; white-space: nowrap;
}
.nav-product-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.mobile-nav-divider {
  height: 1px; background: var(--border); margin: 10px 4px 6px;
}
.mobile-nav-product {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 8px;
  color: var(--accent); font-weight: 600; font-size: .9rem;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  transition: all .15s ease;
}
.mobile-nav-product:hover { background: var(--accent); color: #fff; }

/* -------- Responsive -------- */
@media (max-width: 900px) {
  .nav-main { display: none; }
  .nav-products { display: none; }
  .hamburger { display: grid; }
  .hero-layout { grid-template-columns: 1fr; }
  .hero-photo-wrap { display: flex; justify-content: center; }
  .hero-photo { width: 190px; height: 190px; }
  .hero-cta { flex-wrap: wrap; }
  .resume-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto; aspect-ratio: unset; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .section { padding: 56px 0; }
  .hero-portfolio { padding: 56px 0 48px; }
  .about-meta { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
