:root {
  --bg: #0c0e12;
  --panel: #16191c;
  --border: #1aff7b;
  --green: #1aff7b;
  --cyan: #00e3ff;
  --yellow: #ffe066;
  --white: #f7fff7;
  --gray: #7a8a7a;
  --text-dim: #4fdc8a;
  --accent: #18281d;
  --sidebar: #14191c;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--green);
  font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', monospace;
  font-size: 16px;
  min-height: 100vh;
  scroll-behavior: smooth;
}

.terminal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg,rgba(10,40,20,0.13) 0 100%),
    repeating-linear-gradient(90deg, #11261b 0 1px, transparent 1px 54px),
    repeating-linear-gradient(180deg, #11201b 0 1px, transparent 1px 36px);
  opacity: 0.14;
  pointer-events: none;
}

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 220px;
  background: var(--sidebar);
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 1.2em 0.6em 1.2em 0.6em;
  min-height: 100vh;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: 2.7em;
}
.avatar-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #193825;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 2em;
  border: 2px solid var(--border);
  box-shadow: 0 2px 0 #111a;
}
.sidebar-user .user-name {
  color: var(--green);
  font-size: 1.1em;
  font-weight: bold;
}
.sidebar-user .user-role {
  color: var(--cyan);
  font-size: 0.92em;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  margin-bottom: auto;
}
.sidebar-nav a {
  color: var(--green);
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0.26em 0 0.26em 0.7em;
  font-size: 1em;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color .18s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 0.7em;
  letter-spacing: 0.03em;
}
.sidebar-nav a:hover, .sidebar-nav a:focus {
  color: var(--bg);
  background: var(--border);
  border-left: 3px solid var(--cyan);
  outline: none;
}
.nav-bullet { color: var(--border); font-size: 1.2em;}
.sidebar-footer {
  margin-top: 2.5em;
  font-size: 0.92em;
  color: var(--yellow);
  opacity: 0.85;
  border-top: 1px solid var(--border);
  padding-top: 1.2em;
  text-align: left;
}
.sidebar-location { font-size: 1.1em; }

main {
  margin-left: 240px;
  max-width: 920px;
  padding: 3em 1.2em 2em 1.2em;
  position: relative;
  min-height: 100vw;
}
.term-section { margin-bottom: 2.7em; }
.term-section h2 {
  font-size: 1.02em;
  color: var(--border);
  margin: 0 0 1.1em 0;
  font-weight: bold;
  letter-spacing: 1.7px;
}
.prompt { color: var(--border); font-weight: bold;}
.term-block {
  color: var(--green);
  background: #15181c;
  font-size: 1em;
  padding: 1.2em 1em;
  border-radius: 8px;
  border-left: 3px solid var(--border);
  margin: 0 0 1.5em 0;
  box-shadow: 0 2px 18px #102d1c24;
  white-space: pre-line;
}
.term-green { color: var(--green); }
.term-cyan { color: var(--cyan); }
.term-yellow { color: var(--yellow); }
.term-at { color: var(--cyan); }

.timeline {
  border-left: 3px solid var(--border);
  padding-left: 2em;
  margin-left: 0.7em;
  display: flex;
  flex-direction: column;
  gap: 2.2em;
}
.timeline-entry {
  position: relative;
  margin-left: 0.2em;
}
.timeline-dot {
  position: absolute;
  left: -2.12em;
  top: 0.6em;
  width: 1.2em;
  height: 1.2em;
  background: var(--border);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px #26ff2680;
  z-index: 2;
}
.timeline-title {
  color: var(--cyan);
  font-weight: bold;
  font-size: 1.02em;
}
.timeline-date {
  color: var(--yellow);
  font-size: 0.92em;
  margin-bottom: 0.3em;
}
.timeline-content ul {
  margin: 0.4em 0 0 0.4em;
  padding: 0 0 0 1.1em;
  color: var(--gray);
  font-size: 0.97em;
}

/* --- TECH GRID FIX --- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.1em 1.6em;
}

.tech-grid > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #111a14;
  border-radius: 5px;
  border-left: 3px solid var(--border);
  padding: 0.8em 0.8em 0.6em 1em;
  min-width: 0;
  margin-bottom: 0.12em;
  box-shadow: 0 1px 4px #102d1c18;
  word-break: break-word;
}

.tag {
  background: #11261b;
  color: var(--green);
  padding: 0.15em 0.85em;
  border-radius: 2px;
  font-size: 1.02em;
  font-weight: bold;
  margin-bottom: 0.32em;
  letter-spacing: 0.03em;
  word-break: break-word;
  width: 100%;
}

.desc {
  color: var(--gray);
  font-size: 0.97em;
  word-break: break-word;
  width: 100%;
  margin-left: 0;
}
/* --- END TECH GRID FIX --- */

.proj-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2em;
  margin-top: 1em;
}
.proj-box {
  flex: 1 1 240px;
  min-width: 180px;
  background: #131a14;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 1.1em 1em 1em 1em;
  box-shadow: 0 2px 16px #102d1c18;
}
.proj-title {
  color: var(--border);
  font-size: 1.09em;
  font-weight: bold;
  letter-spacing: 0.02em;
  margin-bottom: 0.3em;
}
.proj-title span { font-size: 1.13em; margin-right: 0.4em;}
.proj-desc {
  color: var(--gray);
  font-size: 0.98em;
}
.edu-table {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  margin-top: 1em;
}
.edu-row {
  display: flex;
  align-items: center;
  gap: 1.1em;
  background: #101217;
  border-radius: 4px;
  padding: 0.5em 1em;
  color: var(--gray);
  border-left: 3px solid var(--border);
}
.edu-ico { font-size: 1.25em; }
.edu-main { flex: 1; }
.edu-meta { color: var(--yellow); font-size: 0.95em; }

.skills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7em;
  margin-top: 1em;
}
.skill-tag {
  background: #11261b;
  color: var(--cyan);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 1em;
  font-weight: 500;
  padding: 0.38em 1.1em;
  opacity: 0.82;
  letter-spacing: 0.02em;
  transition: opacity .15s;
}
.skill-tag:hover { opacity: 1; }

.contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1em;
  align-items: center;
  background: #101217;
  border: 1px solid var(--accent);
  border-radius: 6px;
  margin-top: 1.1em;
  padding: 0.44em 1.1em;
  opacity: 0.78;
  filter: grayscale(0.2) brightness(0.81) contrast(1.1);
}
.contact-bar a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1em;
  font-family: inherit;
  padding: 0.14em 0.85em 0.14em 0.7em;
  border-radius: 3px;
  transition: color .13s, background .14s, border-color .13s, opacity .13s;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  border: none;
  opacity: 0.82;
}
.contact-bar a span {
  font-size: 1.13em;
}
.contact-bar a:hover,
.contact-bar a:focus {
  color: var(--green);
  background: #161f17;
  opacity: 1;
  outline: none;
}
.term-footer {
  background: #141a14;
  color: var(--border);
  text-align: center;
  padding: 1.1em 0 1.1em 0;
  font-size: 0.91em;
  margin-top: 2.7em;
  border-top: 2px solid var(--border);
  box-shadow: 0 -2px 0 #000;
}

.fade-in { opacity: 0; transform: translateY(32px); transition: opacity 1s, transform 1.1s cubic-bezier(.2,.7,.1,1);}
.fade-in.visible { opacity:1; transform: none; }

.term-top-btn {
  position: fixed;
  right: 22px;
  bottom: 32px;
  z-index: 200;
  background: #101217;
  border: 2px solid var(--border);
  box-shadow: 0 2px 0 #0009;
  border-radius: 8px;
  padding: 0.3em 0.6em;
  cursor: pointer;
  display: none;
  transition: background .18s, border-color .18s, box-shadow .18s;
  color: var(--border);
}
.term-top-btn:hover, .term-top-btn:focus {
  background: var(--border);
  color: #101217;
  border-color: var(--white);
  box-shadow: 0 5px 0 #26ff2680;
}

@media (max-width: 1200px) {
  main { max-width: 98vw; }
}

@media (max-width: 900px) {
  .sidebar { width: 144px; padding-left: 0.2em; }
  .sidebar-header { gap: 0.3em; }
  .avatar-circle { width: 38px; height: 38px; font-size: 1.3em; }
  .sidebar-user .user-name { font-size: 0.96em; }
  .sidebar-user .user-role { font-size: 0.77em; }
  .sidebar-nav a { font-size: 0.96em; padding-left: 0.5em;}
  main { margin-left: 156px; padding: 2em 0.3em 2em 0.7em; }
  .contact-bar { gap: 0.7em; }
}

@media (max-width: 700px) {
  .sidebar { position: static; width: 100vw; min-height: unset; flex-direction: row; align-items: center; padding: 0.5em 0.5em 0.4em 0.9em; border-right: none; border-bottom: 2px solid var(--border);}
  .sidebar-header { margin-bottom: 0; align-items: center; }
  .sidebar-nav { flex-direction: row; gap: 0.6em; margin-bottom: 0; }
  .sidebar-nav a { font-size: 0.91em; border-left: none; border-bottom: 3px solid transparent; background: none; padding: 0.13em 0.5em;}
  .sidebar-nav a:hover, .sidebar-nav a:focus { border-bottom: 3px solid var(--cyan); border-left: none;}
  .sidebar-footer { margin-top: 0.6em; border-top: none; padding-top: 0.1em; font-size: 0.87em;}
  main { margin-left: 0; padding: 1.1em 0.2em 2em 0.2em;}
  .timeline { padding-left: 1.1em; }
  .contact-bar { flex-direction: column; gap: 0.1em; align-items: flex-start;}
}

@media (max-width: 600px) {
  .tech-grid {
    grid-template-columns: 1fr;
    gap: 0.5em;
  }
  .tech-grid > div {
    padding: 0.75em 0.8em 0.5em 0.9em;
  }
}
