/* ============================================================
   PULKIT NIJHAWAN — PORTFOLIO
   "the portfolio as a live system" — brutalist / terminal
   ============================================================ */

:root {
  --bg:        #0A0B0C;
  --bg-2:      #101214;
  --bg-3:      #15181B;
  --line:      rgba(255,255,255,0.10);
  --line-2:    rgba(255,255,255,0.18);
  --fg:        #EDEDE7;
  --fg-dim:    #8C9088;
  --fg-faint:  #585B56;
  --accent:    #C7F23C;          /* electric lime (default) */
  --accent-ink:#0A0B0C;          /* text on accent */
  --amber:     #FFB000;
  --red:       #FF5C49;
  --cyan:      #58E0E8;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --maxw: 1200px;

  --scan-opacity: 0.16;
  --grain-opacity: 0.04;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-feature-settings: "ss01", "ss02", "calt", "liga";
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }

/* ---------- CRT overlay ---------- */
.crt-overlay {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 9000;
  mix-blend-mode: overlay;
}
.crt-overlay.scanlines {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.00) 0px,
    rgba(255,255,255,0.00) 2px,
    rgba(0,0,0,0.55) 3px,
    rgba(0,0,0,0.00) 4px
  );
  opacity: var(--scan-opacity);
}
.vignette {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 8999;
  background: radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%);
}
.grid-bg {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, black 30%, transparent 85%);
  mask-image: radial-gradient(120% 100% at 50% 0%, black 30%, transparent 85%);
  opacity: 0.5;
}

/* ---------- layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.section { border-top: 1px solid var(--line); position: relative; }
.section-pad { padding: 90px 0; }

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-dim);
}
.kicker .dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.kicker .idx { color: var(--accent); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 44px;
}
.section-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1;
}
.section-title .accent { color: var(--accent); }

/* mono micro labels */
.mlabel { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-faint); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2);
  background: transparent; color: var(--fg);
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em; white-space: nowrap;
  padding: 11px 16px; cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--line-2); }
.btn.ghost:hover { box-shadow: 4px 4px 0 rgba(199,242,60,0.25); }

/* blinking caret */
.caret { display:inline-block; width: 0.55em; height: 1.05em; background: var(--accent); translate: 0 0.16em; animation: blink 1.05s steps(1) infinite; }
.hero-name .caret { width: 0.14em; height: 0.7em; vertical-align: baseline; translate: 0.08em 0; box-shadow: 0 0 22px rgba(199,242,60,0.55); }
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   STATUS BAR (tmux-style)
   ============================================================ */
.statusbar {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; gap: 0;
  height: 34px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  backdrop-filter: blur(6px);
}
.statusbar .seg { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%; border-right: 1px solid var(--line); white-space: nowrap; }
.statusbar .seg.accent { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.statusbar .seg.dim { color: var(--fg-dim); }
.statusbar .spacer { flex: 1; }
.statusbar .seg.right { border-right: none; border-left: 1px solid var(--line); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #54e36a; box-shadow: 0 0 8px #54e36a; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.statusbar .navlink { cursor: pointer; }
.statusbar .navlink:hover { color: var(--accent); }
@media (max-width: 720px){ .statusbar .hide-sm { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: 76px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: end; }
@media (max-width: 900px){ .hero-grid { grid-template-columns: 1fr; gap: 32px; } }

.hero-name {
  font-size: clamp(42px, 7.4vw, 104px);
  font-weight: 800; line-height: 0.9; letter-spacing: -0.035em;
  text-transform: uppercase;
}
.hero-name .l1 { color: var(--fg-dim); }
.hero-name .l2 { color: var(--fg); position: relative; }
.hero-role {
  margin-top: 22px;
  font-size: clamp(14px, 1.5vw, 18px);
  color: var(--fg-dim);
}
.hero-role b { color: var(--accent); font-weight: 600; }
.hero-summary {
  margin-top: 22px; max-width: 52ch; color: var(--fg-dim);
  font-size: 14.5px; line-height: 1.7;
  text-wrap: pretty;
}
.hero-summary b { color: var(--fg); font-weight: 500; }
.hero-cta { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }

/* neofetch card */
.neofetch {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  font-size: 12.5px;
}
.neofetch .nf-bar { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--fg-dim); }
.nf-bar .tl { display:flex; gap: 6px; }
.nf-bar .tl i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--line-2); display:block; }
.nf-bar .tl i:nth-child(1){ background: var(--red); border-color: var(--red); }
.nf-bar .tl i:nth-child(2){ background: var(--amber); border-color: var(--amber); }
.nf-bar .tl i:nth-child(3){ background: #54e36a; border-color:#54e36a; }
.nf-bar .ttl { margin-left: 6px; font-size: 11.5px; }
.neofetch .nf-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 16px; }
.nf-ascii { color: var(--accent); font-size: 12px; line-height: 1.15; white-space: pre; text-shadow: 0 0 14px rgba(199,242,60,0.4); }
.nf-info { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; align-content: start; font-size: 12.5px; }
.nf-info .k { color: var(--accent); }
.nf-info .v { color: var(--fg); }
.nf-info .hr { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 6px 0; }
.nf-swatch { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 6px; }
.nf-swatch i { width: 16px; height: 12px; display: block; }
@media (max-width: 460px){ .neofetch .nf-body { grid-template-columns: 1fr; } .nf-ascii{ font-size: 10px; } }

/* ============================================================
   METRICS / DASHBOARD
   ============================================================ */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
@media (max-width: 820px){ .metrics { grid-template-columns: repeat(2,1fr); } }
.metric { padding: 26px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.metric:nth-child(4n){ border-right: none; }
.metric .mnum { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--accent); }
.metric .mnum small { font-size: 0.5em; color: var(--fg-dim); font-weight: 600; }
.metric .mlbl { margin-top: 10px; font-size: 12px; color: var(--fg-dim); line-height: 1.4; }
.metric .mtag { position:absolute; top: 12px; right: 12px; font-size: 10px; letter-spacing: 0.12em; color: var(--fg-faint); }

/* ============================================================
   WORK / CASE STUDIES
   ============================================================ */
.case {
  border: 1px solid var(--line);
  background: var(--bg-2);
  margin-bottom: 22px;
}
.case-head {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start;
  padding: 24px 26px; border-bottom: 1px solid var(--line);
}
.case-co { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); }
.case-name { font-size: clamp(24px, 3vw, 36px); font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.case-name .accent { color: var(--accent); }
.case-blurb { margin-top: 12px; color: var(--fg-dim); max-width: 60ch; font-size: 13.5px; line-height: 1.65; text-wrap: pretty; }
.case-meta { text-align: right; font-size: 12px; color: var(--fg-dim); white-space: nowrap; }
.case-meta .role { color: var(--fg); font-weight: 600; }
.case-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0; }
@media (max-width: 820px){ .case-body { grid-template-columns: 1fr; } }
.case-points { padding: 24px 26px; display: flex; flex-direction: column; gap: 16px; }
.cpoint { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.cpoint .arrow { color: var(--accent); font-weight: 700; }
.cpoint .ctext { font-size: 13.5px; color: var(--fg); line-height: 1.6; text-wrap: pretty; }
.cpoint .ctext b { color: var(--accent); font-weight: 600; }
.case-side { border-left: 1px solid var(--line); padding: 24px 26px; background: var(--bg); }
@media (max-width: 820px){ .case-side { border-left: none; border-top: 1px solid var(--line); } }
.case-side .sh { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 14px; }
.stack-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 11.5px; padding: 5px 9px; border: 1px solid var(--line-2); color: var(--fg-dim); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.bigstat { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bigstat:last-child { border-bottom: none; }
.bigstat .bn { color: var(--accent); font-weight: 800; font-size: 19px; min-width: 92px; }
.bigstat .bl { color: var(--fg-dim); font-size: 12px; }

/* ============================================================
   GIT LOG / EXPERIENCE
   ============================================================ */
.gitlog { border: 1px solid var(--line); background: var(--bg-2); font-size: 13.5px; }
.gitlog .gl-bar { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--fg-dim); font-size: 12px; }
.gitlog .gl-bar b { color: var(--fg); }
.commit { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 4px 16px; position: relative; }
.commit .graph { width: 18px; display: flex; justify-content: center; position: relative; }
.commit .graph::before { content:''; position:absolute; top:0; bottom:0; left: 50%; width: 2px; background: var(--line-2); transform: translateX(-50%); }
.commit:first-child .graph::before { top: 18px; }
.commit:last-child .graph::before { bottom: calc(100% - 18px); }
.commit .node { width: 11px; height: 11px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--fg-dim); margin-top: 14px; z-index: 1; }
.commit.head .node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }
.commit .gc { padding: 12px 0 16px; border-bottom: 1px dashed var(--line); }
.commit:last-child .gc { border-bottom: none; }
.gc .hashrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gc .hash { color: var(--amber); font-size: 12.5px; }
.gc .deco { display:flex; gap: 6px; }
.gc .tag { font-size: 10.5px; padding: 2px 7px; border: 1px solid var(--line-2); color: var(--fg-dim); border-radius: 2px; }
.gc .tag.head { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.gc .msg { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--fg); }
.gc .msg .at { color: var(--accent); }
.gc .author { margin-top: 3px; color: var(--fg-dim); font-size: 12px; }
.gc .body { margin-top: 10px; color: var(--fg-dim); font-size: 13px; line-height: 1.6; max-width: 70ch; text-wrap: pretty; }
.gc .body li { margin-left: 18px; margin-top: 3px; }

/* ============================================================
   PROJECTS / man pages
   ============================================================ */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); }
@media (max-width: 860px){ .projects { grid-template-columns: 1fr; } }
.proj { padding: 24px; border-right: 1px solid var(--line); position: relative; transition: background .15s ease; min-height: 230px; display: flex; flex-direction: column; }
.proj:last-child { border-right: none; }
@media (max-width: 860px){ .proj { border-right: none; border-bottom: 1px solid var(--line); } .proj:last-child{ border-bottom: none; } }
.proj:hover { background: var(--bg-2); }
.proj .pcmd { color: var(--accent); font-size: 13px; }
.proj .pcmd .prompt { color: var(--fg-faint); }
.proj .pname { margin-top: 14px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.proj .pdesc { margin-top: 10px; color: var(--fg-dim); font-size: 13px; line-height: 1.6; flex: 1; text-wrap: pretty; }
.proj .pfoot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.proj .plang { font-size: 11.5px; color: var(--fg-faint); display:flex; align-items:center; gap: 7px; }
.proj .plang i { width: 9px; height: 9px; border-radius:50%; display:block; }
.proj .parrow { color: var(--fg-dim); transition: transform .15s ease, color .15s ease; }
.proj:hover .parrow { color: var(--accent); transform: translateX(3px); }

/* ============================================================
   SKILLS manifest
   ============================================================ */
.manifest { border: 1px solid var(--line); background: var(--bg-2); font-size: 13px; }
.manifest .m-bar { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--fg-dim); font-size: 12px; display:flex; justify-content: space-between; }
.mrow { display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.mrow:last-child { border-bottom: none; }
@media (max-width: 640px){ .mrow { grid-template-columns: 1fr; gap: 8px; } }
.mrow .mkey { color: var(--accent); display:flex; align-items:center; gap: 8px; }
.mrow .mkey .c { color: var(--fg-faint); }
.mrow .mvals { display:flex; flex-wrap: wrap; gap: 7px; }
.mrow .mval { font-size: 12px; color: var(--fg); padding: 4px 9px; border: 1px solid var(--line); background: var(--bg); }
.mrow .mval:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   TERMINAL
   ============================================================ */
.terminal-wrap { border: 1px solid var(--line-2); background: #060708; box-shadow: 0 0 0 1px rgba(199,242,60,0.06), 0 24px 70px rgba(0,0,0,0.6); }
.term-bar { display:flex; align-items:center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.term-bar .tl { display:flex; gap: 7px; }
.term-bar .tl i { width: 12px; height: 12px; border-radius: 50%; display:block; }
.term-bar .tl i:nth-child(1){ background: var(--red); }
.term-bar .tl i:nth-child(2){ background: var(--amber); }
.term-bar .tl i:nth-child(3){ background: #54e36a; }
.term-bar .tt { margin-left: 8px; color: var(--fg-dim); font-size: 12px; }
.term-bar .hint { margin-left: auto; color: var(--fg-faint); font-size: 11.5px; }
.term-body { padding: 18px; height: 380px; overflow-y: auto; font-size: 13.5px; line-height: 1.65; }
.term-body::-webkit-scrollbar { width: 10px; }
.term-body::-webkit-scrollbar-thumb { background: var(--line-2); }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line.cmd .p { color: var(--accent); }
.term-line.cmd .u { color: var(--cyan); }
.term-out { color: var(--fg-dim); white-space: pre-wrap; }
.term-out .a { color: var(--accent); }
.term-out .w { color: var(--fg); }
.term-out .am { color: var(--amber); }
.term-out .err { color: var(--red); }
.term-input-row { display:flex; align-items:center; gap: 8px; }
.term-input-row .p { color: var(--accent); white-space: nowrap; }
.term-input-row .u { color: var(--cyan); }
.term-input { flex: 1; background: transparent; border: none; outline: none; color: var(--fg); font-family: var(--mono); font-size: 13.5px; caret-color: var(--accent); }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); }
@media (max-width: 760px){ .contact { grid-template-columns: 1fr; } }
.contact-left { padding: 40px 32px; border-right: 1px solid var(--line); }
@media (max-width: 760px){ .contact-left { border-right: none; border-bottom: 1px solid var(--line); } }
.contact-left .ssh { color: var(--fg-dim); font-size: 13px; }
.contact-left .ssh .a { color: var(--accent); }
.contact-headline { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin: 18px 0; }
.contact-links { display: flex; flex-direction: column; }
.clink { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; padding: 18px 32px; border-bottom: 1px solid var(--line); transition: background .15s ease; }
.clink:last-child { border-bottom: none; }
.clink:hover { background: var(--bg-2); }
.clink .ck { color: var(--fg-faint); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.clink .cv { color: var(--fg); font-size: 14px; }
.clink:hover .cv { color: var(--accent); }
.clink .cx { color: var(--fg-faint); transition: transform .15s; }
.clink:hover .cx { color: var(--accent); transform: translate(2px,-2px); }

.footer { border-top: 1px solid var(--line); padding: 24px 0; display:flex; justify-content: space-between; align-items:center; gap: 16px; flex-wrap: wrap; color: var(--fg-faint); font-size: 12px; }
.footer .a { color: var(--fg-dim); }

/* ============================================================
   BOOT SEQUENCE
   ============================================================ */
.boot {
  position: fixed; inset: 0; z-index: 9500;
  background: var(--bg);
  padding: 7vh 6vw; font-size: 13.5px; color: var(--fg-dim);
  overflow: hidden;
}
.boot-line { white-space: pre-wrap; }
.boot-line .ok { color: #54e36a; }
.boot-line .a { color: var(--accent); }
.boot-line .w { color: var(--fg); }
.boot-line .am { color: var(--amber); }
.boot-skip { position: fixed; bottom: 28px; right: 32px; color: var(--fg-faint); font-size: 12px; }
.boot-skip kbd { border: 1px solid var(--line-2); padding: 2px 7px; color: var(--fg-dim); }

/* reveal animation */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); }
  .reveal.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
}

/* scramble text */
.scramble { font-variant-ligatures: none; }
