/* ============================================
   Parag Salgaonkar — Terminal Console Aesthetic
   ============================================ */

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

:root {
  --bg: #11172a;
  --bg-elevated: #161d32;
  --surface: #1b2338;
  --text: #dfe5ec;
  --text-dim: #626c7d;
  --text-muted: #3d4556;
  --accent: #599692;
  --accent-dim: #4a817d;
  --accent-glow: rgba(89, 150, 146, 0.08);
  --accent-glow-strong: rgba(89, 150, 146, 0.18);
  --green: #599692;
  --green-dim: rgba(89, 150, 146, 0.15);
  --yellow: #c9a84c;
  --purple: #9a8fcc;
  --border: #1e2640;
  --border-light: #283050;
  --mono: "JetBrains Mono", "Fira Code", "SF Mono", monospace;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f0f2f5;
  --bg-elevated: #ffffff;
  --surface: #e8ebf0;
  --text: #1a2035;
  --text-dim: #5a6378;
  --text-muted: #9aa0b0;
  --accent: #457a76;
  --accent-dim: #3a6965;
  --accent-glow: rgba(69, 122, 118, 0.07);
  --accent-glow-strong: rgba(69, 122, 118, 0.14);
  --green: #457a76;
  --green-dim: rgba(69, 122, 118, 0.1);
  --yellow: #8a6d2a;
  --purple: #6b5fa0;
  --border: #d8dce3;
  --border-light: #c8cdd6;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--mono);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ---- Grain ---- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}

[data-theme="light"] .grain { opacity: 0.02; }

#constellation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   SHARED: Prompt + Terminal elements
   ============================================ */
.prompt-char {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.5rem;
  user-select: none;
}

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
   NAV
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(17, 23, 42, 0.8);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] header {
  background: rgba(240, 242, 245, 0.85);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav .logo {
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: opacity 0.3s;
  position: relative;
}

nav .logo:hover { opacity: 0.7; }

nav .logo[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  font-size: 0.58rem;
  font-weight: 400;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

nav .logo[data-tooltip]:hover::after {
  opacity: 1;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

nav ul a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 400;
  transition: color 0.3s;
  position: relative;
}

nav ul a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav ul a:hover { color: var(--text); }
nav ul a:hover::after { width: 100%; }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-icon--moon { display: none; }
.theme-icon--sun { display: block; }
[data-theme="light"] .theme-icon--moon { display: block; }
[data-theme="light"] .theme-icon--sun { display: none; }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 85vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 5rem 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-intro {
  display: flex;
  flex-direction: column;
}

.hero-prompt {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-meta {
  font-size: 0.78rem;
  line-height: 2;
  color: var(--text-dim);
}

.meta-key {
  color: var(--purple);
}

.meta-sep {
  color: var(--text-muted);
}

.meta-val {
  color: var(--text);
}

.meta-dim {
  color: var(--text-muted);
  font-weight: 300;
}

/* Hero stats */
.hero-stats {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.hero-stats-header {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.stats-grid {
  padding: 0.5rem 0;
}

.stat-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  font-size: 0.78rem;
  transition: background 0.2s, border-color 0.2s;
  border-left: 2px solid transparent;
}

.stat-row:hover {
  background: var(--surface);
  border-left-color: var(--accent);
}

.stat-row:hover .stat-key {
  color: var(--accent);
}

.stat-key {
  color: var(--yellow);
  white-space: nowrap;
}

.stat-dots {
  flex: 1;
  margin: 0 0.75rem;
  border-bottom: 1px dotted var(--border-light);
  min-width: 1rem;
}

.stat-val {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.stat-accent {
  color: var(--accent);
  font-weight: 400;
  margin-left: 0.15rem;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.section-cmd {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 1rem;
}

/* ============================================
   EXPERIENCE TIMELINE
   ============================================ */
.experience {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
  border-top: 1px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  background: var(--bg);
  position: relative;
  z-index: 2;
}

.timeline-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow-strong);
}

.timeline-connector {
  display: block;
  width: 1px;
  height: calc(100% + 1rem);
  background: var(--border);
  margin-top: 0.35rem;
}

.timeline-item:last-child .timeline-connector { display: none; }

.timeline-date {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-top: 0.1rem;
}

.timeline-year {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.timeline-badge {
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}

.timeline-badge.now {
  background: var(--green-dim);
  color: var(--green);
}

.timeline-role {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.timeline-company {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.timeline-loc {
  color: var(--text-muted);
}

.timeline-loc::before {
  content: "·";
  margin: 0 0.3rem;
  color: var(--text-muted);
}

.timeline-highlights {
  list-style: none;
}

.timeline-highlights li {
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.65;
  padding-left: 0.85rem;
  position: relative;
  margin-bottom: 0.35rem;
}

.timeline-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.6rem;
}

.timeline-highlights li:last-child { margin-bottom: 0; }

/* Education */
.education {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.education-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.education-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.education-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.education-degree {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.education-school {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 300;
}

/* ============================================
   SKILLS — Flat inline rows
   ============================================ */
.skills {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
  border-top: 1px solid var(--border);
}

.skills-flat {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.skill-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.skill-dir {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--yellow);
  min-width: 6.5rem;
  flex-shrink: 0;
}

.tag {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--text-dim);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.tag-primary {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.tag-primary:hover {
  border-color: var(--accent);
  background: var(--accent-glow-strong);
}

/* Certs */
.certs-inline {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.cert-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  background: var(--green-dim);
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
}

.cert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent-glow-strong);
}

/* ============================================
   CONTACT — Inline chips
   ============================================ */
.contact {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 2rem 2.5rem;
  border-top: 1px solid var(--border);
}

.contact-inline {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-elevated);
  transition: all 0.2s;
}

.contact-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.contact-chip svg {
  flex-shrink: 0;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.footer-made {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   EASTER EGG TERMINAL
   ============================================ */
.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  backdrop-filter: blur(4px);
}

.terminal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.terminal-window {
  width: 560px;
  max-width: 90vw;
  max-height: 70vh;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(10px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.terminal-overlay.is-open .terminal-window {
  transform: translateY(0) scale(1);
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.terminal-title {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.terminal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.terminal-close:hover { color: var(--text); }

.terminal-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  max-height: calc(70vh - 40px);
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  max-height: 350px;
}

.terminal-line {
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-line .cmd-echo {
  color: var(--text-muted);
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 0;
}

.terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  caret-color: var(--accent);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.anim-reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

.anim-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.anim-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: auto;
    padding: 7rem 2rem 4rem;
  }

  .hero-stats { max-width: 480px; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .timeline { padding-left: 1.25rem; }
}

@media (max-width: 640px) {
  nav { padding: 0.85rem 1.25rem; }
  nav ul { gap: 1.25rem; }
  nav ul a { font-size: 0.62rem; }
  .nav-right { gap: 1rem; }

  .hero { padding: 6rem 1.25rem 3rem; }
  .hero-name { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .hero-stats { max-width: 100%; }

  .experience,
  .skills,
  .contact {
    padding: 2.5rem 1.25rem;
  }

  .section-header { margin-bottom: 1.5rem; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .education-grid { grid-template-columns: 1fr; }

  .skill-dir { min-width: 5.5rem; }

  .contact-inline { gap: 0.5rem; }

  .contact-chip {
    font-size: 0.65rem;
    padding: 0.4rem 0.75rem;
  }

  .footer-inner {
    padding: 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
