/* ═══════════════════════════════════════════
   style.css — Yash Jha Portfolio
   ═══════════════════════════════════════════ */

:root {
  --bg:      #050508;
  --surface: #0d0d14;
  --border:  #1a1a2e;
  --accent:  #00ff88;
  --accent2: #ff3366;
  --accent3: #ffcc44;
  --muted:   #444466;
  --text:    #c8c8e0;
  --bright:  #eeeeff;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Syne', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  overflow-x: hidden;
}

/* ── CANVAS ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 3rem;
  background: rgba(5,5,8,0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent2); }

nav ul { list-style: none; display: flex; gap: 2rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
}
nav a:hover { color: var(--accent); }

/* ── SECTIONS ── */
section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 8rem 3rem 5rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── HERO ── */
#hero { gap: 1.5rem; }

.tag {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  border: 1px solid var(--accent);
  padding: 0.25rem 0.75rem;
  display: inline-block;
  animation: fadeIn 0.5s ease both;
}

h1 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1;
  color: var(--bright);
  animation: slideUp 0.6s ease 0.1s both;
}
h1 em { font-style: normal; color: var(--accent); }

.hero-sub {
  font-size: 0.9rem;
  line-height: 1.8;
  max-width: 560px;
  color: var(--text);
  animation: slideUp 0.6s ease 0.2s both;
}

#terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  width: 100%;
  max-width: 640px;
  font-size: 0.8rem;
  line-height: 2;
  animation: slideUp 0.6s ease 0.3s both;
}

.t-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.t-dot { width: 12px; height: 12px; border-radius: 50%; }
.t-dot:nth-child(1) { background: #ff5f57; }
.t-dot:nth-child(2) { background: #febc2e; }
.t-dot:nth-child(3) { background: #28c840; }

.t-line { color: var(--muted); }
.t-line .cmd { color: var(--accent); }
.t-line .val { color: #7ecfff; }
.t-line .str { color: #ffcc66; }
.t-cursor {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: slideUp 0.6s ease 0.4s both;
}

.btn {
  padding: 0.7rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--accent); color: #000; border: 2px solid var(--accent); }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent2); border: 2px solid var(--accent2); }
.btn-ghost:hover { background: var(--accent2); color: #fff; }

/* ── SECTION HEADING ── */
.section-heading {
  font-family: var(--sans);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  color: var(--bright);
  position: relative;
}
.section-heading::before {
  content: attr(data-num);
  position: absolute;
  top: -0.5rem; left: -0.5rem;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}

/* ── ABOUT GRID ── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
  width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  transition: border-color 0.3s, transform 0.3s;
}
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card-icon { font-size: 1.6rem; margin-bottom: 0.7rem; }
.card h3 { font-family: var(--sans); color: var(--bright); margin-bottom: 0.5rem; font-size: 0.95rem; }
.card p { font-size: 0.76rem; line-height: 1.8; color: var(--text); }

/* ── TIMELINE ── */
.tl-subhead {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -1.5rem;
}

.timeline {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 90px 40px 1fr;
  gap: 0;
  align-items: stretch;
}

/* Year label */
.tl-left {
  display: flex;
  justify-content: flex-end;
  padding-right: 1rem;
  padding-top: 0.2rem;
}

.tl-year {
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.tl-year--now {
  color: var(--accent);
  font-weight: 700;
}

/* Spine: dot + vertical line */
.tl-spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--muted);
  flex-shrink: 0;
  margin-top: 0.3rem;
  z-index: 1;
  transition: border-color 0.3s;
}
.tl-item:hover .tl-dot { border-color: var(--accent); }

.tl-dot--pivot {
  border-color: var(--accent2);
  background: rgba(255,51,102,0.15);
  width: 18px;
  height: 18px;
  box-shadow: 0 0 12px rgba(255,51,102,0.4);
}

.tl-dot--now {
  border-color: var(--accent);
  background: rgba(0,255,136,0.2);
  width: 18px;
  height: 18px;
  box-shadow: 0 0 16px rgba(0,255,136,0.5);
  animation: pulse 2s ease-in-out infinite;
}

.tl-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, var(--border), transparent);
  margin-top: 4px;
}

/* Cards */
.tl-right {
  padding: 0 0 2.5rem 1.5rem;
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  transition: border-color 0.3s, transform 0.3s;
}
.tl-card:hover { border-color: var(--muted); transform: translateX(4px); }

.tl-card h3 {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--bright);
  margin: 0.5rem 0 0.4rem;
  line-height: 1.3;
}

.tl-place {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.tl-card p {
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--text);
}
.tl-card p strong { color: var(--bright); font-weight: 600; }

/* Pivot card special style */
.tl-card--pivot {
  border-color: rgba(255,51,102,0.3);
  background: rgba(255,51,102,0.04);
}
.tl-card--pivot:hover { border-color: var(--accent2); }

.tl-pivot-tag {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid var(--accent2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* Current card special style */
.tl-card--now {
  border-color: rgba(0,255,136,0.3);
  background: rgba(0,255,136,0.04);
}
.tl-card--now:hover { border-color: var(--accent); }

/* Badges */
.tl-badge {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid;
}
.tl-school  { color: #7ecfff; border-color: rgba(126,207,255,0.4); background: rgba(126,207,255,0.06); }
.tl-work    { color: var(--accent3); border-color: rgba(255,204,68,0.4); background: rgba(255,204,68,0.06); }
.tl-current { color: var(--accent); border-color: rgba(0,255,136,0.4); background: rgba(0,255,136,0.08); }

/* Responsive */
@media (max-width: 600px) {
  .tl-item { grid-template-columns: 70px 32px 1fr; }
  .tl-year { font-size: 0.62rem; }
  .tl-right { padding-left: 1rem; }
}

/* ── BLOG ── */
.blog-subhead {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -1.5rem;
}

.blog-loading {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.blog-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.blog-card:hover::before { transform: scaleX(1); }

.blog-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.blog-tag {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.2rem 0.5rem;
}
.blog-date { font-size: 0.7rem; color: var(--muted); }
.blog-card h3 {
  font-family: var(--sans);
  font-size: 1.1rem;
  color: var(--bright);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.blog-card p { font-size: 0.78rem; line-height: 1.8; color: var(--text); }
.blog-read {
  display: inline-block;
  margin-top: 1.2rem;
  font-size: 0.7rem;
  color: var(--accent2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.blog-error {
  font-size: 0.78rem;
  color: var(--accent2);
  border: 1px solid var(--accent2);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  width: 100%;
}

/* ── BLOG MODAL ── */
#blog-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5,5,8,0.95);
  overflow-y: auto;
  padding: 2rem;
}
#blog-modal.open { display: flex; justify-content: center; align-items: flex-start; }

.modal-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 740px;
  width: 100%;
  padding: 3rem;
  margin: 4rem auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none;
  border: 1px solid var(--muted);
  color: var(--muted);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.modal-close:hover { border-color: var(--accent2); color: var(--accent2); }

.modal-tag { margin-bottom: 1rem; }
#modal-title {
  font-family: var(--sans);
  font-size: 2rem;
  color: var(--bright);
  margin: 0.5rem 0 0.25rem;
  line-height: 1.2;
}
#modal-date { font-size: 0.75rem; color: var(--muted); margin-bottom: 2rem; }

#modal-body { font-size: 0.85rem; line-height: 2; color: var(--text); }
#modal-body h1, #modal-body h2, #modal-body h3 {
  font-family: var(--sans);
  color: var(--bright);
  margin: 2rem 0 0.75rem;
}
#modal-body h1 { font-size: 1.6rem; }
#modal-body h2 { font-size: 1.2rem; }
#modal-body h3 { font-size: 1rem; color: var(--accent); }
#modal-body p { margin-bottom: 1.2rem; }
#modal-body a { color: var(--accent); }
#modal-body ul, #modal-body ol { padding-left: 1.5rem; margin-bottom: 1.2rem; }
#modal-body li { margin-bottom: 0.4rem; }
#modal-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
  font-style: italic;
}
#modal-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
#modal-body code {
  background: var(--bg);
  color: var(--accent);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: var(--mono);
}
#modal-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
#modal-body pre code { background: none; padding: 0; color: #7ecfff; }
#modal-body img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
#modal-body strong { color: var(--bright); font-weight: 700; }
#modal-body em { color: var(--accent2); font-style: italic; }

/* ── CONTACT ── */
.contact-desc { font-size: 0.85rem; line-height: 2; max-width: 500px; }
.hasta { color: var(--accent); font-style: normal; }
.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── FOOTER ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
footer span { color: var(--accent); }

/* ── ANIMATIONS ── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes blink   { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulse   { 0%, 100% { box-shadow: 0 0 16px rgba(0,255,136,0.5); } 50% { box-shadow: 0 0 28px rgba(0,255,136,0.9); } }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
