/* =========================================================
   Shekhar Gyawali Portfolio
   Design matched to arjunai.engineer: white background,
   black type, gray bordered cards, pill tags.
   ========================================================= */

:root {
  --bg: #fff;
  --text: #0a0a0a;
  --text-body: #171717;
  --text-muted: #717171;
  --text-faint: #a1a1a1;
  --border: #e5e5e5;
  --border-soft: #e5e5e5;
  --pill-bg: #f5f5f5;
  --pill-text: #717171;
  --btn-dark: #737373;
  --btn-dark-hover: #666;
  --accent: #f5f5f5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);

  --sans: "Inter", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --heading: "Space Grotesk", "Inter", system-ui, sans-serif;

  --radius: 12px;
  --max-w: 896px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--text); color: #fff; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

svg.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 14px; font-weight: 500; color: var(--text); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: 14px;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--accent); }
.nav-links a.active { color: var(--text); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 10px; }

@media (max-width: 640px) {
  .nav-links { position: fixed; top: 64px; left: 0; right: 0; background: rgba(255, 255, 255, .96); flex-direction: column; align-items: stretch; padding: 12px 16px; border-bottom: 1px solid var(--border); display: none; gap: 4px; z-index: 40; }
  .nav-links a { justify-content: flex-start; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-block; }
}

/* ---------- Section scaffolding ---------- */
section { padding: 0; border-top: 0; }
#about,
#contact { border-top: 1px solid var(--border); }
.profile-section { padding-top: 80px; }
.content-subsection { padding-top: 64px; }
.major-section { padding-top: 80px; }
.compact-major { padding-top: 64px; }
#contact { margin-top: 80px; padding: 80px 0; }
section:last-of-type { padding-bottom: 80px; }
.page-section {
  padding-top: 144px;
  min-height: calc(100vh - 81px);
}
.container-narrow { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }

h2.section-title {
  font-family: var(--heading);
  font-size: clamp(30px, 5vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 16px;
  color: var(--text);
}
.content-subsection h2.section-title {
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.18;
  margin-bottom: 24px;
}
.section-lead {
  color: var(--text-muted);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.625;
  max-width: 672px;
  margin: 0 0 32px;
}
.major-section .section-lead {
  max-width: var(--max-w);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  padding: 64px 0 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
h1.hero-name {
  font-family: var(--heading);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  line-height: 1;
}
.hero-title {
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 auto 32px;
  max-width: 768px;
  line-height: 1.4;
}
.hero-title .sep { color: var(--text-faint); margin: 0 10px; }
.hero-tagline {
  max-width: 672px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.625;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; padding-top: 16px; }

.btn {
  min-height: 36px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all .15s cubic-bezier(.4, 0, .2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.btn-primary { background: var(--btn-dark); color: #fff; border-color: var(--btn-dark); }
.btn-primary:hover { background: var(--btn-dark-hover); }
.btn-secondary { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--accent); border-color: var(--border); }

/* ---------- About ---------- */
.about-body { color: var(--text-muted); font-size: clamp(16px, 2vw, 18px); line-height: 1.625; max-width: 896px; }
.about-body p { margin: 0 0 16px; }
.about-body strong { color: var(--text); font-weight: 600; }

/* ---------- Bordered content cards (experience, projects, blog list) ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.card:last-child,
.project-card:last-child,
.log-entry:last-child { margin-bottom: 0; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.card-role { font-family: var(--heading); font-size: clamp(18px, 2.5vw, 20px); font-weight: 500; color: var(--text); letter-spacing: -0.02em; }
.card-date { font-size: 16px; color: var(--text-muted); white-space: nowrap; }
.card-org { font-size: 16px; color: var(--text-muted); margin-bottom: 16px; }

.dot-list { list-style: none; margin: 0 0 18px; padding: 0; }
.dot-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.625;
}
.dot-list li::before { content: "\2022"; position: absolute; left: 0; color: var(--text-faint); }
.dot-list li strong { color: var(--text); font-weight: 600; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-size: 14px;
  line-height: 1.25;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--pill-text);
  background: var(--pill-bg);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.skill-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.skill-group h3 { font-size: 16px; font-weight: 500; margin: 0 0 12px; color: var(--text); }

/* ---------- Projects ---------- */
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease;
}
.project-card:hover { border-color: rgba(10, 10, 10, .2); }
.project-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.project-head h3 { font-family: var(--heading); margin: 0; font-size: clamp(20px, 3vw, 24px); font-weight: 500; letter-spacing: -0.02em; }
.project-head a.gh-link { color: var(--text-faint); transition: color .15s ease; }
.project-head a.gh-link:hover { color: var(--text); }
.project-card p.desc { margin: 0 0 16px; color: var(--text-muted); font-size: 16px; line-height: 1.625; }

/* ---------- Contact ---------- */
.contact-section { text-align: center; }
.contact-lead { color: var(--text-muted); max-width: 672px; margin: 0 auto 48px; font-size: clamp(16px, 2vw, 18px); line-height: 1.625; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; text-align: left; }
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease;
}
.contact-card:hover { border-color: rgba(10, 10, 10, .2); }
.contact-card > span:last-child { min-width: 0; }
.contact-icon {
  width: 40px; height: 40px;
  border-radius: 4px;
  background: var(--pill-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.contact-label { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.contact-value { font-size: 16px; font-weight: 500; color: var(--text); word-break: break-word; }
.contact-actions {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ---------- Footer ---------- */
footer { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border-soft); }

/* ---------- Blog list ---------- */
.blog-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-chip {
  min-height: 32px;
  font-size: 14px;
  font-weight: 500;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  background: #fff;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.filter-chip.active { border-color: var(--text); color: var(--text); background: var(--accent); }
.filter-chip:hover { color: var(--text); background: var(--accent); border-color: var(--border); }

.log-entry {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease;
}
.log-entry:hover { border-color: rgba(10, 10, 10, .2); }
.log-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.log-entry h3 {
  font-family: var(--heading);
  margin: 0 0 8px;
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
.log-entry p { margin: 0; color: var(--text-muted); font-size: 16px; line-height: 1.625; }
.log-tags { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.blog-preview-action {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.625;
}

/* ---------- Blog post page ---------- */
.post-header { padding: 144px 16px 0; }
.post-back {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 32px -12px;
  transition: color .15s ease, background-color .15s ease;
}
.post-back:hover { color: var(--text); background: var(--accent); }
.post-title {
  font-family: var(--heading);
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 500;
  line-height: 1;
  margin: 0 0 16px;
  letter-spacing: -0.025em;
  max-width: 768px;
}
.post-meta { font-size: 16px; color: var(--text-muted); margin-bottom: 16px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.post-divider { border: none; border-top: 1px solid var(--border-soft); margin: 32px 0 48px; }
.post-body {
  color: var(--text-body);
  font-size: 17px;
  line-height: 1.75;
  padding: 0 16px 80px;
  max-width: 768px;
}
.post-body h2 {
  font-family: var(--heading);
  color: var(--text);
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
}
.post-body h3 {
  font-family: var(--heading);
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  margin: 32px 0 12px;
}
.post-body p { margin: 0 0 20px; }
.post-body code { background: var(--pill-bg); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace; }
.post-body pre { background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; overflow-x: auto; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.post-body pre code { background: none; padding: 0; }
.post-body ul, .post-body ol { padding-left: 22px; margin: 0 0 20px; }
.post-body li { margin-bottom: 8px; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote {
  border-left: 2px solid var(--text);
  margin: 24px 0;
  padding: 4px 0 4px 18px;
  color: var(--text);
  font-style: italic;
}

@media (max-width: 640px) {
  .hero { align-items: flex-start; padding-top: 168px; min-height: 92vh; }
  .hero-title {
    line-height: 1.35;
  }
  .hero-title .sep {
    display: block;
    height: 2px;
    margin: 0;
    color: transparent;
  }
  .profile-section { padding-top: 64px; }
  .content-subsection { padding-top: 48px; }
  .major-section { padding-top: 64px; }
  .compact-major { padding-top: 48px; }
  #contact { margin-top: 64px; padding: 64px 0; }
  section:last-of-type { padding-bottom: 64px; }
  section.page-section { padding-top: 120px; }
  .post-header { padding-top: 120px; }
  .card,
  .project-card,
  .skill-group,
  .contact-card,
  .log-entry { padding: 20px; }
}
