/* ============================================================
   Sajan Poudyal — portfolio
   Palette: near-black canvas, teal accent, monospace labels
   ============================================================ */

:root {
  --bg:        #0a0c10;
  --bg-alt:    #0e1117;
  --panel:     #12161e;
  --panel-2:   #161b24;
  --line:      #222a36;
  --line-soft: #1a2029;
  --text:      #e8ecf3;
  --text-dim:  #a3adbf;
  --text-mute: #6f7b8f;
  --accent:    #5eead4;
  --accent-2:  #7dd3fc;
  --accent-dim:#1f3c3a;
  --shadow:    0 1px 0 rgba(255,255,255,.03), 0 18px 40px -24px rgba(0,0,0,.8);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --r: 14px;
  --nav-h: 64px;
}

html[data-theme="light"] {
  --bg:        #fbfbfc;
  --bg-alt:    #f3f5f8;
  --panel:     #ffffff;
  --panel-2:   #f7f9fb;
  --line:      #e2e6ec;
  --line-soft: #ebeef3;
  --text:      #121722;
  --text-dim:  #4d586b;
  --text-mute: #7b8798;
  --accent:    #0d9488;
  --accent-2:  #0369a1;
  --accent-dim:#d6f2ee;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 16px 32px -24px rgba(16,24,40,.25);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.68;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.025em; margin: 0; font-weight: 650; }
p { margin: 0 0 1.05em; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { color: var(--text); font-weight: 600; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #04140f; padding: 10px 16px; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ───────────────────────── NAV ───────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__inner { height: var(--nav-h); display: flex; align-items: center; gap: 20px; }

.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; }
.brand__mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-dim); color: var(--accent);
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.brand__name { font-weight: 600; font-size: 15.5px; letter-spacing: -.015em; }

.nav__links { display: flex; gap: 4px; }
.nav__links a {
  position: relative;
  padding: 7px 11px; border-radius: 8px;
  font-size: 14px; color: var(--text-dim); font-weight: 500;
  transition: color .18s ease, background-color .18s ease;
}
.nav__links a:hover { color: var(--text); background: var(--panel); }
.nav__links a.is-active { color: var(--accent); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px;
  height: 1.5px; background: var(--accent); border-radius: 2px;
}

.nav__actions { display: flex; align-items: center; gap: 6px; }
.iconbtn {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; transition: color .18s, border-color .18s, background-color .18s;
}
.iconbtn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--panel); }
.iconbtn svg { width: 17px; height: 17px; }
.i-sun { display: none; }
html[data-theme="light"] .i-sun { display: block; }
html[data-theme="light"] .i-moon { display: none; }
.nav__burger { display: none; }

.nav__progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .08s linear;
}

/* mobile menu */
@media (max-width: 860px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; gap: 2px;
    background: var(--bg-alt); border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 12px 10px; font-size: 15.5px; }
  .nav__links a.is-active::after { display: none; }
}

/* ───────────────────────── HERO ───────────────────────── */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 104px) 0 clamp(56px, 8vw, 96px); }
.hero__grid {
  position: absolute; inset: -40% -10% auto -10%; height: 150%;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 30% 20%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 30% 20%, #000 0%, transparent 72%);
  opacity: .9; pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 64px); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--line);
  padding: 6px 13px; border-radius: 999px; margin: 0 0 22px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.hero__title { font-size: clamp(2.15rem, 4.6vw, 3.35rem); font-weight: 700; letter-spacing: -.035em; margin-bottom: 20px; text-wrap: balance; }
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(1.02rem, 1.4vw, 1.13rem); color: var(--text-dim); max-width: 54ch; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 11px; margin: 28px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  transition: transform .14s ease, border-color .18s, background-color .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn--primary {
  background: var(--accent); color: #04140f; border-color: var(--accent);
  box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn--primary:hover { box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--accent) 80%, transparent); }

.hero__meta { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 36px; }
.hero__meta li { font-size: 13.5px; color: var(--text-mute); font-family: var(--mono); }
.hero__meta span { display: block; font-family: var(--sans); font-size: 1.6rem; font-weight: 700; color: var(--text); letter-spacing: -.03em; line-height: 1.2; }

/* terminal card */
.terminal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden;
}
.terminal__bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); background: var(--panel-2);
}
.tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tdot:first-child { background: #ff5f57; }
.tdot:nth-child(2) { background: #febc2e; }
.tdot:nth-child(3) { background: #28c840; }
.terminal__title { margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); }
.terminal__body { margin: 0; padding: 18px 18px 20px; overflow-x: auto; }
.terminal__body code {
  font-family: var(--mono); font-size: 12.6px; line-height: 1.82;
  color: var(--text-dim); white-space: pre;
}
.c-g { color: var(--accent-2); }
.c-t { color: var(--accent); }
.c-m { color: var(--text-mute); }
.cursor { color: var(--accent); animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { opacity: 0; } }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .terminal { order: 2; }
}

/* ───────────────────────── SECTION SHELL ───────────────────────── */
.section { padding: clamp(60px, 8vw, 104px) 0; border-top: 1px solid var(--line-soft); }
.section--alt { background: var(--bg-alt); }

.shead { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.shead__num { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; }
.shead h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); font-weight: 680; }
.shead::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
  align-self: center; margin-left: 6px;
}
.section__lede { color: var(--text-dim); max-width: 62ch; margin-bottom: 36px; }

/* ───────────────────────── ABOUT ───────────────────────── */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; margin-top: 26px; }
.about__prose p { color: var(--text-dim); }
.about__prose p:last-child { margin-bottom: 0; }

.about__facts {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 6px 18px; box-shadow: var(--shadow);
}
.about__facts li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.about__facts li:last-child { border-bottom: 0; }
.about__facts .k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mute); padding-top: 2px; }
.about__facts .v { text-align: right; font-weight: 550; color: var(--text); }

@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }

/* ───────────────────────── TIMELINE ───────────────────────── */
.timeline { margin-top: 30px; position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--line) 22%, var(--line));
}
.job { position: relative; padding: 0 0 38px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -26px; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--line);
}
.job--current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }

.job__head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.job__role { font-size: 1.16rem; font-weight: 640; }
.job__org { margin: 3px 0 0; font-size: 14.5px; color: var(--text-dim); }
.sep { color: var(--text-mute); margin: 0 5px; }

.pill {
  flex-shrink: 0;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .02em;
  color: var(--text-dim); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  white-space: nowrap;
}
.pill--live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-dim); }

.job__points li {
  position: relative; padding-left: 20px; margin-bottom: 9px;
  color: var(--text-dim); font-size: 15.2px;
}
.job__points li::before {
  content: ""; position: absolute; left: 3px; top: .72em;
  width: 5px; height: 5px; border-radius: 1px;
  background: var(--accent); opacity: .65; transform: rotate(45deg);
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tags li {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--line-soft);
  padding: 4px 10px; border-radius: 6px;
}
.tags--sm li { font-size: 11px; padding: 3px 8px; }

/* ───────────────────────── CARDS ───────────────────────── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px 22px 22px; box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 38%, transparent); }
.card--accent { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.card__icon {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--accent-dim); color: var(--accent);
  margin-bottom: 16px;
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.card p { font-size: 14.6px; color: var(--text-dim); margin-bottom: 14px; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.panel {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0; padding: 22px 24px;
}
.panel h3 { font-size: .95rem; margin-bottom: 9px; }
.panel__k { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.panel p { font-size: 14.6px; color: var(--text-dim); margin: 0; }

@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } .panels { grid-template-columns: 1fr; } }

/* ───────────────────────── SKILLS ───────────────────────── */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.skillcol {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow);
}
.skillcol h3 {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.skillcol li {
  font-size: 14.2px; color: var(--text-dim); padding: 5px 0 5px 16px; position: relative;
}
.skillcol li::before {
  content: ""; position: absolute; left: 0; top: 1.05em;
  width: 7px; height: 1px; background: var(--text-mute);
}
@media (max-width: 900px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .skills { grid-template-columns: 1fr; } }

/* ───────────────────────── APPS ───────────────────────── */
.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.app {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow);
  transition: border-color .18s ease, transform .18s ease;
}
.app:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 38%, transparent); }
.app__icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(145deg, var(--accent-dim), var(--panel-2));
  border: 1px solid var(--line-soft); color: var(--accent);
}
.app__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.app__body h3 { font-size: 1.02rem; margin-bottom: 6px; }
.app__body p { font-size: 14.3px; color: var(--text-dim); margin-bottom: 10px; }
.app__link {
  grid-column: 1 / -1;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--accent);
  padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line-soft);
}
.app__link svg { width: 13px; height: 13px; transition: transform .18s ease; }
.app__link:hover svg { transform: translate(2px, -2px); }

.note {
  margin-top: 18px; font-size: 13.4px; color: var(--text-mute);
  font-family: var(--mono); line-height: 1.6;
}
@media (max-width: 760px) { .apps { grid-template-columns: 1fr; } }

/* ───────────────────────── EDUCATION ───────────────────────── */
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
.edu__item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; box-shadow: var(--shadow);
}
.edu__item h3 { font-size: 1.04rem; margin-bottom: 8px; }
.edu__org { font-size: 14.5px; color: var(--text-dim); margin: 0 0 4px; }
.edu__meta { font-family: var(--mono); font-size: 12.2px; color: var(--text-mute); margin: 0; }
@media (max-width: 760px) { .edu { grid-template-columns: 1fr; } }

/* ───────────────────────── CONTACT ───────────────────────── */
.section--contact { border-top: 1px solid var(--line-soft); }
.contact__lede { margin-bottom: 30px; }
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.contact__card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.contact__card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.contact__k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-mute); }
.contact__v { font-size: 15px; font-weight: 550; word-break: break-word; }
.contact__arrow { position: absolute; top: 20px; right: 20px; width: 15px; height: 15px; color: var(--accent); opacity: .75; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }

/* ───────────────────────── FOOTER ───────────────────────── */
.foot { border-top: 1px solid var(--line-soft); padding: 28px 0; background: var(--bg-alt); }
.foot__inner { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; }
.foot p { margin: 0; font-size: 13.2px; color: var(--text-mute); font-family: var(--mono); }

/* ───────────────────────── REVEAL ───────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ───────────────────────── PRINT ───────────────────────── */
@media print {
  .nav, .hero__grid, .terminal, .hero__cta, .foot__built, .note { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding: 14px 0; border: 0; break-inside: avoid; }
  .card, .skillcol, .edu__item, .about__facts, .contact__card { box-shadow: none; border: 1px solid #ccc; }
  a { color: #000; }
}
