/* ============ TOKENS ============ */
:root{
  --cream:#FBF8F1;
  --grid-line: rgba(44,44,44,0.06);
  --ink:#2C2C2C;
  --ink-soft:#5b5751;
  --amber:#D98E4A;
  --amber-deep:#C97A34;
  --sage:#8BA888;
  --sage-deep:#6F9370;
  --mustard:#E3B23C;
  --teal:#7FB2AC;
  --teal-deep:#5D9992;
  --paper:#FFFDF8;
  --border-w:3px;
  --shadow-off:5px;
  --radius:14px;
  --font-display:'Space Grotesk', sans-serif;
  --font-body:'DM Sans', sans-serif;
  --font-mono:'JetBrains Mono', monospace;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}

body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background-color:var(--cream);
  background-image:
    linear-gradient(var(--grid-line) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--grid-line) 1.5px, transparent 1.5px);
  background-size: 34px 34px;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 34 34"><g transform="rotate(45 17 17)"><rect x="15.5" y="4" width="3" height="16" fill="%232C2C2C" stroke="%23FBF8F1" stroke-width="0.5"/><rect x="14.5" y="19" width="5" height="3" fill="%23D98E4A"/><rect x="13" y="21" width="8" height="2.5" fill="%232C2C2C"/><rect x="16" y="23" width="2" height="7" fill="%232C2C2C"/></g></svg>') 17 17, auto;
  overflow-x:hidden;
}

a{color:inherit; text-decoration:none;}
ul{list-style:none; margin:0; padding:0;}

button, a, .project-card, .til-card, .design-card, .badge, .tab-btn, .cp-card, .github-stat-card{
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 34 34"><g transform="rotate(45 17 17)"><rect x="15.5" y="4" width="3" height="16" fill="%232C2C2C" stroke="%23FBF8F1" stroke-width="0.5"/><rect x="14.5" y="19" width="5" height="3" fill="%23D98E4A"/><rect x="13" y="21" width="8" height="2.5" fill="%232C2C2C"/><rect x="16" y="23" width="2" height="7" fill="%232C2C2C"/></g></svg>') 17 17, pointer;
}

/* ============ ENTRANCE ANIMATIONS ============ */
@keyframes fadeSlideUp{
  from{ opacity:0; transform: translateY(24px); }
  to{ opacity:1; transform: translateY(0); }
}
.stagger{ opacity:0; animation: fadeSlideUp 0.6s ease forwards; }
.stagger:nth-child(1){ animation-delay: 0.05s; }
.stagger:nth-child(2){ animation-delay: 0.15s; }
.stagger:nth-child(3){ animation-delay: 0.25s; }
.stagger:nth-child(4){ animation-delay: 0.35s; }
.stagger:nth-child(5){ animation-delay: 0.45s; }
.stagger:nth-child(6){ animation-delay: 0.55s; }
.stagger:nth-child(7){ animation-delay: 0.65s; }

/* ============ LAYOUT ============ */
.app{
  display:grid;
  grid-template-columns: 380px 1fr;
  max-width: 1320px;
  margin: 0 auto;
  gap: 26px;
  padding: 28px 24px 80px;
  align-items:start;
}

@media (max-width: 960px){
  .app{ grid-template-columns: 1fr; }
  .sidebar{ position:static !important; }
}

/* ============ SIDEBAR ============ */
.sidebar{
  position: sticky;
  top: 28px;
  background: var(--paper);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink);
  padding: 28px 24px;
  display:flex;
  flex-direction:column;
  gap: 22px;
  max-height: calc(100vh - 56px);
  overflow-y:auto;
}
.sidebar::-webkit-scrollbar{ width:8px; }
.sidebar::-webkit-scrollbar-thumb{ background: var(--amber); border-radius:8px; }

.hero-name{
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.status-badge{
  font-family:var(--font-mono);
  font-size:0.68rem;
  background: var(--sage);
  border:2px solid var(--ink);
  padding: 3px 9px;
  border-radius: 20px;
  display:inline-flex;
  align-items:center;
  gap:5px;
  box-shadow: 2px 2px 0 var(--ink);
}
.status-dot{
  width:7px; height:7px; border-radius:50%;
  background:#2E7D32;
  animation: pulseDot 1.6s infinite ease-in-out;
}
@keyframes pulseDot{ 0%,100%{opacity:1;} 50%{opacity:0.3;} }

.tagline{
  font-size:1.02rem;
  color: var(--amber-deep);
  font-weight:600;
  margin-top:-8px;
}

.bio{
  font-size:0.92rem;
  line-height:1.6;
  color: var(--ink-soft);
}
.bio b{ color:var(--ink); background: linear-gradient(180deg, transparent 60%, var(--mustard) 60%); padding:0 2px; }

.tag-row{ display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.retro-tag{
  font-family: var(--font-mono);
  font-size:0.7rem;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--teal);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn{
  font-family:var(--font-body);
  font-weight:700;
  font-size:0.88rem;
  border: var(--border-w) solid var(--ink);
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--amber);
  color: var(--ink);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover{
  transform: translate(-3px,-3px);
  box-shadow: 8px 8px 0 var(--ink);
}
.btn:active{ transform: translate(0,0); box-shadow: 2px 2px 0 var(--ink); }
.btn-primary{ background: var(--amber); width:100%; }
.icon-row{ display:grid; grid-template-columns: repeat(3,1fr); gap:10px; }
.icon-btn{
  border: var(--border-w) solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  padding: 10px 6px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:0.74rem;
  font-weight:600;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.icon-btn:hover{ transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--ink); background: var(--mustard); }

.section-label{
  font-family: var(--font-mono);
  font-size:0.72rem;
  text-transform:uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-bottom: 2px dashed var(--ink);
  padding-bottom:6px;
  margin-bottom: 10px;
}

.stack-group{ margin-bottom:14px; }
.stack-group-title{
  font-size:0.78rem; font-weight:700; margin-bottom:8px; color:var(--ink);
}
.stack-badges{ display:flex; flex-wrap:wrap; gap:6px; }
.badge{
  font-family:var(--font-mono);
  font-size:0.68rem;
  padding: 5px 9px;
  border:2px solid var(--ink);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  transition: background 0.18s ease;
}
.badge:hover{ background: var(--sage); }

/* ============ MAIN CONTENT ============ */
.main{
  background: var(--paper);
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink);
  padding: 24px;
  min-height: 640px;
  display:flex;
  flex-direction:column;
}

.tabs{
  position:relative;
  display:flex;
  gap:4px;
  background: var(--cream);
  border: var(--border-w) solid var(--ink);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 22px;
  overflow-x:auto;
}
.tab-btn{
  position:relative;
  z-index:2;
  flex:1;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight:600;
  font-size:0.86rem;
  background:transparent;
  border:none;
  border-radius:8px;
  color: var(--ink-soft);
  white-space:nowrap;
  transition: color 0.25s ease;
}
.tab-btn.active{ color: var(--ink); }
.tab-indicator{
  position:absolute;
  top:5px; bottom:5px; left:5px;
  width: 100px;
  background: var(--mustard);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  z-index:1;
  box-shadow: 3px 3px 0 var(--ink);
  transition: left 0.35s cubic-bezier(.65,0,.35,1), width 0.35s cubic-bezier(.65,0,.35,1);
}

.tab-panel{ display:none; }
.tab-panel.active{ display:block; animation: crossfade 0.4s ease; }
@keyframes crossfade{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}

.search-bar{
  display:flex;
  align-items:center;
  gap:10px;
  border: var(--border-w) solid var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--cream);
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
}
.search-bar:focus-within{
  box-shadow: 0 0 0 4px rgba(217,142,74,0.35);
  background: var(--paper);
}
.search-bar input{
  border:none; background:transparent; outline:none;
  font-family: var(--font-body); font-size:0.92rem; width:100%;
  color: var(--ink);
}

/* Project cards */
.project-card{
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  display:grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
  padding: 20px;
  margin-bottom:20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover{ transform: translate(-4px,-4px); box-shadow: 10px 10px 0 var(--ink); }
@media (max-width: 720px){ .project-card{ grid-template-columns: 1fr; } }

.proj-title-row{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.proj-title{ font-family: var(--font-display); font-size:1.2rem; font-weight:700; }
.proj-date{ font-family: var(--font-mono); font-size:0.72rem; color: var(--ink-soft); }
.proj-desc{ font-size:0.88rem; color: var(--ink-soft); line-height:1.55; margin: 10px 0 14px; }
.proj-badges{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.proj-links{ display:flex; gap:10px; }
.proj-links a{
  font-size:0.78rem; font-weight:700;
  border:2px solid var(--ink); border-radius:8px; padding:6px 12px;
  background: var(--teal); box-shadow: 3px 3px 0 var(--ink);
  display:flex; align-items:center; gap:5px;
  transition: transform 0.15s ease;
}
.proj-links a:hover{ transform: translate(-2px,-2px); }
.proj-mock{
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: repeating-linear-gradient(135deg, var(--sage) 0px, var(--sage) 10px, #A9C4A6 10px, #A9C4A6 20px);
  display:flex; align-items:center; justify-content:center;
  min-height: 130px;
  position:relative;
  overflow:hidden;
}
.proj-mock span{
  font-family: var(--font-mono); font-size:0.7rem; background:var(--paper);
  border:2px solid var(--ink); padding:4px 8px; border-radius:6px;
}

/* Journey timeline */
.timeline{ position:relative; padding-left: 26px; }
.timeline::before{
  content:''; position:absolute; left:6px; top:6px; bottom:6px; width:3px;
  background: var(--ink); border-radius:3px;
}
.timeline-item{ position:relative; margin-bottom:28px; }
.timeline-dot{
  position:absolute; left:-26px; top:2px; width:16px; height:16px;
  background: var(--amber); border:3px solid var(--ink); border-radius:50%;
}
.timeline-header{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.timeline-role{ font-family:var(--font-display); font-weight:700; font-size:1.05rem; }
.timeline-date{ font-family:var(--font-mono); font-size:0.72rem; color:var(--ink-soft); }
.timeline-tags{ display:flex; gap:6px; margin: 6px 0 8px; }
.timeline-tag{
  font-family:var(--font-mono); font-size:0.66rem; padding:3px 8px;
  border:2px solid var(--ink); border-radius:6px;
}
.tag-internship{ background: var(--mustard); }
.tag-onsite{ background: var(--teal); }
.timeline-list{ font-size:0.86rem; color:var(--ink-soft); line-height:1.6; }
.timeline-list li::before{ content:'▸ '; color: var(--amber-deep); font-weight:700; }

/* TIL grid */
.grid-3{ display:grid; grid-template-columns: repeat(3,1fr); gap:16px; }
@media (max-width: 800px){ .grid-3{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .grid-3{ grid-template-columns: 1fr; } }

.til-card{
  border: var(--border-w) solid var(--ink);
  border-radius: 12px;
  padding: 16px;
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.til-card:hover{ transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--ink); background: var(--paper); }
.til-date{ font-family:var(--font-mono); font-size:0.66rem; color: var(--ink-soft); margin-bottom:8px; }
.til-title{ font-weight:700; font-size:0.92rem; margin-bottom:6px; }
.til-body{ font-size:0.8rem; color: var(--ink-soft); line-height:1.5; }

/* Designs */
.design-card{
  border: var(--border-w) solid var(--ink);
  border-radius: 12px;
  overflow:hidden;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.design-card:hover{ transform: translate(-3px,-3px); box-shadow: 9px 9px 0 var(--ink); }
.design-thumb{
  height:120px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-size:0.7rem;
  border-bottom: 3px solid var(--ink);
}
.design-info{ padding:12px 14px; font-size:0.82rem; font-weight:600; background:var(--paper); }

/* Stats */
.stats-grid{ display:grid; grid-template-columns: 1fr; gap:18px; }
.stat-card{
  border: var(--border-w) solid var(--ink);
  border-radius: 12px;
  padding: 18px;
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card h4{ margin:0 0 12px; font-family: var(--font-display); font-size:0.98rem; }

.github-stat-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
  background: var(--paper);
}

.bar-row{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.bar-label{ width:80px; font-size:0.76rem; font-family:var(--font-mono); flex-shrink:0; }
.bar-track{ flex:1; height:14px; border:2px solid var(--ink); border-radius:8px; background:var(--paper); overflow:hidden; }
.bar-fill{ height:100%; border-right:2px solid var(--ink); }

/* Competitive Programming Stat Cards */
.cp-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: var(--border-w) solid var(--ink);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cp-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
}
.cp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px dashed var(--ink);
}
.cp-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--ink);
}
.cf-badge { background: var(--amber); }
.lc-badge { background: var(--mustard); }

.cp-handle {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.cp-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cp-stat-item {
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.cp-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cp-val {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}

/* FAB */
.fab{
  position:fixed; bottom:28px; right:28px;
  width:64px; height:64px; border-radius:50%;
  background: var(--amber);
  border: var(--border-w) solid var(--ink);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 5px 5px 0 var(--ink);
  z-index: 50;
  transition: transform 0.15s ease;
}
.fab svg{ width:26px; height:26px; position:relative; z-index:2; }
.fab:hover{ transform: translate(-3px,-3px); }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

::selection{ background: var(--mustard); }