/* ==========================================================================
   Sujit Kumar — Portfolio
   Design concept: a personal codebase. Nav reads like open editor tabs,
   sections like files (about.js, projects.js, skills.json, journey.md),
   colors borrowed from a syntax-highlighting palette.
   ========================================================================== */

:root {
  /* --- color tokens --- */
  --bg: #10131a;
  --bg-raised: #161a23;
  --bg-inset: #0c0e13;
  --border: #262c3a;
  --border-soft: #1d222d;

  --text: #dfe3ec;
  --text-dim: #8890a3;
  --text-faint: #5b6274;

  --blue: #7aa2f7;    /* keywords / links */
  --green: #9ece6a;   /* strings / success */
  --amber: #e0af68;   /* highlight / warm accent */
  --purple: #bb9af7;  /* secondary accent */
  --red: #f7768e;     /* traffic light */

  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --max-w: 1120px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
code { font-family: var(--font-mono); }

::selection { background: var(--blue); color: #0c0e13; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- backdrop texture: faint grid, evokes a code/board grid --- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
  opacity: 0.5;
}

/* ==========================================================================
   Tab bar navigation
   ========================================================================== */

.tabbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(16, 19, 26, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.tabbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-dots { display: flex; gap: 5px; }
.brand-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}
.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.brand-name .dim { color: var(--text-faint); font-weight: 500; }

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab:hover { color: var(--text); background: var(--bg-raised); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-ext { color: var(--text-faint); }
.tab.active .tab-ext { color: var(--blue); opacity: 0.6; }

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none; border: none; cursor: pointer;
  flex-shrink: 0;
}
.menu-btn span {
  display: block; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-tabs {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s var(--ease);
}
.mobile-tabs.open { max-height: 320px; }
.mobile-tabs a {
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-soft);
}
.mobile-tabs a.active { color: var(--blue); }

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 96px 24px;
  scroll-margin-top: 56px;
}

.section-head {
  margin-bottom: 44px;
}
.file-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 5px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* editor window chrome, reused across hero / skills / contact */
.editor-window {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px -30px rgba(0,0,0,0.6);
}
.window-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
}
.chrome-dots { display: flex; gap: 7px; }
.chrome-dots.small i { width: 6px; height: 6px; }
.chrome-dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chrome-dots .c-red { background: var(--red); }
.chrome-dots .c-amber { background: var(--amber); }
.chrome-dots .c-green { background: var(--green); }
.chrome-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-top: 64px;
  padding-bottom: 64px;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-code .code-body {
  display: flex;
  padding: 22px 0;
  min-height: 280px;
}
.gutter {
  display: flex;
  flex-direction: column;
  padding: 0 14px 0 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-faint);
  user-select: none;
  text-align: right;
}
.code-content {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 20px;
  flex: 1;
}
.caret {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: var(--blue);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.tok-kw { color: var(--purple); }
.tok-prop { color: var(--blue); }
.tok-str { color: var(--green); }
.tok-punc { color: var(--text-dim); }
.tok-com { color: var(--text-faint); font-style: italic; }

.hero-side { max-width: 460px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green);
  margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.1;
}
.hero-role {
  color: var(--text-dim);
  font-size: 1.02rem;
  margin-bottom: 18px;
  font-weight: 500;
}
.hero-desc {
  color: var(--text-dim);
  font-size: 0.98rem;
  margin-bottom: 30px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary { background: var(--blue); color: #0c0e13; font-weight: 600; }
.btn-primary:hover { transform: translateY(-2px); background: #91b4ff; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }

.hero-links { display: flex; gap: 20px; flex-wrap: wrap; }
.hero-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hero-links a:hover { color: var(--amber); border-color: var(--amber); }

.scroll-cue {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scroll-cue svg { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 52px;
  align-items: start;
}

.portrait-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  aspect-ratio: 4 / 5;
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.lede {
  font-size: 1.12rem;
  color: var(--text);
  margin-bottom: 16px;
  font-weight: 500;
}
.about-copy p { color: var(--text-dim); margin-bottom: 16px; }

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.fact dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.fact dd { font-size: 0.92rem; color: var(--text); font-weight: 500; }

/* ==========================================================================
   Projects
   ========================================================================== */

.project-list { display: flex; flex-direction: column; gap: 22px; }

.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.project-card:hover { border-color: var(--blue); transform: translateY(-3px); }

.project-top h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.project-sub { color: var(--amber); font-family: var(--font-mono); font-size: 0.8rem; margin-bottom: 16px; }
.project-desc { color: var(--text-dim); margin-bottom: 16px; }

.project-notes { margin-bottom: 20px; }
.project-notes li {
  position: relative;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 8px;
}
.project-notes li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 700;
}
.project-notes code {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--amber);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
  background: rgba(122, 162, 247, 0.1);
  border: 1px solid rgba(122, 162, 247, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
}
.tag-accent { color: var(--amber); background: rgba(224, 175, 104, 0.1); border-color: rgba(224, 175, 104, 0.28); }

.project-links { display: flex; gap: 18px; }
.project-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.project-links a:hover { color: var(--blue); border-color: var(--blue); }

/* ==========================================================================
   Skills
   ========================================================================== */

.skills-body { padding: 30px 32px; }
.skill-group { margin-bottom: 22px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-key {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--purple);
  margin-bottom: 10px;
}

/* ==========================================================================
   Journey / timeline
   ========================================================================== */

.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--border);
}

.tl-item { position: relative; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute;
  left: -28px; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--blue);
}
.tl-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.tl-content h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.tl-meta { color: var(--text-faint); font-size: 0.85rem; margin-bottom: 8px; font-family: var(--font-mono); }
.tl-content p:last-child { color: var(--text-dim); font-size: 0.95rem; }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-section { padding-bottom: 64px; }
.contact-body { padding: 44px 36px; }
.contact-body h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 10px 0 34px;
  letter-spacing: -0.01em;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.contact-item {
  background: var(--bg-raised);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.2s var(--ease);
}
.contact-item:hover { background: var(--bg-inset); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.contact-value { font-size: 0.95rem; color: var(--text); font-weight: 500; word-break: break-word; }
.contact-item:hover .contact-value { color: var(--blue); }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  text-align: center;
  padding: 28px 24px 40px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

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

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 40px; min-height: auto; }
  .about-grid { grid-template-columns: 180px 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  .tabs { display: none; }
  .menu-btn { display: flex; }
  .mobile-tabs { display: flex; }

  .section { padding: 64px 20px; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait-frame { max-width: 220px; }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .project-card { padding: 24px 22px; }
  .contact-body { padding: 32px 22px; }
  .hero-actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 460px) {
  .gutter { display: none; }
  .code-content { font-size: 0.78rem; }
  .fact-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
