/* Custom Minimalist Scrollbars (Vertical & Horizontal) */
* {
  scrollbar-width: thin;
  scrollbar-color: #00cc33 #000000;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background-color: #000000;
}

::-webkit-scrollbar-track {
  background-color: #000000;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #003311 0%, #00ff41 50%, #003311 100%);
  border-radius: 4px;
  border: 1px solid #000000;
}

::-webkit-scrollbar-thumb:horizontal {
  background: linear-gradient(90deg, #003311 0%, #00ff41 50%, #003311 100%);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #006622 0%, #69F0AE 50%, #006622 100%);
}

::-webkit-scrollbar-corner {
  background-color: #000000;
}

/* Global Reset & Base */
body, html {
  margin: 0;
  padding: 0;
  font-family: "Cascadia Code", sans-serif;
  background-color: #000;
  color: #fff;
  overflow-x: hidden;
}

.terminal-heading {
  color: #00ff41;
  padding-bottom: 10px;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  text-align: center;
}

/* Matrix Navbar Header */
#matrix-header {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: clamp(70px, 10vw, 100px);
  background-color: #000;
  overflow: hidden;
}

#matrix-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.header-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(15px, 4vw, 40px);
  box-sizing: border-box;
}

.header-content h1 {
  margin: 0;
  font-size: clamp(1.2em, 3vw, 1.8em);
  letter-spacing: 2px;
  color: #00ff41;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.7), 0 0 10px rgba(0, 255, 65, 0.5);
}

.header-content nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.header-content nav a {
  color: #00e640;
  text-decoration: none;
  margin: 0 clamp(2px, 0.8vw, 8px);
  font-size: clamp(0.85em, 1.8vw, 1.15em);
  padding: 8px clamp(6px, 1.5vw, 14px);
  position: relative;
  z-index: 1;
  transition: color 0.3s ease-in-out;
}

.header-content nav a.sponsor-link {
  border: 1px solid rgba(0, 255, 65, 0.35);
}

.header-content nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #00ff41;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.header-content nav a:hover {
  color: #000;
}

.header-content nav a:hover::before {
  transform: scaleX(1);
}

/* Intro Section */
.greeting-container {
  width: 100%;
  margin: clamp(90px, 16vh, 160px) auto 0 auto;
  text-align: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.greeting-wrapper {
  display: inline-block;
  text-align: left;
}

.greeting-sub {
  color: #3FD999;
  font-family: "Cascadia Code", monospace;
  font-weight: 800;
  font-size: clamp(1rem, 2.5vw, 24px);
  margin: 0 0 15px 0;
}

.greeting-main {
  background: linear-gradient(90deg, rgba(45, 128, 0, 1) 10%, rgba(20, 204, 97, 1) 45%, rgba(83, 237, 196, 1) 90%);
  font-weight: 800;
  font-size: clamp(2.3rem, 8vw, 100px);
  margin: 0;
  line-height: 1.1;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-text {
  font-size: clamp(1.2rem, 3.3vw, 3rem);
  font-weight: 300;
  text-align: center;
  margin: clamp(20px, 4vh, 40px) 20px clamp(30px, 6vh, 50px) 20px;
}

.intro-prefix {
  color: #ffffff;
}

#typewriter-text {
  font-weight: 600;
  color: rgba(20, 204, 97, 1);
  position: relative;
}

#typewriter-text::after {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 0;
  width: clamp(2px, 0.5vw, 4px);
  height: 100%;
  background-color: #00ff41;
  animation: blink 1s infinite;
}

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

/* Live GitHub Log Section */
.git-activity-container {
  max-width: 960px;
  margin: 0 auto clamp(45px, 8vh, 80px) auto;
  padding: 0 clamp(15px, 4vw, 20px);
  box-sizing: border-box;
}

.git-activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.25);
  border-bottom: none;
  padding: 8px 14px;
  border-radius: 4px 4px 0 0;
  font-size: clamp(0.75rem, 1.6vw, 0.9rem);
}

.git-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.git-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #00ff41;
  box-shadow: 0 0 6px #00ff41;
  animation: pulseDot 2s infinite;
}

.git-status-dot.offline {
  background-color: #558B2F;
  box-shadow: none;
  animation: none;
}

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

.git-title {
  color: #00e640;
  font-weight: 600;
}

.git-branch-tag {
  color: #558B2F;
  font-size: 0.9em;
}

.git-log-feed {
  border: 1px solid rgba(0, 255, 65, 0.25);
  border-radius: 0 0 4px 4px;
  background-color: #000;
  padding: clamp(10px, 2vw, 16px) 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: clamp(0.8rem, 1.7vw, 0.95rem);
  line-height: 1.5;
}

.git-log-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  word-break: break-word;
}

.git-time {
  color: #26A69A;
  font-size: 0.9em;
  white-space: nowrap;
}

.git-action {
  color: #e0e0e0;
}

.git-repo {
  color: #00E676;
  text-decoration: none;
  border-bottom: 1px solid #558B2F;
}

.git-repo:hover {
  color: #CCFF90;
  border-bottom-color: #00ff41;
}

.git-msg {
  color: #8BC34A;
  font-style: italic;
}

.git-dim {
  color: #558B2F;
}

/* Code Story Section */
.code-story {
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: clamp(0.9rem, 2.5vw, 1.5rem);
  line-height: 1.8;
  counter-reset: line;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(10px, 4vw, 20px);
  box-sizing: border-box;
}

.code-story .line {
  display: block;
  position: relative;
  padding-left: clamp(2.5em, 5vw, 4em);
  white-space: pre-wrap;
  word-break: break-word;
  color: #e0e0e0;
}

.code-story .line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(1.5em, 3vw, 2em);
  text-align: right;
  padding-right: clamp(0.5em, 1vw, 1em);
  color: #555;
  user-select: none;
}

.code-story .comment { color: #558B2F; font-style: italic; }
.code-story .keyword { color: #00E676; font-weight: bold; }
.code-story .function { color: #CCFF90; font-weight: bold; }
.code-story .string { color: #8BC34A; }
.code-story .property { color: #26A69A; }
.code-story .number { color: #69F0AE; }

.project-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid #558B2F;
  transition: all 0.2s ease;
}

.project-link:hover,
.project-link:visited,
.project-link:active {
  color: inherit;
  text-decoration: none;
  border-bottom-color: #558B2F;
}

/* Recent Repo Linked List */
.code-story .linked-list-line {
  white-space: normal;
  margin-top: 10px;
  margin-bottom: 10px;
}

.linked-list-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: clamp(0.78rem, 1.45vw, 0.92rem);
  line-height: 1.45;
}

.ll-ellipsis {
  color: #558B2F;
  font-weight: 700;
  letter-spacing: 2px;
  user-select: none;
}

.ll-null {
  color: #00E676;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px dashed rgba(0, 255, 65, 0.35);
  border-radius: 4px;
  user-select: none;
}

.ll-arrow {
  color: #00ff41;
  font-weight: 700;
  white-space: nowrap;
  user-select: none;
}

.ll-node {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 210px;
  max-width: 285px;
  min-height: 112px;
  padding: 12px 14px;
  background-color: #000;
  border: 1px solid rgba(0, 255, 65, 0.35);
  border-radius: 4px;
  text-decoration: none;
  color: #e0e0e0;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.ll-node:hover {
  border-color: #00ff41;
  background-color: rgba(0, 255, 65, 0.06);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.2);
  transform: translateY(-2px);
}

.ll-node.ll-head {
  border-color: rgba(0, 255, 65, 0.75);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 65, 0.15);
}

.ll-node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.78em;
}

.ll-ptr {
  color: #26A69A;
  font-weight: 600;
}

.ll-head-badge {
  color: #000;
  background-color: #00ff41;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 0.85em;
}

.ll-repo-name {
  color: #00E676;
  font-weight: 700;
  font-size: 1.05em;
  margin-bottom: 6px;
  word-break: break-word;
}

.ll-repo-desc {
  color: #8BC34A;
  font-size: 0.86em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.ll-node-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75em;
  color: #558B2F;
  border-top: 1px solid rgba(0, 255, 65, 0.12);
  padding-top: 6px;
}

.ll-dim {
  color: #558B2F;
}

@media (max-width: 768px) {
  .linked-list-chain {
    flex-direction: column;
    align-items: flex-start;
  }

  .ll-node {
    width: 100%;
    max-width: 100%;
    flex: none;
  }

  .ll-arrow {
    transform: rotate(90deg);
    margin: 2px 0 2px 14px;
  }
}

/* Emoji Spin */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.emoji-icon {
  display: inline-block;
  font-size: clamp(1.2rem, 3vw, 2rem);
  margin-left: 10px;
  animation: spin 4s linear infinite;
}

/* Contact Images */
.code-story img {
  width: clamp(25px, 4vw, 35px);
  height: auto;
  vertical-align: middle;
}

/* Terminal Section */
#shell {
  margin: clamp(50px, 10vh, 100px) auto;
  padding: 0 clamp(10px, 4vw, 20px);
  max-width: 1100px;
  box-sizing: border-box;
}

#terminal {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  padding: clamp(15px, 4vw, 40px);
  border-radius: 5px;
  min-height: clamp(250px, 50vh, 400px);
  max-height: clamp(350px, 60vh, 400px);
  overflow-y: auto;
  width: 100%;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-sizing: border-box;
  border: 5px solid rgba(0, 255, 65, 0.15);
}

#terminal:focus-within {
  outline: none;
  border-color: rgba(0, 255, 65, 0.5);
}

#terminal-output {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-line { color: #e0e0e0; margin: 4px 0; }
.command-line { color: #00ff41; margin: 4px 0; }

.input-line {
  display: flex;
  flex-wrap: wrap;
  color: #00ff41;
  font-family: "Cascadia Code", sans-serif;
  margin-top: 4px;
}

.input-line .prompt {
  white-space: nowrap;
  margin-right: 8px;
}

#terminal-input {
  font-size: inherit;
  background: transparent;
  font-family: "Cascadia Code", monospace;
  border: none;
  outline: none;
  color: #00ff41;
  flex-grow: 1;
  padding: 0;
  margin: 0;
  min-width: 50%;
  caret-color: #00ff41;
}