@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600;800&display=swap");

/* =========================================
   TABLE OF CONTENTS
   1. Variables & Theme
   2. Reset & Base
   3. Utilities
   4. Header & Navigation
   5. Hero & Sections
   6. Terminal Component (FIXED)
   7. Card Components (Projects/Profile/Identity)
   8. Form Elements (Contact/Upload)
   9. Footer
   10. Media Queries
   ========================================= */

/* =========================================
   1. VARIABLES & THEME
   ========================================= */
:root {
  --bg-core: #0f1117;
  --bg-surface: rgba(22, 27, 34, 0.7);
  --bg-surface-hover: rgba(30, 36, 46, 0.8);
  --border-dim: rgba(48, 54, 61, 0.5);
  --border-bright: #58a6ff;
  --accent-primary: #238636;
  --accent-secondary: #3fb950;
  --accent-info: #58a6ff;
  --accent-warn: #d29922;
  --accent-error: #f85149;
  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --text-header: #f0f6fc;
  --nav-height: 70px;
  --radius: 8px;
  --font-stack: "JetBrains Mono", "Segoe UI", sans-serif;
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-core);
  background-image: linear-gradient(rgba(88, 166, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  color: var(--text-main);
  font-family: var(--font-stack);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s ease;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: transparent;
}

input,
textarea {
  font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-dim);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-bright);
}

/* =========================================
   3. UTILITY CLASSES
   ========================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hidden {
  display: none !important;
}

.w-100 {
  width: 100%;
}

.text-center {
  text-align: center;
}

/* Flex Utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-center-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.grid-cols {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* Spacing */
.mb-1 {
  margin-bottom: 1rem;
}

.mb-1-5 {
  margin-bottom: 1.5rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-1-5 {
  margin-top: 1.5rem;
}

.mt-2 {
  margin-top: 2rem;
}

.p-0 {
  padding: 0;
}

/* Colors */
.text-accent {
  color: var(--accent-primary);
}

.text-blue {
  color: var(--accent-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-header {
  color: var(--text-header);
}

/* Background Canvas */
.network-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* =========================================
   4. HEADER & NAVIGATION
   ========================================= */
header {
  height: var(--nav-height);
  background: rgba(10, 12, 16, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-dim);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrapper {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  color: var(--text-header);
}

.brand::before {
  content: "./";
  color: var(--accent-secondary);
}

nav ul {
  display: flex;
  gap: 2rem;
}

nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
}

nav a:hover,
nav a.active {
  color: var(--text-header);
}

nav a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-primary);
}

/* =========================================
   5. HERO & SECTIONS
   ========================================= */
main {
  flex: 1;
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-split {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-left,
.hero-right {
  flex: 1;
  width: 100%;
}

h1 {
  font-size: 3rem;
  line-height: 1.1;
  color: var(--text-header);
  margin: 1rem 0;
}

.tagline {
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(46, 160, 67, 0.15);
  color: var(--accent-primary);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
}

.hero-badge {
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent-info);
  border: 1px solid var(--accent-info);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.hero-description {
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* =========================================
   6. TERMINAL COMPONENT (FIXED)
   ========================================= */
.terminal-window {
  background: #000;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  font-size: 0.85rem;
  font-family: "JetBrains Mono", monospace;
  position: relative;
}

.terminal-window::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.terminal-header {
  background: var(--bg-surface);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  gap: 8px;
  align-items: center;
}

.terminal-live-text {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.win-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-dim);
}

.win-btn.close {
  background: var(--accent-error);
}

.win-btn.min {
  background: var(--accent-warn);
}

.win-btn.max {
  background: var(--accent-primary);
}

.terminal-body {
  background: transparent;
  border: none;
  color: #c9d1d9;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  width: 100%;
  padding: 1rem;
  height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* --- Input Fix --- */
.input-line {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 5px;
}

.prompt-text {
  color: #58a6ff;
  margin-right: 8px;
  white-space: nowrap;
}

.cmd-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  flex: 1;
  caret-color: var(--accent-info);
  padding: 0;
  margin: 0;
}

/* Logs */
.log-line {
  display: block;
  margin-bottom: 4px;
  word-break: break-word;
}

.log-line-base {
  padding-left: 8px;
}

.log-line-success {
  border-left: 2px solid var(--accent-secondary);
}

.log-line-default {
  border-left: 2px solid transparent;
}

.log-time {
  color: var(--border-bright);
  margin-right: 8px;
  user-select: none;
  opacity: 0.7;
}

.log-type {
  color: var(--accent-info);
  font-weight: bold;
  margin-right: 8px;
}

.log-cmd {
  color: #fff;
  font-weight: bold;
}

/* =========================================
   7. CARD COMPONENTS (Projects / Profile / Identity)
   ========================================= */
.card {
  background: rgba(22, 27, 34, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: scale(1.02);
  border-color: var(--accent-info);
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
  background: var(--bg-surface-hover);
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  transition: 0.5s;
}

.card:hover::after {
  left: 100%;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-title {
  font-size: 1.25rem;
  color: var(--text-header);
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-inspect-btn {
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--accent-info);
  color: var(--accent-info);
}

.repo-link {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-header);
  border: 1px solid var(--border-dim);
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

.repo-link:hover {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent-info);
  border-color: var(--accent-info);
  transform: translateY(-1px);
}

/* Badges */
.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent-secondary);
  border-radius: 12px;
}

.badge-outline {
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  background: transparent;
  padding: 4px 12px;
}

.badge-pad {
  padding: 4px 12px;
}

/* Profile Card (About Page) */
.profile-col {
  flex: 0 0 280px;
  width: 100%;
}

.profile-card {
  padding: 1.5rem;
  text-align: center;
  transform: none !important;
}

.profile-img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
  margin-bottom: 1rem;
  object-fit: cover;
}

.profile-name {
  font-size: 1.25rem;
  color: var(--text-header);
  margin-bottom: 0.5rem;
}

.profile-details {
  margin-top: 1.5rem;
  text-align: left;
  font-size: 0.85rem;
  border-top: 1px solid var(--border-dim);
  padding-top: 1.5rem;
}

.detail-item {
  margin-bottom: 12px;
}

/* System Identity Card (About Page) */
.system-identity-card {
  transform: none !important;
  padding: 2rem;
}

.identity-text p {
  margin-bottom: 1.2rem;
}

.tech-arsenal-section {
  border-top: 1px dashed var(--border-dim);
  padding-top: 2rem;
}

.arsenal-header {
  color: var(--text-header);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.arsenal-category-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.8rem;
  letter-spacing: 1px;
}

/* Social Icons */
.social-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-dim);
  padding-top: 1.5rem;
}

.social-link {
  transition: transform 0.2s ease, filter 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-link img {
  width: 24px;
  height: 24px;
  filter: invert(80%);
  opacity: 0.8;
  transition: 0.3s ease;
}

.social-link:hover img {
  filter: none;
  opacity: 1;
}

.social-link:hover {
  transform: translateY(-2px);
}

/* =========================================
   8. FORM ELEMENTS (Contact / Upload)
   ========================================= */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

input,
textarea {
  width: 100%;
  background: #0d1117;
  border: 1px solid var(--border-dim);
  color: var(--text-header);
  padding: 12px;
  border-radius: var(--radius);
  transition: 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

/* Buttons */
.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-core);
  padding: 10px 24px;
  font-weight: 600;
  border-radius: var(--radius);
  display: inline-block;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary-link {
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-dim);
}

.copyBtn {
  margin-top: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* File Upload */
.contact-wrapper {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.file-drop-zone {
  border: 1px dashed var(--border-dim);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius);
}

.file-drop-text {
  font-size: 0.9rem;
}

.file-error-msg {
  color: var(--accent-error);
  display: none;
  margin-top: 5px;
}

/* =========================================
   9. FOOTER & MODALS
   ========================================= */
.sys-footer {
  border-top: 1px solid var(--border-dim);
  background: var(--bg-surface);
  margin-top: 1.5rem;
  padding: 0.5rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-bar {
  display: flex;
  justify-content: space-between;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.footer-status-meta {
  font-size: 0.7rem;
  gap: 1rem;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Command Palette */
.cmd-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 15vh;
}

.cmd-box {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

.cmd-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.cmd-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-left: 2px solid transparent;
  cursor: pointer;
}

.cmd-item:hover {
  background: var(--bg-surface-hover);
  border-left-color: var(--accent-primary);
}

#cmd-search {
  width: 100%;
  padding: 16px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-dim);
}

.cmd-hint {
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.45;
  margin-left: 1rem;
  letter-spacing: 0.12em;
  user-select: none;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Code Modal */
.modal-box-base {
  max-width: 800px;
  height: 500px;
  display: flex;
  flex-direction: column;
}

.modal-header-base {
  background: #1e1e1e;
  border-bottom: 1px solid #333;
}

.modal-title-wrapper {
  gap: 10px;
}

.modal-code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.5rem;
  overflow: auto;
  flex: 1;
  margin: 0;
  font-size: 0.85rem;
}

/* =========================================
   10. MEDIA QUERIES
   ========================================= */
.mobile-nav {
  display: none;
}

@media (max-width: 1024px) {
  .hero-split {
    gap: 2rem;
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  header nav {
    display: none;
  }

  .cmd-hint {
    display: none;
  }

  .hero-split {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
    align-items: center !important;
  }

  .hero-left div[style*="display: flex"] {
    justify-content: center;
  }

  .hero-left,
  .hero-right {
    width: 100%;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

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

  .card-header {
    gap: 0.5rem;
  }

  .status-bar {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
  }

  /* Mobile Bottom Nav */
  .mobile-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 17, 21, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-dim);
    border-radius: 50px;
    padding: 0 1.5rem;
    display: flex !important;
    gap: 1.5rem;
    height: 55px;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    z-index: 1000;
  }

  .mobile-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px;
  }

  .mobile-nav a.active {
    color: var(--accent-info);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }

  .card {
    padding: 1.2rem;
  }

  .terminal-body {
    height: 250px;
    font-size: 0.75rem;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }
}