/* upendrakhanal.com.np — hand-rolled, no frameworks */

:root {
  --bg: #ffffff;
  --text: #1b1f24;
  --muted: #59636e;
  --link: #0b63c4;
  --rule: #e3e6ea;
  --hover-bg: rgba(11, 99, 196, 0.06);
  --glow: rgba(11, 99, 196, 0.05);
  --ok: #1a7f37;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --text: #e4e7eb;
    --muted: #8b949e;
    --link: #58a6ff;
    --rule: #262b33;
    --hover-bg: rgba(88, 166, 255, 0.07);
    --glow: rgba(88, 166, 255, 0.07);
    --ok: #3fb950;
  }
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #1b1f24;
  --muted: #59636e;
  --link: #0b63c4;
  --rule: #e3e6ea;
  --hover-bg: rgba(11, 99, 196, 0.06);
  --glow: rgba(11, 99, 196, 0.05);
  --ok: #1a7f37;
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --text: #e4e7eb;
  --muted: #8b949e;
  --link: #58a6ff;
  --rule: #262b33;
  --hover-bg: rgba(88, 166, 255, 0.07);
  --glow: rgba(88, 166, 255, 0.07);
  --ok: #3fb950;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  transition: background 0.3s ease;
}

body {
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
  max-width: 42rem;
  background: transparent;
  color: var(--text);
  font: 16px/1.65 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  transition: color 0.3s ease;
}

/* cursor spotlight — subtle radial glow that follows the mouse */
#spotlight {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 20%),
              var(--glow), transparent 75%);
}

/* links with animated underline */
a {
  color: var(--link);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size 0.25s ease;
}
a:hover { background-size: 100% 1px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

/* header */
header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.avatar {
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}
.avatar:hover {
  transform: scale(1.06) rotate(2deg);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--link);
}

h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
  border-radius: 2rem;
  padding: 0.15rem 0.65rem;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); }
  55% { box-shadow: 0 0 0 6px transparent; }
}

#theme {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#theme:hover { color: var(--text); background: var(--hover-bg); transform: rotate(180deg); }

/* sections */
section { margin-bottom: 2.5rem; }

h2 {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 2.25rem;
  background: var(--link);
}

p { margin: 0 0 0.9rem; }
section > p:last-child { margin-bottom: 0; }

.links { color: var(--muted); }

.section-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: -0.35rem;
}

/* item lists (projects, research, education) */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list > li {
  margin-bottom: 0.5rem;
  padding: 0.85rem 0.9rem;
  margin-inline: -0.9rem;
  border-radius: 10px;
  transition: background 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}
.list.compact > li { padding: 0.45rem 0.9rem; margin-bottom: 0.1rem; }
.list > li:last-child { margin-bottom: 0; }

/* hovering one item gently dims the others */
@media (hover: hover) {
  .list:hover > li { opacity: 0.55; }
  .list:hover > li:hover {
    opacity: 1;
    background: var(--hover-bg);
    transform: translateY(-1px);
  }
}

.item-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.meta {
  color: var(--muted);
  font-size: 0.8rem;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  white-space: nowrap;
  margin-left: auto;
}

.list p {
  margin: 0.25rem 0 0;
  color: var(--text);
}

.item-links { font-size: 0.92rem; }

/* footer */
footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}
footer p { margin: 0; }

/* scroll-reveal animation (added by JS; no-JS users see everything) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  #spotlight { display: none; }
}

@media (max-width: 480px) {
  body { padding-top: 2rem; }
  .meta { margin-left: 0; width: 100%; }
}
