/* ==========================================================================
   Abhinav Jaiswal — Portfolio
   Plain CSS (no framework). Organized by component, mobile-first.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --base: #12141c;
  --surface: #181b25;
  --surface-2: #1e2230;
  --line: #262b3a;
  --ink: #e6e9f2;
  --ink-dim: #8b93a8;
  --ink-faint: #565d70;

  --kw: #569cd6;
  /* keyword blue   */
  --fn: #dcdcaa;
  /* function amber */
  --str: #ce9178;
  /* string orange  */
  --type: #4ec9b0;
  /* type teal      */
  --cmt: #6a9955;
  /* comment green  */
  --var: #9cdcfe;
  /* variable blue  */
  --statusbar: #0e6ba8;

  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --header-h: 48px;
  --statusbar-h: 28px;
  --sidebar-w: 256px;
}

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--base);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

img,
svg {
  display: block;
}

::selection {
  background: var(--statusbar);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--base);
}

::-webkit-scrollbar-thumb {
  background: #2a2f40;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a4056;
}

.focus-ring:focus-visible {
  outline: 2px solid var(--kw);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .cursor::after {
    animation: none;
  }
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.menu-btn {
  display: inline-flex;
  padding: 6px;
  border-radius: 6px;
  color: var(--ink-dim);
}

.menu-btn:hover {
  color: var(--ink);
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
}

.traffic {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.traffic--red {
  background: #ff5f56;
}

.traffic--yellow {
  background: #ffbd2e;
}

.traffic--green {
  background: #27c93f;
}

.topbar-title {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-dim);
}

.topbar-title .dim {
  color: var(--ink-faint);
}

.topbar-title .bright {
  color: var(--ink);
}

.btn-contact {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(86, 156, 214, 0.1);
  color: #8ab4e0;
  border: 1px solid rgba(86, 156, 214, 0.3);
  transition: background-color 0.15s ease;
}

.btn-contact:hover {
  background: rgba(86, 156, 214, 0.2);
}

/* ==========================================================================
   Layout shell
   ========================================================================== */
.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ==========================================================================
   Sidebar / file explorer
   ========================================================================== */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  z-index: 40;
  height: calc(100vh - var(--header-h));
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar-eyebrow {
  padding: 20px 16px 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.sidebar-folder {
  padding: 0 16px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-nav {
  padding-bottom: 32px;
  font-size: 14px;
  font-family: var(--font-mono);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-left: 2px solid transparent;
  color: var(--ink-dim);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.sidebar-link.active {
  color: var(--ink);
  background: var(--surface-2);
  border-left-color: var(--kw);
}

.sidebar-link .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
}

.sidebar-link.active .dot {
  background: var(--type);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  line-height: 1.6;
}

.sidebar-footer .plus {
  color: var(--type);
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.backdrop.is-visible {
  display: block;
}

/* ==========================================================================
   Main content
   ========================================================================== */
.main {
  flex: 1;
  min-width: 0;
  padding-bottom: 64px;
}

.section {
  scroll-margin-top: var(--header-h);
  padding: 40px 20px;
  max-width: 900px;
}

.section--hero {
  padding-top: 56px;
  padding-bottom: 64px;
  max-width: 780px;
}

.section--wide {
  max-width: 1000px;
}

.section--widest {
  max-width: 1150px;
}

.file-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.file-tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
}

.section-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 4px;
}

.section-sub {
  color: var(--ink-dim);
  margin-bottom: 32px;
}

/* ---------- reveal-on-scroll animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Code panel (hero)
   ========================================================================== */
.code-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.code-tabbar {
  display: flex;
  font-size: 12px;
  font-family: var(--font-mono);
}

.code-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--kw);
  background: var(--surface-2);
  color: var(--ink);
}

.code-body {
  padding: 20px;
  overflow-x: auto;
}

.code-body pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
}

.gutter {
  color: #3a3f52;
  user-select: none;
  display: inline-block;
  width: 1.4em;
  text-align: right;
}

.tok-kw {
  color: var(--kw);
}

.tok-fn {
  color: var(--fn);
}

.tok-str {
  color: var(--str);
}

.tok-type {
  color: var(--type);
}

.tok-cmt {
  color: var(--cmt);
}

.tok-var {
  color: var(--var);
}

.cursor::after {
  content: "▌";
  display: inline-block;
  margin-left: 2px;
  color: var(--fn);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- hero actions ---------- */
.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  transition: background-color 0.15s ease;
}

.btn-primary {
  background: var(--kw);
  color: #0d1420;
  font-weight: 600;
}

.btn-primary:hover {
  background: #6fa8dc;
}

.btn-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.hero-links {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 8px;
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--ink-dim);
}

.hero-links a {
  border-radius: 4px;
  transition: color 0.15s ease;
}

.hero-links a:hover {
  color: var(--var);
}

/* ==========================================================================
   Skills grid
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.skill-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.15s ease;
}

.skill-card:hover {
  border-color: rgba(86, 156, 214, 0.5);
}

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.skill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.skill-card-head h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Training
   ========================================================================== */
.training-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.training-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.training-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.training-head .date {
  color: var(--ink-faint);
  font-size: 12px;
}

.training-org {
  color: var(--ink-dim);
  font-size: 12px;
  margin-bottom: 16px;
}

.training-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-dim);
}

.training-list li {
  display: flex;
  gap: 8px;
}

.training-list .marker {
  color: var(--kw);
  flex-shrink: 0;
}

/* ==========================================================================
   Projects
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 24px;
  transition: border-color 0.15s ease;
}

.project-card:hover {
  border-color: rgba(86, 156, 214, 0.5);
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.project-head h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.badge {
  flex-shrink: 0;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 999px;
}

.badge--live {
  background: rgba(78, 201, 176, 0.1);
  color: var(--type);
  border: 1px solid rgba(78, 201, 176, 0.3);
}

.badge--django {
  background: rgba(220, 220, 170, 0.1);
  color: var(--fn);
  border: 1px solid rgba(220, 220, 170, 0.3);
}

.badge--new {
  background: rgba(206, 145, 120, 0.1);
  color: var(--str);
  border: 1px solid rgba(206, 145, 120, 0.3);
}

.project-desc {
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 16px;
  flex: 1;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-dim);
  margin-bottom: 16px;
}

.project-list li {
  display: flex;
  gap: 8px;
}

.project-list .marker {
  color: var(--kw);
  flex-shrink: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--var);
}

.project-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-family: var(--font-mono);
  color: #8ab4e0;
  transition: color 0.15s ease;
}

.project-link:hover {
  color: var(--ink);
}

/* ==========================================================================
   Education timeline
   ========================================================================== */
.timeline {
  position: relative;
  margin-left: 8px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

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

.timeline-dot {
  position: absolute;
  left: -31px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 4px solid var(--base);
}

.timeline-dot--primary {
  background: var(--kw);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.timeline-head h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
}

.timeline-head .date {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
}

.timeline-item p {
  font-size: 14px;
  color: var(--ink-dim);
  margin-top: 4px;
}

.interests-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-dim);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.terminal {
  border: 1px solid var(--line);
  background: #0d0f14;
  border-radius: 8px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
}

.terminal p {
  margin: 0;
}

.terminal .echo-line {
  margin-top: 8px;
}

.contact-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 16px 20px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.contact-card:hover {
  border-color: rgba(86, 156, 214, 0.5);
  background: var(--surface-2);
}

.contact-card .label {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
}

.contact-card .value {
  font-size: 14px;
  color: var(--ink-dim);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 32px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   Status bar
   ========================================================================== */
.statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--statusbar-h);
  background: var(--statusbar);
  color: #fff;
  font-size: 11px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.statusbar-branch {
  display: flex;
  align-items: center;
  gap: 4px;
}

.statusbar-push {
  margin-left: auto;
}

.hide-mobile {
  display: none;
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */

/* small screens up (≥640px) */
@media (min-width: 640px) {
  .topbar-title {
    display: flex;
  }

  .btn-contact {
    font-size: 14px;
  }

  .section-title {
    font-size: 30px;
  }

  .code-body {
    padding: 28px;
  }

  .code-body pre {
    font-size: 15px;
  }

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

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

  .hide-mobile {
    display: inline;
  }
}

/* medium screens up (≥768px) */
@media (min-width: 768px) {
  .topbar {
    padding: 0 16px;
  }

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

  .hide-medium {
    display: inline;
  }

  .statusbar-push {
    display: inline;
  }
}

/* large screens up (≥1024px) — sidebar becomes permanent */
@media (min-width: 1024px) {
  .menu-btn {
    display: none;
  }

  .sidebar {
    position: sticky;
    transform: none;
  }

  .backdrop {
    display: none !important;
  }

  .section {
    padding-left: 56px;
    padding-right: 56px;
  }
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }
}