/* ==========================================================================
   TECH BRUTALIST BLUEPRINT DESIGN SYSTEM - ANUGRAH SINGH PORTFOLIO
   Built using Impeccable UI/UX Principles (8px spatial grid, 0px border radius,
   2px hard borders, crisp JetBrains Mono typography, WCAG AA contrast)
   ========================================================================== */

:root {
  /* Color Palette - Monochromatic Blueprint */
  --bg-main: #e8e8e8;
  --bg-card: #ffffff;
  --bg-subtle: #f0f0f0;
  --bg-dark: #0f1011;
  --text-main: #000000;
  --text-muted: #555555;
  --text-inverse: #ffffff;
  --border-color: #000000;
  --border-width: 2px;
  --border-subtle: rgba(0, 0, 0, 0.15);
  --grid-line: rgba(0, 0, 0, 0.08);

  /* Unified Brand Accents */
  --accent-cyan: #00e5ff;
  --accent-green: #00e676;
  --accent-blue: #0052ff;

  /* Spacing Scale (8px Grid System) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  /* Typography System */
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-sans: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;

  /* Hard Shadow Offsets */
  --shadow-sm: 2px 2px 0px #000000;
  --shadow-md: 4px 4px 0px #000000;
  --shadow-lg: 6px 6px 0px #000000;

  /* Layout Container */
  --container-max: 1320px;
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  line-height: 1.6;
  font-family: var(--font-sans);
  background-image: 
    radial-gradient(var(--border-color) 1px, transparent 0),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px, 48px 48px, 48px 48px;
  background-position: -1px -1px;
  overflow-x: hidden;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); line-height: 1.15; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
p { font-family: var(--font-sans); font-size: 1.05rem; line-height: 1.6; color: #1a1a1a; }

a {
  color: inherit;
  text-decoration: none;
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* Brutalist Buttons & Elements */
.btn-brutal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

.btn-brutal:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
  background-color: var(--text-main);
  color: var(--bg-card);
}

.btn-brutal:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #000000;
}

.btn-brutal-sm {
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.tag-pill {
  display: inline-block;
  padding: 2px var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  text-transform: uppercase;
  margin-right: 4px;
  margin-bottom: 4px;
}

/* Header & Navigation */
.header-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-main);
  border-bottom: var(--border-width) solid var(--border-color);
  backdrop-filter: blur(8px);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: none;
  background: transparent;
  mix-blend-mode: multiply;
  transition: transform 0.2s ease;
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.08);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.nav-link-item {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
}

.nav-link-item::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--border-color);
  transition: width 0.2s ease;
}

.nav-link-item:hover::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: var(--border-width) solid var(--border-color);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-weight: 800;
  cursor: pointer;
}

/* Section Common Layout */
.section-block {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: var(--border-width) solid var(--border-color);
}

.section-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  border-bottom: 2px dashed var(--border-color);
  padding-bottom: var(--space-2);
}

.section-header::after {
  content: '+';
  position: absolute;
  right: -6px;
  bottom: -14px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--border-color);
  background: var(--bg-main);
  padding: 0 4px;
}

.section-num {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Hero Section */
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-5);
  align-items: stretch;
}

/* Profile Blueprint Card */
.profile-blueprint-card {
  background-color: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.blueprint-header-bar {
  background-color: var(--bg-dark);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-bottom: var(--border-width) solid var(--border-color);
}

.blueprint-coords {
  color: #00e5ff;
}

.blueprint-photo-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.blueprint-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(125%) brightness(95%);
  transition: filter 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-blueprint-card:hover .blueprint-photo {
  filter: grayscale(0%) contrast(105%);
  transform: scale(1.04);
}

.blueprint-overlay-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.blueprint-marker {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--border-color);
  pointer-events: none;
}

.marker-tl { top: 8px; left: 8px; }
.marker-tr { top: 8px; right: 8px; }
.marker-bl { bottom: 8px; left: 8px; }
.marker-br { bottom: 8px; right: 8px; }

.blueprint-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: var(--bg-dark);
  color: #00ff66;
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 2px 2px 0px #000000;
}

.hero-card {
  background-color: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: var(--space-2);
  transition: border-color 0.2s ease;
}

.stat-box:hover {
  border-color: var(--border-color);
}

.stat-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Terminal ASCII Canvas Card */
.terminal-card {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-dark);
  color: #00ff66;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Subtle CRT Scanline Overlay */
.terminal-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 10;
}

.terminal-header {
  position: relative;
  z-index: 20;
  background-color: #222222;
  color: #ffffff;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #444444;
  font-size: 0.8rem;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-body {
  position: relative;
  z-index: 20;
  padding: var(--space-4);
  font-size: 0.85rem;
  line-height: 1.5;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  overflow-x: auto;
}

.ascii-art,
pre.ascii-art {
  font-family: monospace;
  white-space: pre;
  color: #00e5ff;
  line-height: 1.1;
  font-size: clamp(0.5rem, 1.8vw, 0.85rem);
  margin-bottom: var(--space-3);
  margin-left: 0 !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  display: block !important;
  text-align: left !important;
}

#typewriterText,
.terminal-typewriter {
  color: #ffffff;
  font-family: var(--font-mono);
  margin-bottom: var(--space-3);
  margin-left: 0 !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  text-align: left !important;
  width: 100% !important;
  display: block !important;
}

/* Hero Terminal Interactive Command Console */
.hero-terminal-cmd {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px dashed #3f3f46;
  font-family: var(--font-mono);
  text-align: left !important;
  margin-left: 0 !important;
}

/* Quick-Click Command Chips */
.cmd-quick-chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.cmd-chip-label {
  font-size: 0.72rem;
  color: #71717a;
  font-weight: 700;
}

.cmd-chip {
  background: transparent;
  color: #00e5ff;
  border: 1px solid #27272a;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.cmd-chip:hover {
  background-color: #00e5ff;
  color: #0f1011;
  border-color: #00e5ff;
}

.cmd-logs-container {
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #e4e4e7;
  line-height: 1.5;
  margin-bottom: var(--space-2);
  text-align: left !important;
}

.cmd-logs-container::-webkit-scrollbar {
  width: 4px;
}

.cmd-logs-container::-webkit-scrollbar-track {
  background: #18181b;
}

.cmd-logs-container::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 2px;
}

.cmd-logs-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Native Borderless Terminal Input Line */
.cmd-input-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  border: none;
  padding: 4px 0;
  width: 100%;
}

.cmd-prompt-text {
  color: #00ff66;
  font-weight: 700;
  white-space: nowrap;
}

.cmd-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.cmd-input {
  background: transparent;
  border: none;
  outline: none;
  color: #00ff66;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 100%;
  caret-color: #00ff66;
}

/* Blinking Terminal Cursor Accent */
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: #00ff66;
  margin-left: 2px;
  animation: blink-cursor 1s steps(2, start) infinite;
}

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

/* Projects Section Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.project-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
}

.card-top-bar {
  background: var(--bg-main);
  border-bottom: var(--border-width) solid var(--border-color);
  padding: var(--space-2) var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Real Live Website Preview Frame */
.project-preview-wrapper {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-dark);
  border-bottom: var(--border-width) solid var(--border-color);
  text-decoration: none;
}

.project-preview-img,
.project-preview-iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  filter: contrast(105%) brightness(98%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

.project-preview-iframe {
  width: 400%;
  height: 400%;
  border: none;
  pointer-events: none;
  transform: scale(0.25);
  transform-origin: top left;
}

.project-preview-wrapper:hover .project-preview-img {
  transform: scale(1.03);
  filter: contrast(110%) brightness(102%);
}

.project-preview-wrapper:hover .project-preview-iframe {
  transform: scale(0.255);
  filter: contrast(110%) brightness(102%);
}

.project-preview-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background-color: var(--bg-dark);
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 2px 2px 0px #000000;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.project-preview-wrapper:hover .project-preview-badge {
  background-color: var(--accent-cyan);
  color: var(--bg-dark);
}

.card-content {
  padding: var(--space-4);
  flex-grow: 1;
}

.project-title {
  font-size: 1.4rem;
  margin-bottom: var(--space-2);
}

.project-desc {
  font-size: 0.9rem;
  color: #333333;
  margin-bottom: var(--space-4);
}

.project-features-list {
  list-style: none;
  margin-bottom: var(--space-4);
}

.project-features-list li {
  font-size: 0.82rem;
  margin-bottom: var(--space-1);
  padding-left: var(--space-3);
  position: relative;
}

.project-features-list li::before {
  content: '->';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-weight: 700;
}

.card-actions {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Skills Matrix */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.skill-category-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: var(--space-3);
}

.skill-category-title {
  font-size: 0.95rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-3);
}

.skill-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: 0.85rem;
}

.skill-progress-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  margin-top: 2px;
  margin-bottom: var(--space-2);
}

.skill-progress-fill {
  height: 100%;
  background: var(--text-main);
}

/* Education & Achievements Split */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.info-block-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
}

.achievement-item {
  border-left: 3px solid var(--border-color);
  padding-left: var(--space-3);
  margin-bottom: var(--space-4);
}

/* Footer & Command Line */
.footer-section {
  background-color: var(--bg-dark);
  color: #ffffff;
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
  border-top: var(--border-width) solid var(--border-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.terminal-cmd-box {
  background: #18181b;
  border: 1px solid #3f3f46;
  padding: var(--space-3);
}

.cmd-input-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.cmd-input {
  background: transparent;
  border: none;
  outline: none;
  color: #00ff66;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 100%;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (FULL DEVICE COMPATIBILITY)
   Mobile: < 768px | Tablet: 768px - 1024px | Desktop: > 1024px
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-grid,
  .projects-grid,
  .split-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-card, .terminal-card {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .header-nav {
    padding-top: var(--space-1);
    padding-bottom: var(--space-1);
  }

  .mobile-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background-color: var(--bg-main);
    border-bottom: var(--border-width) solid var(--border-color);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-3);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.active {
    display: flex;
  }

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

  .hero-stats-row {
    grid-template-columns: 1fr;
  }

  .btn-brutal {
    width: 100%;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn-brutal {
    width: 100%;
  }
}
