/* ══════════════════════════════════════════════════════════════
   Jay Agarwal — Personal Site
   ══════════════════════════════════════════════════════════════ */

/* ─── variables ──────────────────────────────────────────────── */
:root {
  --bg:          #0d0d0d;
  --surface:     #111111;
  --border:      #272727;
  --border-hi:   #484848;
  --text:        #d2d2d2;
  --text-bright: #ffffff;
  --text-mid:    #888888;
  --text-dim:    #636363;
  --text-faint:  #2a2a2a;
  --accent:      #5cc8ff;   /* Cherenkov blue */
  --accent-glow: rgba(92,200,255,0.35);
}

/* ─── reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.72;
  min-height: 100vh;
  overflow-x: clip;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-hi);
}
a:hover {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
  text-decoration-color: var(--accent);
}

/* ─── pixel jet events in the margins ────────────────────────── */
.jet {
  position: absolute;
  top: 40px;
  right: 0;
  width: 2400px;
  height: 760px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  color: #fff;
  -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
}
/* the text column stays calm: the event ghosts through it */
.jet-h {
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 50vw - 480px), rgba(0,0,0,0.22) calc(100% - 50vw - 430px), rgba(0,0,0,0.22) calc(100% - 50vw + 430px), #000 calc(100% - 50vw + 480px));
  mask-image: linear-gradient(to right, #000 calc(100% - 50vw - 480px), rgba(0,0,0,0.22) calc(100% - 50vw - 430px), rgba(0,0,0,0.22) calc(100% - 50vw + 430px), #000 calc(100% - 50vw + 480px));
}
.jet-art {
  position: relative;
  width: 100%;
  height: 100%;
  background: currentColor;
  -webkit-mask: url(pictures/jets.svg) 0 0 / 2400px 760px no-repeat;
  mask: url(pictures/jets.svg) 0 0 / 2400px 760px no-repeat;
}
.jet::after {
  content: '';
  position: absolute;
  left: 1967px;
  top: 247px;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
:root.light .jet { color: #1a1a1a; opacity: 0.12; }
@media (max-width: 900px) {
  .jet { display: none; }
}

/* ─── menu bar ───────────────────────────────────────────────── */
.menubar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,0.97);
  border-bottom: 1px solid var(--border);
  padding: 6px 24px;
  display: flex;
  align-items: center;
  font-size: 12px;
}
.cat-logo {
  display: flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.85;
  margin-right: 20px;
}
.cat-logo:hover {
  opacity: 1;
  text-shadow: 0 0 10px var(--accent-glow);
  color: var(--accent);
}
.menubar nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
}
.menubar nav a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.05em;
}
.menubar nav a:hover,
.menubar nav a.active {
  color: var(--accent);
  text-shadow: none;
}
#theme-btn {
  margin-left: 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}
#theme-btn:hover {
  color: var(--text);
}

/* ─── main layout ────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 64px 32px 48px;
}

/* ─── sections ───────────────────────────────────────────────── */
.s {
  margin-bottom: 72px;
  scroll-margin-top: 52px;
}

.s-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-bright);
  text-transform: lowercase;
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.s-label::before,
.highlight-label::before {
  content: '>';
  color: var(--accent);
  margin-right: 0.6em;
}
.s-label.active::after,
.highlight-label.active::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.5em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .s-label.active::after,
  .highlight-label.active::after { animation: none; }
}

/* ─── bio ────────────────────────────────────────────────────── */
.bio-layout {
  display: flex;
  gap: 36px;
  align-items: center;
}

.portrait-frame {
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #090909;
  padding: 0;
  line-height: 0;
}
.portrait-img {
  display: block;
  width: 192px;
  height: auto;
}

.bio-content h1 {
  font-size: 36px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-bright, #fff);
  margin-bottom: 16px;
}
.bio-content p {
  font-size: 12px;
  color: var(--text-mid, #a0a0a0);
  line-height: 1.78;
  margin-bottom: 10px;
}

.bio-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
/* pixel buttons: 2px blocks, corners left out */
.bio-links a {
  --pc: var(--border-hi);
  position: relative;
  font-size: 11px;
  text-decoration: none;
  border: 0;
  margin: 2px;
  padding: 5px 16px;
  color: var(--text-mid);
  box-shadow: 0 -2px 0 0 var(--pc), 0 2px 0 0 var(--pc), -2px 0 0 0 var(--pc), 2px 0 0 0 var(--pc);
  transition: color 0.12s steps(2), background 0.12s steps(2), box-shadow 0.12s steps(2);
}
.bio-links a:hover {
  --pc: var(--accent);
  color: var(--bg);
  background: var(--accent);
  text-shadow: none;
}
/* pixel cat ears, shown on hover */
.bio-links a::before,
.bio-links a::after {
  content: '';
  position: absolute;
  top: -8px;
  width: 2px;
  height: 2px;
  background: var(--accent);
  box-shadow:
    -2px 2px 0 var(--accent), 0 2px 0 var(--accent), 2px 2px 0 var(--accent),
    -4px 4px 0 var(--accent), -2px 4px 0 var(--accent), 0 4px 0 var(--accent), 2px 4px 0 var(--accent), 4px 4px 0 var(--accent);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s steps(2), transform 0.12s steps(2);
  pointer-events: none;
}
.bio-links a::before { left: 14px; }
.bio-links a::after  { right: 14px; }
.bio-links a:hover::before,
.bio-links a:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ─── recent (highlight box) ─────────────────────────────────── */
.recent-box {
  margin-bottom: 72px;
  scroll-margin-top: 52px;
}
.highlight-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-bright);
  text-transform: lowercase;
  margin-bottom: 16px;
}
.recent-box .misc-list {
  margin-bottom: 0;
}

/* ─── about ──────────────────────────────────────────────────── */
#experience p {
  font-size: 12px;
  color: var(--text-mid, #a0a0a0);
  line-height: 1.78;
  margin-bottom: 14px;
}
#experience p:last-child {
  margin-bottom: 0;
}
#experience a {
  color: inherit;
  text-decoration-color: var(--text-faint);
}
#experience a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ─── research ───────────────────────────────────────────────── */
.paper-row {
  display: flex;
  gap: 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--text-faint);
  align-items: flex-start;
  position: relative;
}
.paper-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}


.paper-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border: 1px solid var(--border);
  background: #090909;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.paper-thumb:hover {
  transform: scale(3.3);
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  border-color: var(--accent);
  z-index: 10;
}
.paper-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-ph {
  font-size: 18px;
  color: var(--text-faint);
  letter-spacing: 6px;
}

.paper-info { flex: 1; min-width: 0; }

.paper-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 6px;
  color: var(--text-bright);
}
.paper-authors {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.paper-authors .me {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--accent);
}
.paper-venue {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 10px;
}
.paper-links {
  display: flex;
  gap: 14px;
}
.paper-links a {
  font-size: 11px;
  color: var(--text-dim);
}
.paper-links a:hover { color: var(--accent); }

.paper-title a {
  color: inherit;
  text-decoration: none;
}
.paper-title a:hover {
  color: var(--accent);
  text-shadow: none;
}

.paper-row.wip { opacity: 0.52; }

.paper-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 5px;
  line-height: 1.65;
}


/* ─── misc ───────────────────────────────────────────────────── */
.misc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}
.misc-list li {
  font-size: 12px;
  color: var(--text-mid, #888);
  padding-left: 18px;
  position: relative;
  line-height: 1.65;
}
.misc-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.6;
}

.misc-footer {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 10px;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ─── cat ────────────────────────────────────────────────────── */
.cat { overflow: visible; }
.cat .lid { opacity: 0; animation: blink-eyes 5s infinite; }
@keyframes blink-eyes {
  0%, 94%, 100% { opacity: 0; }
  96%, 98%      { opacity: 1; }
}
.cat .ear { transition: transform 0.12s steps(1); }
.cat-logo:hover .ear-l { animation: twitch 0.5s steps(1) 1; }
.cat-logo:hover .ear-r { animation: twitch 0.5s steps(1) 0.15s 1; }
@keyframes twitch {
  0%, 100% { transform: translateY(0); }
  25%, 75% { transform: translateY(-1px); }
}

.misc-footer-cat {
  margin-top: 36px;
  text-align: center;
  color: var(--text-dim);
}
.sleepy {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
}
.zzz {
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 14px;
}
.zzz span {
  display: inline-block;
  opacity: 0;
  animation: float-z 3s infinite;
}
.zzz span:nth-child(2) { animation-delay: 0.7s; font-size: 12px; }
.zzz span:nth-child(3) { animation-delay: 1.4s; font-size: 14px; }
@keyframes float-z {
  0%   { opacity: 0; transform: translateY(4px); }
  30%, 70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .cat .lid, .zzz span { animation: none; }
  .zzz span { opacity: 1; }
}

/* ─── utilities ──────────────────────────────────────────────── */
.dim  { color: var(--text-dim); }
.mono { font-family: 'Space Mono', monospace; }

/* ─── light mode ─────────────────────────────────────────────── */
:root.light {
  --bg:          #f6f6f4;
  --surface:     #efefed;
  --border:      #d6d6d6;
  --border-hi:   #aaaaaa;
  --text:        #1a1a1a;
  --text-bright: #0a0a0a;
  --text-mid:    #555555;
  --text-dim:    #5a5a5a;
  --text-faint:  #b0b0b0;
  --accent:      #0b6fa4;
  --accent-glow: rgba(11,111,164,0);
}
:root.light body {
  background: var(--bg);
}
:root.light .menubar {
  background: rgba(246,246,244,0.97);
}
:root.light .portrait-frame {
  background: #e4e4e2;
}
:root.light a:hover {
  text-shadow: none;
}


/* ─── responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .bio-layout {
    flex-direction: column;
    align-items: center;
  }

  .paper-row {
    flex-direction: column;
  }
  .paper-thumb {
    width: 100%;
    height: 60px;
  }

  main { padding: 40px 20px 80px; }

  .menubar nav { gap: 14px; }
}
